From 0187447a643c3ea262b13b3052cb1531990eafe6 Mon Sep 17 00:00:00 2001 From: Paul Baltescu Date: Tue, 19 Feb 2013 21:23:48 +0000 Subject: Timing every part of the extractor. --- python/pkg/cdec/sa/compile.py | 21 ++++++++++++++++++++- python/pkg/cdec/sa/extract.py | 7 ++++++- 2 files changed, 26 insertions(+), 2 deletions(-) (limited to 'python/pkg') diff --git a/python/pkg/cdec/sa/compile.py b/python/pkg/cdec/sa/compile.py index ce249c0f..d4cd8387 100644 --- a/python/pkg/cdec/sa/compile.py +++ b/python/pkg/cdec/sa/compile.py @@ -4,6 +4,7 @@ import os import logging import cdec.configobj import cdec.sa +from cdec.sa._sa import monitor_cpu import sys MAX_PHRASE_LENGTH = 4 @@ -21,6 +22,7 @@ def precompute(f_sa, max_len, max_nt, max_size, min_gap, rank1, rank2, tight_phr return precomp def main(): + preprocess_start_time = monitor_cpu() sys.setrecursionlimit(sys.getrecursionlimit() * 100) logging.basicConfig(level=logging.INFO) @@ -73,31 +75,46 @@ def main(): a_bin = os.path.join(args.output, 'a.bin') lex_bin = os.path.join(args.output, 'lex.bin') + start_time = monitor_cpu() logger.info('Compiling source suffix array') if args.bitext: f_sa = cdec.sa.SuffixArray(from_text=args.bitext, side='source') else: f_sa = cdec.sa.SuffixArray(from_text=args.source) f_sa.write_binary(f_sa_bin) + stop_time = monitor_cpu() + logger.info('Compiling source suffix array took %f seconds', stop_time - start_time) + start_time = monitor_cpu() logger.info('Compiling target data array') if args.bitext: e = cdec.sa.DataArray(from_text=args.bitext, side='target') else: e = cdec.sa.DataArray(from_text=args.target) e.write_binary(e_bin) + stop_time = monitor_cpu() + logger.info('Compiling target data array took %f seconds', stop_time - start_time) + start_time = monitor_cpu() logger.info('Precomputing frequent phrases') precompute(f_sa, *params).write_binary(precomp_bin) + stop_time = monitor_cpu() + logger.info('Compiling precomputations took %f seconds', stop_time - start_time) + start_time = monitor_cpu() logger.info('Compiling alignment') a = cdec.sa.Alignment(from_text=args.alignment) a.write_binary(a_bin) + stop_time = monitor_cpu() + logger.info('Compiling alignment took %f seonds', stop_time - start_time) + start_time = monitor_cpu() logger.info('Compiling bilexical dictionary') lex = cdec.sa.BiLex(from_data=True, alignment=a, earray=e, fsarray=f_sa) lex.write_binary(lex_bin) - + stop_time = monitor_cpu() + logger.info('Compiling bilexical dictionary took %f seconds', stop_time - start_time) + # Write configuration config = cdec.configobj.ConfigObj(args.config, unrepr=True) config['f_sa_file'] = os.path.abspath(f_sa_bin) @@ -108,6 +125,8 @@ def main(): for name, value in zip(param_names, params): config[name] = value config.write() + preprocess_stop_time = monitor_cpu() + logger.info('Overall preprocessing step took %f seconds', preprocess_stop_time - preprocess_start_time) if __name__ == '__main__': main() diff --git a/python/pkg/cdec/sa/extract.py b/python/pkg/cdec/sa/extract.py index b7d2fe6e..87b7d5d4 100644 --- a/python/pkg/cdec/sa/extract.py +++ b/python/pkg/cdec/sa/extract.py @@ -7,6 +7,7 @@ import re import multiprocessing as mp import signal import cdec.sa +from cdec.sa._sa import monitor_cpu extractor, prefix = None, None def make_extractor(config, grammars, features): @@ -62,7 +63,8 @@ def main(): sys.stderr.write('Error: feature definition file <{0}>' ' should be a python module\n'.format(featdef)) sys.exit(1) - + + start_time = monitor_cpu() if args.jobs > 1: logging.info('Starting %d workers; chunk size: %d', args.jobs, args.chunksize) pool = mp.Pool(args.jobs, make_extractor, (args.config, args.grammars, args.features)) @@ -76,5 +78,8 @@ def main(): for output in map(extract, enumerate(sys.stdin)): print(output) + stop_time = monitor_cpu() + logging.info("Overall extraction step took %f seconds", stop_time - start_time) + if __name__ == '__main__': main() -- cgit v1.2.3 From cfef250df7ef378d6678bb6fc26402407f496184 Mon Sep 17 00:00:00 2001 From: Paul Baltescu Date: Fri, 22 Feb 2013 16:50:29 +0000 Subject: Memory analysis pointless code. --- extractor/rule_factory.cc | 2 + extractor/run_extractor.cc | 8 + extractor/vocabulary.cc | 5 + extractor/vocabulary.h | 2 + python/pkg/cdec/sa/compile.py | 11 + python/src/sa/_sa.c | 13363 +++++++++++++++++++--------------------- 6 files changed, 6356 insertions(+), 7035 deletions(-) (limited to 'python/pkg') diff --git a/extractor/rule_factory.cc b/extractor/rule_factory.cc index 4101fcfa..fbdc7cce 100644 --- a/extractor/rule_factory.cc +++ b/extractor/rule_factory.cc @@ -220,6 +220,8 @@ Grammar HieroCachingRuleFactory::GetGrammar(const vector& word_ids) { } } + cerr << "Vocabulary size = " << vocabulary->Size() << endl; + Clock::time_point stop_time = Clock::now(); cerr << "Total time for rule lookup, extraction, and scoring = " << GetDuration(start_time, stop_time) << " seconds" << endl; diff --git a/extractor/run_extractor.cc b/extractor/run_extractor.cc index 38f10a5f..2b01e832 100644 --- a/extractor/run_extractor.cc +++ b/extractor/run_extractor.cc @@ -31,6 +31,14 @@ namespace fs = boost::filesystem; namespace po = boost::program_options; using namespace std; +void my_pause() { + cerr << "pausing..." << endl; + for (int i = 0; i < 10000000; ++i) { + cerr << endl; + } + cerr << "end pause" << endl; +} + int main(int argc, char** argv) { // TODO(pauldb): Also take arguments from config file. po::options_description desc("Command line options"); diff --git a/extractor/vocabulary.cc b/extractor/vocabulary.cc index 5c379a29..b68d76a9 100644 --- a/extractor/vocabulary.cc +++ b/extractor/vocabulary.cc @@ -24,3 +24,8 @@ bool Vocabulary::IsTerminal(int symbol) { string Vocabulary::GetTerminalValue(int symbol) { return words[symbol]; } + +int Vocabulary::Size() { + return words.size(); +} + diff --git a/extractor/vocabulary.h b/extractor/vocabulary.h index c6a8b3e8..ff3e7a63 100644 --- a/extractor/vocabulary.h +++ b/extractor/vocabulary.h @@ -19,6 +19,8 @@ class Vocabulary { virtual string GetTerminalValue(int symbol); + int Size(); + private: unordered_map dictionary; vector words; diff --git a/python/pkg/cdec/sa/compile.py b/python/pkg/cdec/sa/compile.py index d4cd8387..1362e7b5 100644 --- a/python/pkg/cdec/sa/compile.py +++ b/python/pkg/cdec/sa/compile.py @@ -21,6 +21,10 @@ def precompute(f_sa, max_len, max_nt, max_size, min_gap, rank1, rank2, tight_phr train_min_gap_size=min_gap) return precomp +def my_pause(): + for i in range(10000000): + print >> sys.stderr, "" + def main(): preprocess_start_time = monitor_cpu() sys.setrecursionlimit(sys.getrecursionlimit() * 100) @@ -85,6 +89,8 @@ def main(): stop_time = monitor_cpu() logger.info('Compiling source suffix array took %f seconds', stop_time - start_time) + my_pause() + start_time = monitor_cpu() logger.info('Compiling target data array') if args.bitext: @@ -94,6 +100,7 @@ def main(): e.write_binary(e_bin) stop_time = monitor_cpu() logger.info('Compiling target data array took %f seconds', stop_time - start_time) + my_pause() start_time = monitor_cpu() logger.info('Precomputing frequent phrases') @@ -101,12 +108,15 @@ def main(): stop_time = monitor_cpu() logger.info('Compiling precomputations took %f seconds', stop_time - start_time) + my_pause() + start_time = monitor_cpu() logger.info('Compiling alignment') a = cdec.sa.Alignment(from_text=args.alignment) a.write_binary(a_bin) stop_time = monitor_cpu() logger.info('Compiling alignment took %f seonds', stop_time - start_time) + my_pause() start_time = monitor_cpu() logger.info('Compiling bilexical dictionary') @@ -114,6 +124,7 @@ def main(): lex.write_binary(lex_bin) stop_time = monitor_cpu() logger.info('Compiling bilexical dictionary took %f seconds', stop_time - start_time) + my_pause() # Write configuration config = cdec.configobj.ConfigObj(args.config, unrepr=True) diff --git a/python/src/sa/_sa.c b/python/src/sa/_sa.c index 17957593..5d5152d5 100644 --- a/python/src/sa/_sa.c +++ b/python/src/sa/_sa.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.17.1 on Thu Feb 21 14:13:02 2013 */ +/* Generated by Cython 0.16 on Fri Feb 22 00:29:51 2013 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -11,6 +11,7 @@ #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif + #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall @@ -22,18 +23,22 @@ #define __fastcall #endif #endif + #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif + #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif + #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif + #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 @@ -41,25 +46,28 @@ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif + +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyCFunction_Call PyObject_Call +#else + #define __Pyx_PyCFunction_Call PyCFunction_Call +#endif + #if PY_VERSION_HEX < 0x02050000 typedef int Py_ssize_t; #define PY_SSIZE_T_MAX INT_MAX #define PY_SSIZE_T_MIN INT_MIN #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 PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ - (PyErr_Format(PyExc_TypeError, \ - "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ - (PyObject*)0)) - #define PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && !PyComplex_Check(o)) + #define PyNumber_Index(o) PyNumber_Int(o) + #define PyIndex_Check(o) PyNumber_Check(o) #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) #define __PYX_BUILD_PY_SSIZE_T "i" #else #define __PYX_BUILD_PY_SSIZE_T "n" - #define CYTHON_FORMAT_SSIZE_T "z" #endif + #if PY_VERSION_HEX < 0x02060000 #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) @@ -67,6 +75,7 @@ #define PyVarObject_HEAD_INIT(type, size) \ PyObject_HEAD_INIT(type) size, #define PyType_Modified(t) + typedef struct { void *buf; PyObject *obj; @@ -80,6 +89,7 @@ Py_ssize_t *suboffsets; void *internal; } Py_buffer; + #define PyBUF_SIMPLE 0 #define PyBUF_WRITABLE 0x0001 #define PyBUF_FORMAT 0x0004 @@ -91,9 +101,11 @@ #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) + typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); typedef void (*releasebufferproc)(PyObject *, Py_buffer *); #endif + #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) \ @@ -103,30 +115,31 @@ #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) #endif + #if PY_MAJOR_VERSION < 3 && PY_MINOR_VERSION < 6 #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") #endif + #if PY_MAJOR_VERSION >= 3 #define Py_TPFLAGS_CHECKTYPES 0 #define Py_TPFLAGS_HAVE_INDEX 0 #endif + #if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif -#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + + +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_GET_LENGTH) #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_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) - #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #else #define CYTHON_PEP393_ENABLED 0 - #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) - #define __Pyx_PyUnicode_READ(k, d, i) ((k=k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #endif + #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject @@ -134,6 +147,7 @@ #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif + #if PY_VERSION_HEX < 0x02060000 #define PyBytesObject PyStringObject #define PyBytes_Type PyString_Type @@ -152,6 +166,7 @@ #define PyBytes_Concat PyString_Concat #define PyBytes_ConcatAndDel PyString_ConcatAndDel #endif + #if PY_VERSION_HEX < 0x02060000 #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) @@ -159,7 +174,9 @@ #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif + #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) + #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type @@ -176,9 +193,11 @@ #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #endif + #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif + #if PY_VERSION_HEX < 0x03020000 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong @@ -187,6 +206,7 @@ #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif + #if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) @@ -205,9 +225,11 @@ (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) #endif + #if PY_MAJOR_VERSION >= 3 #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #endif + #if PY_VERSION_HEX < 0x02050000 #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) @@ -217,6 +239,7 @@ #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) #endif + #if PY_VERSION_HEX < 0x02050000 #define __Pyx_NAMESTR(n) ((char *)(n)) #define __Pyx_DOCSTR(n) ((char *)(n)) @@ -225,7 +248,6 @@ #define __Pyx_DOCSTR(n) (n) #endif - #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) @@ -307,11 +329,7 @@ static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); -#if CYTHON_COMPILING_IN_CPYTHON #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) -#else -#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) -#endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #ifdef __GNUC__ @@ -420,7 +438,7 @@ struct __pyx_t_3_sa__Trie_Node; struct __pyx_t_3_sa_match_node; struct __pyx_t_3_sa_Matching; -/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":9 +/* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":9 * from libc.string cimport memset, strcpy * * cdef struct _node: # <<<<<<<<<<<<<< @@ -434,7 +452,7 @@ struct __pyx_t_3_sa__node { int val; }; -/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":30 +/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":30 * _init_lower_mask() * * cdef struct _BitSet: # <<<<<<<<<<<<<< @@ -448,7 +466,7 @@ struct __pyx_t_3_sa__BitSet { int size; }; -/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":168 +/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":168 * return result * * cdef struct _VEB: # <<<<<<<<<<<<<< @@ -465,7 +483,7 @@ struct __pyx_t_3_sa__VEB { void **bottom; }; -/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":10 +/* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":10 * cdef struct _Trie_Node # forward decl * * cdef struct _Trie_Edge: # <<<<<<<<<<<<<< @@ -479,7 +497,7 @@ struct __pyx_t_3_sa__Trie_Edge { struct __pyx_t_3_sa__Trie_Edge *smaller; }; -/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":8 +/* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":8 * from libc.string cimport memset, memcpy * * cdef struct _Trie_Node # forward decl # <<<<<<<<<<<<<< @@ -492,7 +510,7 @@ struct __pyx_t_3_sa__Trie_Node { int arr_len; }; -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":76 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":76 * * # linked list structure for storing matches in BaselineRuleFactory * cdef struct match_node: # <<<<<<<<<<<<<< @@ -504,7 +522,7 @@ struct __pyx_t_3_sa_match_node { struct __pyx_t_3_sa_match_node *next; }; -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":172 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":172 * * # struct used to encapsulate a single matching * cdef struct Matching: # <<<<<<<<<<<<<< @@ -519,7 +537,7 @@ struct __pyx_t_3_sa_Matching { int size; }; -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":228 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":228 * * * cdef class HieroCachingRuleFactory: # <<<<<<<<<<<<<< @@ -578,7 +596,7 @@ struct __pyx_obj_3_sa_HieroCachingRuleFactory { }; -/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":118 +/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":118 * for arc in node for node in lattice) * * def decode_sentence(lattice): # <<<<<<<<<<<<<< @@ -591,7 +609,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_9_decode_sentence { }; -/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":187 +/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":187 * 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())) # <<<<<<<<<<<<<< @@ -608,7 +626,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_17_genexpr { }; -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1187 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1187 * # Online rule extraction and scoring * if self.online: * f_syms = tuple(word[0][0] for word in fwords) # <<<<<<<<<<<<<< @@ -625,7 +643,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_20_genexpr { }; -/* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":36 +/* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":36 * logger.info("LCP array completed") * * def compute_stats(self, int max_n): # <<<<<<<<<<<<<< @@ -656,7 +674,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_3_compute_stats { }; -/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":122 +/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":122 * * def encode_words(words): * return tuple(sym_fromstring(word, True) for word in words) # <<<<<<<<<<<<<< @@ -673,7 +691,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_12_genexpr { }; -/* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":21 +/* "/home/paulb/workspace/cdec/python/src/sa/features.pxi":21 * * def __str__(self): * return ' '.join('%s=%s' % feat for feat in self) # <<<<<<<<<<<<<< @@ -707,7 +725,7 @@ struct __pyx_obj_3_sa_IntList { }; -/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":340 +/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":340 * * * cdef class VEBIterator: # <<<<<<<<<<<<<< @@ -721,7 +739,7 @@ struct __pyx_obj_3_sa_VEBIterator { }; -/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":47 +/* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":47 * * * cdef class BiLex: # <<<<<<<<<<<<<< @@ -742,7 +760,7 @@ struct __pyx_obj_3_sa_BiLex { }; -/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":354 +/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":354 * * * cdef class VEB: # <<<<<<<<<<<<<< @@ -756,7 +774,7 @@ struct __pyx_obj_3_sa_VEB { }; -/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":121 +/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":121 * return tuple(sym_tostring(sym) for ((sym, _, _),) in lattice) * * def encode_words(words): # <<<<<<<<<<<<<< @@ -769,7 +787,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_11_encode_words { }; -/* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":5 +/* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":5 * as k most frequent n-grams""" * * cdef class LCP: # <<<<<<<<<<<<<< @@ -783,7 +801,7 @@ struct __pyx_obj_3_sa_LCP { }; -/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":9 +/* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":9 * from libc.string cimport memset, strcpy * * cdef class DataArray: # <<<<<<<<<<<<<< @@ -802,7 +820,7 @@ struct __pyx_obj_3_sa_DataArray { }; -/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":100 +/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":100 * * * cdef class BitSetIterator: # <<<<<<<<<<<<<< @@ -816,7 +834,7 @@ struct __pyx_obj_3_sa_BitSetIterator { }; -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2115 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2115 * f = Phrase(f_sym) * e = Phrase(e_sym) * a = tuple(self.alignment.link(i, j) for (i, j) in links) # <<<<<<<<<<<<<< @@ -834,7 +852,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_23_genexpr { }; -/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":188 +/* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":188 * * * cdef class Precomputation: # <<<<<<<<<<<<<< @@ -855,7 +873,7 @@ struct __pyx_obj_3_sa_Precomputation { }; -/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":190 +/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":190 * return ' ||| '.join(fields) * * def alignments(self): # <<<<<<<<<<<<<< @@ -872,7 +890,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_18_alignments { }; -/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":125 +/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":125 * * def decode_words(syms): * return tuple(sym_tostring(sym) for sym in syms) # <<<<<<<<<<<<<< @@ -887,7 +905,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_14_genexpr { }; -/* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":6 +/* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":6 * from libc.stdio cimport FILE, fclose, fopen * * cdef class SuffixArray: # <<<<<<<<<<<<<< @@ -903,7 +921,7 @@ struct __pyx_obj_3_sa_SuffixArray { }; -/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":183 +/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":183 * return self.f.arity() * * def __str__(self): # <<<<<<<<<<<<<< @@ -916,7 +934,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_16___str__ { }; -/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":7 +/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":7 * cdef int INDEX_MASK = (1<= 0)) ? i : i + PyList_GET_SIZE(o); if (likely((n >= 0) & (n < PyList_GET_SIZE(o)))) { @@ -2015,36 +2017,30 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) Py_INCREF(r); return r; } - } else { /* inlined PySequence_GetItem() */ + } + else if (likely(i >= 0)) { PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; if (likely(m && m->sq_item)) { - if (unlikely(i < 0) && likely(m->sq_length)) { - Py_ssize_t l = m->sq_length(o); - if (unlikely(l < 0)) return NULL; - i += l; - } return m->sq_item(o, i); } } -#else - if (PySequence_Check(o)) { - return PySequence_GetItem(o, i); - } -#endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } -static CYTHON_INLINE int __Pyx_PySequence_Contains(PyObject* item, PyObject* seq, int eq) { - int result = PySequence_Contains(seq, item); - return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +static CYTHON_INLINE int __Pyx_NegateNonNeg(int b) { + return unlikely(b < 0) ? b : !b; +} +static CYTHON_INLINE PyObject* __Pyx_PyBoolOrNull_FromLong(long b) { + return unlikely(b < 0) ? NULL : __Pyx_PyBool_FromLong(b); } static CYTHON_INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) { if (likely(PyList_CheckExact(L))) { - if (unlikely(PyList_Append(L, x) < 0)) return NULL; + if (PyList_Append(L, x) < 0) return NULL; Py_INCREF(Py_None); return Py_None; /* this is just to have an accurate signature */ - } else { + } + else { PyObject *r, *m; m = __Pyx_GetAttrString(L, "append"); if (!m) return NULL; @@ -2062,11 +2058,9 @@ static CYTHON_INLINE long __Pyx_div_long(long, long); /* proto */ static CYTHON_INLINE long __Pyx_mod_long(long, long); /* proto */ -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); - static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); -static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/ @@ -2081,7 +2075,6 @@ static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyOb return r; } static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v) { -#if CYTHON_COMPILING_IN_CPYTHON if (PyList_CheckExact(o)) { Py_ssize_t n = (likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if (likely((n >= 0) & (n < PyList_GET_SIZE(o)))) { @@ -2091,79 +2084,26 @@ static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObje Py_DECREF(old); return 1; } - } else { /* inlined PySequence_SetItem() */ + } + else if (likely(i >= 0)) { PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; if (likely(m && m->sq_ass_item)) { - if (unlikely(i < 0) && likely(m->sq_length)) { - Py_ssize_t l = m->sq_length(o); - if (unlikely(l < 0)) return -1; - i += l; - } return m->sq_ass_item(o, i, v); } } -#else -#if CYTHON_COMPILING_IN_PYPY - if (PySequence_Check(o) && !PyDict_Check(o)) { -#else - if (PySequence_Check(o)) { -#endif - return PySequence_SetItem(o, i, v); - } -#endif return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v); } static double __Pyx__PyObject_AsDouble(PyObject* obj); /* proto */ -#if CYTHON_COMPILING_IN_PYPY -#define __Pyx_PyObject_AsDouble(obj) \ -(likely(PyFloat_CheckExact(obj)) ? PyFloat_AS_DOUBLE(obj) : \ - likely(PyInt_CheckExact(obj)) ? \ - PyFloat_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj)) -#else #define __Pyx_PyObject_AsDouble(obj) \ ((likely(PyFloat_CheckExact(obj))) ? \ PyFloat_AS_DOUBLE(obj) : __Pyx__PyObject_AsDouble(obj)) -#endif static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact); /*proto*/ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { - PyListObject* L = (PyListObject*) list; - Py_ssize_t len = Py_SIZE(list); - if (likely(L->allocated > len)) { - Py_INCREF(x); - PyList_SET_ITEM(list, len, x); - Py_SIZE(list) = len+1; - return 0; - } - return PyList_Append(list, x); -} -#else -#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) -#endif - -static CYTHON_INLINE int __Pyx_PyDict_Contains(PyObject* item, PyObject* dict, int eq) { - int result = PyDict_Contains(dict, item); - return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); -} - -static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); - -static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /*proto*/ - -static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** value1, PyObject** value2, - int is_tuple, int has_known_size, int decref_tuple); - -static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name, - Py_ssize_t* p_orig_length, int* p_is_dict); -static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos, - PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict); - #if PY_VERSION_HEX < 0x02050000 #ifndef PyAnySet_CheckExact #define PyAnySet_CheckExact(ob) \ @@ -2197,9 +2137,15 @@ static CYTHON_INLINE int PySet_Add(PyObject *set, PyObject *key) { #endif /* PyAnySet_CheckExact (<= Py2.4) */ #endif /* < Py2.5 */ +static CYTHON_INLINE void __Pyx_RaiseNoneIndexingError(void); + #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { PyObject *value; + if (unlikely(d == Py_None)) { + __Pyx_RaiseNoneIndexingError(); + return NULL; + } value = PyDict_GetItemWithError(d, key); if (unlikely(!value)) { if (!PyErr_Occurred()) @@ -2240,6 +2186,18 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level); static CYTHON_INLINE void __Pyx_RaiseImportError(PyObject *name); +#include + +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 + #define __Pyx_CyFunction_USED 1 #include #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 @@ -2321,30 +2279,22 @@ static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, #define __Pyx_Generator_USED #include -#include typedef PyObject *(*__pyx_generator_body_t)(PyObject *, PyObject *); typedef struct { PyObject_HEAD __pyx_generator_body_t body; PyObject *closure; + int is_running; + int resume_label; PyObject *exc_type; PyObject *exc_value; PyObject *exc_traceback; PyObject *gi_weakreflist; PyObject *classobj; - PyObject *yieldfrom; - int resume_label; - char is_running; // using T_BOOL for property below requires char value } __pyx_GeneratorObject; static __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body, PyObject *closure); static int __pyx_Generator_init(void); -static int __Pyx_Generator_clear(PyObject* self); -#if 1 || PY_VERSION_HEX < 0x030300B0 -static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue); -#else -#define __Pyx_PyGen_FetchStopIterationValue(pvalue) PyGen_FetchStopIterationValue(pvalue) -#endif static int __Pyx_check_binary_version(void); @@ -2825,7 +2775,7 @@ static char __pyx_k_131[] = "Inside edges of following subphrase are not tight"; static char __pyx_k_132[] = "Subphrase [%d, %d] failed integrity check"; static char __pyx_k_133[] = "Didn't extract anything from [%d, %d] -> [%d, %d]"; static char __pyx_k_134[] = "Unable to extract basic phrase"; -static char __pyx_k_137[] = "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi"; +static char __pyx_k_137[] = "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi"; static char __pyx_k_138[] = "{0}-{1}"; static char __pyx_k_139[] = "[X] ||| {0} ||| {1} ||| {2}"; static char __pyx_k_140[] = "------------------------------"; @@ -2833,9 +2783,9 @@ static char __pyx_k_142[] = " Online Stats "; static char __pyx_k_146[] = " : "; static char __pyx_k_152[] = "OnlineFeatureContext"; static char __pyx_k_155[] = "%s=%s"; -static char __pyx_k_157[] = "/home/pauldb/workspace/cdec/python/src/sa/_sa.pyx"; +static char __pyx_k_157[] = "/home/paulb/workspace/cdec/python/src/sa/_sa.pyx"; static char __pyx_k_160[] = "cdec.sa"; -static char __pyx_k_164[] = "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi"; +static char __pyx_k_164[] = "/home/paulb/workspace/cdec/python/src/sa/sym.pxi"; static char __pyx_k_175[] = "*EPS*"; static char __pyx_k__FE[] = "FE"; static char __pyx_k__al[] = "al"; @@ -3529,6 +3479,7 @@ static PyObject *__pyx_pw_3_sa_1monitor_cpu(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("monitor_cpu (wrapper)", 0); + __pyx_self = __pyx_self; __pyx_r = __pyx_pf_3_sa_monitor_cpu(__pyx_self); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -3645,6 +3596,7 @@ static PyObject *__pyx_pw_3_sa_3gzip_or_text(PyObject *__pyx_self, PyObject *__p PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("gzip_or_text (wrapper)", 0); + __pyx_self = __pyx_self; assert(__pyx_arg_filename); { __pyx_v_filename = PyBytes_AsString(__pyx_arg_filename); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -3767,11 +3719,11 @@ static int __pyx_pw_3_sa_9FloatList_1__cinit__(PyObject *__pyx_v_self, PyObject int __pyx_v_size; int __pyx_v_increment; int __pyx_v_initial_len; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__size,&__pyx_n_s__increment,&__pyx_n_s__initial_len,0}; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__size,&__pyx_n_s__increment,&__pyx_n_s__initial_len,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -3804,6 +3756,18 @@ static int __pyx_pw_3_sa_9FloatList_1__cinit__(PyObject *__pyx_v_self, PyObject if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } + if (values[0]) { + } else { + __pyx_v_size = ((int)0); + } + if (values[1]) { + } else { + __pyx_v_increment = ((int)1); + } + if (values[2]) { + } else { + __pyx_v_initial_len = ((int)0); + } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); @@ -3842,7 +3806,7 @@ static int __pyx_pw_3_sa_9FloatList_1__cinit__(PyObject *__pyx_v_self, PyObject return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":11 +/* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":11 * cdef class FloatList: * * def __cinit__(self, int size=0, int increment=1, int initial_len=0): # <<<<<<<<<<<<<< @@ -3856,7 +3820,7 @@ static int __pyx_pf_3_sa_9FloatList___cinit__(struct __pyx_obj_3_sa_FloatList *_ int __pyx_t_1; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":12 + /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":12 * * def __cinit__(self, int size=0, int increment=1, int initial_len=0): * if initial_len > size: # <<<<<<<<<<<<<< @@ -3866,7 +3830,7 @@ static int __pyx_pf_3_sa_9FloatList___cinit__(struct __pyx_obj_3_sa_FloatList *_ __pyx_t_1 = (__pyx_v_initial_len > __pyx_v_size); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":13 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -3878,7 +3842,7 @@ static int __pyx_pf_3_sa_9FloatList___cinit__(struct __pyx_obj_3_sa_FloatList *_ } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":14 + /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":14 * if initial_len > size: * size = initial_len * self.size = size # <<<<<<<<<<<<<< @@ -3887,7 +3851,7 @@ static int __pyx_pf_3_sa_9FloatList___cinit__(struct __pyx_obj_3_sa_FloatList *_ */ __pyx_v_self->size = __pyx_v_size; - /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":15 + /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":15 * size = initial_len * self.size = size * self.increment = increment # <<<<<<<<<<<<<< @@ -3896,7 +3860,7 @@ static int __pyx_pf_3_sa_9FloatList___cinit__(struct __pyx_obj_3_sa_FloatList *_ */ __pyx_v_self->increment = __pyx_v_increment; - /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":16 + /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":16 * self.size = size * self.increment = increment * self.len = initial_len # <<<<<<<<<<<<<< @@ -3905,7 +3869,7 @@ static int __pyx_pf_3_sa_9FloatList___cinit__(struct __pyx_obj_3_sa_FloatList *_ */ __pyx_v_self->len = __pyx_v_initial_len; - /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":17 + /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":17 * self.increment = increment * self.len = initial_len * self.arr = malloc(size*sizeof(float)) # <<<<<<<<<<<<<< @@ -3914,7 +3878,7 @@ static int __pyx_pf_3_sa_9FloatList___cinit__(struct __pyx_obj_3_sa_FloatList *_ */ __pyx_v_self->arr = ((float *)malloc((__pyx_v_size * (sizeof(float))))); - /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":18 + /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":18 * self.len = initial_len * self.arr = malloc(size*sizeof(float)) * memset(self.arr, 0, initial_len*sizeof(float)) # <<<<<<<<<<<<<< @@ -3937,7 +3901,7 @@ static void __pyx_pw_3_sa_9FloatList_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyFinishContext(); } -/* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":20 +/* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":20 * memset(self.arr, 0, initial_len*sizeof(float)) * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -3949,7 +3913,7 @@ static void __pyx_pf_3_sa_9FloatList_2__dealloc__(struct __pyx_obj_3_sa_FloatLis __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":21 + /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":21 * * def __dealloc__(self): * free(self.arr) # <<<<<<<<<<<<<< @@ -3972,7 +3936,7 @@ static PyObject *__pyx_pw_3_sa_9FloatList_5__getitem__(PyObject *__pyx_v_self, P return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":23 +/* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":23 * free(self.arr) * * def __getitem__(self, i): # <<<<<<<<<<<<<< @@ -3995,7 +3959,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_4__getitem__(struct __pyx_obj_3_sa_Flo int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":24 + /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":24 * * def __getitem__(self, i): * j = i # <<<<<<<<<<<<<< @@ -4005,19 +3969,20 @@ static PyObject *__pyx_pf_3_sa_9FloatList_4__getitem__(struct __pyx_obj_3_sa_Flo __Pyx_INCREF(__pyx_v_i); __pyx_v_j = __pyx_v_i; - /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":25 + /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":25 * def __getitem__(self, i): * j = i * if i<0: # <<<<<<<<<<<<<< * j = self.len + i * if j<0 or j>=self.len: */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_i, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_i, __pyx_int_0, Py_LT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 25; __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[1]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":26 + /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":26 * j = i * if i<0: * j = self.len + i # <<<<<<<<<<<<<< @@ -4036,20 +4001,22 @@ static PyObject *__pyx_pf_3_sa_9FloatList_4__getitem__(struct __pyx_obj_3_sa_Flo } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":27 + /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":27 * 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)) * return self.arr[j] */ - __pyx_t_3 = PyObject_RichCompare(__pyx_v_j, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_j, __pyx_int_0, Py_LT); 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_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_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_t_1 = PyObject_RichCompare(__pyx_v_j, __pyx_t_3, Py_GE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -4059,7 +4026,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_4__getitem__(struct __pyx_obj_3_sa_Flo } if (__pyx_t_5) { - /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":28 + /* "/home/paulb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -4094,7 +4061,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_4__getitem__(struct __pyx_obj_3_sa_Flo } __pyx_L4:; - /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":29 + /* "/home/paulb/workspace/cdec/python/src/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] # <<<<<<<<<<<<<< @@ -4123,7 +4090,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_4__getitem__(struct __pyx_obj_3_sa_Flo return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":31 +/* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":31 * return self.arr[j] * * cdef void set(self, int i, float v): # <<<<<<<<<<<<<< @@ -4145,7 +4112,7 @@ static void __pyx_f_3_sa_9FloatList_set(struct __pyx_obj_3_sa_FloatList *__pyx_v int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":32 + /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":32 * * cdef void set(self, int i, float v): * j = i # <<<<<<<<<<<<<< @@ -4154,7 +4121,7 @@ static void __pyx_f_3_sa_9FloatList_set(struct __pyx_obj_3_sa_FloatList *__pyx_v */ __pyx_v_j = __pyx_v_i; - /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":33 + /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":33 * cdef void set(self, int i, float v): * j = i * if i<0: # <<<<<<<<<<<<<< @@ -4164,7 +4131,7 @@ static void __pyx_f_3_sa_9FloatList_set(struct __pyx_obj_3_sa_FloatList *__pyx_v __pyx_t_1 = (__pyx_v_i < 0); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":34 + /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":34 * j = i * if i<0: * j = self.len + i # <<<<<<<<<<<<<< @@ -4176,7 +4143,7 @@ static void __pyx_f_3_sa_9FloatList_set(struct __pyx_obj_3_sa_FloatList *__pyx_v } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":35 + /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":35 * if i<0: * j = self.len + i * if j<0 or j>=self.len: # <<<<<<<<<<<<<< @@ -4192,7 +4159,7 @@ static void __pyx_f_3_sa_9FloatList_set(struct __pyx_obj_3_sa_FloatList *__pyx_v } if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":36 + /* "/home/paulb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -4229,7 +4196,7 @@ static void __pyx_f_3_sa_9FloatList_set(struct __pyx_obj_3_sa_FloatList *__pyx_v } __pyx_L4:; - /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":37 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -4259,7 +4226,7 @@ static int __pyx_pw_3_sa_9FloatList_7__setitem__(PyObject *__pyx_v_self, PyObjec return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":39 +/* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":39 * self.arr[j] = v * * def __setitem__(self, i, val): # <<<<<<<<<<<<<< @@ -4277,7 +4244,7 @@ static int __pyx_pf_3_sa_9FloatList_6__setitem__(struct __pyx_obj_3_sa_FloatList int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setitem__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":40 + /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":40 * * def __setitem__(self, i, val): * self.set(i, val) # <<<<<<<<<<<<<< @@ -4309,7 +4276,7 @@ static Py_ssize_t __pyx_pw_3_sa_9FloatList_9__len__(PyObject *__pyx_v_self) { return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":42 +/* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":42 * self.set(i, val) * * def __len__(self): # <<<<<<<<<<<<<< @@ -4322,7 +4289,7 @@ static Py_ssize_t __pyx_pf_3_sa_9FloatList_8__len__(struct __pyx_obj_3_sa_FloatL __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":43 + /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":43 * * def __len__(self): * return self.len # <<<<<<<<<<<<<< @@ -4359,7 +4326,7 @@ static PyObject *__pyx_pw_3_sa_9FloatList_11append(PyObject *__pyx_v_self, PyObj return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":45 +/* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":45 * return self.len * * def append(self, float val): # <<<<<<<<<<<<<< @@ -4373,7 +4340,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_10append(struct __pyx_obj_3_sa_FloatLi int __pyx_t_1; __Pyx_RefNannySetupContext("append", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":46 + /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":46 * * def append(self, float val): * if self.len == self.size: # <<<<<<<<<<<<<< @@ -4383,7 +4350,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_10append(struct __pyx_obj_3_sa_FloatLi __pyx_t_1 = (__pyx_v_self->len == __pyx_v_self->size); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":47 + /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":47 * def append(self, float val): * if self.len == self.size: * self.size = self.size + self.increment # <<<<<<<<<<<<<< @@ -4392,7 +4359,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_10append(struct __pyx_obj_3_sa_FloatLi */ __pyx_v_self->size = (__pyx_v_self->size + __pyx_v_self->increment); - /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":48 + /* "/home/paulb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -4404,7 +4371,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_10append(struct __pyx_obj_3_sa_FloatLi } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":49 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -4413,7 +4380,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_10append(struct __pyx_obj_3_sa_FloatLi */ (__pyx_v_self->arr[__pyx_v_self->len]) = __pyx_v_val; - /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":50 + /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":50 * self.arr = realloc(self.arr, self.size*sizeof(float)) * self.arr[self.len] = val * self.len = self.len + 1 # <<<<<<<<<<<<<< @@ -4428,7 +4395,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_10append(struct __pyx_obj_3_sa_FloatLi return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":52 +/* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":52 * self.len = self.len + 1 * * cdef void write_handle(self, FILE* f): # <<<<<<<<<<<<<< @@ -4440,7 +4407,7 @@ static void __pyx_f_3_sa_9FloatList_write_handle(struct __pyx_obj_3_sa_FloatList __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("write_handle", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":53 + /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":53 * * cdef void write_handle(self, FILE* f): * fwrite(&(self.len), sizeof(float), 1, f) # <<<<<<<<<<<<<< @@ -4449,7 +4416,7 @@ static void __pyx_f_3_sa_9FloatList_write_handle(struct __pyx_obj_3_sa_FloatList */ fwrite((&__pyx_v_self->len), (sizeof(float)), 1, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":54 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -4482,7 +4449,7 @@ static PyObject *__pyx_pw_3_sa_9FloatList_13write(PyObject *__pyx_v_self, PyObje return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":56 +/* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":56 * fwrite(self.arr, sizeof(float), self.len, f) * * def write(self, char* filename): # <<<<<<<<<<<<<< @@ -4496,7 +4463,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_12write(struct __pyx_obj_3_sa_FloatLis __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("write", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":58 + /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":58 * def write(self, char* filename): * cdef FILE* f * f = fopen(filename, "w") # <<<<<<<<<<<<<< @@ -4505,7 +4472,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_12write(struct __pyx_obj_3_sa_FloatLis */ __pyx_v_f = fopen(__pyx_v_filename, __pyx_k__w); - /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":59 + /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":59 * cdef FILE* f * f = fopen(filename, "w") * self.write_handle(f) # <<<<<<<<<<<<<< @@ -4514,7 +4481,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_12write(struct __pyx_obj_3_sa_FloatLis */ ((struct __pyx_vtabstruct_3_sa_FloatList *)__pyx_v_self->__pyx_vtab)->write_handle(__pyx_v_self, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":60 + /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":60 * f = fopen(filename, "w") * self.write_handle(f) * fclose(f) # <<<<<<<<<<<<<< @@ -4529,7 +4496,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_12write(struct __pyx_obj_3_sa_FloatLis return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":62 +/* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":62 * fclose(f) * * cdef void read_handle(self, FILE* f): # <<<<<<<<<<<<<< @@ -4541,7 +4508,7 @@ static void __pyx_f_3_sa_9FloatList_read_handle(struct __pyx_obj_3_sa_FloatList __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("read_handle", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":63 + /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":63 * * cdef void read_handle(self, FILE* f): * free(self.arr) # <<<<<<<<<<<<<< @@ -4550,7 +4517,7 @@ static void __pyx_f_3_sa_9FloatList_read_handle(struct __pyx_obj_3_sa_FloatList */ free(__pyx_v_self->arr); - /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":64 + /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":64 * cdef void read_handle(self, FILE* f): * free(self.arr) * fread(&(self.len), sizeof(float), 1, f) # <<<<<<<<<<<<<< @@ -4559,7 +4526,7 @@ static void __pyx_f_3_sa_9FloatList_read_handle(struct __pyx_obj_3_sa_FloatList */ fread((&__pyx_v_self->len), (sizeof(float)), 1, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":65 + /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":65 * free(self.arr) * fread(&(self.len), sizeof(float), 1, f) * self.arr = malloc(self.len * sizeof(float)) # <<<<<<<<<<<<<< @@ -4568,7 +4535,7 @@ static void __pyx_f_3_sa_9FloatList_read_handle(struct __pyx_obj_3_sa_FloatList */ __pyx_v_self->arr = ((float *)malloc((__pyx_v_self->len * (sizeof(float))))); - /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":66 + /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":66 * fread(&(self.len), sizeof(float), 1, f) * self.arr = malloc(self.len * sizeof(float)) * self.size = self.len # <<<<<<<<<<<<<< @@ -4577,7 +4544,7 @@ static void __pyx_f_3_sa_9FloatList_read_handle(struct __pyx_obj_3_sa_FloatList */ __pyx_v_self->size = __pyx_v_self->len; - /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":67 + /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":67 * self.arr = malloc(self.len * sizeof(float)) * self.size = self.len * fread(self.arr, sizeof(float), self.len, f) # <<<<<<<<<<<<<< @@ -4610,7 +4577,7 @@ static PyObject *__pyx_pw_3_sa_9FloatList_15read(PyObject *__pyx_v_self, PyObjec return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":69 +/* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":69 * fread(self.arr, sizeof(float), self.len, f) * * def read(self, char* filename): # <<<<<<<<<<<<<< @@ -4624,7 +4591,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_14read(struct __pyx_obj_3_sa_FloatList __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("read", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":71 + /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":71 * def read(self, char* filename): * cdef FILE* f * f = fopen(filename, "r") # <<<<<<<<<<<<<< @@ -4633,7 +4600,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_14read(struct __pyx_obj_3_sa_FloatList */ __pyx_v_f = fopen(__pyx_v_filename, __pyx_k__r); - /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":72 + /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":72 * cdef FILE* f * f = fopen(filename, "r") * self.read_handle(f) # <<<<<<<<<<<<<< @@ -4641,7 +4608,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_14read(struct __pyx_obj_3_sa_FloatList */ ((struct __pyx_vtabstruct_3_sa_FloatList *)__pyx_v_self->__pyx_vtab)->read_handle(__pyx_v_self, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":73 + /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":73 * f = fopen(filename, "r") * self.read_handle(f) * fclose(f) # <<<<<<<<<<<<<< @@ -4660,11 +4627,11 @@ static int __pyx_pw_3_sa_7IntList_1__cinit__(PyObject *__pyx_v_self, PyObject *_ int __pyx_v_size; int __pyx_v_increment; int __pyx_v_initial_len; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__size,&__pyx_n_s__increment,&__pyx_n_s__initial_len,0}; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__size,&__pyx_n_s__increment,&__pyx_n_s__initial_len,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -4697,6 +4664,18 @@ static int __pyx_pw_3_sa_7IntList_1__cinit__(PyObject *__pyx_v_self, PyObject *_ if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } + if (values[0]) { + } else { + __pyx_v_size = ((int)0); + } + if (values[1]) { + } else { + __pyx_v_increment = ((int)1); + } + if (values[2]) { + } else { + __pyx_v_initial_len = ((int)0); + } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); @@ -4735,7 +4714,7 @@ static int __pyx_pw_3_sa_7IntList_1__cinit__(PyObject *__pyx_v_self, PyObject *_ return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":11 +/* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":11 * cdef class IntList: * * def __cinit__(self, int size=0, int increment=1, int initial_len=0): # <<<<<<<<<<<<<< @@ -4749,7 +4728,7 @@ static int __pyx_pf_3_sa_7IntList___cinit__(struct __pyx_obj_3_sa_IntList *__pyx int __pyx_t_1; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":12 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":12 * * def __cinit__(self, int size=0, int increment=1, int initial_len=0): * if initial_len > size: # <<<<<<<<<<<<<< @@ -4759,7 +4738,7 @@ static int __pyx_pf_3_sa_7IntList___cinit__(struct __pyx_obj_3_sa_IntList *__pyx __pyx_t_1 = (__pyx_v_initial_len > __pyx_v_size); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":13 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -4771,7 +4750,7 @@ static int __pyx_pf_3_sa_7IntList___cinit__(struct __pyx_obj_3_sa_IntList *__pyx } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":14 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":14 * if initial_len > size: * size = initial_len * self.size = size # <<<<<<<<<<<<<< @@ -4780,7 +4759,7 @@ static int __pyx_pf_3_sa_7IntList___cinit__(struct __pyx_obj_3_sa_IntList *__pyx */ __pyx_v_self->size = __pyx_v_size; - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":15 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":15 * size = initial_len * self.size = size * self.increment = increment # <<<<<<<<<<<<<< @@ -4789,7 +4768,7 @@ static int __pyx_pf_3_sa_7IntList___cinit__(struct __pyx_obj_3_sa_IntList *__pyx */ __pyx_v_self->increment = __pyx_v_increment; - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":16 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":16 * self.size = size * self.increment = increment * self.len = initial_len # <<<<<<<<<<<<<< @@ -4798,7 +4777,7 @@ static int __pyx_pf_3_sa_7IntList___cinit__(struct __pyx_obj_3_sa_IntList *__pyx */ __pyx_v_self->len = __pyx_v_initial_len; - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":17 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":17 * self.increment = increment * self.len = initial_len * self.arr = malloc(size*sizeof(int)) # <<<<<<<<<<<<<< @@ -4807,7 +4786,7 @@ static int __pyx_pf_3_sa_7IntList___cinit__(struct __pyx_obj_3_sa_IntList *__pyx */ __pyx_v_self->arr = ((int *)malloc((__pyx_v_size * (sizeof(int))))); - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":18 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":18 * self.len = initial_len * self.arr = malloc(size*sizeof(int)) * memset(self.arr, 0, initial_len*sizeof(int)) # <<<<<<<<<<<<<< @@ -4832,7 +4811,7 @@ static PyObject *__pyx_pw_3_sa_7IntList_3__str__(PyObject *__pyx_v_self) { return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":20 +/* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":20 * memset(self.arr, 0, initial_len*sizeof(int)) * * def __str__(self): # <<<<<<<<<<<<<< @@ -4855,7 +4834,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_2__str__(struct __pyx_obj_3_sa_IntList * int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__str__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":22 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":22 * def __str__(self): * cdef unsigned i * ret = "IntList[" # <<<<<<<<<<<<<< @@ -4865,7 +4844,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_2__str__(struct __pyx_obj_3_sa_IntList * __Pyx_INCREF(((PyObject *)__pyx_kp_s_3)); __pyx_v_ret = ((PyObject *)__pyx_kp_s_3); - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":23 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":23 * cdef unsigned i * ret = "IntList[" * for idx in range(self.size): # <<<<<<<<<<<<<< @@ -4876,7 +4855,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_2__str__(struct __pyx_obj_3_sa_IntList * for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_idx = __pyx_t_2; - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":24 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":24 * ret = "IntList[" * for idx in range(self.size): * if idx>0: # <<<<<<<<<<<<<< @@ -4886,7 +4865,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_2__str__(struct __pyx_obj_3_sa_IntList * __pyx_t_3 = (__pyx_v_idx > 0); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":25 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":25 * for idx in range(self.size): * if idx>0: * ret += "," # <<<<<<<<<<<<<< @@ -4902,7 +4881,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_2__str__(struct __pyx_obj_3_sa_IntList * } __pyx_L5:; - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":26 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":26 * if idx>0: * ret += "," * ret += str(self.arr[idx]) # <<<<<<<<<<<<<< @@ -4927,7 +4906,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_2__str__(struct __pyx_obj_3_sa_IntList * __pyx_t_5 = 0; } - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":27 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":27 * ret += "," * ret += str(self.arr[idx]) * ret += "]" # <<<<<<<<<<<<<< @@ -4940,7 +4919,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_2__str__(struct __pyx_obj_3_sa_IntList * __pyx_v_ret = __pyx_t_5; __pyx_t_5 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":28 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":28 * ret += str(self.arr[idx]) * ret += "]" * ret += "len=" # <<<<<<<<<<<<<< @@ -4953,7 +4932,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_2__str__(struct __pyx_obj_3_sa_IntList * __pyx_v_ret = __pyx_t_5; __pyx_t_5 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":29 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":29 * ret += "]" * ret += "len=" * ret += str(self.len) # <<<<<<<<<<<<<< @@ -4977,7 +4956,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_2__str__(struct __pyx_obj_3_sa_IntList * __pyx_v_ret = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":30 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":30 * ret += "len=" * ret += str(self.len) * return ret # <<<<<<<<<<<<<< @@ -5014,7 +4993,7 @@ static PyObject *__pyx_pw_3_sa_7IntList_5index(PyObject *__pyx_v_self, PyObject return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":32 +/* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":32 * return ret * * def index(self, val): # <<<<<<<<<<<<<< @@ -5036,7 +5015,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_4index(struct __pyx_obj_3_sa_IntList *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("index", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":34 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":34 * def index(self, val): * cdef unsigned i * for i in range(self.len): # <<<<<<<<<<<<<< @@ -5047,7 +5026,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_4index(struct __pyx_obj_3_sa_IntList *__ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":35 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":35 * cdef unsigned i * for i in range(self.len): * if self.arr[i] == val: # <<<<<<<<<<<<<< @@ -5056,13 +5035,14 @@ static PyObject *__pyx_pf_3_sa_7IntList_4index(struct __pyx_obj_3_sa_IntList *__ */ __pyx_t_3 = PyInt_FromLong((__pyx_v_self->arr[__pyx_v_i])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_val, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_val, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":36 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":36 * for i in range(self.len): * if self.arr[i] == val: * return i # <<<<<<<<<<<<<< @@ -5080,7 +5060,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_4index(struct __pyx_obj_3_sa_IntList *__ __pyx_L5:; } - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":37 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":37 * if self.arr[i] == val: * return i * return IndexError # <<<<<<<<<<<<<< @@ -5110,11 +5090,11 @@ static PyObject *__pyx_pw_3_sa_7IntList_7partition(PyObject *__pyx_v_self, PyObj static PyObject *__pyx_pw_3_sa_7IntList_7partition(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_start = 0; PyObject *__pyx_v_end = 0; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__start,&__pyx_n_s__end,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("partition (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__start,&__pyx_n_s__end,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -5128,10 +5108,12 @@ static PyObject *__pyx_pw_3_sa_7IntList_7partition(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__start)) != 0)) kw_args--; + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start); + if (likely(values[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--; + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__end); + if (likely(values[1])) 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;} } @@ -5161,7 +5143,7 @@ static PyObject *__pyx_pw_3_sa_7IntList_7partition(PyObject *__pyx_v_self, PyObj return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":39 +/* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":39 * return IndexError * * def partition(self,start,end): # <<<<<<<<<<<<<< @@ -5187,7 +5169,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList int __pyx_clineno = 0; __Pyx_RefNannySetupContext("partition", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":40 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":40 * * def partition(self,start,end): * pivot = self.arr[end] # <<<<<<<<<<<<<< @@ -5200,7 +5182,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList __pyx_v_pivot = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":41 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":41 * def partition(self,start,end): * pivot = self.arr[end] * bottom = start-1 # <<<<<<<<<<<<<< @@ -5212,7 +5194,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList __pyx_v_bottom = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":42 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":42 * pivot = self.arr[end] * bottom = start-1 * top = end # <<<<<<<<<<<<<< @@ -5222,7 +5204,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList __Pyx_INCREF(__pyx_v_end); __pyx_v_top = __pyx_v_end; - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":43 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":43 * bottom = start-1 * top = end * done = 0 # <<<<<<<<<<<<<< @@ -5231,7 +5213,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList */ __pyx_v_done = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":44 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":44 * top = end * done = 0 * while not done: # <<<<<<<<<<<<<< @@ -5242,7 +5224,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList __pyx_t_3 = (!__pyx_v_done); if (!__pyx_t_3) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":45 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":45 * done = 0 * while not done: * while not done: # <<<<<<<<<<<<<< @@ -5253,7 +5235,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList __pyx_t_3 = (!__pyx_v_done); if (!__pyx_t_3) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":46 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":46 * while not done: * while not done: * bottom += 1 # <<<<<<<<<<<<<< @@ -5266,19 +5248,20 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList __pyx_v_bottom = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":47 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":47 * while not done: * bottom += 1 * if bottom == top: # <<<<<<<<<<<<<< * done = 1 * break */ - __pyx_t_2 = PyObject_RichCompare(__pyx_v_bottom, __pyx_v_top, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_v_bottom, __pyx_v_top, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 47; __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[2]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":48 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":48 * bottom += 1 * if bottom == top: * done = 1 # <<<<<<<<<<<<<< @@ -5287,7 +5270,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList */ __pyx_v_done = 1; - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":49 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":49 * if bottom == top: * done = 1 * break # <<<<<<<<<<<<<< @@ -5299,7 +5282,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList } __pyx_L7:; - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":50 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":50 * done = 1 * break * if self.arr[bottom] > pivot: # <<<<<<<<<<<<<< @@ -5309,13 +5292,14 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList __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_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_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_v_pivot, Py_GT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __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[2]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":51 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":51 * break * if self.arr[bottom] > pivot: * self.arr[top] = self.arr[bottom] # <<<<<<<<<<<<<< @@ -5326,7 +5310,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList __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/pauldb/workspace/cdec/python/src/sa/int_list.pxi":52 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":52 * if self.arr[bottom] > pivot: * self.arr[top] = self.arr[bottom] * break # <<<<<<<<<<<<<< @@ -5340,7 +5324,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList } __pyx_L6_break:; - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":53 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":53 * self.arr[top] = self.arr[bottom] * break * while not done: # <<<<<<<<<<<<<< @@ -5351,7 +5335,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList __pyx_t_3 = (!__pyx_v_done); if (!__pyx_t_3) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":54 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":54 * break * while not done: * top -= 1 # <<<<<<<<<<<<<< @@ -5364,19 +5348,20 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList __pyx_v_top = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":55 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":55 * while not done: * top -= 1 * if top == bottom: # <<<<<<<<<<<<<< * done = 1 * break */ - __pyx_t_4 = PyObject_RichCompare(__pyx_v_top, __pyx_v_bottom, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_top, __pyx_v_bottom, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":56 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":56 * top -= 1 * if top == bottom: * done = 1 # <<<<<<<<<<<<<< @@ -5385,7 +5370,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList */ __pyx_v_done = 1; - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":57 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":57 * if top == bottom: * done = 1 * break # <<<<<<<<<<<<<< @@ -5397,7 +5382,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList } __pyx_L11:; - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":58 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":58 * done = 1 * break * if self.arr[top] < pivot: # <<<<<<<<<<<<<< @@ -5407,13 +5392,14 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList __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_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_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_v_pivot, Py_LT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __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[2]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":59 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":59 * break * if self.arr[top] < pivot: * self.arr[bottom] = self.arr[top] # <<<<<<<<<<<<<< @@ -5424,7 +5410,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList __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/pauldb/workspace/cdec/python/src/sa/int_list.pxi":60 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":60 * if self.arr[top] < pivot: * self.arr[bottom] = self.arr[top] * break # <<<<<<<<<<<<<< @@ -5439,7 +5425,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList __pyx_L10_break:; } - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":61 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":61 * self.arr[bottom] = self.arr[top] * break * self.arr[top] = pivot # <<<<<<<<<<<<<< @@ -5450,7 +5436,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList __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/pauldb/workspace/cdec/python/src/sa/int_list.pxi":62 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":62 * break * self.arr[top] = pivot * return top # <<<<<<<<<<<<<< @@ -5483,11 +5469,11 @@ static PyObject *__pyx_pw_3_sa_7IntList_9_doquicksort(PyObject *__pyx_v_self, Py static PyObject *__pyx_pw_3_sa_7IntList_9_doquicksort(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_start = 0; PyObject *__pyx_v_end = 0; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__start,&__pyx_n_s__end,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_doquicksort (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__start,&__pyx_n_s__end,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -5501,10 +5487,12 @@ static PyObject *__pyx_pw_3_sa_7IntList_9_doquicksort(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__start)) != 0)) kw_args--; + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start); + if (likely(values[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--; + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__end); + if (likely(values[1])) 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;} } @@ -5534,7 +5522,7 @@ static PyObject *__pyx_pw_3_sa_7IntList_9_doquicksort(PyObject *__pyx_v_self, Py return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":64 +/* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":64 * return top * * def _doquicksort(self,start,end): # <<<<<<<<<<<<<< @@ -5555,19 +5543,20 @@ static PyObject *__pyx_pf_3_sa_7IntList_8_doquicksort(struct __pyx_obj_3_sa_IntL int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_doquicksort", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":65 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":65 * * def _doquicksort(self,start,end): * if start < end: # <<<<<<<<<<<<<< * split = self.partition(start,end) * self._doquicksort(start,split-1) */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_start, __pyx_v_end, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_start, __pyx_v_end, Py_LT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 65; __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[2]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":66 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":66 * def _doquicksort(self,start,end): * if start < end: * split = self.partition(start,end) # <<<<<<<<<<<<<< @@ -5591,7 +5580,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_8_doquicksort(struct __pyx_obj_3_sa_IntL __pyx_v_split = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":67 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":67 * if start < end: * split = self.partition(start,end) * self._doquicksort(start,split-1) # <<<<<<<<<<<<<< @@ -5616,7 +5605,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_8_doquicksort(struct __pyx_obj_3_sa_IntL __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":68 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":68 * split = self.partition(start,end) * self._doquicksort(start,split-1) * self._doquicksort(split+1,end) # <<<<<<<<<<<<<< @@ -5644,7 +5633,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_8_doquicksort(struct __pyx_obj_3_sa_IntL } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":70 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":70 * self._doquicksort(split+1,end) * else: * return # <<<<<<<<<<<<<< @@ -5683,7 +5672,7 @@ static PyObject *__pyx_pw_3_sa_7IntList_11sort(PyObject *__pyx_v_self, CYTHON_UN return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":72 +/* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":72 * return * * def sort(self): # <<<<<<<<<<<<<< @@ -5702,7 +5691,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_10sort(struct __pyx_obj_3_sa_IntList *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sort", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":73 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":73 * * def sort(self): * self._doquicksort(0,self.len-1) # <<<<<<<<<<<<<< @@ -5752,7 +5741,7 @@ static PyObject *__pyx_pw_3_sa_7IntList_13reset(PyObject *__pyx_v_self, CYTHON_U return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":75 +/* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":75 * self._doquicksort(0,self.len-1) * * def reset(self): # <<<<<<<<<<<<<< @@ -5765,7 +5754,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_12reset(struct __pyx_obj_3_sa_IntList *_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reset", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":76 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":76 * * def reset(self): * self.len = 0 # <<<<<<<<<<<<<< @@ -5789,7 +5778,7 @@ static void __pyx_pw_3_sa_7IntList_15__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyFinishContext(); } -/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":78 +/* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":78 * self.len = 0 * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -5801,7 +5790,7 @@ static void __pyx_pf_3_sa_7IntList_14__dealloc__(struct __pyx_obj_3_sa_IntList * __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":79 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":79 * * def __dealloc__(self): * free(self.arr) # <<<<<<<<<<<<<< @@ -5825,7 +5814,7 @@ static PyObject *__pyx_pw_3_sa_7IntList_17__iter__(PyObject *__pyx_v_self) { return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":81 +/* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":81 * free(self.arr) * * def __iter__(self): # <<<<<<<<<<<<<< @@ -5888,7 +5877,7 @@ static PyObject *__pyx_gb_3_sa_7IntList_18generator(__pyx_GeneratorObject *__pyx __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/pauldb/workspace/cdec/python/src/sa/int_list.pxi":83 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":83 * def __iter__(self): * cdef int i * for i in range(self.len): # <<<<<<<<<<<<<< @@ -5899,7 +5888,7 @@ static PyObject *__pyx_gb_3_sa_7IntList_18generator(__pyx_GeneratorObject *__pyx 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/pauldb/workspace/cdec/python/src/sa/int_list.pxi":84 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":84 * cdef int i * for i in range(self.len): * yield self.arr[i] # <<<<<<<<<<<<<< @@ -5930,7 +5919,6 @@ static PyObject *__pyx_gb_3_sa_7IntList_18generator(__pyx_GeneratorObject *__pyx __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_generator->resume_label = -1; - __Pyx_Generator_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return NULL; } @@ -5946,7 +5934,7 @@ static PyObject *__pyx_pw_3_sa_7IntList_20__getitem__(PyObject *__pyx_v_self, Py return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":86 +/* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":86 * yield self.arr[i] * * def __getitem__(self, index): # <<<<<<<<<<<<<< @@ -5976,7 +5964,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":88 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":88 * def __getitem__(self, index): * cdef int i, j, k * if isinstance(index, int): # <<<<<<<<<<<<<< @@ -5989,7 +5977,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":89 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":89 * cdef int i, j, k * if isinstance(index, int): * j = index # <<<<<<<<<<<<<< @@ -5999,7 +5987,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL __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_v_j = __pyx_t_3; - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":90 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":90 * if isinstance(index, int): * j = index * if j < 0: # <<<<<<<<<<<<<< @@ -6009,7 +5997,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL __pyx_t_2 = (__pyx_v_j < 0); if (__pyx_t_2) { - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":91 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":91 * j = index * if j < 0: * j = self.len + j # <<<<<<<<<<<<<< @@ -6021,7 +6009,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL } __pyx_L4:; - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":92 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":92 * if j < 0: * j = self.len + j * if j<0 or j>=self.len: # <<<<<<<<<<<<<< @@ -6037,7 +6025,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL } if (__pyx_t_5) { - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":93 + /* "/home/paulb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -6072,7 +6060,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL } __pyx_L5:; - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":94 + /* "/home/paulb/workspace/cdec/python/src/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] # <<<<<<<<<<<<<< @@ -6088,7 +6076,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL goto __pyx_L3; } - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":95 + /* "/home/paulb/workspace/cdec/python/src/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): # <<<<<<<<<<<<<< @@ -6101,7 +6089,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":96 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":96 * return self.arr[j] * elif isinstance(index, slice): * i = index.start # <<<<<<<<<<<<<< @@ -6114,7 +6102,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_i = __pyx_t_3; - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":97 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":97 * elif isinstance(index, slice): * i = index.start * j = index.stop # <<<<<<<<<<<<<< @@ -6127,7 +6115,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_j = __pyx_t_3; - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":98 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":98 * i = index.start * j = index.stop * if i < 0: # <<<<<<<<<<<<<< @@ -6137,7 +6125,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL __pyx_t_5 = (__pyx_v_i < 0); if (__pyx_t_5) { - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":99 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":99 * j = index.stop * if i < 0: * i = self.len + i # <<<<<<<<<<<<<< @@ -6149,7 +6137,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL } __pyx_L6:; - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":100 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":100 * if i < 0: * i = self.len + i * if j < 0: # <<<<<<<<<<<<<< @@ -6159,7 +6147,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL __pyx_t_5 = (__pyx_v_j < 0); if (__pyx_t_5) { - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":101 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":101 * i = self.len + i * if j < 0: * j = self.len + j # <<<<<<<<<<<<<< @@ -6171,7 +6159,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL } __pyx_L7:; - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":102 + /* "/home/paulb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -6199,7 +6187,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL } if (__pyx_t_2) { - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":103 + /* "/home/paulb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -6241,7 +6229,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL } __pyx_L8:; - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":104 + /* "/home/paulb/workspace/cdec/python/src/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 = () # <<<<<<<<<<<<<< @@ -6251,7 +6239,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL __Pyx_INCREF(((PyObject *)__pyx_empty_tuple)); __pyx_v_result = __pyx_empty_tuple; - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":105 + /* "/home/paulb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -6261,7 +6249,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL __pyx_t_3 = __pyx_v_j; for (__pyx_v_k = __pyx_v_i; __pyx_v_k < __pyx_t_3; __pyx_v_k++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":106 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":106 * result = () * for k from i <= k < j: * result = result + (self.arr[k],) # <<<<<<<<<<<<<< @@ -6283,7 +6271,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL __pyx_t_9 = 0; } - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":107 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":107 * for k from i <= k < j: * result = result + (self.arr[k],) * return result # <<<<<<<<<<<<<< @@ -6298,7 +6286,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":109 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":109 * return result * else: * raise TypeError("Illegal key type %s for IntList" % type(index)) # <<<<<<<<<<<<<< @@ -6337,7 +6325,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":111 +/* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":111 * raise TypeError("Illegal key type %s for IntList" % type(index)) * * cdef void set(self, int i, int val): # <<<<<<<<<<<<<< @@ -6359,7 +6347,7 @@ static void __pyx_f_3_sa_7IntList_set(struct __pyx_obj_3_sa_IntList *__pyx_v_sel int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":112 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":112 * * cdef void set(self, int i, int val): * j = i # <<<<<<<<<<<<<< @@ -6368,7 +6356,7 @@ static void __pyx_f_3_sa_7IntList_set(struct __pyx_obj_3_sa_IntList *__pyx_v_sel */ __pyx_v_j = __pyx_v_i; - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":113 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":113 * cdef void set(self, int i, int val): * j = i * if i<0: # <<<<<<<<<<<<<< @@ -6378,7 +6366,7 @@ static void __pyx_f_3_sa_7IntList_set(struct __pyx_obj_3_sa_IntList *__pyx_v_sel __pyx_t_1 = (__pyx_v_i < 0); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":114 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":114 * j = i * if i<0: * j = self.len + i # <<<<<<<<<<<<<< @@ -6390,7 +6378,7 @@ static void __pyx_f_3_sa_7IntList_set(struct __pyx_obj_3_sa_IntList *__pyx_v_sel } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":115 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":115 * if i<0: * j = self.len + i * if j<0 or j>=self.len: # <<<<<<<<<<<<<< @@ -6406,7 +6394,7 @@ static void __pyx_f_3_sa_7IntList_set(struct __pyx_obj_3_sa_IntList *__pyx_v_sel } if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":116 + /* "/home/paulb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -6443,7 +6431,7 @@ static void __pyx_f_3_sa_7IntList_set(struct __pyx_obj_3_sa_IntList *__pyx_v_sel } __pyx_L4:; - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":117 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -6473,7 +6461,7 @@ static int __pyx_pw_3_sa_7IntList_22__setitem__(PyObject *__pyx_v_self, PyObject return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":119 +/* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":119 * self.arr[j] = val * * def __setitem__(self, i, val): # <<<<<<<<<<<<<< @@ -6491,7 +6479,7 @@ static int __pyx_pf_3_sa_7IntList_21__setitem__(struct __pyx_obj_3_sa_IntList *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setitem__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":120 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":120 * * def __setitem__(self, i, val): * self.set(i, val) # <<<<<<<<<<<<<< @@ -6523,7 +6511,7 @@ static Py_ssize_t __pyx_pw_3_sa_7IntList_24__len__(PyObject *__pyx_v_self) { return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":122 +/* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":122 * self.set(i, val) * * def __len__(self): # <<<<<<<<<<<<<< @@ -6536,7 +6524,7 @@ static Py_ssize_t __pyx_pf_3_sa_7IntList_23__len__(struct __pyx_obj_3_sa_IntList __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":123 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":123 * * def __len__(self): * return self.len # <<<<<<<<<<<<<< @@ -6563,7 +6551,7 @@ static PyObject *__pyx_pw_3_sa_7IntList_26get_size(PyObject *__pyx_v_self, CYTHO return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":125 +/* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":125 * return self.len * * def get_size(self): # <<<<<<<<<<<<<< @@ -6580,7 +6568,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_25get_size(struct __pyx_obj_3_sa_IntList int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_size", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":126 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":126 * * def get_size(self): * return self.size # <<<<<<<<<<<<<< @@ -6627,7 +6615,7 @@ static PyObject *__pyx_pw_3_sa_7IntList_28append(PyObject *__pyx_v_self, PyObjec return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":128 +/* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":128 * return self.size * * def append(self, int val): # <<<<<<<<<<<<<< @@ -6640,7 +6628,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_27append(struct __pyx_obj_3_sa_IntList * __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("append", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":129 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":129 * * def append(self, int val): * self._append(val) # <<<<<<<<<<<<<< @@ -6655,7 +6643,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_27append(struct __pyx_obj_3_sa_IntList * return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":131 +/* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":131 * self._append(val) * * cdef void _append(self, int val): # <<<<<<<<<<<<<< @@ -6668,7 +6656,7 @@ static void __pyx_f_3_sa_7IntList__append(struct __pyx_obj_3_sa_IntList *__pyx_v int __pyx_t_1; __Pyx_RefNannySetupContext("_append", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":132 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":132 * * cdef void _append(self, int val): * if self.len == self.size: # <<<<<<<<<<<<<< @@ -6678,7 +6666,7 @@ static void __pyx_f_3_sa_7IntList__append(struct __pyx_obj_3_sa_IntList *__pyx_v __pyx_t_1 = (__pyx_v_self->len == __pyx_v_self->size); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":133 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":133 * cdef void _append(self, int val): * if self.len == self.size: * self.size = self.size + self.increment # <<<<<<<<<<<<<< @@ -6687,7 +6675,7 @@ static void __pyx_f_3_sa_7IntList__append(struct __pyx_obj_3_sa_IntList *__pyx_v */ __pyx_v_self->size = (__pyx_v_self->size + __pyx_v_self->increment); - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":134 + /* "/home/paulb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -6699,7 +6687,7 @@ static void __pyx_f_3_sa_7IntList__append(struct __pyx_obj_3_sa_IntList *__pyx_v } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":135 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -6708,7 +6696,7 @@ static void __pyx_f_3_sa_7IntList__append(struct __pyx_obj_3_sa_IntList *__pyx_v */ (__pyx_v_self->arr[__pyx_v_self->len]) = __pyx_v_val; - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":136 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":136 * self.arr = realloc(self.arr, self.size*sizeof(int)) * self.arr[self.len] = val * self.len = self.len + 1 # <<<<<<<<<<<<<< @@ -6731,7 +6719,7 @@ static PyObject *__pyx_pw_3_sa_7IntList_30extend(PyObject *__pyx_v_self, PyObjec return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":138 +/* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":138 * self.len = self.len + 1 * * def extend(self, other): # <<<<<<<<<<<<<< @@ -6748,7 +6736,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_29extend(struct __pyx_obj_3_sa_IntList * int __pyx_clineno = 0; __Pyx_RefNannySetupContext("extend", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":139 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":139 * * def extend(self, other): * self._extend(other) # <<<<<<<<<<<<<< @@ -6773,7 +6761,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_29extend(struct __pyx_obj_3_sa_IntList * return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":141 +/* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":141 * self._extend(other) * * cdef void _extend(self, IntList other): # <<<<<<<<<<<<<< @@ -6785,7 +6773,7 @@ static void __pyx_f_3_sa_7IntList__extend(struct __pyx_obj_3_sa_IntList *__pyx_v __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_extend", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":142 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":142 * * cdef void _extend(self, IntList other): * self._extend_arr(other.arr, other.len) # <<<<<<<<<<<<<< @@ -6797,7 +6785,7 @@ static void __pyx_f_3_sa_7IntList__extend(struct __pyx_obj_3_sa_IntList *__pyx_v __Pyx_RefNannyFinishContext(); } -/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":144 +/* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":144 * self._extend_arr(other.arr, other.len) * * cdef void _extend_arr(self, int* other, int other_len): # <<<<<<<<<<<<<< @@ -6810,7 +6798,7 @@ static void __pyx_f_3_sa_7IntList__extend_arr(struct __pyx_obj_3_sa_IntList *__p int __pyx_t_1; __Pyx_RefNannySetupContext("_extend_arr", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":145 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":145 * * cdef void _extend_arr(self, int* other, int other_len): * if self.size < self.len + other_len: # <<<<<<<<<<<<<< @@ -6820,7 +6808,7 @@ static void __pyx_f_3_sa_7IntList__extend_arr(struct __pyx_obj_3_sa_IntList *__p __pyx_t_1 = (__pyx_v_self->size < (__pyx_v_self->len + __pyx_v_other_len)); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":146 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -6829,7 +6817,7 @@ static void __pyx_f_3_sa_7IntList__extend_arr(struct __pyx_obj_3_sa_IntList *__p */ __pyx_v_self->size = (__pyx_v_self->len + __pyx_v_other_len); - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":147 + /* "/home/paulb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -6841,7 +6829,7 @@ static void __pyx_f_3_sa_7IntList__extend_arr(struct __pyx_obj_3_sa_IntList *__p } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":148 + /* "/home/paulb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -6850,7 +6838,7 @@ static void __pyx_f_3_sa_7IntList__extend_arr(struct __pyx_obj_3_sa_IntList *__p */ memcpy((__pyx_v_self->arr + __pyx_v_self->len), __pyx_v_other, (__pyx_v_other_len * (sizeof(int)))); - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":149 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -6862,7 +6850,7 @@ static void __pyx_f_3_sa_7IntList__extend_arr(struct __pyx_obj_3_sa_IntList *__p __Pyx_RefNannyFinishContext(); } -/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":151 +/* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":151 * self.len = self.len + other_len * * cdef void _clear(self): # <<<<<<<<<<<<<< @@ -6874,7 +6862,7 @@ static void __pyx_f_3_sa_7IntList__clear(struct __pyx_obj_3_sa_IntList *__pyx_v_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_clear", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":152 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":152 * * cdef void _clear(self): * free(self.arr) # <<<<<<<<<<<<<< @@ -6883,7 +6871,7 @@ static void __pyx_f_3_sa_7IntList__clear(struct __pyx_obj_3_sa_IntList *__pyx_v_ */ free(__pyx_v_self->arr); - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":153 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":153 * cdef void _clear(self): * free(self.arr) * self.len = 0 # <<<<<<<<<<<<<< @@ -6892,7 +6880,7 @@ static void __pyx_f_3_sa_7IntList__clear(struct __pyx_obj_3_sa_IntList *__pyx_v_ */ __pyx_v_self->len = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":154 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":154 * free(self.arr) * self.len = 0 * self.size = 0 # <<<<<<<<<<<<<< @@ -6901,7 +6889,7 @@ static void __pyx_f_3_sa_7IntList__clear(struct __pyx_obj_3_sa_IntList *__pyx_v_ */ __pyx_v_self->size = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":155 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":155 * self.len = 0 * self.size = 0 * self.arr = malloc(0) # <<<<<<<<<<<<<< @@ -6913,7 +6901,7 @@ static void __pyx_f_3_sa_7IntList__clear(struct __pyx_obj_3_sa_IntList *__pyx_v_ __Pyx_RefNannyFinishContext(); } -/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":157 +/* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":157 * self.arr = malloc(0) * * cdef void write_handle(self, FILE* f): # <<<<<<<<<<<<<< @@ -6925,7 +6913,7 @@ static void __pyx_f_3_sa_7IntList_write_handle(struct __pyx_obj_3_sa_IntList *__ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("write_handle", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":158 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":158 * * cdef void write_handle(self, FILE* f): * fwrite(&(self.len), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -6934,7 +6922,7 @@ static void __pyx_f_3_sa_7IntList_write_handle(struct __pyx_obj_3_sa_IntList *__ */ fwrite((&__pyx_v_self->len), (sizeof(int)), 1, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":159 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -6967,7 +6955,7 @@ static PyObject *__pyx_pw_3_sa_7IntList_32write(PyObject *__pyx_v_self, PyObject return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":161 +/* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":161 * fwrite(self.arr, sizeof(int), self.len, f) * * def write(self, char* filename): # <<<<<<<<<<<<<< @@ -6981,7 +6969,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_31write(struct __pyx_obj_3_sa_IntList *_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("write", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":163 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":163 * def write(self, char* filename): * cdef FILE* f * f = fopen(filename, "w") # <<<<<<<<<<<<<< @@ -6990,7 +6978,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_31write(struct __pyx_obj_3_sa_IntList *_ */ __pyx_v_f = fopen(__pyx_v_filename, __pyx_k__w); - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":164 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":164 * cdef FILE* f * f = fopen(filename, "w") * self.write_handle(f) # <<<<<<<<<<<<<< @@ -6999,7 +6987,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_31write(struct __pyx_obj_3_sa_IntList *_ */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->__pyx_vtab)->write_handle(__pyx_v_self, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":165 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":165 * f = fopen(filename, "w") * self.write_handle(f) * fclose(f) # <<<<<<<<<<<<<< @@ -7014,7 +7002,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_31write(struct __pyx_obj_3_sa_IntList *_ return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":167 +/* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":167 * fclose(f) * * cdef void read_handle(self, FILE* f): # <<<<<<<<<<<<<< @@ -7026,7 +7014,7 @@ static void __pyx_f_3_sa_7IntList_read_handle(struct __pyx_obj_3_sa_IntList *__p __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("read_handle", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":168 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":168 * * cdef void read_handle(self, FILE* f): * (self.arr) # <<<<<<<<<<<<<< @@ -7035,7 +7023,7 @@ static void __pyx_f_3_sa_7IntList_read_handle(struct __pyx_obj_3_sa_IntList *__p */ __pyx_v_self->arr; - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":169 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":169 * cdef void read_handle(self, FILE* f): * (self.arr) * fread(&(self.len), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -7044,7 +7032,7 @@ static void __pyx_f_3_sa_7IntList_read_handle(struct __pyx_obj_3_sa_IntList *__p */ fread((&__pyx_v_self->len), (sizeof(int)), 1, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":170 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":170 * (self.arr) * fread(&(self.len), sizeof(int), 1, f) * self.arr = malloc(self.len * sizeof(int)) # <<<<<<<<<<<<<< @@ -7053,7 +7041,7 @@ static void __pyx_f_3_sa_7IntList_read_handle(struct __pyx_obj_3_sa_IntList *__p */ __pyx_v_self->arr = ((int *)malloc((__pyx_v_self->len * (sizeof(int))))); - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":171 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":171 * fread(&(self.len), sizeof(int), 1, f) * self.arr = malloc(self.len * sizeof(int)) * self.size = self.len # <<<<<<<<<<<<<< @@ -7062,7 +7050,7 @@ static void __pyx_f_3_sa_7IntList_read_handle(struct __pyx_obj_3_sa_IntList *__p */ __pyx_v_self->size = __pyx_v_self->len; - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":172 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":172 * self.arr = malloc(self.len * sizeof(int)) * self.size = self.len * fread(self.arr, sizeof(int), self.len, f) # <<<<<<<<<<<<<< @@ -7095,7 +7083,7 @@ static PyObject *__pyx_pw_3_sa_7IntList_34read(PyObject *__pyx_v_self, PyObject return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":174 +/* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":174 * fread(self.arr, sizeof(int), self.len, f) * * def read(self, char* filename): # <<<<<<<<<<<<<< @@ -7109,7 +7097,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_33read(struct __pyx_obj_3_sa_IntList *__ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("read", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":176 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":176 * def read(self, char* filename): * cdef FILE* f * f = fopen(filename, "r") # <<<<<<<<<<<<<< @@ -7118,7 +7106,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_33read(struct __pyx_obj_3_sa_IntList *__ */ __pyx_v_f = fopen(__pyx_v_filename, __pyx_k__r); - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":177 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":177 * cdef FILE* f * f = fopen(filename, "r") * self.read_handle(f) # <<<<<<<<<<<<<< @@ -7126,7 +7114,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_33read(struct __pyx_obj_3_sa_IntList *__ */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->__pyx_vtab)->read_handle(__pyx_v_self, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":178 + /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":178 * f = fopen(filename, "r") * self.read_handle(f) * fclose(f) # <<<<<<<<<<<<<< @@ -7153,7 +7141,7 @@ static int __pyx_pw_3_sa_9StringMap_1__cinit__(PyObject *__pyx_v_self, PyObject return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/str_map.pxi":13 +/* "/home/paulb/workspace/cdec/python/src/sa/str_map.pxi":13 * cdef int index(self, char *s) * * def __cinit__(self): # <<<<<<<<<<<<<< @@ -7166,7 +7154,7 @@ static int __pyx_pf_3_sa_9StringMap___cinit__(struct __pyx_obj_3_sa_StringMap *_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/str_map.pxi":14 + /* "/home/paulb/workspace/cdec/python/src/sa/str_map.pxi":14 * * def __cinit__(self): * self.vocab = stringmap_new() # <<<<<<<<<<<<<< @@ -7189,7 +7177,7 @@ static void __pyx_pw_3_sa_9StringMap_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyFinishContext(); } -/* "/home/pauldb/workspace/cdec/python/src/sa/str_map.pxi":16 +/* "/home/paulb/workspace/cdec/python/src/sa/str_map.pxi":16 * self.vocab = stringmap_new() * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -7201,7 +7189,7 @@ static void __pyx_pf_3_sa_9StringMap_2__dealloc__(struct __pyx_obj_3_sa_StringMa __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/str_map.pxi":17 + /* "/home/paulb/workspace/cdec/python/src/sa/str_map.pxi":17 * * def __dealloc__(self): * stringmap_delete(self.vocab) # <<<<<<<<<<<<<< @@ -7213,7 +7201,7 @@ static void __pyx_pf_3_sa_9StringMap_2__dealloc__(struct __pyx_obj_3_sa_StringMa __Pyx_RefNannyFinishContext(); } -/* "/home/pauldb/workspace/cdec/python/src/sa/str_map.pxi":19 +/* "/home/paulb/workspace/cdec/python/src/sa/str_map.pxi":19 * stringmap_delete(self.vocab) * * cdef char *word(self, int i): # <<<<<<<<<<<<<< @@ -7226,7 +7214,7 @@ static char *__pyx_f_3_sa_9StringMap_word(struct __pyx_obj_3_sa_StringMap *__pyx __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("word", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/str_map.pxi":20 + /* "/home/paulb/workspace/cdec/python/src/sa/str_map.pxi":20 * * cdef char *word(self, int i): * return stringmap_word(self.vocab, i) # <<<<<<<<<<<<<< @@ -7242,7 +7230,7 @@ static char *__pyx_f_3_sa_9StringMap_word(struct __pyx_obj_3_sa_StringMap *__pyx return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/str_map.pxi":22 +/* "/home/paulb/workspace/cdec/python/src/sa/str_map.pxi":22 * return stringmap_word(self.vocab, i) * * cdef int index(self, char *s): # <<<<<<<<<<<<<< @@ -7254,7 +7242,7 @@ static int __pyx_f_3_sa_9StringMap_index(struct __pyx_obj_3_sa_StringMap *__pyx_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("index", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/str_map.pxi":23 + /* "/home/paulb/workspace/cdec/python/src/sa/str_map.pxi":23 * * cdef int index(self, char *s): * return stringmap_index(self.vocab, s) # <<<<<<<<<<<<<< @@ -7275,14 +7263,14 @@ static int __pyx_pw_3_sa_9DataArray_1__cinit__(PyObject *__pyx_v_self, PyObject PyObject *__pyx_v_from_text = 0; PyObject *__pyx_v_side = 0; int __pyx_v_use_sent_id; + 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}; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__from_binary,&__pyx_n_s__from_text,&__pyx_n_s__side,&__pyx_n_s__use_sent_id,0}; PyObject* values[4] = {0,0,0,0}; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":17 + /* "/home/paulb/workspace/cdec/python/src/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): # <<<<<<<<<<<<<< @@ -7329,6 +7317,10 @@ static int __pyx_pw_3_sa_9DataArray_1__cinit__(PyObject *__pyx_v_self, PyObject if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } + if (values[3]) { + } else { + __pyx_v_use_sent_id = ((int)0); + } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); @@ -7374,7 +7366,7 @@ static int __pyx_pf_3_sa_9DataArray___cinit__(struct __pyx_obj_3_sa_DataArray *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":18 + /* "/home/paulb/workspace/cdec/python/src/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} # <<<<<<<<<<<<<< @@ -7391,7 +7383,7 @@ static int __pyx_pf_3_sa_9DataArray___cinit__(struct __pyx_obj_3_sa_DataArray *_ __pyx_v_self->word2id = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":19 + /* "/home/paulb/workspace/cdec/python/src/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"] # <<<<<<<<<<<<<< @@ -7412,7 +7404,7 @@ static int __pyx_pf_3_sa_9DataArray___cinit__(struct __pyx_obj_3_sa_DataArray *_ __pyx_v_self->id2word = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":20 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -7427,7 +7419,7 @@ static int __pyx_pf_3_sa_9DataArray___cinit__(struct __pyx_obj_3_sa_DataArray *_ __pyx_v_self->data = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":21 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":21 * self.id2word = ["END_OF_FILE", "END_OF_LINE"] * self.data = IntList(1000,1000) * self.sent_id = IntList(1000,1000) # <<<<<<<<<<<<<< @@ -7442,7 +7434,7 @@ static int __pyx_pf_3_sa_9DataArray___cinit__(struct __pyx_obj_3_sa_DataArray *_ __pyx_v_self->sent_id = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":22 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":22 * self.data = IntList(1000,1000) * self.sent_id = IntList(1000,1000) * self.sent_index = IntList(1000,1000) # <<<<<<<<<<<<<< @@ -7457,7 +7449,7 @@ static int __pyx_pf_3_sa_9DataArray___cinit__(struct __pyx_obj_3_sa_DataArray *_ __pyx_v_self->sent_index = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":23 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":23 * self.sent_id = IntList(1000,1000) * self.sent_index = IntList(1000,1000) * self.use_sent_id = use_sent_id # <<<<<<<<<<<<<< @@ -7466,7 +7458,7 @@ static int __pyx_pf_3_sa_9DataArray___cinit__(struct __pyx_obj_3_sa_DataArray *_ */ __pyx_v_self->use_sent_id = __pyx_v_use_sent_id; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":24 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":24 * self.sent_index = IntList(1000,1000) * self.use_sent_id = use_sent_id * if from_binary: # <<<<<<<<<<<<<< @@ -7476,7 +7468,7 @@ static int __pyx_pf_3_sa_9DataArray___cinit__(struct __pyx_obj_3_sa_DataArray *_ __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/pauldb/workspace/cdec/python/src/sa/data_array.pxi":25 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":25 * self.use_sent_id = use_sent_id * if from_binary: * self.read_binary(from_binary) # <<<<<<<<<<<<<< @@ -7498,7 +7490,7 @@ static int __pyx_pf_3_sa_9DataArray___cinit__(struct __pyx_obj_3_sa_DataArray *_ goto __pyx_L3; } - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":26 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":26 * if from_binary: * self.read_binary(from_binary) * elif from_text: # <<<<<<<<<<<<<< @@ -7508,7 +7500,7 @@ static int __pyx_pf_3_sa_9DataArray___cinit__(struct __pyx_obj_3_sa_DataArray *_ __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/pauldb/workspace/cdec/python/src/sa/data_array.pxi":27 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":27 * self.read_binary(from_binary) * elif from_text: * if side: # <<<<<<<<<<<<<< @@ -7518,7 +7510,7 @@ static int __pyx_pf_3_sa_9DataArray___cinit__(struct __pyx_obj_3_sa_DataArray *_ __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/pauldb/workspace/cdec/python/src/sa/data_array.pxi":28 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":28 * elif from_text: * if side: * self.read_bitext(from_text, (0 if side == 'source' else 1)) # <<<<<<<<<<<<<< @@ -7527,9 +7519,7 @@ static int __pyx_pf_3_sa_9DataArray___cinit__(struct __pyx_obj_3_sa_DataArray *_ */ __pyx_t_4 = PyObject_GetAttr(((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, ((PyObject *)__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; } else { @@ -7554,7 +7544,7 @@ static int __pyx_pf_3_sa_9DataArray___cinit__(struct __pyx_obj_3_sa_DataArray *_ } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":30 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":30 * self.read_bitext(from_text, (0 if side == 'source' else 1)) * else: * self.read_text(from_text) # <<<<<<<<<<<<<< @@ -7603,7 +7593,7 @@ static Py_ssize_t __pyx_pw_3_sa_9DataArray_3__len__(PyObject *__pyx_v_self) { return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":32 +/* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":32 * self.read_text(from_text) * * def __len__(self): # <<<<<<<<<<<<<< @@ -7621,7 +7611,7 @@ static Py_ssize_t __pyx_pf_3_sa_9DataArray_2__len__(struct __pyx_obj_3_sa_DataAr int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__len__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":33 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":33 * * def __len__(self): * return len(self.data) # <<<<<<<<<<<<<< @@ -7657,7 +7647,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_5get_sentence_id(PyObject *__pyx_v_sel return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":35 +/* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":35 * return len(self.data) * * def get_sentence_id(self, i): # <<<<<<<<<<<<<< @@ -7675,7 +7665,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_4get_sentence_id(struct __pyx_obj_3_sa int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_sentence_id", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":36 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":36 * * def get_sentence_id(self, i): * return self.sent_id.arr[i] # <<<<<<<<<<<<<< @@ -7713,7 +7703,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_7get_sentence(PyObject *__pyx_v_self, return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":38 +/* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":38 * return self.sent_id.arr[i] * * def get_sentence(self, i): # <<<<<<<<<<<<<< @@ -7738,7 +7728,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_6get_sentence(struct __pyx_obj_3_sa_Da __Pyx_RefNannySetupContext("get_sentence", 0); __Pyx_INCREF(__pyx_v_i); - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":40 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":40 * def get_sentence(self, i): * cdef int j, start, stop * sent = [] # <<<<<<<<<<<<<< @@ -7750,7 +7740,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_6get_sentence(struct __pyx_obj_3_sa_Da __pyx_v_sent = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":41 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":41 * cdef int j, start, stop * sent = [] * start = self.sent_index.arr[i] # <<<<<<<<<<<<<< @@ -7760,7 +7750,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_6get_sentence(struct __pyx_obj_3_sa_Da __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/pauldb/workspace/cdec/python/src/sa/data_array.pxi":42 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":42 * sent = [] * start = self.sent_index.arr[i] * stop = self.sent_index.arr[i+1] # <<<<<<<<<<<<<< @@ -7773,7 +7763,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_6get_sentence(struct __pyx_obj_3_sa_Da __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_stop = (__pyx_v_self->sent_index->arr[__pyx_t_2]); - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":43 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":43 * start = self.sent_index.arr[i] * stop = self.sent_index.arr[i+1] * for i from start <= i < stop: # <<<<<<<<<<<<<< @@ -7788,7 +7778,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_6get_sentence(struct __pyx_obj_3_sa_Da __pyx_v_i = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":44 + /* "/home/paulb/workspace/cdec/python/src/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]]) # <<<<<<<<<<<<<< @@ -7803,7 +7793,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_6get_sentence(struct __pyx_obj_3_sa_Da __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;} } - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":43 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":43 * start = self.sent_index.arr[i] * stop = self.sent_index.arr[i+1] * for i from start <= i < stop: # <<<<<<<<<<<<<< @@ -7816,7 +7806,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_6get_sentence(struct __pyx_obj_3_sa_Da __pyx_v_i = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":45 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":45 * for i from start <= i < stop: * sent.append(self.id2word[self.data.arr[i]]) * return sent # <<<<<<<<<<<<<< @@ -7853,7 +7843,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_9get_id(PyObject *__pyx_v_self, PyObje return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":47 +/* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":47 * return sent * * def get_id(self, word): # <<<<<<<<<<<<<< @@ -7873,18 +7863,18 @@ static PyObject *__pyx_pf_3_sa_9DataArray_8get_id(struct __pyx_obj_3_sa_DataArra int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_id", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":48 + /* "/home/paulb/workspace/cdec/python/src/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_1 = ((PySequence_Contains(__pyx_v_self->word2id, __pyx_v_word))); 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); if (__pyx_t_2) { - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":49 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":49 * def get_id(self, word): * if not word in self.word2id: * self.word2id[word] = len(self.id2word) # <<<<<<<<<<<<<< @@ -7900,7 +7890,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_8get_id(struct __pyx_obj_3_sa_DataArra 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;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":50 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":50 * if not word in self.word2id: * self.word2id[word] = len(self.id2word) * self.id2word.append(word) # <<<<<<<<<<<<<< @@ -7914,7 +7904,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_8get_id(struct __pyx_obj_3_sa_DataArra } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":51 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":51 * self.word2id[word] = len(self.id2word) * self.id2word.append(word) * return self.word2id[word] # <<<<<<<<<<<<<< @@ -7951,7 +7941,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_11__getitem__(PyObject *__pyx_v_self, return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":53 +/* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":53 * return self.word2id[word] * * def __getitem__(self, loc): # <<<<<<<<<<<<<< @@ -7969,7 +7959,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_10__getitem__(struct __pyx_obj_3_sa_Da int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":54 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":54 * * def __getitem__(self, loc): * return self.id2word[self.data.arr[loc]] # <<<<<<<<<<<<<< @@ -8007,7 +7997,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_13get_sentence_bounds(PyObject *__pyx_ return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":56 +/* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":56 * return self.id2word[self.data.arr[loc]] * * def get_sentence_bounds(self, loc): # <<<<<<<<<<<<<< @@ -8028,7 +8018,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_12get_sentence_bounds(struct __pyx_obj int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_sentence_bounds", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":57 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":57 * * def get_sentence_bounds(self, loc): * cdef int sid = self.sent_id.arr[loc] # <<<<<<<<<<<<<< @@ -8038,7 +8028,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_12get_sentence_bounds(struct __pyx_obj __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/pauldb/workspace/cdec/python/src/sa/data_array.pxi":58 + /* "/home/paulb/workspace/cdec/python/src/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]) # <<<<<<<<<<<<<< @@ -8097,7 +8087,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_15write_text(PyObject *__pyx_v_self, P return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":60 +/* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":60 * return (self.sent_index.arr[sid], self.sent_index.arr[sid+1]) * * def write_text(self, char* filename): # <<<<<<<<<<<<<< @@ -8129,7 +8119,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_14write_text(struct __pyx_obj_3_sa_Dat int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_text", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":61 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":61 * * def write_text(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -8169,7 +8159,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_14write_text(struct __pyx_obj_3_sa_Dat __pyx_v_f = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":62 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":62 * def write_text(self, char* filename): * with open(filename, "w") as f: * for w_id in self.data: # <<<<<<<<<<<<<< @@ -8187,18 +8177,10 @@ static PyObject *__pyx_pf_3_sa_9DataArray_14write_text(struct __pyx_obj_3_sa_Dat for (;;) { if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_4)) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_4)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #endif + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_4)) { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_4)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #endif + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; } else { __pyx_t_1 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_1)) { @@ -8214,19 +8196,20 @@ static PyObject *__pyx_pf_3_sa_9DataArray_14write_text(struct __pyx_obj_3_sa_Dat __pyx_v_w_id = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":63 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":63 * with open(filename, "w") as f: * for w_id in self.data: * if w_id > 1: # <<<<<<<<<<<<<< * f.write("%s " % self.get_word(w_id)) * if w_id == 1: */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_w_id, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_w_id, __pyx_int_1, Py_GT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_10) { - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":64 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":64 * for w_id in self.data: * if w_id > 1: * f.write("%s " % self.get_word(w_id)) # <<<<<<<<<<<<<< @@ -8263,19 +8246,20 @@ static PyObject *__pyx_pf_3_sa_9DataArray_14write_text(struct __pyx_obj_3_sa_Dat } __pyx_L18:; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":65 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":65 * if w_id > 1: * f.write("%s " % self.get_word(w_id)) * if w_id == 1: # <<<<<<<<<<<<<< * f.write("\n") * */ - __pyx_t_11 = PyObject_RichCompare(__pyx_v_w_id, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_11 = PyObject_RichCompare(__pyx_v_w_id, __pyx_int_1, Py_EQ); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_11); __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_10) { - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":66 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":66 * f.write("%s " % self.get_word(w_id)) * if w_id == 1: * f.write("\n") # <<<<<<<<<<<<<< @@ -8305,7 +8289,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_14write_text(struct __pyx_obj_3_sa_Dat __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":61 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":61 * * def write_text(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -8424,7 +8408,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_17read_text(PyObject *__pyx_v_self, Py return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":68 +/* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":68 * f.write("\n") * * def read_text(self, char* filename): # <<<<<<<<<<<<<< @@ -8452,7 +8436,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_16read_text(struct __pyx_obj_3_sa_Data int __pyx_clineno = 0; __Pyx_RefNannySetupContext("read_text", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":69 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":69 * * def read_text(self, char* filename): * with gzip_or_text(filename) as fp: # <<<<<<<<<<<<<< @@ -8492,7 +8476,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_16read_text(struct __pyx_obj_3_sa_Data __pyx_v_fp = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":70 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":70 * def read_text(self, char* filename): * with gzip_or_text(filename) as fp: * self.read_text_data(fp) # <<<<<<<<<<<<<< @@ -8521,7 +8505,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_16read_text(struct __pyx_obj_3_sa_Data __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":69 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":69 * * def read_text(self, char* filename): * with gzip_or_text(filename) as fp: # <<<<<<<<<<<<<< @@ -8622,11 +8606,11 @@ static PyObject *__pyx_pw_3_sa_9DataArray_19read_bitext(PyObject *__pyx_v_self, static PyObject *__pyx_pw_3_sa_9DataArray_19read_bitext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { char *__pyx_v_filename; int __pyx_v_side; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__filename,&__pyx_n_s__side,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("read_bitext (wrapper)", 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; @@ -8640,10 +8624,12 @@ static PyObject *__pyx_pw_3_sa_9DataArray_19read_bitext(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__filename)) != 0)) kw_args--; + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__filename); + if (likely(values[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--; + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__side); + if (likely(values[1])) 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;} } @@ -8674,7 +8660,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_19read_bitext(PyObject *__pyx_v_self, } static PyObject *__pyx_gb_3_sa_9DataArray_11read_bitext_2generator6(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":74 +/* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -8750,18 +8736,10 @@ static PyObject *__pyx_gb_3_sa_9DataArray_11read_bitext_2generator6(__pyx_Genera for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 74; __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[3]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; } 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[3]; __pyx_lineno = 74; __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[3]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { @@ -8816,12 +8794,11 @@ static PyObject *__pyx_gb_3_sa_9DataArray_11read_bitext_2generator6(__pyx_Genera __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_generator->resume_label = -1; - __Pyx_Generator_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return NULL; } -/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":72 +/* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":72 * self.read_text_data(fp) * * def read_bitext(self, char* filename, int side): # <<<<<<<<<<<<<< @@ -8857,7 +8834,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_18read_bitext(struct __pyx_obj_3_sa_Da __Pyx_GOTREF(__pyx_cur_scope); __pyx_cur_scope->__pyx_v_side = __pyx_v_side; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":73 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":73 * * def read_bitext(self, char* filename, int side): * with gzip_or_text(filename) as fp: # <<<<<<<<<<<<<< @@ -8898,7 +8875,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_18read_bitext(struct __pyx_obj_3_sa_Da __pyx_cur_scope->__pyx_v_fp = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":74 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -8910,7 +8887,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_18read_bitext(struct __pyx_obj_3_sa_Da __pyx_v_data = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":75 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -8939,7 +8916,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_18read_bitext(struct __pyx_obj_3_sa_Da __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":73 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":73 * * def read_bitext(self, char* filename, int side): * with gzip_or_text(filename) as fp: # <<<<<<<<<<<<<< @@ -9047,7 +9024,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_21read_text_data(PyObject *__pyx_v_sel return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":77 +/* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":77 * self.read_text_data(data) * * def read_text_data(self, data): # <<<<<<<<<<<<<< @@ -9077,7 +9054,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa int __pyx_clineno = 0; __Pyx_RefNannySetupContext("read_text_data", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":78 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":78 * * def read_text_data(self, data): * cdef int word_count = 0 # <<<<<<<<<<<<<< @@ -9086,7 +9063,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa */ __pyx_v_word_count = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":79 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":79 * def read_text_data(self, data): * cdef int word_count = 0 * for line_num, line in enumerate(data): # <<<<<<<<<<<<<< @@ -9106,18 +9083,10 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa for (;;) { if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; } else { __pyx_t_5 = __pyx_t_4(__pyx_t_2); if (unlikely(!__pyx_t_5)) { @@ -9141,7 +9110,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":80 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":80 * cdef int word_count = 0 * for line_num, line in enumerate(data): * self.sent_index.append(word_count) # <<<<<<<<<<<<<< @@ -9155,7 +9124,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":81 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":81 * for line_num, line in enumerate(data): * self.sent_index.append(word_count) * for word in line.split(): # <<<<<<<<<<<<<< @@ -9179,18 +9148,10 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa for (;;) { if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_6)) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_6)) 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;} - #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;} - #endif + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_6)) { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_6)) 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;} - #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;} - #endif + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; } else { __pyx_t_5 = __pyx_t_8(__pyx_t_6); if (unlikely(!__pyx_t_5)) { @@ -9206,7 +9167,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa __pyx_v_word = __pyx_t_5; __pyx_t_5 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":82 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":82 * self.sent_index.append(word_count) * for word in line.split(): * self.data.append(self.get_id(word)) # <<<<<<<<<<<<<< @@ -9229,7 +9190,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":83 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":83 * for word in line.split(): * self.data.append(self.get_id(word)) * if self.use_sent_id: # <<<<<<<<<<<<<< @@ -9238,7 +9199,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa */ if (__pyx_v_self->use_sent_id) { - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":84 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":84 * self.data.append(self.get_id(word)) * if self.use_sent_id: * self.sent_id.append(line_num) # <<<<<<<<<<<<<< @@ -9252,7 +9213,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa } __pyx_L7:; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":85 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":85 * if self.use_sent_id: * self.sent_id.append(line_num) * word_count = word_count + 1 # <<<<<<<<<<<<<< @@ -9263,7 +9224,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":86 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":86 * self.sent_id.append(line_num) * word_count = word_count + 1 * self.data.append(1) # <<<<<<<<<<<<<< @@ -9274,7 +9235,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":87 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":87 * word_count = word_count + 1 * self.data.append(1) * if self.use_sent_id: # <<<<<<<<<<<<<< @@ -9283,7 +9244,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa */ if (__pyx_v_self->use_sent_id) { - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":88 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":88 * self.data.append(1) * if self.use_sent_id: * self.sent_id.append(line_num) # <<<<<<<<<<<<<< @@ -9297,7 +9258,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa } __pyx_L8:; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":89 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":89 * if self.use_sent_id: * self.sent_id.append(line_num) * word_count = word_count + 1 # <<<<<<<<<<<<<< @@ -9309,7 +9270,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":90 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":90 * self.sent_id.append(line_num) * word_count = word_count + 1 * self.data.append(0) # <<<<<<<<<<<<<< @@ -9320,7 +9281,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":91 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":91 * word_count = word_count + 1 * self.data.append(0) * self.sent_index.append(word_count) # <<<<<<<<<<<<<< @@ -9375,7 +9336,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_23read_binary(PyObject *__pyx_v_self, return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":94 +/* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":94 * * * def read_binary(self, char* filename): # <<<<<<<<<<<<<< @@ -9389,7 +9350,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_22read_binary(struct __pyx_obj_3_sa_Da __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("read_binary", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":96 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":96 * def read_binary(self, char* filename): * cdef FILE* f * f = fopen(filename, "r") # <<<<<<<<<<<<<< @@ -9398,7 +9359,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_22read_binary(struct __pyx_obj_3_sa_Da */ __pyx_v_f = fopen(__pyx_v_filename, __pyx_k__r); - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":97 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":97 * cdef FILE* f * f = fopen(filename, "r") * self.read_handle(f) # <<<<<<<<<<<<<< @@ -9407,7 +9368,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_22read_binary(struct __pyx_obj_3_sa_Da */ ((struct __pyx_vtabstruct_3_sa_DataArray *)__pyx_v_self->__pyx_vtab)->read_handle(__pyx_v_self, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":98 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":98 * f = fopen(filename, "r") * self.read_handle(f) * fclose(f) # <<<<<<<<<<<<<< @@ -9422,7 +9383,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_22read_binary(struct __pyx_obj_3_sa_Da return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":100 +/* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":100 * fclose(f) * * cdef void read_handle(self, FILE* f): # <<<<<<<<<<<<<< @@ -9447,7 +9408,7 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray int __pyx_clineno = 0; __Pyx_RefNannySetupContext("read_handle", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":105 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":105 * cdef char* word * * self.data.read_handle(f) # <<<<<<<<<<<<<< @@ -9456,7 +9417,7 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->data->__pyx_vtab)->read_handle(__pyx_v_self->data, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":106 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":106 * * self.data.read_handle(f) * self.sent_index.read_handle(f) # <<<<<<<<<<<<<< @@ -9465,7 +9426,7 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->sent_index->__pyx_vtab)->read_handle(__pyx_v_self->sent_index, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":107 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":107 * self.data.read_handle(f) * self.sent_index.read_handle(f) * self.sent_id.read_handle(f) # <<<<<<<<<<<<<< @@ -9474,7 +9435,7 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->sent_id->__pyx_vtab)->read_handle(__pyx_v_self->sent_id, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":108 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":108 * self.sent_index.read_handle(f) * self.sent_id.read_handle(f) * fread(&(num_words), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -9483,7 +9444,7 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray */ fread((&__pyx_v_num_words), (sizeof(int)), 1, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":109 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":109 * self.sent_id.read_handle(f) * fread(&(num_words), sizeof(int), 1, f) * for i in range(num_words): # <<<<<<<<<<<<<< @@ -9494,7 +9455,7 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":110 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -9503,7 +9464,7 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray */ fread((&__pyx_v_word_len), (sizeof(int)), 1, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":111 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":111 * for i in range(num_words): * fread(&(word_len), sizeof(int), 1, f) * word = malloc (word_len * sizeof(char)) # <<<<<<<<<<<<<< @@ -9512,7 +9473,7 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray */ __pyx_v_word = ((char *)malloc((__pyx_v_word_len * (sizeof(char))))); - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":112 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -9521,7 +9482,7 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray */ fread(__pyx_v_word, (sizeof(char)), __pyx_v_word_len, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":113 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":113 * word = malloc (word_len * sizeof(char)) * fread(word, sizeof(char), word_len, f) * self.word2id[word] = len(self.id2word) # <<<<<<<<<<<<<< @@ -9540,7 +9501,7 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":114 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":114 * fread(word, sizeof(char), word_len, f) * self.word2id[word] = len(self.id2word) * self.id2word.append(word) # <<<<<<<<<<<<<< @@ -9554,7 +9515,7 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":115 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":115 * self.word2id[word] = len(self.id2word) * self.id2word.append(word) * free(word) # <<<<<<<<<<<<<< @@ -9564,7 +9525,7 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray free(__pyx_v_word); } - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":116 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":116 * self.id2word.append(word) * free(word) * if len(self.sent_id) == 0: # <<<<<<<<<<<<<< @@ -9578,7 +9539,7 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray __pyx_t_6 = (__pyx_t_4 == 0); if (__pyx_t_6) { - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":117 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":117 * free(word) * if len(self.sent_id) == 0: * self.use_sent_id = False # <<<<<<<<<<<<<< @@ -9590,7 +9551,7 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":119 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":119 * self.use_sent_id = False * else: * self.use_sent_id = True # <<<<<<<<<<<<<< @@ -9610,7 +9571,7 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray __Pyx_RefNannyFinishContext(); } -/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":121 +/* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":121 * self.use_sent_id = True * * cdef void write_handle(self, FILE* f): # <<<<<<<<<<<<<< @@ -9634,7 +9595,7 @@ static void __pyx_f_3_sa_9DataArray_write_handle(struct __pyx_obj_3_sa_DataArray int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_handle", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":125 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":125 * cdef int num_words * * self.data.write_handle(f) # <<<<<<<<<<<<<< @@ -9643,7 +9604,7 @@ static void __pyx_f_3_sa_9DataArray_write_handle(struct __pyx_obj_3_sa_DataArray */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->data->__pyx_vtab)->write_handle(__pyx_v_self->data, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":126 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":126 * * self.data.write_handle(f) * self.sent_index.write_handle(f) # <<<<<<<<<<<<<< @@ -9652,7 +9613,7 @@ static void __pyx_f_3_sa_9DataArray_write_handle(struct __pyx_obj_3_sa_DataArray */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->sent_index->__pyx_vtab)->write_handle(__pyx_v_self->sent_index, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":127 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":127 * self.data.write_handle(f) * self.sent_index.write_handle(f) * self.sent_id.write_handle(f) # <<<<<<<<<<<<<< @@ -9661,7 +9622,7 @@ static void __pyx_f_3_sa_9DataArray_write_handle(struct __pyx_obj_3_sa_DataArray */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->sent_id->__pyx_vtab)->write_handle(__pyx_v_self->sent_id, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":128 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":128 * self.sent_index.write_handle(f) * self.sent_id.write_handle(f) * num_words = len(self.id2word) - 2 # <<<<<<<<<<<<<< @@ -9674,7 +9635,7 @@ static void __pyx_f_3_sa_9DataArray_write_handle(struct __pyx_obj_3_sa_DataArray __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_num_words = (__pyx_t_2 - 2); - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":129 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":129 * self.sent_id.write_handle(f) * num_words = len(self.id2word) - 2 * fwrite(&(num_words), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -9683,7 +9644,7 @@ static void __pyx_f_3_sa_9DataArray_write_handle(struct __pyx_obj_3_sa_DataArray */ fwrite((&__pyx_v_num_words), (sizeof(int)), 1, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":130 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":130 * num_words = len(self.id2word) - 2 * fwrite(&(num_words), sizeof(int), 1, f) * for word in self.id2word[2:]: # <<<<<<<<<<<<<< @@ -9704,18 +9665,10 @@ static void __pyx_f_3_sa_9DataArray_write_handle(struct __pyx_obj_3_sa_DataArray for (;;) { if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_3)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_3)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; } else { __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) { @@ -9731,7 +9684,7 @@ static void __pyx_f_3_sa_9DataArray_write_handle(struct __pyx_obj_3_sa_DataArray __pyx_v_word = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":131 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":131 * fwrite(&(num_words), sizeof(int), 1, f) * for word in self.id2word[2:]: * word_len = len(word) + 1 # <<<<<<<<<<<<<< @@ -9741,7 +9694,7 @@ static void __pyx_f_3_sa_9DataArray_write_handle(struct __pyx_obj_3_sa_DataArray __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/pauldb/workspace/cdec/python/src/sa/data_array.pxi":132 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":132 * for word in self.id2word[2:]: * word_len = len(word) + 1 * fwrite(&(word_len), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -9750,7 +9703,7 @@ static void __pyx_f_3_sa_9DataArray_write_handle(struct __pyx_obj_3_sa_DataArray */ fwrite((&__pyx_v_word_len), (sizeof(int)), 1, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":133 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":133 * word_len = len(word) + 1 * fwrite(&(word_len), sizeof(int), 1, f) * fwrite(word, sizeof(char), word_len, f) # <<<<<<<<<<<<<< @@ -9793,7 +9746,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_25write_binary(PyObject *__pyx_v_self, return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":135 +/* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":135 * fwrite(word, sizeof(char), word_len, f) * * def write_binary(self, char* filename): # <<<<<<<<<<<<<< @@ -9807,7 +9760,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_24write_binary(struct __pyx_obj_3_sa_D __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("write_binary", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":137 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":137 * def write_binary(self, char* filename): * cdef FILE* f * f = fopen(filename, "w") # <<<<<<<<<<<<<< @@ -9816,7 +9769,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_24write_binary(struct __pyx_obj_3_sa_D */ __pyx_v_f = fopen(__pyx_v_filename, __pyx_k__w); - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":138 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":138 * cdef FILE* f * f = fopen(filename, "w") * self.write_handle(f) # <<<<<<<<<<<<<< @@ -9825,7 +9778,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_24write_binary(struct __pyx_obj_3_sa_D */ ((struct __pyx_vtabstruct_3_sa_DataArray *)__pyx_v_self->__pyx_vtab)->write_handle(__pyx_v_self, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":139 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":139 * f = fopen(filename, "w") * self.write_handle(f) * fclose(f) # <<<<<<<<<<<<<< @@ -9851,7 +9804,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_27write_enhanced_handle(PyObject *__py return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":141 +/* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":141 * fclose(f) * * def write_enhanced_handle(self, f): # <<<<<<<<<<<<<< @@ -9875,7 +9828,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_o int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_enhanced_handle", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":142 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":142 * * def write_enhanced_handle(self, f): * for i in self.data: # <<<<<<<<<<<<<< @@ -9893,18 +9846,10 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_o for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 142; __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[3]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; } 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[3]; __pyx_lineno = 142; __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[3]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { @@ -9920,7 +9865,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_o __pyx_v_i = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":143 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":143 * def write_enhanced_handle(self, f): * for i in self.data: * f.write("%d " %i) # <<<<<<<<<<<<<< @@ -9944,7 +9889,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_o } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":144 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":144 * for i in self.data: * f.write("%d " %i) * f.write("\n") # <<<<<<<<<<<<<< @@ -9958,7 +9903,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_o __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":145 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":145 * f.write("%d " %i) * f.write("\n") * for i in self.sent_index: # <<<<<<<<<<<<<< @@ -9976,18 +9921,10 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_o for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_5)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_5)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_5)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_5)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; } else { __pyx_t_1 = __pyx_t_3(__pyx_t_5); if (unlikely(!__pyx_t_1)) { @@ -10003,7 +9940,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_o __pyx_v_i = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":146 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":146 * f.write("\n") * for i in self.sent_index: * f.write("%d " %i) # <<<<<<<<<<<<<< @@ -10027,7 +9964,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_o } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":147 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":147 * for i in self.sent_index: * f.write("%d " %i) * f.write("\n") # <<<<<<<<<<<<<< @@ -10041,7 +9978,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_o __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":148 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":148 * f.write("%d " %i) * f.write("\n") * for i in self.sent_id: # <<<<<<<<<<<<<< @@ -10059,18 +9996,10 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_o for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_6)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_6)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_6)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_6)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; } else { __pyx_t_5 = __pyx_t_3(__pyx_t_6); if (unlikely(!__pyx_t_5)) { @@ -10086,7 +10015,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_o __pyx_v_i = __pyx_t_5; __pyx_t_5 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":149 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":149 * f.write("\n") * for i in self.sent_id: * f.write("%d " %i) # <<<<<<<<<<<<<< @@ -10110,7 +10039,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_o } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":150 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":150 * for i in self.sent_id: * f.write("%d " %i) * f.write("\n") # <<<<<<<<<<<<<< @@ -10124,7 +10053,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_o __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":151 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":151 * f.write("%d " %i) * f.write("\n") * for word in self.id2word: # <<<<<<<<<<<<<< @@ -10142,18 +10071,10 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_o for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_4)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_4)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_4)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; } else { __pyx_t_6 = __pyx_t_3(__pyx_t_4); if (unlikely(!__pyx_t_6)) { @@ -10169,7 +10090,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_o __pyx_v_word = __pyx_t_6; __pyx_t_6 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":152 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":152 * f.write("\n") * for word in self.id2word: * f.write("%s %d " % (word, self.word2id[word])) # <<<<<<<<<<<<<< @@ -10204,7 +10125,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_o } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":153 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":153 * for word in self.id2word: * f.write("%s %d " % (word, self.word2id[word])) * f.write("\n") # <<<<<<<<<<<<<< @@ -10256,7 +10177,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_29write_enhanced(PyObject *__pyx_v_sel return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":155 +/* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":155 * f.write("\n") * * def write_enhanced(self, char* filename): # <<<<<<<<<<<<<< @@ -10284,7 +10205,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_28write_enhanced(struct __pyx_obj_3_sa int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_enhanced", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":156 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":156 * * def write_enhanced(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -10323,7 +10244,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_28write_enhanced(struct __pyx_obj_3_sa __pyx_v_f = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":157 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":157 * def write_enhanced(self, char* filename): * with open(filename, "w") as f: * self.write_enhanced_handle(self, f) # <<<<<<<<<<<<<< @@ -10353,7 +10274,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_28write_enhanced(struct __pyx_obj_3_sa __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":156 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":156 * * def write_enhanced(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -10459,7 +10380,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_7word2id_1__get__(PyObject *__pyx_v_se return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":10 +/* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":10 * * cdef class DataArray: * cdef public word2id # <<<<<<<<<<<<<< @@ -10546,7 +10467,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_7id2word_1__get__(PyObject *__pyx_v_se return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":11 +/* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":11 * cdef class DataArray: * cdef public word2id * cdef public id2word # <<<<<<<<<<<<<< @@ -10633,7 +10554,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_4data_1__get__(PyObject *__pyx_v_self) return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":12 +/* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":12 * cdef public word2id * cdef public id2word * cdef public IntList data # <<<<<<<<<<<<<< @@ -10729,7 +10650,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_7sent_id_1__get__(PyObject *__pyx_v_se return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":13 +/* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":13 * cdef public id2word * cdef public IntList data * cdef public IntList sent_id # <<<<<<<<<<<<<< @@ -10825,7 +10746,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_10sent_index_1__get__(PyObject *__pyx_ return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":14 +/* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":14 * cdef public IntList data * cdef public IntList sent_id * cdef public IntList sent_index # <<<<<<<<<<<<<< @@ -10910,7 +10831,7 @@ static int __pyx_pf_3_sa_9DataArray_10sent_index_4__del__(struct __pyx_obj_3_sa_ return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":12 +/* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":12 * cdef IntList sent_index * * cdef int link(self, int i, int j): # <<<<<<<<<<<<<< @@ -10923,7 +10844,7 @@ static int __pyx_f_3_sa_9Alignment_link(CYTHON_UNUSED struct __pyx_obj_3_sa_Alig __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("link", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":14 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":14 * cdef int link(self, int i, int j): * """Integerizes an alignment link pair""" * return i*65536 + j # <<<<<<<<<<<<<< @@ -10951,7 +10872,7 @@ static PyObject *__pyx_pw_3_sa_9Alignment_1unlink(PyObject *__pyx_v_self, PyObje return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":16 +/* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":16 * return i*65536 + j * * def unlink(self, link): # <<<<<<<<<<<<<< @@ -10970,7 +10891,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_unlink(CYTHON_UNUSED struct __pyx_obj_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("unlink", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":18 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":18 * def unlink(self, link): * """De-integerizes an alignment link pair""" * return (link/65536, link%65536) # <<<<<<<<<<<<<< @@ -11008,7 +10929,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_unlink(CYTHON_UNUSED struct __pyx_obj_ return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":20 +/* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":20 * return (link/65536, link%65536) * * cdef _unlink(self, int link, int* f, int* e): # <<<<<<<<<<<<<< @@ -11021,7 +10942,7 @@ static PyObject *__pyx_f_3_sa_9Alignment__unlink(CYTHON_UNUSED struct __pyx_obj_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_unlink", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":21 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":21 * * cdef _unlink(self, int link, int* f, int* e): * f[0] = link/65536 # <<<<<<<<<<<<<< @@ -11030,7 +10951,7 @@ static PyObject *__pyx_f_3_sa_9Alignment__unlink(CYTHON_UNUSED struct __pyx_obj_ */ (__pyx_v_f[0]) = __Pyx_div_long(__pyx_v_link, 65536); - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":22 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":22 * cdef _unlink(self, int link, int* f, int* e): * f[0] = link/65536 * e[0] = link%65536 # <<<<<<<<<<<<<< @@ -11066,7 +10987,7 @@ static PyObject *__pyx_pw_3_sa_9Alignment_3get_sent_links(PyObject *__pyx_v_self return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":24 +/* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":24 * e[0] = link%65536 * * def get_sent_links(self, int sent_id): # <<<<<<<<<<<<<< @@ -11086,7 +11007,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_2get_sent_links(struct __pyx_obj_3_sa_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_sent_links", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":28 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":28 * cdef int* arr * cdef int arr_len * sent_links = IntList() # <<<<<<<<<<<<<< @@ -11098,7 +11019,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_2get_sent_links(struct __pyx_obj_3_sa_ __pyx_v_sent_links = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":29 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":29 * cdef int arr_len * sent_links = IntList() * arr = self._get_sent_links(sent_id, &arr_len) # <<<<<<<<<<<<<< @@ -11107,7 +11028,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_2get_sent_links(struct __pyx_obj_3_sa_ */ __pyx_v_arr = ((struct __pyx_vtabstruct_3_sa_Alignment *)__pyx_v_self->__pyx_vtab)->_get_sent_links(__pyx_v_self, __pyx_v_sent_id, (&__pyx_v_arr_len)); - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":30 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":30 * sent_links = IntList() * arr = self._get_sent_links(sent_id, &arr_len) * sent_links._extend_arr(arr, arr_len*2) # <<<<<<<<<<<<<< @@ -11116,7 +11037,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_2get_sent_links(struct __pyx_obj_3_sa_ */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_sent_links->__pyx_vtab)->_extend_arr(__pyx_v_sent_links, __pyx_v_arr, (__pyx_v_arr_len * 2)); - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":31 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":31 * arr = self._get_sent_links(sent_id, &arr_len) * sent_links._extend_arr(arr, arr_len*2) * free(arr) # <<<<<<<<<<<<<< @@ -11125,7 +11046,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_2get_sent_links(struct __pyx_obj_3_sa_ */ free(__pyx_v_arr); - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":32 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":32 * sent_links._extend_arr(arr, arr_len*2) * free(arr) * return sent_links # <<<<<<<<<<<<<< @@ -11150,7 +11071,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_2get_sent_links(struct __pyx_obj_3_sa_ return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":34 +/* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":34 * return sent_links * * cdef int* _get_sent_links(self, int sent_id, int* num_links): # <<<<<<<<<<<<<< @@ -11172,7 +11093,7 @@ static int *__pyx_f_3_sa_9Alignment__get_sent_links(struct __pyx_obj_3_sa_Alignm int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_sent_links", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":37 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":37 * cdef int* sent_links * cdef int i, start, end * start = self.sent_index.arr[sent_id] # <<<<<<<<<<<<<< @@ -11181,7 +11102,7 @@ static int *__pyx_f_3_sa_9Alignment__get_sent_links(struct __pyx_obj_3_sa_Alignm */ __pyx_v_start = (__pyx_v_self->sent_index->arr[__pyx_v_sent_id]); - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":38 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":38 * cdef int i, start, end * start = self.sent_index.arr[sent_id] * end = self.sent_index.arr[sent_id+1] # <<<<<<<<<<<<<< @@ -11190,7 +11111,7 @@ static int *__pyx_f_3_sa_9Alignment__get_sent_links(struct __pyx_obj_3_sa_Alignm */ __pyx_v_end = (__pyx_v_self->sent_index->arr[(__pyx_v_sent_id + 1)]); - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":39 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":39 * start = self.sent_index.arr[sent_id] * end = self.sent_index.arr[sent_id+1] * num_links[0] = end - start # <<<<<<<<<<<<<< @@ -11199,7 +11120,7 @@ static int *__pyx_f_3_sa_9Alignment__get_sent_links(struct __pyx_obj_3_sa_Alignm */ (__pyx_v_num_links[0]) = (__pyx_v_end - __pyx_v_start); - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":40 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":40 * end = self.sent_index.arr[sent_id+1] * num_links[0] = end - start * sent_links = malloc(2*num_links[0]*sizeof(int)) # <<<<<<<<<<<<<< @@ -11208,7 +11129,7 @@ static int *__pyx_f_3_sa_9Alignment__get_sent_links(struct __pyx_obj_3_sa_Alignm */ __pyx_v_sent_links = ((int *)malloc(((2 * (__pyx_v_num_links[0])) * (sizeof(int))))); - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":41 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":41 * num_links[0] = end - start * sent_links = malloc(2*num_links[0]*sizeof(int)) * for i from 0 <= i < num_links[0]: # <<<<<<<<<<<<<< @@ -11218,7 +11139,7 @@ static int *__pyx_f_3_sa_9Alignment__get_sent_links(struct __pyx_obj_3_sa_Alignm __pyx_t_1 = (__pyx_v_num_links[0]); for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":42 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":42 * 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) # <<<<<<<<<<<<<< @@ -11230,7 +11151,7 @@ static int *__pyx_f_3_sa_9Alignment__get_sent_links(struct __pyx_obj_3_sa_Alignm __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":43 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":43 * 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 # <<<<<<<<<<<<<< @@ -11256,14 +11177,14 @@ static int __pyx_pw_3_sa_9Alignment_5__cinit__(PyObject *__pyx_v_self, PyObject static int __pyx_pw_3_sa_9Alignment_5__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_from_binary = 0; PyObject *__pyx_v_from_text = 0; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__from_binary,&__pyx_n_s__from_text,0}; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__from_binary,&__pyx_n_s__from_text,0}; PyObject* values[2] = {0,0}; - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":45 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":45 * return sent_links * * def __cinit__(self, from_binary=None, from_text=None): # <<<<<<<<<<<<<< @@ -11333,7 +11254,7 @@ static int __pyx_pf_3_sa_9Alignment_4__cinit__(struct __pyx_obj_3_sa_Alignment * int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":46 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":46 * * def __cinit__(self, from_binary=None, from_text=None): * self.links = IntList(1000,1000) # <<<<<<<<<<<<<< @@ -11348,7 +11269,7 @@ static int __pyx_pf_3_sa_9Alignment_4__cinit__(struct __pyx_obj_3_sa_Alignment * __pyx_v_self->links = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":47 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":47 * def __cinit__(self, from_binary=None, from_text=None): * self.links = IntList(1000,1000) * self.sent_index = IntList(1000,1000) # <<<<<<<<<<<<<< @@ -11363,7 +11284,7 @@ static int __pyx_pf_3_sa_9Alignment_4__cinit__(struct __pyx_obj_3_sa_Alignment * __pyx_v_self->sent_index = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":48 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":48 * self.links = IntList(1000,1000) * self.sent_index = IntList(1000,1000) * if from_binary: # <<<<<<<<<<<<<< @@ -11373,7 +11294,7 @@ static int __pyx_pf_3_sa_9Alignment_4__cinit__(struct __pyx_obj_3_sa_Alignment * __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_from_binary); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":49 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":49 * self.sent_index = IntList(1000,1000) * if from_binary: * self.read_binary(from_binary) # <<<<<<<<<<<<<< @@ -11395,7 +11316,7 @@ static int __pyx_pf_3_sa_9Alignment_4__cinit__(struct __pyx_obj_3_sa_Alignment * goto __pyx_L3; } - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":50 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":50 * if from_binary: * self.read_binary(from_binary) * elif from_text: # <<<<<<<<<<<<<< @@ -11405,7 +11326,7 @@ static int __pyx_pf_3_sa_9Alignment_4__cinit__(struct __pyx_obj_3_sa_Alignment * __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_from_text); 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/pauldb/workspace/cdec/python/src/sa/alignment.pxi":51 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":51 * self.read_binary(from_binary) * elif from_text: * self.read_text(from_text) # <<<<<<<<<<<<<< @@ -11462,7 +11383,7 @@ static PyObject *__pyx_pw_3_sa_9Alignment_7read_text(PyObject *__pyx_v_self, PyO return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":53 +/* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":53 * self.read_text(from_text) * * def read_text(self, char* filename): # <<<<<<<<<<<<<< @@ -11504,7 +11425,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_6read_text(struct __pyx_obj_3_sa_Align int __pyx_clineno = 0; __Pyx_RefNannySetupContext("read_text", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":54 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":54 * * def read_text(self, char* filename): * with gzip_or_text(filename) as f: # <<<<<<<<<<<<<< @@ -11544,7 +11465,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_6read_text(struct __pyx_obj_3_sa_Align __pyx_v_f = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":55 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":55 * def read_text(self, char* filename): * with gzip_or_text(filename) as f: * for line in f: # <<<<<<<<<<<<<< @@ -11562,18 +11483,10 @@ static PyObject *__pyx_pf_3_sa_9Alignment_6read_text(struct __pyx_obj_3_sa_Align for (;;) { if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #endif + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #endif + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; } else { __pyx_t_2 = __pyx_t_9(__pyx_t_1); if (unlikely(!__pyx_t_2)) { @@ -11589,7 +11502,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_6read_text(struct __pyx_obj_3_sa_Align __pyx_v_line = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":56 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":56 * with gzip_or_text(filename) as f: * for line in f: * self.sent_index.append(len(self.links)) # <<<<<<<<<<<<<< @@ -11607,7 +11520,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_6read_text(struct __pyx_obj_3_sa_Align __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":57 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":57 * for line in f: * self.sent_index.append(len(self.links)) * pairs = line.split() # <<<<<<<<<<<<<< @@ -11623,7 +11536,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_6read_text(struct __pyx_obj_3_sa_Align __pyx_v_pairs = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":58 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":58 * self.sent_index.append(len(self.links)) * pairs = line.split() * for pair in pairs: # <<<<<<<<<<<<<< @@ -11641,18 +11554,10 @@ static PyObject *__pyx_pf_3_sa_9Alignment_6read_text(struct __pyx_obj_3_sa_Align for (;;) { if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_2)) { if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 58; __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 = 58; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #endif + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_2)) { if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 58; __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 = 58; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #endif + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; } else { __pyx_t_3 = __pyx_t_11(__pyx_t_2); if (unlikely(!__pyx_t_3)) { @@ -11668,7 +11573,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_6read_text(struct __pyx_obj_3_sa_Align __pyx_v_pair = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":59 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":59 * pairs = line.split() * for pair in pairs: * (i, j) = map(int, pair.split('-')) # <<<<<<<<<<<<<< @@ -11693,33 +11598,27 @@ static PyObject *__pyx_pf_3_sa_9Alignment_6read_text(struct __pyx_obj_3_sa_Align __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_12))) || (PyList_CheckExact(__pyx_t_12))) { PyObject* sequence = __pyx_t_12; - #if CYTHON_COMPILING_IN_CPYTHON - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[4]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - } - #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { + if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { + if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); + else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[4]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + } __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_13 = PyTuple_GET_ITEM(sequence, 1); } else { + if (unlikely(PyList_GET_SIZE(sequence) != 2)) { + if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); + else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[4]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + } __pyx_t_3 = PyList_GET_ITEM(sequence, 0); __pyx_t_13 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_13); - #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __pyx_t_13 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #endif __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - } else - { + } else { Py_ssize_t index = -1; __pyx_t_14 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_14); @@ -11730,13 +11629,12 @@ static PyObject *__pyx_pf_3_sa_9Alignment_6read_text(struct __pyx_obj_3_sa_Align index = 1; __pyx_t_13 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_13)) goto __pyx_L20_unpacking_failed; __Pyx_GOTREF(__pyx_t_13); if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L21_unpacking_done; __pyx_L20_unpacking_failed:; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_15 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); + if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __pyx_L21_unpacking_done:; } @@ -11747,7 +11645,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_6read_text(struct __pyx_obj_3_sa_Align __pyx_v_j = __pyx_t_13; __pyx_t_13 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":60 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":60 * for pair in pairs: * (i, j) = map(int, pair.split('-')) * self.links.append(self.link(i, j)) # <<<<<<<<<<<<<< @@ -11767,7 +11665,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_6read_text(struct __pyx_obj_3_sa_Align } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":61 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":61 * (i, j) = map(int, pair.split('-')) * self.links.append(self.link(i, j)) * self.sent_index.append(len(self.links)) # <<<<<<<<<<<<<< @@ -11797,7 +11695,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_6read_text(struct __pyx_obj_3_sa_Align __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":54 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":54 * * def read_text(self, char* filename): * with gzip_or_text(filename) as f: # <<<<<<<<<<<<<< @@ -11921,7 +11819,7 @@ static PyObject *__pyx_pw_3_sa_9Alignment_9read_binary(PyObject *__pyx_v_self, P return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":63 +/* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":63 * self.sent_index.append(len(self.links)) * * def read_binary(self, char* filename): # <<<<<<<<<<<<<< @@ -11935,7 +11833,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_8read_binary(struct __pyx_obj_3_sa_Ali __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("read_binary", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":65 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":65 * def read_binary(self, char* filename): * cdef FILE* f * f = fopen(filename, "r") # <<<<<<<<<<<<<< @@ -11944,7 +11842,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_8read_binary(struct __pyx_obj_3_sa_Ali */ __pyx_v_f = fopen(__pyx_v_filename, __pyx_k__r); - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":66 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":66 * cdef FILE* f * f = fopen(filename, "r") * self.links.read_handle(f) # <<<<<<<<<<<<<< @@ -11953,7 +11851,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_8read_binary(struct __pyx_obj_3_sa_Ali */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->links->__pyx_vtab)->read_handle(__pyx_v_self->links, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":67 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":67 * f = fopen(filename, "r") * self.links.read_handle(f) * self.sent_index.read_handle(f) # <<<<<<<<<<<<<< @@ -11962,7 +11860,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_8read_binary(struct __pyx_obj_3_sa_Ali */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->sent_index->__pyx_vtab)->read_handle(__pyx_v_self->sent_index, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":68 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":68 * self.links.read_handle(f) * self.sent_index.read_handle(f) * fclose(f) # <<<<<<<<<<<<<< @@ -11998,7 +11896,7 @@ static PyObject *__pyx_pw_3_sa_9Alignment_11write_text(PyObject *__pyx_v_self, P return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":70 +/* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":70 * fclose(f) * * def write_text(self, char* filename): # <<<<<<<<<<<<<< @@ -12033,7 +11931,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_10write_text(struct __pyx_obj_3_sa_Ali int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_text", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":71 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":71 * * def write_text(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -12073,7 +11971,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_10write_text(struct __pyx_obj_3_sa_Ali __pyx_v_f = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":72 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":72 * def write_text(self, char* filename): * with open(filename, "w") as f: * sent_num = 0 # <<<<<<<<<<<<<< @@ -12083,7 +11981,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_10write_text(struct __pyx_obj_3_sa_Ali __Pyx_INCREF(__pyx_int_0); __pyx_v_sent_num = __pyx_int_0; - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":73 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":73 * with open(filename, "w") as f: * sent_num = 0 * for i, link in enumerate(self.links): # <<<<<<<<<<<<<< @@ -12103,18 +12001,10 @@ static PyObject *__pyx_pf_3_sa_9Alignment_10write_text(struct __pyx_obj_3_sa_Ali for (;;) { if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #endif + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #endif + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; } else { __pyx_t_2 = __pyx_t_9(__pyx_t_1); if (unlikely(!__pyx_t_2)) { @@ -12138,7 +12028,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_10write_text(struct __pyx_obj_3_sa_Ali __pyx_t_4 = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":74 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":74 * sent_num = 0 * for i, link in enumerate(self.links): * while i >= self.sent_index[sent_num]: # <<<<<<<<<<<<<< @@ -12148,13 +12038,14 @@ static PyObject *__pyx_pf_3_sa_9Alignment_10write_text(struct __pyx_obj_3_sa_Ali 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 = 74; __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 = 74; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_10 = PyObject_RichCompare(__pyx_v_i, __pyx_t_2, Py_GE); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (!__pyx_t_11) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":75 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":75 * for i, link in enumerate(self.links): * while i >= self.sent_index[sent_num]: * f.write("\n") # <<<<<<<<<<<<<< @@ -12168,7 +12059,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_10write_text(struct __pyx_obj_3_sa_Ali __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":76 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":76 * while i >= self.sent_index[sent_num]: * f.write("\n") * sent_num = sent_num + 1 # <<<<<<<<<<<<<< @@ -12182,7 +12073,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_10write_text(struct __pyx_obj_3_sa_Ali __pyx_t_2 = 0; } - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":77 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":77 * f.write("\n") * sent_num = sent_num + 1 * f.write("%d-%d " % self.unlink(link)) # <<<<<<<<<<<<<< @@ -12219,7 +12110,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_10write_text(struct __pyx_obj_3_sa_Ali __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":78 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":78 * sent_num = sent_num + 1 * f.write("%d-%d " % self.unlink(link)) * f.write("\n") # <<<<<<<<<<<<<< @@ -12245,7 +12136,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_10write_text(struct __pyx_obj_3_sa_Ali __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":71 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":71 * * def write_text(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -12367,7 +12258,7 @@ static PyObject *__pyx_pw_3_sa_9Alignment_13write_binary(PyObject *__pyx_v_self, return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":80 +/* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":80 * f.write("\n") * * def write_binary(self, char* filename): # <<<<<<<<<<<<<< @@ -12381,7 +12272,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_12write_binary(struct __pyx_obj_3_sa_A __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("write_binary", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":82 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":82 * def write_binary(self, char* filename): * cdef FILE* f * f = fopen(filename, "w") # <<<<<<<<<<<<<< @@ -12390,7 +12281,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_12write_binary(struct __pyx_obj_3_sa_A */ __pyx_v_f = fopen(__pyx_v_filename, __pyx_k__w); - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":83 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":83 * cdef FILE* f * f = fopen(filename, "w") * self.links.write_handle(f) # <<<<<<<<<<<<<< @@ -12399,7 +12290,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_12write_binary(struct __pyx_obj_3_sa_A */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->links->__pyx_vtab)->write_handle(__pyx_v_self->links, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":84 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":84 * f = fopen(filename, "w") * self.links.write_handle(f) * self.sent_index.write_handle(f) # <<<<<<<<<<<<<< @@ -12408,7 +12299,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_12write_binary(struct __pyx_obj_3_sa_A */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->sent_index->__pyx_vtab)->write_handle(__pyx_v_self->sent_index, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":85 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":85 * self.links.write_handle(f) * self.sent_index.write_handle(f) * fclose(f) # <<<<<<<<<<<<<< @@ -12444,7 +12335,7 @@ static PyObject *__pyx_pw_3_sa_9Alignment_15write_enhanced(PyObject *__pyx_v_sel return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":87 +/* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":87 * fclose(f) * * def write_enhanced(self, char* filename): # <<<<<<<<<<<<<< @@ -12477,7 +12368,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_14write_enhanced(struct __pyx_obj_3_sa int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_enhanced", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":88 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":88 * * def write_enhanced(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -12517,7 +12408,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_14write_enhanced(struct __pyx_obj_3_sa __pyx_v_f = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":89 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":89 * def write_enhanced(self, char* filename): * with open(filename, "w") as f: * sent_num = 1 # <<<<<<<<<<<<<< @@ -12526,7 +12417,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_14write_enhanced(struct __pyx_obj_3_sa */ __pyx_v_sent_num = 1; - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":90 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":90 * with open(filename, "w") as f: * sent_num = 1 * for link in self.links: # <<<<<<<<<<<<<< @@ -12544,18 +12435,10 @@ static PyObject *__pyx_pf_3_sa_9Alignment_14write_enhanced(struct __pyx_obj_3_sa for (;;) { if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_4)) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_4)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #endif + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_4)) { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_4)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #endif + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; } else { __pyx_t_1 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_1)) { @@ -12571,7 +12454,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_14write_enhanced(struct __pyx_obj_3_sa __pyx_v_link = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":91 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":91 * sent_num = 1 * for link in self.links: * f.write("%d " % link) # <<<<<<<<<<<<<< @@ -12595,7 +12478,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_14write_enhanced(struct __pyx_obj_3_sa } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":92 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":92 * for link in self.links: * f.write("%d " % link) * f.write("\n") # <<<<<<<<<<<<<< @@ -12609,7 +12492,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_14write_enhanced(struct __pyx_obj_3_sa __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":93 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":93 * f.write("%d " % link) * f.write("\n") * for i in self.sent_index: # <<<<<<<<<<<<<< @@ -12627,18 +12510,10 @@ static PyObject *__pyx_pf_3_sa_9Alignment_14write_enhanced(struct __pyx_obj_3_sa for (;;) { if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_2)) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #endif + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_2)) { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #endif + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; } else { __pyx_t_4 = __pyx_t_9(__pyx_t_2); if (unlikely(!__pyx_t_4)) { @@ -12654,7 +12529,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_14write_enhanced(struct __pyx_obj_3_sa __pyx_v_i = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":94 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":94 * f.write("\n") * for i in self.sent_index: * f.write("%d " % i) # <<<<<<<<<<<<<< @@ -12678,7 +12553,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_14write_enhanced(struct __pyx_obj_3_sa } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":95 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":95 * for i in self.sent_index: * f.write("%d " % i) * f.write("\n") # <<<<<<<<<<<<<< @@ -12702,7 +12577,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_14write_enhanced(struct __pyx_obj_3_sa __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":88 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":88 * * def write_enhanced(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -12812,7 +12687,7 @@ static PyObject *__pyx_pw_3_sa_9Alignment_17alignment(PyObject *__pyx_v_self, Py return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":97 +/* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":97 * f.write("\n") * * def alignment(self, i): # <<<<<<<<<<<<<< @@ -12838,7 +12713,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_16alignment(struct __pyx_obj_3_sa_Alig int __pyx_clineno = 0; __Pyx_RefNannySetupContext("alignment", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":100 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":100 * """Return all (e,f) pairs for sentence i""" * cdef int j, start, end * result = [] # <<<<<<<<<<<<<< @@ -12850,7 +12725,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_16alignment(struct __pyx_obj_3_sa_Alig __pyx_v_result = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":101 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":101 * cdef int j, start, end * result = [] * start = self.sent_index.arr[i] # <<<<<<<<<<<<<< @@ -12860,7 +12735,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_16alignment(struct __pyx_obj_3_sa_Alig __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 = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_start = (__pyx_v_self->sent_index->arr[__pyx_t_2]); - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":102 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":102 * result = [] * start = self.sent_index.arr[i] * end = self.sent_index.arr[i+1] # <<<<<<<<<<<<<< @@ -12873,7 +12748,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_16alignment(struct __pyx_obj_3_sa_Alig __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_end = (__pyx_v_self->sent_index->arr[__pyx_t_2]); - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":103 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":103 * start = self.sent_index.arr[i] * end = self.sent_index.arr[i+1] * for j from start <= j < end: # <<<<<<<<<<<<<< @@ -12883,7 +12758,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_16alignment(struct __pyx_obj_3_sa_Alig __pyx_t_3 = __pyx_v_end; for (__pyx_v_j = __pyx_v_start; __pyx_v_j < __pyx_t_3; __pyx_v_j++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":104 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":104 * end = self.sent_index.arr[i+1] * for j from start <= j < end: * result.append(self.unlink(self.links.arr[j])) # <<<<<<<<<<<<<< @@ -12906,7 +12781,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_16alignment(struct __pyx_obj_3_sa_Alig __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":105 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":105 * for j from start <= j < end: * result.append(self.unlink(self.links.arr[j])) * return result # <<<<<<<<<<<<<< @@ -12931,7 +12806,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_16alignment(struct __pyx_obj_3_sa_Alig return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":15 +/* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":15 * int val * * cdef _node* new_node(int key): # <<<<<<<<<<<<<< @@ -12945,7 +12820,7 @@ static struct __pyx_t_3_sa__node *__pyx_f_3_sa_new_node(int __pyx_v_key) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("new_node", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":17 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":17 * cdef _node* new_node(int key): * cdef _node* n * n = <_node*> malloc(sizeof(_node)) # <<<<<<<<<<<<<< @@ -12954,7 +12829,7 @@ static struct __pyx_t_3_sa__node *__pyx_f_3_sa_new_node(int __pyx_v_key) { */ __pyx_v_n = ((struct __pyx_t_3_sa__node *)malloc((sizeof(struct __pyx_t_3_sa__node)))); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":18 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":18 * cdef _node* n * n = <_node*> malloc(sizeof(_node)) * n.smaller = NULL # <<<<<<<<<<<<<< @@ -12963,7 +12838,7 @@ static struct __pyx_t_3_sa__node *__pyx_f_3_sa_new_node(int __pyx_v_key) { */ __pyx_v_n->smaller = NULL; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":19 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":19 * n = <_node*> malloc(sizeof(_node)) * n.smaller = NULL * n.bigger = NULL # <<<<<<<<<<<<<< @@ -12972,7 +12847,7 @@ static struct __pyx_t_3_sa__node *__pyx_f_3_sa_new_node(int __pyx_v_key) { */ __pyx_v_n->bigger = NULL; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":20 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":20 * n.smaller = NULL * n.bigger = NULL * n.key = key # <<<<<<<<<<<<<< @@ -12981,7 +12856,7 @@ static struct __pyx_t_3_sa__node *__pyx_f_3_sa_new_node(int __pyx_v_key) { */ __pyx_v_n->key = __pyx_v_key; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":21 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":21 * n.bigger = NULL * n.key = key * n.val = 0 # <<<<<<<<<<<<<< @@ -12990,7 +12865,7 @@ static struct __pyx_t_3_sa__node *__pyx_f_3_sa_new_node(int __pyx_v_key) { */ __pyx_v_n->val = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":22 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":22 * n.key = key * n.val = 0 * return n # <<<<<<<<<<<<<< @@ -13006,7 +12881,7 @@ static struct __pyx_t_3_sa__node *__pyx_f_3_sa_new_node(int __pyx_v_key) { return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":25 +/* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":25 * * * cdef del_node(_node* n): # <<<<<<<<<<<<<< @@ -13024,7 +12899,7 @@ static PyObject *__pyx_f_3_sa_del_node(struct __pyx_t_3_sa__node *__pyx_v_n) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("del_node", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":26 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":26 * * cdef del_node(_node* n): * if n.smaller != NULL: # <<<<<<<<<<<<<< @@ -13034,7 +12909,7 @@ static PyObject *__pyx_f_3_sa_del_node(struct __pyx_t_3_sa__node *__pyx_v_n) { __pyx_t_1 = (__pyx_v_n->smaller != NULL); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":27 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":27 * cdef del_node(_node* n): * if n.smaller != NULL: * del_node(n.smaller) # <<<<<<<<<<<<<< @@ -13048,7 +12923,7 @@ static PyObject *__pyx_f_3_sa_del_node(struct __pyx_t_3_sa__node *__pyx_v_n) { } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":28 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":28 * if n.smaller != NULL: * del_node(n.smaller) * if n.bigger != NULL: # <<<<<<<<<<<<<< @@ -13058,7 +12933,7 @@ static PyObject *__pyx_f_3_sa_del_node(struct __pyx_t_3_sa__node *__pyx_v_n) { __pyx_t_1 = (__pyx_v_n->bigger != NULL); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":29 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":29 * del_node(n.smaller) * if n.bigger != NULL: * del_node(n.bigger) # <<<<<<<<<<<<<< @@ -13072,7 +12947,7 @@ static PyObject *__pyx_f_3_sa_del_node(struct __pyx_t_3_sa__node *__pyx_v_n) { } __pyx_L4:; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":30 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":30 * if n.bigger != NULL: * del_node(n.bigger) * free(n) # <<<<<<<<<<<<<< @@ -13093,7 +12968,7 @@ static PyObject *__pyx_f_3_sa_del_node(struct __pyx_t_3_sa__node *__pyx_v_n) { return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":32 +/* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":32 * free(n) * * cdef int* get_val(_node* n, int key): # <<<<<<<<<<<<<< @@ -13107,7 +12982,7 @@ static int *__pyx_f_3_sa_get_val(struct __pyx_t_3_sa__node *__pyx_v_n, int __pyx int __pyx_t_1; __Pyx_RefNannySetupContext("get_val", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":33 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":33 * * cdef int* get_val(_node* n, int key): * if key == n.key: # <<<<<<<<<<<<<< @@ -13117,7 +12992,7 @@ static int *__pyx_f_3_sa_get_val(struct __pyx_t_3_sa__node *__pyx_v_n, int __pyx __pyx_t_1 = (__pyx_v_key == __pyx_v_n->key); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":34 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":34 * cdef int* get_val(_node* n, int key): * if key == n.key: * return &n.val # <<<<<<<<<<<<<< @@ -13129,7 +13004,7 @@ static int *__pyx_f_3_sa_get_val(struct __pyx_t_3_sa__node *__pyx_v_n, int __pyx goto __pyx_L3; } - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":35 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":35 * if key == n.key: * return &n.val * elif key < n.key: # <<<<<<<<<<<<<< @@ -13139,7 +13014,7 @@ static int *__pyx_f_3_sa_get_val(struct __pyx_t_3_sa__node *__pyx_v_n, int __pyx __pyx_t_1 = (__pyx_v_key < __pyx_v_n->key); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":36 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":36 * return &n.val * elif key < n.key: * if n.smaller == NULL: # <<<<<<<<<<<<<< @@ -13149,7 +13024,7 @@ static int *__pyx_f_3_sa_get_val(struct __pyx_t_3_sa__node *__pyx_v_n, int __pyx __pyx_t_1 = (__pyx_v_n->smaller == NULL); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":37 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":37 * elif key < n.key: * if n.smaller == NULL: * n.smaller = new_node(key) # <<<<<<<<<<<<<< @@ -13158,7 +13033,7 @@ static int *__pyx_f_3_sa_get_val(struct __pyx_t_3_sa__node *__pyx_v_n, int __pyx */ __pyx_v_n->smaller = __pyx_f_3_sa_new_node(__pyx_v_key); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":38 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":38 * if n.smaller == NULL: * n.smaller = new_node(key) * return &(n.smaller.val) # <<<<<<<<<<<<<< @@ -13171,7 +13046,7 @@ static int *__pyx_f_3_sa_get_val(struct __pyx_t_3_sa__node *__pyx_v_n, int __pyx } __pyx_L4:; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":39 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":39 * n.smaller = new_node(key) * return &(n.smaller.val) * return get_val(n.smaller, key) # <<<<<<<<<<<<<< @@ -13184,7 +13059,7 @@ static int *__pyx_f_3_sa_get_val(struct __pyx_t_3_sa__node *__pyx_v_n, int __pyx } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":41 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":41 * return get_val(n.smaller, key) * else: * if n.bigger == NULL: # <<<<<<<<<<<<<< @@ -13194,7 +13069,7 @@ static int *__pyx_f_3_sa_get_val(struct __pyx_t_3_sa__node *__pyx_v_n, int __pyx __pyx_t_1 = (__pyx_v_n->bigger == NULL); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":42 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":42 * else: * if n.bigger == NULL: * n.bigger = new_node(key) # <<<<<<<<<<<<<< @@ -13203,7 +13078,7 @@ static int *__pyx_f_3_sa_get_val(struct __pyx_t_3_sa__node *__pyx_v_n, int __pyx */ __pyx_v_n->bigger = __pyx_f_3_sa_new_node(__pyx_v_key); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":43 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":43 * if n.bigger == NULL: * n.bigger = new_node(key) * return &(n.bigger.val) # <<<<<<<<<<<<<< @@ -13216,7 +13091,7 @@ static int *__pyx_f_3_sa_get_val(struct __pyx_t_3_sa__node *__pyx_v_n, int __pyx } __pyx_L5:; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":44 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":44 * n.bigger = new_node(key) * return &(n.bigger.val) * return get_val(n.bigger, key) # <<<<<<<<<<<<<< @@ -13243,14 +13118,14 @@ static int __pyx_pw_3_sa_5BiLex_1__cinit__(PyObject *__pyx_v_self, PyObject *__p PyObject *__pyx_v_earray = 0; PyObject *__pyx_v_fsarray = 0; PyObject *__pyx_v_alignment = 0; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__from_text,&__pyx_n_s__from_data,&__pyx_n_s__from_binary,&__pyx_n_s__earray,&__pyx_n_s__fsarray,&__pyx_n_s__alignment,0}; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__from_text,&__pyx_n_s__from_data,&__pyx_n_s__from_binary,&__pyx_n_s__earray,&__pyx_n_s__fsarray,&__pyx_n_s__alignment,0}; PyObject* values[6] = {0,0,0,0,0,0}; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":54 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":54 * cdef id2eword, id2fword, eword2id, fword2id * * def __cinit__(self, from_text=None, from_data=False, from_binary=None, # <<<<<<<<<<<<<< @@ -13261,7 +13136,7 @@ static int __pyx_pw_3_sa_5BiLex_1__cinit__(PyObject *__pyx_v_self, PyObject *__p values[1] = __pyx_k_41; values[2] = ((PyObject *)Py_None); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":55 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":55 * * def __cinit__(self, from_text=None, from_data=False, from_binary=None, * earray=None, fsarray=None, alignment=None): # <<<<<<<<<<<<<< @@ -13352,7 +13227,7 @@ static int __pyx_pw_3_sa_5BiLex_1__cinit__(PyObject *__pyx_v_self, PyObject *__p return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":54 +/* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":54 * cdef id2eword, id2fword, eword2id, fword2id * * def __cinit__(self, from_text=None, from_data=False, from_binary=None, # <<<<<<<<<<<<<< @@ -13373,7 +13248,7 @@ static int __pyx_pf_3_sa_5BiLex___cinit__(struct __pyx_obj_3_sa_BiLex *__pyx_v_s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":56 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":56 * def __cinit__(self, from_text=None, from_data=False, from_binary=None, * earray=None, fsarray=None, alignment=None): * self.id2eword = [] # <<<<<<<<<<<<<< @@ -13388,7 +13263,7 @@ static int __pyx_pf_3_sa_5BiLex___cinit__(struct __pyx_obj_3_sa_BiLex *__pyx_v_s __pyx_v_self->id2eword = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":57 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":57 * earray=None, fsarray=None, alignment=None): * self.id2eword = [] * self.id2fword = [] # <<<<<<<<<<<<<< @@ -13403,7 +13278,7 @@ static int __pyx_pf_3_sa_5BiLex___cinit__(struct __pyx_obj_3_sa_BiLex *__pyx_v_s __pyx_v_self->id2fword = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":58 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":58 * self.id2eword = [] * self.id2fword = [] * self.eword2id = {} # <<<<<<<<<<<<<< @@ -13418,7 +13293,7 @@ static int __pyx_pf_3_sa_5BiLex___cinit__(struct __pyx_obj_3_sa_BiLex *__pyx_v_s __pyx_v_self->eword2id = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":59 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":59 * self.id2fword = [] * self.eword2id = {} * self.fword2id = {} # <<<<<<<<<<<<<< @@ -13433,7 +13308,7 @@ static int __pyx_pf_3_sa_5BiLex___cinit__(struct __pyx_obj_3_sa_BiLex *__pyx_v_s __pyx_v_self->fword2id = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":60 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":60 * self.eword2id = {} * self.fword2id = {} * self.e_index = IntList() # <<<<<<<<<<<<<< @@ -13448,7 +13323,7 @@ static int __pyx_pf_3_sa_5BiLex___cinit__(struct __pyx_obj_3_sa_BiLex *__pyx_v_s __pyx_v_self->e_index = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":61 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":61 * self.fword2id = {} * self.e_index = IntList() * self.f_index = IntList() # <<<<<<<<<<<<<< @@ -13463,7 +13338,7 @@ static int __pyx_pf_3_sa_5BiLex___cinit__(struct __pyx_obj_3_sa_BiLex *__pyx_v_s __pyx_v_self->f_index = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":62 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":62 * self.e_index = IntList() * self.f_index = IntList() * self.col1 = FloatList() # <<<<<<<<<<<<<< @@ -13478,7 +13353,7 @@ static int __pyx_pf_3_sa_5BiLex___cinit__(struct __pyx_obj_3_sa_BiLex *__pyx_v_s __pyx_v_self->col1 = ((struct __pyx_obj_3_sa_FloatList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":63 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":63 * self.f_index = IntList() * self.col1 = FloatList() * self.col2 = FloatList() # <<<<<<<<<<<<<< @@ -13493,7 +13368,7 @@ static int __pyx_pf_3_sa_5BiLex___cinit__(struct __pyx_obj_3_sa_BiLex *__pyx_v_s __pyx_v_self->col2 = ((struct __pyx_obj_3_sa_FloatList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":64 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":64 * self.col1 = FloatList() * self.col2 = FloatList() * if from_binary: # <<<<<<<<<<<<<< @@ -13503,7 +13378,7 @@ static int __pyx_pf_3_sa_5BiLex___cinit__(struct __pyx_obj_3_sa_BiLex *__pyx_v_s __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/pauldb/workspace/cdec/python/src/sa/bilex.pxi":65 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":65 * self.col2 = FloatList() * if from_binary: * self.read_binary(from_binary) # <<<<<<<<<<<<<< @@ -13525,7 +13400,7 @@ static int __pyx_pf_3_sa_5BiLex___cinit__(struct __pyx_obj_3_sa_BiLex *__pyx_v_s goto __pyx_L3; } - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":66 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":66 * if from_binary: * self.read_binary(from_binary) * elif from_data: # <<<<<<<<<<<<<< @@ -13535,7 +13410,7 @@ static int __pyx_pf_3_sa_5BiLex___cinit__(struct __pyx_obj_3_sa_BiLex *__pyx_v_s __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/pauldb/workspace/cdec/python/src/sa/bilex.pxi":67 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":67 * self.read_binary(from_binary) * elif from_data: * self.compute_from_data(fsarray, earray, alignment) # <<<<<<<<<<<<<< @@ -13561,7 +13436,7 @@ static int __pyx_pf_3_sa_5BiLex___cinit__(struct __pyx_obj_3_sa_BiLex *__pyx_v_s } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":69 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":69 * self.compute_from_data(fsarray, earray, alignment) * else: * self.read_text(from_text) # <<<<<<<<<<<<<< @@ -13597,7 +13472,7 @@ static int __pyx_pf_3_sa_5BiLex___cinit__(struct __pyx_obj_3_sa_BiLex *__pyx_v_s return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":72 +/* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":72 * * * cdef compute_from_data(self, SuffixArray fsa, DataArray eda, Alignment aa): # <<<<<<<<<<<<<< @@ -13651,7 +13526,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL int __pyx_clineno = 0; __Pyx_RefNannySetupContext("compute_from_data", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":79 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":79 * cdef int null_word * * null_word = 0 # <<<<<<<<<<<<<< @@ -13660,7 +13535,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ __pyx_v_null_word = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":80 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":80 * * null_word = 0 * for word in fsa.darray.id2word: # I miss list comprehensions # <<<<<<<<<<<<<< @@ -13678,18 +13553,10 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 80; __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[5]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; } 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[5]; __pyx_lineno = 80; __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[5]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { @@ -13705,7 +13572,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_v_word = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":81 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":81 * null_word = 0 * for word in fsa.darray.id2word: # I miss list comprehensions * self.id2fword.append(word) # <<<<<<<<<<<<<< @@ -13718,7 +13585,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":82 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":82 * for word in fsa.darray.id2word: # I miss list comprehensions * self.id2fword.append(word) * self.id2fword[null_word] = "NULL" # <<<<<<<<<<<<<< @@ -13727,7 +13594,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ if (__Pyx_SetItemInt(__pyx_v_self->id2fword, __pyx_v_null_word, ((PyObject *)__pyx_n_s__NULL), sizeof(int), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":83 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":83 * self.id2fword.append(word) * self.id2fword[null_word] = "NULL" * for id, word in enumerate(self.id2fword): # <<<<<<<<<<<<<< @@ -13747,18 +13614,10 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_4)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; 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;} - #endif + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; } 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;} - #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;} - #endif + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; } else { __pyx_t_5 = __pyx_t_3(__pyx_t_4); if (unlikely(!__pyx_t_5)) { @@ -13782,7 +13641,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":84 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":84 * self.id2fword[null_word] = "NULL" * for id, word in enumerate(self.id2fword): * self.fword2id[word] = id # <<<<<<<<<<<<<< @@ -13794,7 +13653,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":86 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":86 * self.fword2id[word] = id * * for word in eda.id2word: # <<<<<<<<<<<<<< @@ -13812,18 +13671,10 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 86; __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[5]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; } 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[5]; __pyx_lineno = 86; __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[5]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { @@ -13839,7 +13690,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_v_word = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":87 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":87 * * for word in eda.id2word: * self.id2eword.append(word) # <<<<<<<<<<<<<< @@ -13852,7 +13703,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":88 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":88 * for word in eda.id2word: * self.id2eword.append(word) * self.id2eword[null_word] = "NULL" # <<<<<<<<<<<<<< @@ -13861,7 +13712,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ if (__Pyx_SetItemInt(__pyx_v_self->id2eword, __pyx_v_null_word, ((PyObject *)__pyx_n_s__NULL), sizeof(int), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":89 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":89 * self.id2eword.append(word) * self.id2eword[null_word] = "NULL" * for id, word in enumerate(self.id2eword): # <<<<<<<<<<<<<< @@ -13881,18 +13732,10 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_4)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; 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;} - #endif + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; } 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;} - #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;} - #endif + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; } else { __pyx_t_5 = __pyx_t_3(__pyx_t_4); if (unlikely(!__pyx_t_5)) { @@ -13916,7 +13759,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":90 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":90 * self.id2eword[null_word] = "NULL" * for id, word in enumerate(self.id2eword): * self.eword2id[word] = id # <<<<<<<<<<<<<< @@ -13928,7 +13771,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":92 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":92 * self.eword2id[word] = id * * num_pairs = 0 # <<<<<<<<<<<<<< @@ -13937,7 +13780,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ __pyx_v_num_pairs = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":94 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":94 * num_pairs = 0 * * V_E = len(eda.id2word) # <<<<<<<<<<<<<< @@ -13950,7 +13793,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_V_E = __pyx_t_2; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":95 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":95 * * V_E = len(eda.id2word) * V_F = len(fsa.darray.id2word) # <<<<<<<<<<<<<< @@ -13963,7 +13806,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_V_F = __pyx_t_2; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":96 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":96 * V_E = len(eda.id2word) * V_F = len(fsa.darray.id2word) * fmargin = malloc(V_F*sizeof(int)) # <<<<<<<<<<<<<< @@ -13972,7 +13815,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ __pyx_v_fmargin = ((int *)malloc((__pyx_v_V_F * (sizeof(int))))); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":97 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":97 * V_F = len(fsa.darray.id2word) * fmargin = malloc(V_F*sizeof(int)) * emargin = malloc(V_E*sizeof(int)) # <<<<<<<<<<<<<< @@ -13981,7 +13824,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ __pyx_v_emargin = ((int *)malloc((__pyx_v_V_E * (sizeof(int))))); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":98 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":98 * fmargin = malloc(V_F*sizeof(int)) * emargin = malloc(V_E*sizeof(int)) * memset(fmargin, 0, V_F*sizeof(int)) # <<<<<<<<<<<<<< @@ -13990,7 +13833,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ memset(__pyx_v_fmargin, 0, (__pyx_v_V_F * (sizeof(int)))); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":99 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":99 * emargin = malloc(V_E*sizeof(int)) * memset(fmargin, 0, V_F*sizeof(int)) * memset(emargin, 0, V_E*sizeof(int)) # <<<<<<<<<<<<<< @@ -13999,7 +13842,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ memset(__pyx_v_emargin, 0, (__pyx_v_V_E * (sizeof(int)))); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":101 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":101 * memset(emargin, 0, V_E*sizeof(int)) * * dict = <_node**> malloc(V_F*sizeof(_node*)) # <<<<<<<<<<<<<< @@ -14008,7 +13851,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ __pyx_v_dict = ((struct __pyx_t_3_sa__node **)malloc((__pyx_v_V_F * (sizeof(struct __pyx_t_3_sa__node *))))); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":102 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":102 * * dict = <_node**> malloc(V_F*sizeof(_node*)) * memset(dict, 0, V_F*sizeof(_node*)) # <<<<<<<<<<<<<< @@ -14017,7 +13860,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ memset(__pyx_v_dict, 0, (__pyx_v_V_F * (sizeof(struct __pyx_t_3_sa__node *)))); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":104 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":104 * memset(dict, 0, V_F*sizeof(_node*)) * * num_sents = len(fsa.darray.sent_index) # <<<<<<<<<<<<<< @@ -14033,7 +13876,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_v_num_sents = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":105 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":105 * * num_sents = len(fsa.darray.sent_index) * for sent_id from 0 <= sent_id < num_sents-1: # <<<<<<<<<<<<<< @@ -14046,7 +13889,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __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++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":107 + /* "/home/paulb/workspace/cdec/python/src/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] # <<<<<<<<<<<<<< @@ -14055,7 +13898,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ __pyx_v_fsent = (__pyx_v_fsa->darray->data->arr + (__pyx_v_fsa->darray->sent_index->arr[__pyx_v_sent_id])); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":108 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -14064,7 +13907,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ __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/pauldb/workspace/cdec/python/src/sa/bilex.pxi":109 + /* "/home/paulb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -14073,7 +13916,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ __pyx_v_faligned = ((int *)malloc((__pyx_v_I * (sizeof(int))))); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":110 + /* "/home/paulb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -14082,7 +13925,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ memset(__pyx_v_faligned, 0, (__pyx_v_I * (sizeof(int)))); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":112 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":112 * memset(faligned, 0, I*sizeof(int)) * * esent = eda.data.arr + eda.sent_index.arr[sent_id] # <<<<<<<<<<<<<< @@ -14091,7 +13934,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ __pyx_v_esent = (__pyx_v_eda->data->arr + (__pyx_v_eda->sent_index->arr[__pyx_v_sent_id])); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":113 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -14100,7 +13943,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ __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/pauldb/workspace/cdec/python/src/sa/bilex.pxi":114 + /* "/home/paulb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -14109,7 +13952,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ __pyx_v_ealigned = ((int *)malloc((__pyx_v_J * (sizeof(int))))); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":115 + /* "/home/paulb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -14118,7 +13961,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ memset(__pyx_v_ealigned, 0, (__pyx_v_J * (sizeof(int)))); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":117 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":117 * memset(ealigned, 0, J*sizeof(int)) * * links = aa._get_sent_links(sent_id, &num_links) # <<<<<<<<<<<<<< @@ -14127,7 +13970,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ __pyx_v_links = ((struct __pyx_vtabstruct_3_sa_Alignment *)__pyx_v_aa->__pyx_vtab)->_get_sent_links(__pyx_v_aa, __pyx_v_sent_id, (&__pyx_v_num_links)); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":119 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":119 * links = aa._get_sent_links(sent_id, &num_links) * * for l from 0 <= l < num_links: # <<<<<<<<<<<<<< @@ -14137,7 +13980,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_t_7 = __pyx_v_num_links; for (__pyx_v_l = 0; __pyx_v_l < __pyx_t_7; __pyx_v_l++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":120 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":120 * * for l from 0 <= l < num_links: * i = links[l*2] # <<<<<<<<<<<<<< @@ -14146,7 +13989,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ __pyx_v_i = (__pyx_v_links[(__pyx_v_l * 2)]); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":121 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":121 * for l from 0 <= l < num_links: * i = links[l*2] * j = links[l*2+1] # <<<<<<<<<<<<<< @@ -14155,7 +13998,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ __pyx_v_j = (__pyx_v_links[((__pyx_v_l * 2) + 1)]); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":122 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":122 * i = links[l*2] * j = links[l*2+1] * if i >= I or j >= J: # <<<<<<<<<<<<<< @@ -14171,7 +14014,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL } if (__pyx_t_10) { - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":123 + /* "/home/paulb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -14223,7 +14066,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL } __pyx_L15:; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":124 + /* "/home/paulb/workspace/cdec/python/src/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] # <<<<<<<<<<<<<< @@ -14232,7 +14075,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ __pyx_v_f_i = (__pyx_v_fsent[__pyx_v_i]); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":125 + /* "/home/paulb/workspace/cdec/python/src/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] # <<<<<<<<<<<<<< @@ -14241,7 +14084,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ __pyx_v_e_j = (__pyx_v_esent[__pyx_v_j]); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":126 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":126 * f_i = fsent[i] * e_j = esent[j] * fmargin[f_i] = fmargin[f_i]+1 # <<<<<<<<<<<<<< @@ -14250,7 +14093,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ (__pyx_v_fmargin[__pyx_v_f_i]) = ((__pyx_v_fmargin[__pyx_v_f_i]) + 1); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":127 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":127 * e_j = esent[j] * fmargin[f_i] = fmargin[f_i]+1 * emargin[e_j] = emargin[e_j]+1 # <<<<<<<<<<<<<< @@ -14259,7 +14102,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ (__pyx_v_emargin[__pyx_v_e_j]) = ((__pyx_v_emargin[__pyx_v_e_j]) + 1); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":128 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":128 * fmargin[f_i] = fmargin[f_i]+1 * emargin[e_j] = emargin[e_j]+1 * if dict[f_i] == NULL: # <<<<<<<<<<<<<< @@ -14269,7 +14112,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_t_10 = ((__pyx_v_dict[__pyx_v_f_i]) == NULL); if (__pyx_t_10) { - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":129 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":129 * emargin[e_j] = emargin[e_j]+1 * if dict[f_i] == NULL: * dict[f_i] = new_node(e_j) # <<<<<<<<<<<<<< @@ -14278,7 +14121,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ (__pyx_v_dict[__pyx_v_f_i]) = __pyx_f_3_sa_new_node(__pyx_v_e_j); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":130 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":130 * if dict[f_i] == NULL: * dict[f_i] = new_node(e_j) * dict[f_i].val = 1 # <<<<<<<<<<<<<< @@ -14287,7 +14130,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ (__pyx_v_dict[__pyx_v_f_i])->val = 1; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":131 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":131 * dict[f_i] = new_node(e_j) * dict[f_i].val = 1 * num_pairs = num_pairs + 1 # <<<<<<<<<<<<<< @@ -14299,7 +14142,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":133 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":133 * num_pairs = num_pairs + 1 * else: * count = get_val(dict[f_i], e_j) # <<<<<<<<<<<<<< @@ -14308,7 +14151,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ __pyx_v_count = __pyx_f_3_sa_get_val((__pyx_v_dict[__pyx_v_f_i]), __pyx_v_e_j); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":134 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":134 * else: * count = get_val(dict[f_i], e_j) * if count[0] == 0: # <<<<<<<<<<<<<< @@ -14318,7 +14161,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_t_10 = ((__pyx_v_count[0]) == 0); if (__pyx_t_10) { - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":135 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":135 * count = get_val(dict[f_i], e_j) * if count[0] == 0: * num_pairs = num_pairs + 1 # <<<<<<<<<<<<<< @@ -14330,7 +14173,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL } __pyx_L17:; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":136 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":136 * if count[0] == 0: * num_pairs = num_pairs + 1 * count[0] = count[0] + 1 # <<<<<<<<<<<<<< @@ -14341,7 +14184,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL } __pyx_L16:; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":138 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":138 * count[0] = count[0] + 1 * # add count * faligned[i] = 1 # <<<<<<<<<<<<<< @@ -14350,7 +14193,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ (__pyx_v_faligned[__pyx_v_i]) = 1; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":139 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":139 * # add count * faligned[i] = 1 * ealigned[j] = 1 # <<<<<<<<<<<<<< @@ -14360,7 +14203,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL (__pyx_v_ealigned[__pyx_v_j]) = 1; } - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":140 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":140 * faligned[i] = 1 * ealigned[j] = 1 * for i from 0 <= i < I: # <<<<<<<<<<<<<< @@ -14370,7 +14213,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_t_7 = __pyx_v_I; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":141 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":141 * ealigned[j] = 1 * for i from 0 <= i < I: * if faligned[i] == 0: # <<<<<<<<<<<<<< @@ -14380,7 +14223,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_t_10 = ((__pyx_v_faligned[__pyx_v_i]) == 0); if (__pyx_t_10) { - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":142 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":142 * for i from 0 <= i < I: * if faligned[i] == 0: * f_i = fsent[i] # <<<<<<<<<<<<<< @@ -14389,7 +14232,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ __pyx_v_f_i = (__pyx_v_fsent[__pyx_v_i]); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":143 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":143 * if faligned[i] == 0: * f_i = fsent[i] * fmargin[f_i] = fmargin[f_i] + 1 # <<<<<<<<<<<<<< @@ -14398,7 +14241,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ (__pyx_v_fmargin[__pyx_v_f_i]) = ((__pyx_v_fmargin[__pyx_v_f_i]) + 1); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":144 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":144 * f_i = fsent[i] * fmargin[f_i] = fmargin[f_i] + 1 * emargin[null_word] = emargin[null_word] + 1 # <<<<<<<<<<<<<< @@ -14407,7 +14250,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ (__pyx_v_emargin[__pyx_v_null_word]) = ((__pyx_v_emargin[__pyx_v_null_word]) + 1); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":145 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":145 * fmargin[f_i] = fmargin[f_i] + 1 * emargin[null_word] = emargin[null_word] + 1 * if dict[f_i] == NULL: # <<<<<<<<<<<<<< @@ -14417,7 +14260,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_t_10 = ((__pyx_v_dict[__pyx_v_f_i]) == NULL); if (__pyx_t_10) { - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":146 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":146 * emargin[null_word] = emargin[null_word] + 1 * if dict[f_i] == NULL: * dict[f_i] = new_node(null_word) # <<<<<<<<<<<<<< @@ -14426,7 +14269,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ (__pyx_v_dict[__pyx_v_f_i]) = __pyx_f_3_sa_new_node(__pyx_v_null_word); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":147 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":147 * if dict[f_i] == NULL: * dict[f_i] = new_node(null_word) * dict[f_i].val = 1 # <<<<<<<<<<<<<< @@ -14435,7 +14278,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ (__pyx_v_dict[__pyx_v_f_i])->val = 1; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":148 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":148 * dict[f_i] = new_node(null_word) * dict[f_i].val = 1 * num_pairs = num_pairs + 1 # <<<<<<<<<<<<<< @@ -14447,7 +14290,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":150 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":150 * num_pairs = num_pairs + 1 * else: * count = get_val(dict[f_i], null_word) # <<<<<<<<<<<<<< @@ -14456,7 +14299,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ __pyx_v_count = __pyx_f_3_sa_get_val((__pyx_v_dict[__pyx_v_f_i]), __pyx_v_null_word); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":151 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":151 * else: * count = get_val(dict[f_i], null_word) * if count[0] == 0: # <<<<<<<<<<<<<< @@ -14466,7 +14309,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_t_10 = ((__pyx_v_count[0]) == 0); if (__pyx_t_10) { - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":152 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":152 * count = get_val(dict[f_i], null_word) * if count[0] == 0: * num_pairs = num_pairs + 1 # <<<<<<<<<<<<<< @@ -14478,7 +14321,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL } __pyx_L22:; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":153 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":153 * if count[0] == 0: * num_pairs = num_pairs + 1 * count[0] = count[0] + 1 # <<<<<<<<<<<<<< @@ -14493,7 +14336,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_L20:; } - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":154 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":154 * num_pairs = num_pairs + 1 * count[0] = count[0] + 1 * for j from 0 <= j < J: # <<<<<<<<<<<<<< @@ -14503,7 +14346,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_t_7 = __pyx_v_J; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":155 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":155 * count[0] = count[0] + 1 * for j from 0 <= j < J: * if ealigned[j] == 0: # <<<<<<<<<<<<<< @@ -14513,7 +14356,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_t_10 = ((__pyx_v_ealigned[__pyx_v_j]) == 0); if (__pyx_t_10) { - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":156 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":156 * for j from 0 <= j < J: * if ealigned[j] == 0: * e_j = esent[j] # <<<<<<<<<<<<<< @@ -14522,7 +14365,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ __pyx_v_e_j = (__pyx_v_esent[__pyx_v_j]); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":157 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":157 * if ealigned[j] == 0: * e_j = esent[j] * fmargin[null_word] = fmargin[null_word] + 1 # <<<<<<<<<<<<<< @@ -14531,7 +14374,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ (__pyx_v_fmargin[__pyx_v_null_word]) = ((__pyx_v_fmargin[__pyx_v_null_word]) + 1); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":158 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":158 * e_j = esent[j] * fmargin[null_word] = fmargin[null_word] + 1 * emargin[e_j] = emargin[e_j] + 1 # <<<<<<<<<<<<<< @@ -14540,7 +14383,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ (__pyx_v_emargin[__pyx_v_e_j]) = ((__pyx_v_emargin[__pyx_v_e_j]) + 1); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":159 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":159 * fmargin[null_word] = fmargin[null_word] + 1 * emargin[e_j] = emargin[e_j] + 1 * if dict[null_word] == NULL: # <<<<<<<<<<<<<< @@ -14550,7 +14393,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_t_10 = ((__pyx_v_dict[__pyx_v_null_word]) == NULL); if (__pyx_t_10) { - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":160 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":160 * emargin[e_j] = emargin[e_j] + 1 * if dict[null_word] == NULL: * dict[null_word] = new_node(e_j) # <<<<<<<<<<<<<< @@ -14559,7 +14402,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ (__pyx_v_dict[__pyx_v_null_word]) = __pyx_f_3_sa_new_node(__pyx_v_e_j); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":161 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":161 * if dict[null_word] == NULL: * dict[null_word] = new_node(e_j) * dict[null_word].val = 1 # <<<<<<<<<<<<<< @@ -14568,7 +14411,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ (__pyx_v_dict[__pyx_v_null_word])->val = 1; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":162 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":162 * dict[null_word] = new_node(e_j) * dict[null_word].val = 1 * num_pairs = num_pairs + 1 # <<<<<<<<<<<<<< @@ -14580,7 +14423,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":164 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":164 * num_pairs = num_pairs + 1 * else: * count = get_val(dict[null_word], e_j) # <<<<<<<<<<<<<< @@ -14589,7 +14432,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ __pyx_v_count = __pyx_f_3_sa_get_val((__pyx_v_dict[__pyx_v_null_word]), __pyx_v_e_j); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":165 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":165 * else: * count = get_val(dict[null_word], e_j) * if count[0] == 0: # <<<<<<<<<<<<<< @@ -14599,7 +14442,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_t_10 = ((__pyx_v_count[0]) == 0); if (__pyx_t_10) { - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":166 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":166 * count = get_val(dict[null_word], e_j) * if count[0] == 0: * num_pairs = num_pairs + 1 # <<<<<<<<<<<<<< @@ -14611,7 +14454,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL } __pyx_L27:; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":167 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":167 * if count[0] == 0: * num_pairs = num_pairs + 1 * count[0] = count[0] + 1 # <<<<<<<<<<<<<< @@ -14626,7 +14469,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_L25:; } - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":168 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":168 * num_pairs = num_pairs + 1 * count[0] = count[0] + 1 * free(links) # <<<<<<<<<<<<<< @@ -14635,7 +14478,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ free(__pyx_v_links); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":169 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":169 * count[0] = count[0] + 1 * free(links) * free(faligned) # <<<<<<<<<<<<<< @@ -14644,7 +14487,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ free(__pyx_v_faligned); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":170 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":170 * free(links) * free(faligned) * free(ealigned) # <<<<<<<<<<<<<< @@ -14654,7 +14497,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL free(__pyx_v_ealigned); } - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":171 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":171 * free(faligned) * free(ealigned) * self.f_index = IntList(initial_len=V_F) # <<<<<<<<<<<<<< @@ -14676,7 +14519,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_v_self->f_index = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_13); __pyx_t_13 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":172 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":172 * free(ealigned) * self.f_index = IntList(initial_len=V_F) * self.e_index = IntList(initial_len=num_pairs) # <<<<<<<<<<<<<< @@ -14698,7 +14541,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_v_self->e_index = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_12); __pyx_t_12 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":173 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -14720,7 +14563,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_v_self->col1 = ((struct __pyx_obj_3_sa_FloatList *)__pyx_t_13); __pyx_t_13 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":174 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -14742,7 +14585,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_v_self->col2 = ((struct __pyx_obj_3_sa_FloatList *)__pyx_t_12); __pyx_t_12 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":176 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":176 * self.col2 = FloatList(initial_len=num_pairs) * * num_pairs = 0 # <<<<<<<<<<<<<< @@ -14751,7 +14594,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ __pyx_v_num_pairs = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":177 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":177 * * num_pairs = 0 * for i from 0 <= i < V_F: # <<<<<<<<<<<<<< @@ -14761,7 +14604,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_t_6 = __pyx_v_V_F; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":179 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":179 * for i from 0 <= i < V_F: * #self.f_index[i] = num_pairs * self.f_index.set(i, num_pairs) # <<<<<<<<<<<<<< @@ -14770,7 +14613,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->f_index->__pyx_vtab)->set(__pyx_v_self->f_index, __pyx_v_i, __pyx_v_num_pairs); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":180 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":180 * #self.f_index[i] = num_pairs * self.f_index.set(i, num_pairs) * if dict[i] != NULL: # <<<<<<<<<<<<<< @@ -14780,7 +14623,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_t_10 = ((__pyx_v_dict[__pyx_v_i]) != NULL); if (__pyx_t_10) { - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":181 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -14791,7 +14634,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":182 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":182 * if dict[i] != NULL: * self._add_node(dict[i], &num_pairs, float(fmargin[i]), emargin) * del_node(dict[i]) # <<<<<<<<<<<<<< @@ -14806,7 +14649,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_L30:; } - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":183 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":183 * self._add_node(dict[i], &num_pairs, float(fmargin[i]), emargin) * del_node(dict[i]) * free(fmargin) # <<<<<<<<<<<<<< @@ -14815,7 +14658,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ free(__pyx_v_fmargin); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":184 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":184 * del_node(dict[i]) * free(fmargin) * free(emargin) # <<<<<<<<<<<<<< @@ -14824,7 +14667,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ free(__pyx_v_emargin); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":185 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":185 * free(fmargin) * free(emargin) * free(dict) # <<<<<<<<<<<<<< @@ -14833,7 +14676,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ free(__pyx_v_dict); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":186 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":186 * free(emargin) * free(dict) * return # <<<<<<<<<<<<<< @@ -14864,7 +14707,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":189 +/* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":189 * * * cdef _add_node(self, _node* n, int* num_pairs, float fmargin, int* emargin): # <<<<<<<<<<<<<< @@ -14883,7 +14726,7 @@ static PyObject *__pyx_f_3_sa_5BiLex__add_node(struct __pyx_obj_3_sa_BiLex *__py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_add_node", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":191 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":191 * cdef _add_node(self, _node* n, int* num_pairs, float fmargin, int* emargin): * cdef int loc * if n.smaller != NULL: # <<<<<<<<<<<<<< @@ -14893,7 +14736,7 @@ static PyObject *__pyx_f_3_sa_5BiLex__add_node(struct __pyx_obj_3_sa_BiLex *__py __pyx_t_1 = (__pyx_v_n->smaller != NULL); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":192 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":192 * cdef int loc * if n.smaller != NULL: * self._add_node(n.smaller, num_pairs, fmargin, emargin) # <<<<<<<<<<<<<< @@ -14907,7 +14750,7 @@ static PyObject *__pyx_f_3_sa_5BiLex__add_node(struct __pyx_obj_3_sa_BiLex *__py } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":193 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":193 * if n.smaller != NULL: * self._add_node(n.smaller, num_pairs, fmargin, emargin) * loc = num_pairs[0] # <<<<<<<<<<<<<< @@ -14916,7 +14759,7 @@ static PyObject *__pyx_f_3_sa_5BiLex__add_node(struct __pyx_obj_3_sa_BiLex *__py */ __pyx_v_loc = (__pyx_v_num_pairs[0]); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":194 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":194 * self._add_node(n.smaller, num_pairs, fmargin, emargin) * loc = num_pairs[0] * self.e_index.set(loc, n.key) # <<<<<<<<<<<<<< @@ -14925,7 +14768,7 @@ static PyObject *__pyx_f_3_sa_5BiLex__add_node(struct __pyx_obj_3_sa_BiLex *__py */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->e_index->__pyx_vtab)->set(__pyx_v_self->e_index, __pyx_v_loc, __pyx_v_n->key); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":195 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":195 * loc = num_pairs[0] * self.e_index.set(loc, n.key) * self.col1.set(loc, float(n.val)/fmargin) # <<<<<<<<<<<<<< @@ -14938,7 +14781,7 @@ static PyObject *__pyx_f_3_sa_5BiLex__add_node(struct __pyx_obj_3_sa_BiLex *__py } ((struct __pyx_vtabstruct_3_sa_FloatList *)__pyx_v_self->col1->__pyx_vtab)->set(__pyx_v_self->col1, __pyx_v_loc, (((double)__pyx_v_n->val) / __pyx_v_fmargin)); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":196 + /* "/home/paulb/workspace/cdec/python/src/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])) # <<<<<<<<<<<<<< @@ -14951,7 +14794,7 @@ static PyObject *__pyx_f_3_sa_5BiLex__add_node(struct __pyx_obj_3_sa_BiLex *__py } ((struct __pyx_vtabstruct_3_sa_FloatList *)__pyx_v_self->col2->__pyx_vtab)->set(__pyx_v_self->col2, __pyx_v_loc, (((double)__pyx_v_n->val) / ((double)(__pyx_v_emargin[__pyx_v_n->key])))); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":197 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -14960,7 +14803,7 @@ static PyObject *__pyx_f_3_sa_5BiLex__add_node(struct __pyx_obj_3_sa_BiLex *__py */ (__pyx_v_num_pairs[0]) = (__pyx_v_loc + 1); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":198 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":198 * self.col2.set(loc, float(n.val)/float(emargin[n.key])) * num_pairs[0] = loc + 1 * if n.bigger != NULL: # <<<<<<<<<<<<<< @@ -14970,7 +14813,7 @@ static PyObject *__pyx_f_3_sa_5BiLex__add_node(struct __pyx_obj_3_sa_BiLex *__py __pyx_t_1 = (__pyx_v_n->bigger != NULL); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":199 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":199 * num_pairs[0] = loc + 1 * if n.bigger != NULL: * self._add_node(n.bigger, num_pairs, fmargin, emargin) # <<<<<<<<<<<<<< @@ -15017,7 +14860,7 @@ static PyObject *__pyx_pw_3_sa_5BiLex_3write_binary(PyObject *__pyx_v_self, PyOb return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":202 +/* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":202 * * * def write_binary(self, char* filename): # <<<<<<<<<<<<<< @@ -15036,7 +14879,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_2write_binary(struct __pyx_obj_3_sa_BiLex int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_binary", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":204 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":204 * def write_binary(self, char* filename): * cdef FILE* f * f = fopen(filename, "w") # <<<<<<<<<<<<<< @@ -15045,7 +14888,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_2write_binary(struct __pyx_obj_3_sa_BiLex */ __pyx_v_f = fopen(__pyx_v_filename, __pyx_k__w); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":205 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":205 * cdef FILE* f * f = fopen(filename, "w") * self.f_index.write_handle(f) # <<<<<<<<<<<<<< @@ -15054,7 +14897,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_2write_binary(struct __pyx_obj_3_sa_BiLex */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->f_index->__pyx_vtab)->write_handle(__pyx_v_self->f_index, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":206 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":206 * f = fopen(filename, "w") * self.f_index.write_handle(f) * self.e_index.write_handle(f) # <<<<<<<<<<<<<< @@ -15063,7 +14906,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_2write_binary(struct __pyx_obj_3_sa_BiLex */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->e_index->__pyx_vtab)->write_handle(__pyx_v_self->e_index, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":207 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":207 * self.f_index.write_handle(f) * self.e_index.write_handle(f) * self.col1.write_handle(f) # <<<<<<<<<<<<<< @@ -15072,7 +14915,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_2write_binary(struct __pyx_obj_3_sa_BiLex */ ((struct __pyx_vtabstruct_3_sa_FloatList *)__pyx_v_self->col1->__pyx_vtab)->write_handle(__pyx_v_self->col1, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":208 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":208 * self.e_index.write_handle(f) * self.col1.write_handle(f) * self.col2.write_handle(f) # <<<<<<<<<<<<<< @@ -15081,7 +14924,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_2write_binary(struct __pyx_obj_3_sa_BiLex */ ((struct __pyx_vtabstruct_3_sa_FloatList *)__pyx_v_self->col2->__pyx_vtab)->write_handle(__pyx_v_self->col2, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":209 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":209 * self.col1.write_handle(f) * self.col2.write_handle(f) * self.write_wordlist(self.id2fword, f) # <<<<<<<<<<<<<< @@ -15095,7 +14938,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_2write_binary(struct __pyx_obj_3_sa_BiLex __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":210 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":210 * self.col2.write_handle(f) * self.write_wordlist(self.id2fword, f) * self.write_wordlist(self.id2eword, f) # <<<<<<<<<<<<<< @@ -15109,7 +14952,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_2write_binary(struct __pyx_obj_3_sa_BiLex __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":211 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":211 * self.write_wordlist(self.id2fword, f) * self.write_wordlist(self.id2eword, f) * fclose(f) # <<<<<<<<<<<<<< @@ -15131,7 +14974,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_2write_binary(struct __pyx_obj_3_sa_BiLex return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":214 +/* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":214 * * * cdef write_wordlist(self, wordlist, FILE* f): # <<<<<<<<<<<<<< @@ -15156,7 +14999,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_write_wordlist(CYTHON_UNUSED struct __pyx_o int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_wordlist", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":218 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":218 * cdef int num_words * * num_words = len(wordlist) # <<<<<<<<<<<<<< @@ -15166,7 +15009,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_write_wordlist(CYTHON_UNUSED struct __pyx_o __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/pauldb/workspace/cdec/python/src/sa/bilex.pxi":219 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":219 * * num_words = len(wordlist) * fwrite(&(num_words), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -15175,7 +15018,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_write_wordlist(CYTHON_UNUSED struct __pyx_o */ fwrite((&__pyx_v_num_words), (sizeof(int)), 1, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":220 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":220 * num_words = len(wordlist) * fwrite(&(num_words), sizeof(int), 1, f) * for word in wordlist: # <<<<<<<<<<<<<< @@ -15193,18 +15036,10 @@ static PyObject *__pyx_f_3_sa_5BiLex_write_wordlist(CYTHON_UNUSED struct __pyx_o for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_2)) { if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++; } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_2)) { if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++; } else { __pyx_t_4 = __pyx_t_3(__pyx_t_2); if (unlikely(!__pyx_t_4)) { @@ -15220,7 +15055,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_write_wordlist(CYTHON_UNUSED struct __pyx_o __pyx_v_word = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":221 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":221 * fwrite(&(num_words), sizeof(int), 1, f) * for word in wordlist: * word_len = len(word) + 1 # <<<<<<<<<<<<<< @@ -15230,7 +15065,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_write_wordlist(CYTHON_UNUSED struct __pyx_o __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/pauldb/workspace/cdec/python/src/sa/bilex.pxi":222 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":222 * for word in wordlist: * word_len = len(word) + 1 * fwrite(&(word_len), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -15239,7 +15074,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_write_wordlist(CYTHON_UNUSED struct __pyx_o */ fwrite((&__pyx_v_word_len), (sizeof(int)), 1, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":223 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":223 * word_len = len(word) + 1 * fwrite(&(word_len), sizeof(int), 1, f) * fwrite(word, sizeof(char), word_len, f) # <<<<<<<<<<<<<< @@ -15265,7 +15100,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_write_wordlist(CYTHON_UNUSED struct __pyx_o return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":226 +/* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":226 * * * cdef read_wordlist(self, word2id, id2word, FILE* f): # <<<<<<<<<<<<<< @@ -15289,7 +15124,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_read_wordlist(CYTHON_UNUSED struct __pyx_ob int __pyx_clineno = 0; __Pyx_RefNannySetupContext("read_wordlist", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":231 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":231 * cdef char* word * * fread(&(num_words), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -15298,7 +15133,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_read_wordlist(CYTHON_UNUSED struct __pyx_ob */ fread((&__pyx_v_num_words), (sizeof(int)), 1, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":232 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":232 * * fread(&(num_words), sizeof(int), 1, f) * for i from 0 <= i < num_words: # <<<<<<<<<<<<<< @@ -15308,7 +15143,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_read_wordlist(CYTHON_UNUSED struct __pyx_ob __pyx_t_1 = __pyx_v_num_words; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":233 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -15317,7 +15152,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_read_wordlist(CYTHON_UNUSED struct __pyx_ob */ fread((&__pyx_v_word_len), (sizeof(int)), 1, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":234 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":234 * for i from 0 <= i < num_words: * fread(&(word_len), sizeof(int), 1, f) * word = malloc (word_len * sizeof(char)) # <<<<<<<<<<<<<< @@ -15326,7 +15161,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_read_wordlist(CYTHON_UNUSED struct __pyx_ob */ __pyx_v_word = ((char *)malloc((__pyx_v_word_len * (sizeof(char))))); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":235 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":235 * fread(&(word_len), sizeof(int), 1, f) * word = malloc (word_len * sizeof(char)) * fread(word, sizeof(char), word_len, f) # <<<<<<<<<<<<<< @@ -15335,7 +15170,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_read_wordlist(CYTHON_UNUSED struct __pyx_ob */ fread(__pyx_v_word, (sizeof(char)), __pyx_v_word_len, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":236 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":236 * word = malloc (word_len * sizeof(char)) * fread(word, sizeof(char), word_len, f) * word2id[word] = len(id2word) # <<<<<<<<<<<<<< @@ -15351,7 +15186,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_read_wordlist(CYTHON_UNUSED struct __pyx_ob __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":237 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":237 * fread(word, sizeof(char), word_len, f) * word2id[word] = len(id2word) * id2word.append(word) # <<<<<<<<<<<<<< @@ -15365,7 +15200,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_read_wordlist(CYTHON_UNUSED struct __pyx_ob __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":238 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":238 * word2id[word] = len(id2word) * id2word.append(word) * free(word) # <<<<<<<<<<<<<< @@ -15409,7 +15244,7 @@ static PyObject *__pyx_pw_3_sa_5BiLex_5read_binary(PyObject *__pyx_v_self, PyObj return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":240 +/* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":240 * free(word) * * def read_binary(self, char* filename): # <<<<<<<<<<<<<< @@ -15429,7 +15264,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_4read_binary(struct __pyx_obj_3_sa_BiLex * int __pyx_clineno = 0; __Pyx_RefNannySetupContext("read_binary", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":242 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":242 * def read_binary(self, char* filename): * cdef FILE* f * f = fopen(filename, "r") # <<<<<<<<<<<<<< @@ -15438,7 +15273,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_4read_binary(struct __pyx_obj_3_sa_BiLex * */ __pyx_v_f = fopen(__pyx_v_filename, __pyx_k__r); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":243 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":243 * cdef FILE* f * f = fopen(filename, "r") * self.f_index.read_handle(f) # <<<<<<<<<<<<<< @@ -15447,7 +15282,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_4read_binary(struct __pyx_obj_3_sa_BiLex * */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->f_index->__pyx_vtab)->read_handle(__pyx_v_self->f_index, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":244 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":244 * f = fopen(filename, "r") * self.f_index.read_handle(f) * self.e_index.read_handle(f) # <<<<<<<<<<<<<< @@ -15456,7 +15291,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_4read_binary(struct __pyx_obj_3_sa_BiLex * */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->e_index->__pyx_vtab)->read_handle(__pyx_v_self->e_index, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":245 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":245 * self.f_index.read_handle(f) * self.e_index.read_handle(f) * self.col1.read_handle(f) # <<<<<<<<<<<<<< @@ -15465,7 +15300,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_4read_binary(struct __pyx_obj_3_sa_BiLex * */ ((struct __pyx_vtabstruct_3_sa_FloatList *)__pyx_v_self->col1->__pyx_vtab)->read_handle(__pyx_v_self->col1, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":246 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":246 * self.e_index.read_handle(f) * self.col1.read_handle(f) * self.col2.read_handle(f) # <<<<<<<<<<<<<< @@ -15474,7 +15309,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_4read_binary(struct __pyx_obj_3_sa_BiLex * */ ((struct __pyx_vtabstruct_3_sa_FloatList *)__pyx_v_self->col2->__pyx_vtab)->read_handle(__pyx_v_self->col2, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":247 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":247 * self.col1.read_handle(f) * self.col2.read_handle(f) * self.read_wordlist(self.fword2id, self.id2fword, f) # <<<<<<<<<<<<<< @@ -15491,7 +15326,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_4read_binary(struct __pyx_obj_3_sa_BiLex * __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":248 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -15508,7 +15343,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_4read_binary(struct __pyx_obj_3_sa_BiLex * __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":249 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":249 * self.read_wordlist(self.fword2id, self.id2fword, f) * self.read_wordlist(self.eword2id, self.id2eword, f) * fclose(f) # <<<<<<<<<<<<<< @@ -15542,7 +15377,7 @@ static PyObject *__pyx_pw_3_sa_5BiLex_7get_e_id(PyObject *__pyx_v_self, PyObject return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":252 +/* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":252 * * * def get_e_id(self, eword): # <<<<<<<<<<<<<< @@ -15562,17 +15397,17 @@ static PyObject *__pyx_pf_3_sa_5BiLex_6get_e_id(struct __pyx_obj_3_sa_BiLex *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_e_id", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":253 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":253 * * def get_e_id(self, eword): * if eword not in self.eword2id: # <<<<<<<<<<<<<< * e_id = len(self.id2eword) * self.id2eword.append(eword) */ - __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_eword, __pyx_v_self->eword2id, Py_NE)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = (__Pyx_NegateNonNeg(PySequence_Contains(__pyx_v_self->eword2id, __pyx_v_eword))); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":254 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":254 * def get_e_id(self, eword): * if eword not in self.eword2id: * e_id = len(self.id2eword) # <<<<<<<<<<<<<< @@ -15588,7 +15423,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_6get_e_id(struct __pyx_obj_3_sa_BiLex *__p __pyx_v_e_id = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":255 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":255 * if eword not in self.eword2id: * e_id = len(self.id2eword) * self.id2eword.append(eword) # <<<<<<<<<<<<<< @@ -15599,7 +15434,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_6get_e_id(struct __pyx_obj_3_sa_BiLex *__p __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":256 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":256 * e_id = len(self.id2eword) * self.id2eword.append(eword) * self.eword2id[eword] = e_id # <<<<<<<<<<<<<< @@ -15611,7 +15446,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_6get_e_id(struct __pyx_obj_3_sa_BiLex *__p } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":257 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":257 * self.id2eword.append(eword) * self.eword2id[eword] = e_id * return self.eword2id[eword] # <<<<<<<<<<<<<< @@ -15649,7 +15484,7 @@ static PyObject *__pyx_pw_3_sa_5BiLex_9get_f_id(PyObject *__pyx_v_self, PyObject return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":260 +/* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":260 * * * def get_f_id(self, fword): # <<<<<<<<<<<<<< @@ -15669,17 +15504,17 @@ static PyObject *__pyx_pf_3_sa_5BiLex_8get_f_id(struct __pyx_obj_3_sa_BiLex *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_f_id", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":261 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":261 * * def get_f_id(self, fword): * if fword not in self.fword2id: # <<<<<<<<<<<<<< * f_id = len(self.id2fword) * self.id2fword.append(fword) */ - __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_fword, __pyx_v_self->fword2id, Py_NE)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = (__Pyx_NegateNonNeg(PySequence_Contains(__pyx_v_self->fword2id, __pyx_v_fword))); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":262 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":262 * def get_f_id(self, fword): * if fword not in self.fword2id: * f_id = len(self.id2fword) # <<<<<<<<<<<<<< @@ -15695,7 +15530,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_8get_f_id(struct __pyx_obj_3_sa_BiLex *__p __pyx_v_f_id = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":263 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":263 * if fword not in self.fword2id: * f_id = len(self.id2fword) * self.id2fword.append(fword) # <<<<<<<<<<<<<< @@ -15706,7 +15541,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_8get_f_id(struct __pyx_obj_3_sa_BiLex *__p __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":264 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":264 * f_id = len(self.id2fword) * self.id2fword.append(fword) * self.fword2id[fword] = f_id # <<<<<<<<<<<<<< @@ -15718,7 +15553,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_8get_f_id(struct __pyx_obj_3_sa_BiLex *__p } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":265 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":265 * self.id2fword.append(fword) * self.fword2id[fword] = f_id * return self.fword2id[fword] # <<<<<<<<<<<<<< @@ -15766,7 +15601,7 @@ static PyObject *__pyx_pw_3_sa_5BiLex_11read_text(PyObject *__pyx_v_self, PyObje return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":268 +/* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":268 * * * def read_text(self, char* filename): # <<<<<<<<<<<<<< @@ -15821,7 +15656,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("read_text", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":272 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":272 * cdef IntList fcount * * fcount = IntList() # <<<<<<<<<<<<<< @@ -15833,7 +15668,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_fcount = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":273 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":273 * * fcount = IntList() * with gzip_or_text(filename) as f: # <<<<<<<<<<<<<< @@ -15873,7 +15708,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_f = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":275 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":275 * with gzip_or_text(filename) as f: * # first loop merely establishes size of array objects * for line in f: # <<<<<<<<<<<<<< @@ -15891,18 +15726,10 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ for (;;) { if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #endif + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #endif + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; } else { __pyx_t_2 = __pyx_t_9(__pyx_t_1); if (unlikely(!__pyx_t_2)) { @@ -15918,7 +15745,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_line = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":276 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":276 * # first loop merely establishes size of array objects * for line in f: * (fword, eword, score1, score2) = line.split() # <<<<<<<<<<<<<< @@ -15932,23 +15759,22 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; - #if CYTHON_COMPILING_IN_CPYTHON - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 4)) { - if (size > 4) __Pyx_RaiseTooManyValuesError(4); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[5]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - } - #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { + if (unlikely(PyTuple_GET_SIZE(sequence) != 4)) { + if (PyTuple_GET_SIZE(sequence) > 4) __Pyx_RaiseTooManyValuesError(4); + else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[5]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + } __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_11 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_12 = PyTuple_GET_ITEM(sequence, 3); } else { + if (unlikely(PyList_GET_SIZE(sequence) != 4)) { + if (PyList_GET_SIZE(sequence) > 4) __Pyx_RaiseTooManyValuesError(4); + else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[5]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + } __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_10 = PyList_GET_ITEM(sequence, 1); __pyx_t_11 = PyList_GET_ITEM(sequence, 2); @@ -15958,36 +15784,28 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx_t_12); - #else - Py_ssize_t i; - PyObject** temps[4] = {&__pyx_t_2,&__pyx_t_10,&__pyx_t_11,&__pyx_t_12}; - for (i=0; i < 4; i++) { - PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - *(temps[i]) = item; - } - #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else - { + } else { Py_ssize_t index = -1; - PyObject** temps[4] = {&__pyx_t_2,&__pyx_t_10,&__pyx_t_11,&__pyx_t_12}; __pyx_t_13 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext; - for (index=0; index < 4; index++) { - PyObject* item = __pyx_t_14(__pyx_t_13); if (unlikely(!item)) goto __pyx_L18_unpacking_failed; - __Pyx_GOTREF(item); - *(temps[index]) = item; - } + index = 0; __pyx_t_2 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_2)) goto __pyx_L18_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_10 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_10)) goto __pyx_L18_unpacking_failed; + __Pyx_GOTREF(__pyx_t_10); + index = 2; __pyx_t_11 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_11)) goto __pyx_L18_unpacking_failed; + __Pyx_GOTREF(__pyx_t_11); + index = 3; __pyx_t_12 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_12)) goto __pyx_L18_unpacking_failed; + __Pyx_GOTREF(__pyx_t_12); if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 4) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L19_unpacking_done; __pyx_L18_unpacking_failed:; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_14 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); + if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __pyx_L19_unpacking_done:; } @@ -16004,7 +15822,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_score2 = __pyx_t_12; __pyx_t_12 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":277 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":277 * for line in f: * (fword, eword, score1, score2) = line.split() * f_id = self.get_f_id(fword) # <<<<<<<<<<<<<< @@ -16026,7 +15844,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_f_id = __pyx_t_11; __pyx_t_11 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":278 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":278 * (fword, eword, score1, score2) = line.split() * f_id = self.get_f_id(fword) * e_id = self.get_e_id(eword) # <<<<<<<<<<<<<< @@ -16048,7 +15866,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_e_id = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":279 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":279 * f_id = self.get_f_id(fword) * e_id = self.get_e_id(eword) * while f_id >= len(fcount): # <<<<<<<<<<<<<< @@ -16059,13 +15877,14 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __pyx_t_15 = PyObject_Length(((PyObject *)__pyx_v_fcount)); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_15); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_12 = PyObject_RichCompare(__pyx_v_f_id, __pyx_t_3, Py_GE); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_12 = PyObject_RichCompare(__pyx_v_f_id, __pyx_t_3, Py_GE); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (!__pyx_t_16) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":280 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":280 * e_id = self.get_e_id(eword) * while f_id >= len(fcount): * fcount.append(0) # <<<<<<<<<<<<<< @@ -16077,7 +15896,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":281 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":281 * while f_id >= len(fcount): * fcount.append(0) * fcount.arr[f_id] = fcount.arr[f_id] + 1 # <<<<<<<<<<<<<< @@ -16090,7 +15909,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":284 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":284 * * # Allocate space for dictionary in arrays * N = 0 # <<<<<<<<<<<<<< @@ -16100,7 +15919,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __Pyx_INCREF(__pyx_int_0); __pyx_v_N = __pyx_int_0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":285 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":285 * # Allocate space for dictionary in arrays * N = 0 * n_f = len(fcount) # <<<<<<<<<<<<<< @@ -16113,7 +15932,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_n_f = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":286 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":286 * N = 0 * n_f = len(fcount) * self.f_index = IntList(initial_len=n_f+1) # <<<<<<<<<<<<<< @@ -16135,7 +15954,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_self->f_index = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_12); __pyx_t_12 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":287 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":287 * n_f = len(fcount) * self.f_index = IntList(initial_len=n_f+1) * for i from 0 <= i < n_f: # <<<<<<<<<<<<<< @@ -16150,7 +15969,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_i = __pyx_t_12; __pyx_t_12 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":288 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":288 * self.f_index = IntList(initial_len=n_f+1) * for i from 0 <= i < n_f: * self.f_index.arr[i] = N # <<<<<<<<<<<<<< @@ -16161,7 +15980,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __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 = 288; __pyx_clineno = __LINE__; goto __pyx_L7_error;} (__pyx_v_self->f_index->arr[__pyx_t_8]) = __pyx_t_20; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":289 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":289 * for i from 0 <= i < n_f: * self.f_index.arr[i] = N * N = N + fcount.arr[i] # <<<<<<<<<<<<<< @@ -16178,7 +15997,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_N = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":290 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":290 * self.f_index.arr[i] = N * N = N + fcount.arr[i] * fcount.arr[i] = 0 # <<<<<<<<<<<<<< @@ -16190,7 +16009,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __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 = 287; __pyx_clineno = __LINE__; goto __pyx_L7_error;} } - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":287 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":287 * n_f = len(fcount) * self.f_index = IntList(initial_len=n_f+1) * for i from 0 <= i < n_f: # <<<<<<<<<<<<<< @@ -16203,7 +16022,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_i = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":291 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":291 * N = N + fcount.arr[i] * fcount.arr[i] = 0 * self.f_index.arr[n_f] = N # <<<<<<<<<<<<<< @@ -16214,7 +16033,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __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 = 291; __pyx_clineno = __LINE__; goto __pyx_L7_error;} (__pyx_v_self->f_index->arr[__pyx_t_8]) = __pyx_t_20; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":292 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":292 * fcount.arr[i] = 0 * self.f_index.arr[n_f] = N * self.e_index = IntList(initial_len=N) # <<<<<<<<<<<<<< @@ -16233,7 +16052,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_self->e_index = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_12); __pyx_t_12 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":293 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":293 * self.f_index.arr[n_f] = N * self.e_index = IntList(initial_len=N) * self.col1 = FloatList(initial_len=N) # <<<<<<<<<<<<<< @@ -16252,7 +16071,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_self->col1 = ((struct __pyx_obj_3_sa_FloatList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":294 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":294 * self.e_index = IntList(initial_len=N) * self.col1 = FloatList(initial_len=N) * self.col2 = FloatList(initial_len=N) # <<<<<<<<<<<<<< @@ -16271,7 +16090,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_self->col2 = ((struct __pyx_obj_3_sa_FloatList *)__pyx_t_12); __pyx_t_12 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":297 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":297 * * # Re-read file, placing words into buckets * f.seek(0) # <<<<<<<<<<<<<< @@ -16285,7 +16104,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":298 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":298 * # Re-read file, placing words into buckets * f.seek(0) * for line in f: # <<<<<<<<<<<<<< @@ -16303,18 +16122,10 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ for (;;) { if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_12 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_12); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #else - __pyx_t_12 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #endif + __pyx_t_12 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_12); __pyx_t_8++; } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_12); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #else - __pyx_t_12 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #endif + __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_12); __pyx_t_8++; } else { __pyx_t_12 = __pyx_t_9(__pyx_t_1); if (unlikely(!__pyx_t_12)) { @@ -16330,7 +16141,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_line = __pyx_t_12; __pyx_t_12 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":299 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":299 * f.seek(0) * for line in f: * (fword, eword, score1, score2) = line.split() # <<<<<<<<<<<<<< @@ -16344,23 +16155,22 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; - #if CYTHON_COMPILING_IN_CPYTHON - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 4)) { - if (size > 4) __Pyx_RaiseTooManyValuesError(4); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[5]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - } - #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { + if (unlikely(PyTuple_GET_SIZE(sequence) != 4)) { + if (PyTuple_GET_SIZE(sequence) > 4) __Pyx_RaiseTooManyValuesError(4); + else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[5]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + } __pyx_t_12 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_10 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 3); } else { + if (unlikely(PyList_GET_SIZE(sequence) != 4)) { + if (PyList_GET_SIZE(sequence) > 4) __Pyx_RaiseTooManyValuesError(4); + else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[5]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + } __pyx_t_12 = PyList_GET_ITEM(sequence, 0); __pyx_t_11 = PyList_GET_ITEM(sequence, 1); __pyx_t_10 = PyList_GET_ITEM(sequence, 2); @@ -16370,36 +16180,28 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(__pyx_t_2); - #else - Py_ssize_t i; - PyObject** temps[4] = {&__pyx_t_12,&__pyx_t_11,&__pyx_t_10,&__pyx_t_2}; - for (i=0; i < 4; i++) { - PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - *(temps[i]) = item; - } - #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else - { + } else { Py_ssize_t index = -1; - PyObject** temps[4] = {&__pyx_t_12,&__pyx_t_11,&__pyx_t_10,&__pyx_t_2}; __pyx_t_13 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext; - for (index=0; index < 4; index++) { - PyObject* item = __pyx_t_14(__pyx_t_13); if (unlikely(!item)) goto __pyx_L26_unpacking_failed; - __Pyx_GOTREF(item); - *(temps[index]) = item; - } + index = 0; __pyx_t_12 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_12)) goto __pyx_L26_unpacking_failed; + __Pyx_GOTREF(__pyx_t_12); + index = 1; __pyx_t_11 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_11)) goto __pyx_L26_unpacking_failed; + __Pyx_GOTREF(__pyx_t_11); + index = 2; __pyx_t_10 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_10)) goto __pyx_L26_unpacking_failed; + __Pyx_GOTREF(__pyx_t_10); + index = 3; __pyx_t_2 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_2)) goto __pyx_L26_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 4) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L27_unpacking_done; __pyx_L26_unpacking_failed:; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_14 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); + if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __pyx_L27_unpacking_done:; } @@ -16416,7 +16218,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_score2 = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":300 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":300 * for line in f: * (fword, eword, score1, score2) = line.split() * f_id = self.get_f_id(fword) # <<<<<<<<<<<<<< @@ -16438,7 +16240,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_f_id = __pyx_t_10; __pyx_t_10 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":301 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":301 * (fword, eword, score1, score2) = line.split() * f_id = self.get_f_id(fword) * e_id = self.get_e_id(eword) # <<<<<<<<<<<<<< @@ -16460,7 +16262,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_e_id = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":302 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":302 * 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] # <<<<<<<<<<<<<< @@ -16475,7 +16277,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_index = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":303 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":303 * 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 # <<<<<<<<<<<<<< @@ -16486,7 +16288,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __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 = 303; __pyx_clineno = __LINE__; goto __pyx_L7_error;} (__pyx_v_fcount->arr[__pyx_t_15]) = ((__pyx_v_fcount->arr[__pyx_t_17]) + 1); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":304 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":304 * 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) # <<<<<<<<<<<<<< @@ -16506,7 +16308,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __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 = 304; __pyx_clineno = __LINE__; goto __pyx_L7_error;} (__pyx_v_self->e_index->arr[__pyx_t_17]) = __pyx_t_20; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":305 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":305 * fcount.arr[f_id] = fcount.arr[f_id] + 1 * self.e_index.arr[index] = int(e_id) * self.col1[index] = float(score1) # <<<<<<<<<<<<<< @@ -16519,7 +16321,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ if (PyObject_SetItem(((PyObject *)__pyx_v_self->col1), __pyx_v_index, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":306 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":306 * self.e_index.arr[index] = int(e_id) * self.col1[index] = float(score1) * self.col2[index] = float(score2) # <<<<<<<<<<<<<< @@ -16547,7 +16349,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":273 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":273 * * fcount = IntList() * with gzip_or_text(filename) as f: # <<<<<<<<<<<<<< @@ -16627,7 +16429,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __pyx_L31:; } - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":309 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":309 * * # Sort buckets by eword * for b from 0 <= b < n_f: # <<<<<<<<<<<<<< @@ -16643,7 +16445,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_b = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":310 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":310 * # Sort buckets by eword * for b from 0 <= b < n_f: * i = self.f_index.arr[b] # <<<<<<<<<<<<<< @@ -16657,7 +16459,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_i = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":311 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":311 * for b from 0 <= b < n_f: * i = self.f_index.arr[b] * j = self.f_index.arr[b+1] # <<<<<<<<<<<<<< @@ -16674,7 +16476,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_j = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":312 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":312 * i = self.f_index.arr[b] * j = self.f_index.arr[b+1] * self.qsort(i,j, "") # <<<<<<<<<<<<<< @@ -16692,7 +16494,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __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 = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":309 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":309 * * # Sort buckets by eword * for b from 0 <= b < n_f: # <<<<<<<<<<<<<< @@ -16738,7 +16540,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":315 +/* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":315 * * * cdef swap(self, int i, int j): # <<<<<<<<<<<<<< @@ -16754,7 +16556,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_swap(struct __pyx_obj_3_sa_BiLex *__pyx_v_s int __pyx_t_1; __Pyx_RefNannySetupContext("swap", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":319 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":319 * cdef float ftmp * * if i == j: # <<<<<<<<<<<<<< @@ -16764,7 +16566,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_swap(struct __pyx_obj_3_sa_BiLex *__pyx_v_s __pyx_t_1 = (__pyx_v_i == __pyx_v_j); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":320 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":320 * * if i == j: * return # <<<<<<<<<<<<<< @@ -16778,7 +16580,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_swap(struct __pyx_obj_3_sa_BiLex *__pyx_v_s } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":322 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":322 * return * * itmp = self.e_index.arr[i] # <<<<<<<<<<<<<< @@ -16787,7 +16589,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_swap(struct __pyx_obj_3_sa_BiLex *__pyx_v_s */ __pyx_v_itmp = (__pyx_v_self->e_index->arr[__pyx_v_i]); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":323 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":323 * * itmp = self.e_index.arr[i] * self.e_index.arr[i] = self.e_index.arr[j] # <<<<<<<<<<<<<< @@ -16796,7 +16598,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_swap(struct __pyx_obj_3_sa_BiLex *__pyx_v_s */ (__pyx_v_self->e_index->arr[__pyx_v_i]) = (__pyx_v_self->e_index->arr[__pyx_v_j]); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":324 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":324 * itmp = self.e_index.arr[i] * self.e_index.arr[i] = self.e_index.arr[j] * self.e_index.arr[j] = itmp # <<<<<<<<<<<<<< @@ -16805,7 +16607,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_swap(struct __pyx_obj_3_sa_BiLex *__pyx_v_s */ (__pyx_v_self->e_index->arr[__pyx_v_j]) = __pyx_v_itmp; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":326 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":326 * self.e_index.arr[j] = itmp * * ftmp = self.col1.arr[i] # <<<<<<<<<<<<<< @@ -16814,7 +16616,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_swap(struct __pyx_obj_3_sa_BiLex *__pyx_v_s */ __pyx_v_ftmp = (__pyx_v_self->col1->arr[__pyx_v_i]); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":327 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":327 * * ftmp = self.col1.arr[i] * self.col1.arr[i] = self.col1.arr[j] # <<<<<<<<<<<<<< @@ -16823,7 +16625,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_swap(struct __pyx_obj_3_sa_BiLex *__pyx_v_s */ (__pyx_v_self->col1->arr[__pyx_v_i]) = (__pyx_v_self->col1->arr[__pyx_v_j]); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":328 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":328 * ftmp = self.col1.arr[i] * self.col1.arr[i] = self.col1.arr[j] * self.col1.arr[j] = ftmp # <<<<<<<<<<<<<< @@ -16832,7 +16634,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_swap(struct __pyx_obj_3_sa_BiLex *__pyx_v_s */ (__pyx_v_self->col1->arr[__pyx_v_j]) = __pyx_v_ftmp; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":330 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":330 * self.col1.arr[j] = ftmp * * ftmp = self.col2.arr[i] # <<<<<<<<<<<<<< @@ -16841,7 +16643,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_swap(struct __pyx_obj_3_sa_BiLex *__pyx_v_s */ __pyx_v_ftmp = (__pyx_v_self->col2->arr[__pyx_v_i]); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":331 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":331 * * ftmp = self.col2.arr[i] * self.col2.arr[i] = self.col2.arr[j] # <<<<<<<<<<<<<< @@ -16850,7 +16652,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_swap(struct __pyx_obj_3_sa_BiLex *__pyx_v_s */ (__pyx_v_self->col2->arr[__pyx_v_i]) = (__pyx_v_self->col2->arr[__pyx_v_j]); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":332 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":332 * ftmp = self.col2.arr[i] * self.col2.arr[i] = self.col2.arr[j] * self.col2.arr[j] = ftmp # <<<<<<<<<<<<<< @@ -16866,7 +16668,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_swap(struct __pyx_obj_3_sa_BiLex *__pyx_v_s return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":335 +/* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":335 * * * cdef qsort(self, int i, int j, pad): # <<<<<<<<<<<<<< @@ -16889,7 +16691,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("qsort", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":338 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":338 * cdef int pval, p * * if i > j: # <<<<<<<<<<<<<< @@ -16899,7 +16701,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_ __pyx_t_1 = (__pyx_v_i > __pyx_v_j); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":339 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":339 * * if i > j: * raise Exception("Sort error in CLex") # <<<<<<<<<<<<<< @@ -16915,7 +16717,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_ } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":340 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":340 * if i > j: * raise Exception("Sort error in CLex") * if i == j: #empty interval # <<<<<<<<<<<<<< @@ -16925,7 +16727,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_ __pyx_t_1 = (__pyx_v_i == __pyx_v_j); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":341 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":341 * raise Exception("Sort error in CLex") * if i == j: #empty interval * return # <<<<<<<<<<<<<< @@ -16939,7 +16741,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_ } __pyx_L4:; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":342 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":342 * if i == j: #empty interval * return * if i == j-1: # singleton interval # <<<<<<<<<<<<<< @@ -16949,7 +16751,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_ __pyx_t_1 = (__pyx_v_i == (__pyx_v_j - 1)); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":343 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":343 * return * if i == j-1: # singleton interval * return # <<<<<<<<<<<<<< @@ -16963,7 +16765,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_ } __pyx_L5:; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":345 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":345 * return * * p = (i+j)/2 # <<<<<<<<<<<<<< @@ -16972,7 +16774,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_ */ __pyx_v_p = __Pyx_div_long((__pyx_v_i + __pyx_v_j), 2); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":346 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":346 * * p = (i+j)/2 * pval = self.e_index.arr[p] # <<<<<<<<<<<<<< @@ -16981,7 +16783,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_ */ __pyx_v_pval = (__pyx_v_self->e_index->arr[__pyx_v_p]); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":347 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":347 * p = (i+j)/2 * pval = self.e_index.arr[p] * self.swap(i, p) # <<<<<<<<<<<<<< @@ -16992,7 +16794,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_ __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":348 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":348 * pval = self.e_index.arr[p] * self.swap(i, p) * p = i # <<<<<<<<<<<<<< @@ -17001,7 +16803,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_ */ __pyx_v_p = __pyx_v_i; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":349 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":349 * self.swap(i, p) * p = i * for k from i+1 <= k < j: # <<<<<<<<<<<<<< @@ -17011,7 +16813,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_ __pyx_t_3 = __pyx_v_j; for (__pyx_v_k = (__pyx_v_i + 1); __pyx_v_k < __pyx_t_3; __pyx_v_k++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":350 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":350 * p = i * for k from i+1 <= k < j: * if pval >= self.e_index.arr[k]: # <<<<<<<<<<<<<< @@ -17021,7 +16823,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_ __pyx_t_1 = (__pyx_v_pval >= (__pyx_v_self->e_index->arr[__pyx_v_k])); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":351 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":351 * for k from i+1 <= k < j: * if pval >= self.e_index.arr[k]: * self.swap(p+1, k) # <<<<<<<<<<<<<< @@ -17032,7 +16834,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_ __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":352 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":352 * if pval >= self.e_index.arr[k]: * self.swap(p+1, k) * self.swap(p, p+1) # <<<<<<<<<<<<<< @@ -17043,7 +16845,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_ __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":353 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":353 * self.swap(p+1, k) * self.swap(p, p+1) * p = p + 1 # <<<<<<<<<<<<<< @@ -17056,7 +16858,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_ __pyx_L8:; } - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":354 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":354 * self.swap(p, p+1) * p = p + 1 * self.qsort(i,p, pad+" ") # <<<<<<<<<<<<<< @@ -17070,7 +16872,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":355 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":355 * p = p + 1 * self.qsort(i,p, pad+" ") * self.qsort(p+1,j, pad+" ") # <<<<<<<<<<<<<< @@ -17118,7 +16920,7 @@ static PyObject *__pyx_pw_3_sa_5BiLex_13write_enhanced(PyObject *__pyx_v_self, P return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":358 +/* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":358 * * * def write_enhanced(self, char* filename): # <<<<<<<<<<<<<< @@ -17155,7 +16957,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_enhanced", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":359 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":359 * * def write_enhanced(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -17195,7 +16997,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL __pyx_v_f = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":360 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":360 * def write_enhanced(self, char* filename): * with open(filename, "w") as f: * for i in self.f_index: # <<<<<<<<<<<<<< @@ -17213,18 +17015,10 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL for (;;) { if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_4)) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_4)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #endif + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_4)) { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_4)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #endif + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; } else { __pyx_t_1 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_1)) { @@ -17240,7 +17034,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL __pyx_v_i = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":361 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":361 * with open(filename, "w") as f: * for i in self.f_index: * f.write("%d " % i) # <<<<<<<<<<<<<< @@ -17264,7 +17058,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":362 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":362 * for i in self.f_index: * f.write("%d " % i) * f.write("\n") # <<<<<<<<<<<<<< @@ -17278,7 +17072,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":363 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":363 * f.write("%d " % i) * f.write("\n") * for i, s1, s2 in zip(self.e_index, self.col1, self.col2): # <<<<<<<<<<<<<< @@ -17311,18 +17105,10 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL for (;;) { if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_2)) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #endif + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_2)) { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #endif + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; } else { __pyx_t_4 = __pyx_t_9(__pyx_t_2); if (unlikely(!__pyx_t_4)) { @@ -17336,22 +17122,21 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL } if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { PyObject* sequence = __pyx_t_4; - #if CYTHON_COMPILING_IN_CPYTHON - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 3)) { - if (size > 3) __Pyx_RaiseTooManyValuesError(3); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[5]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - } - #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { + if (unlikely(PyTuple_GET_SIZE(sequence) != 3)) { + if (PyTuple_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3); + else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[5]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + } __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_11 = PyTuple_GET_ITEM(sequence, 2); } else { + if (unlikely(PyList_GET_SIZE(sequence) != 3)) { + if (PyList_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3); + else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[5]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + } __pyx_t_10 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); __pyx_t_11 = PyList_GET_ITEM(sequence, 2); @@ -17359,14 +17144,8 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_11); - #else - __pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __pyx_t_11 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } else - { + } else { Py_ssize_t index = -1; __pyx_t_12 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_12); @@ -17379,13 +17158,12 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL index = 2; __pyx_t_11 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_11)) goto __pyx_L20_unpacking_failed; __Pyx_GOTREF(__pyx_t_11); if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 3) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __pyx_t_13 = NULL; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; goto __pyx_L21_unpacking_done; __pyx_L20_unpacking_failed:; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_13 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); + if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __pyx_L21_unpacking_done:; } @@ -17399,7 +17177,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL __pyx_v_s2 = __pyx_t_11; __pyx_t_11 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":364 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":364 * f.write("\n") * for i, s1, s2 in zip(self.e_index, self.col1, self.col2): * f.write("%d %f %f " % (i, s1, s2)) # <<<<<<<<<<<<<< @@ -17435,7 +17213,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":365 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":365 * for i, s1, s2 in zip(self.e_index, self.col1, self.col2): * f.write("%d %f %f " % (i, s1, s2)) * f.write("\n") # <<<<<<<<<<<<<< @@ -17449,7 +17227,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":366 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":366 * f.write("%d %f %f " % (i, s1, s2)) * f.write("\n") * for i, w in enumerate(self.id2fword): # <<<<<<<<<<<<<< @@ -17469,18 +17247,10 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL for (;;) { if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_2)) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_11 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_11); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #else - __pyx_t_11 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #endif + __pyx_t_11 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_11); __pyx_t_8++; } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_2)) { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_11); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #else - __pyx_t_11 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #endif + __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_11); __pyx_t_8++; } else { __pyx_t_11 = __pyx_t_9(__pyx_t_2); if (unlikely(!__pyx_t_11)) { @@ -17504,7 +17274,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL __pyx_t_1 = __pyx_t_11; __pyx_t_11 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":367 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":367 * f.write("\n") * for i, w in enumerate(self.id2fword): * f.write("%d %s " % (i, w)) # <<<<<<<<<<<<<< @@ -17538,7 +17308,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":368 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":368 * for i, w in enumerate(self.id2fword): * f.write("%d %s " % (i, w)) * f.write("\n") # <<<<<<<<<<<<<< @@ -17552,7 +17322,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":369 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":369 * f.write("%d %s " % (i, w)) * f.write("\n") * for i, w in enumerate(self.id2eword): # <<<<<<<<<<<<<< @@ -17572,18 +17342,10 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL for (;;) { if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_10 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #else - __pyx_t_10 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #endif + __pyx_t_10 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #else - __pyx_t_10 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #endif + __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; } else { __pyx_t_10 = __pyx_t_9(__pyx_t_1); if (unlikely(!__pyx_t_10)) { @@ -17607,7 +17369,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL __pyx_t_2 = __pyx_t_10; __pyx_t_10 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":370 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":370 * f.write("\n") * for i, w in enumerate(self.id2eword): * f.write("%d %s " % (i, w)) # <<<<<<<<<<<<<< @@ -17641,7 +17403,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":371 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":371 * for i, w in enumerate(self.id2eword): * f.write("%d %s " % (i, w)) * f.write("\n") # <<<<<<<<<<<<<< @@ -17667,7 +17429,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":359 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":359 * * def write_enhanced(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -17775,11 +17537,11 @@ static PyObject *__pyx_pw_3_sa_5BiLex_15get_score(PyObject *__pyx_v_self, PyObje PyObject *__pyx_v_fword = 0; PyObject *__pyx_v_eword = 0; PyObject *__pyx_v_col = 0; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fword,&__pyx_n_s__eword,&__pyx_n_s__col,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_score (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fword,&__pyx_n_s__eword,&__pyx_n_s__col,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -17794,15 +17556,18 @@ static PyObject *__pyx_pw_3_sa_5BiLex_15get_score(PyObject *__pyx_v_self, PyObje 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--; + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fword); + if (likely(values[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--; + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__eword); + if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("get_score", 1, 3, 3, 1); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__col)) != 0)) kw_args--; + values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__col); + if (likely(values[2])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("get_score", 1, 3, 3, 2); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -17834,7 +17599,7 @@ static PyObject *__pyx_pw_3_sa_5BiLex_15get_score(PyObject *__pyx_v_self, PyObje return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":374 +/* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":374 * * * def get_score(self, fword, eword, col): # <<<<<<<<<<<<<< @@ -17860,17 +17625,17 @@ static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_score", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":377 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":377 * cdef e_id, f_id, low, high, midpoint, val * * if eword not in self.eword2id: # <<<<<<<<<<<<<< * return None * if fword not in self.fword2id: */ - __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_eword, __pyx_v_self->eword2id, Py_NE)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = (__Pyx_NegateNonNeg(PySequence_Contains(__pyx_v_self->eword2id, __pyx_v_eword))); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":378 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":378 * * if eword not in self.eword2id: * return None # <<<<<<<<<<<<<< @@ -17885,17 +17650,17 @@ static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *_ } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":379 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":379 * if eword not in self.eword2id: * return None * if fword not in self.fword2id: # <<<<<<<<<<<<<< * return None * f_id = self.fword2id[fword] */ - __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_fword, __pyx_v_self->fword2id, Py_NE)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = (__Pyx_NegateNonNeg(PySequence_Contains(__pyx_v_self->fword2id, __pyx_v_fword))); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":380 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":380 * return None * if fword not in self.fword2id: * return None # <<<<<<<<<<<<<< @@ -17910,7 +17675,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *_ } __pyx_L4:; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":381 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":381 * if fword not in self.fword2id: * return None * f_id = self.fword2id[fword] # <<<<<<<<<<<<<< @@ -17922,7 +17687,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_f_id = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":382 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":382 * return None * f_id = self.fword2id[fword] * e_id = self.eword2id[eword] # <<<<<<<<<<<<<< @@ -17934,7 +17699,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_e_id = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":383 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":383 * f_id = self.fword2id[fword] * e_id = self.eword2id[eword] * low = self.f_index.arr[f_id] # <<<<<<<<<<<<<< @@ -17947,7 +17712,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_low = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":384 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":384 * e_id = self.eword2id[eword] * low = self.f_index.arr[f_id] * high = self.f_index.arr[f_id+1] # <<<<<<<<<<<<<< @@ -17963,7 +17728,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_high = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":385 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":385 * low = self.f_index.arr[f_id] * high = self.f_index.arr[f_id+1] * while high - low > 0: # <<<<<<<<<<<<<< @@ -17973,13 +17738,14 @@ static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *_ while (1) { __pyx_t_2 = PyNumber_Subtract(__pyx_v_high, __pyx_v_low); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_int_0, Py_GT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_1) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":386 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":386 * high = self.f_index.arr[f_id+1] * while high - low > 0: * midpoint = (low+high)/2 # <<<<<<<<<<<<<< @@ -17995,7 +17761,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_midpoint = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":387 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":387 * while high - low > 0: * midpoint = (low+high)/2 * val = self.e_index.arr[midpoint] # <<<<<<<<<<<<<< @@ -18009,31 +17775,33 @@ static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_val = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":388 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":388 * midpoint = (low+high)/2 * val = self.e_index.arr[midpoint] * if val == e_id: # <<<<<<<<<<<<<< * if col == 0: * return self.col1.arr[midpoint] */ - __pyx_t_2 = PyObject_RichCompare(__pyx_v_val, __pyx_v_e_id, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_v_val, __pyx_v_e_id, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":389 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":389 * val = self.e_index.arr[midpoint] * if val == e_id: * if col == 0: # <<<<<<<<<<<<<< * return self.col1.arr[midpoint] * if col == 1: */ - __pyx_t_2 = PyObject_RichCompare(__pyx_v_col, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_v_col, __pyx_int_0, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":390 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":390 * if val == e_id: * if col == 0: * return self.col1.arr[midpoint] # <<<<<<<<<<<<<< @@ -18051,19 +17819,20 @@ static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *_ } __pyx_L8:; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":391 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":391 * if col == 0: * return self.col1.arr[midpoint] * if col == 1: # <<<<<<<<<<<<<< * return self.col2.arr[midpoint] * if val > e_id: */ - __pyx_t_2 = PyObject_RichCompare(__pyx_v_col, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_v_col, __pyx_int_1, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":392 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":392 * return self.col1.arr[midpoint] * if col == 1: * return self.col2.arr[midpoint] # <<<<<<<<<<<<<< @@ -18084,19 +17853,20 @@ static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *_ } __pyx_L7:; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":393 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":393 * if col == 1: * return self.col2.arr[midpoint] * if val > e_id: # <<<<<<<<<<<<<< * high = midpoint * if val < e_id: */ - __pyx_t_2 = PyObject_RichCompare(__pyx_v_val, __pyx_v_e_id, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_v_val, __pyx_v_e_id, Py_GT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":394 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":394 * return self.col2.arr[midpoint] * if val > e_id: * high = midpoint # <<<<<<<<<<<<<< @@ -18110,19 +17880,20 @@ static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *_ } __pyx_L10:; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":395 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":395 * if val > e_id: * high = midpoint * if val < e_id: # <<<<<<<<<<<<<< * low = midpoint + 1 * return None */ - __pyx_t_2 = PyObject_RichCompare(__pyx_v_val, __pyx_v_e_id, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_v_val, __pyx_v_e_id, Py_LT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":396 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":396 * high = midpoint * if val < e_id: * low = midpoint + 1 # <<<<<<<<<<<<<< @@ -18139,7 +17910,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *_ __pyx_L11:; } - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":397 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":397 * if val < e_id: * low = midpoint + 1 * return None # <<<<<<<<<<<<<< @@ -18192,7 +17963,7 @@ static PyObject *__pyx_pw_3_sa_5BiLex_17write_text(PyObject *__pyx_v_self, PyObj return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":400 +/* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":400 * * * def write_text(self, char* filename): # <<<<<<<<<<<<<< @@ -18229,7 +18000,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_16write_text(struct __pyx_obj_3_sa_BiLex * int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_text", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":404 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":404 * cdef i, N, e_id, f_id * * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -18269,7 +18040,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_16write_text(struct __pyx_obj_3_sa_BiLex * __pyx_v_f = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":405 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":405 * * with open(filename, "w") as f: * N = len(self.e_index) # <<<<<<<<<<<<<< @@ -18285,7 +18056,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_16write_text(struct __pyx_obj_3_sa_BiLex * __pyx_v_N = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":406 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":406 * with open(filename, "w") as f: * N = len(self.e_index) * f_id = 0 # <<<<<<<<<<<<<< @@ -18295,7 +18066,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_16write_text(struct __pyx_obj_3_sa_BiLex * __Pyx_INCREF(__pyx_int_0); __pyx_v_f_id = __pyx_int_0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":407 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":407 * N = len(self.e_index) * f_id = 0 * for i from 0 <= i < N: # <<<<<<<<<<<<<< @@ -18310,7 +18081,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_16write_text(struct __pyx_obj_3_sa_BiLex * __pyx_v_i = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":408 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":408 * f_id = 0 * for i from 0 <= i < N: * while self.f_index.arr[f_id+1] == i: # <<<<<<<<<<<<<< @@ -18324,13 +18095,14 @@ static PyObject *__pyx_pf_3_sa_5BiLex_16write_text(struct __pyx_obj_3_sa_BiLex * __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 = 408; __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 = 408; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_v_i, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_11) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":409 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":409 * for i from 0 <= i < N: * while self.f_index.arr[f_id+1] == i: * f_id = f_id + 1 # <<<<<<<<<<<<<< @@ -18344,7 +18116,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_16write_text(struct __pyx_obj_3_sa_BiLex * __pyx_t_1 = 0; } - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":410 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":410 * while self.f_index.arr[f_id+1] == i: * f_id = f_id + 1 * e_id = self.e_index.arr[i] # <<<<<<<<<<<<<< @@ -18358,7 +18130,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_16write_text(struct __pyx_obj_3_sa_BiLex * __pyx_v_e_id = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":411 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":411 * f_id = f_id + 1 * e_id = self.e_index.arr[i] * score1 = self.col1.arr[i] # <<<<<<<<<<<<<< @@ -18372,7 +18144,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_16write_text(struct __pyx_obj_3_sa_BiLex * __pyx_v_score1 = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":412 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":412 * e_id = self.e_index.arr[i] * score1 = self.col1.arr[i] * score2 = self.col2.arr[i] # <<<<<<<<<<<<<< @@ -18385,7 +18157,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_16write_text(struct __pyx_obj_3_sa_BiLex * __pyx_v_score2 = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":413 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":413 * 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)) # <<<<<<<<<<<<<< @@ -18426,7 +18198,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_16write_text(struct __pyx_obj_3_sa_BiLex * __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 = 407; __pyx_clineno = __LINE__; goto __pyx_L7_error;} } - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":407 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":407 * N = len(self.e_index) * f_id = 0 * for i from 0 <= i < N: # <<<<<<<<<<<<<< @@ -18449,7 +18221,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_16write_text(struct __pyx_obj_3_sa_BiLex * __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":404 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":404 * cdef i, N, e_id, f_id * * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -18551,7 +18323,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_16write_text(struct __pyx_obj_3_sa_BiLex * return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":21 +/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":21 * cdef int LOWER_MASK[32] * * cdef void _init_lower_mask(): # <<<<<<<<<<<<<< @@ -18567,7 +18339,7 @@ static void __pyx_f_3_sa__init_lower_mask(void) { unsigned int __pyx_t_2; __Pyx_RefNannySetupContext("_init_lower_mask", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":23 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":23 * cdef void _init_lower_mask(): * cdef unsigned i * cdef int mask = 0 # <<<<<<<<<<<<<< @@ -18576,7 +18348,7 @@ static void __pyx_f_3_sa__init_lower_mask(void) { */ __pyx_v_mask = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":24 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":24 * cdef unsigned i * cdef int mask = 0 * for i in range(MIN_BOTTOM_SIZE): # <<<<<<<<<<<<<< @@ -18587,7 +18359,7 @@ static void __pyx_f_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/pauldb/workspace/cdec/python/src/sa/veb.pxi":25 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":25 * cdef int mask = 0 * for i in range(MIN_BOTTOM_SIZE): * mask = (mask << 1) + 1 # <<<<<<<<<<<<<< @@ -18596,7 +18368,7 @@ static void __pyx_f_3_sa__init_lower_mask(void) { */ __pyx_v_mask = ((__pyx_v_mask << 1) + 1); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":26 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":26 * for i in range(MIN_BOTTOM_SIZE): * mask = (mask << 1) + 1 * LOWER_MASK[i] = mask # <<<<<<<<<<<<<< @@ -18609,7 +18381,7 @@ static void __pyx_f_3_sa__init_lower_mask(void) { __Pyx_RefNannyFinishContext(); } -/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":37 +/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":37 * * * cdef _BitSet* new_BitSet(): # <<<<<<<<<<<<<< @@ -18623,7 +18395,7 @@ static struct __pyx_t_3_sa__BitSet *__pyx_f_3_sa_new_BitSet(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("new_BitSet", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":40 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":40 * cdef _BitSet* b * * b = <_BitSet*> malloc(sizeof(_BitSet)) # <<<<<<<<<<<<<< @@ -18632,7 +18404,7 @@ static struct __pyx_t_3_sa__BitSet *__pyx_f_3_sa_new_BitSet(void) { */ __pyx_v_b = ((struct __pyx_t_3_sa__BitSet *)malloc((sizeof(struct __pyx_t_3_sa__BitSet)))); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":41 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":41 * * b = <_BitSet*> malloc(sizeof(_BitSet)) * b.bitset = 0 # <<<<<<<<<<<<<< @@ -18641,7 +18413,7 @@ static struct __pyx_t_3_sa__BitSet *__pyx_f_3_sa_new_BitSet(void) { */ __pyx_v_b->bitset = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":42 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":42 * b = <_BitSet*> malloc(sizeof(_BitSet)) * b.bitset = 0 * b.min_val = -1 # <<<<<<<<<<<<<< @@ -18650,7 +18422,7 @@ static struct __pyx_t_3_sa__BitSet *__pyx_f_3_sa_new_BitSet(void) { */ __pyx_v_b->min_val = -1; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":43 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":43 * b.bitset = 0 * b.min_val = -1 * b.max_val = -1 # <<<<<<<<<<<<<< @@ -18659,7 +18431,7 @@ static struct __pyx_t_3_sa__BitSet *__pyx_f_3_sa_new_BitSet(void) { */ __pyx_v_b->max_val = -1; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":44 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":44 * b.min_val = -1 * b.max_val = -1 * b.size = 0 # <<<<<<<<<<<<<< @@ -18668,7 +18440,7 @@ static struct __pyx_t_3_sa__BitSet *__pyx_f_3_sa_new_BitSet(void) { */ __pyx_v_b->size = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":45 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":45 * b.max_val = -1 * b.size = 0 * return b # <<<<<<<<<<<<<< @@ -18684,7 +18456,7 @@ static struct __pyx_t_3_sa__BitSet *__pyx_f_3_sa_new_BitSet(void) { return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":48 +/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":48 * * * cdef int bitset_findsucc(_BitSet* b, int i): # <<<<<<<<<<<<<< @@ -18705,7 +18477,7 @@ static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *__pyx_v_b, int __pyx_t_3; __Pyx_RefNannySetupContext("bitset_findsucc", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":52 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":52 * cdef int low, high, mid * * if b.max_val == -1 or i >= b.max_val: # <<<<<<<<<<<<<< @@ -18721,7 +18493,7 @@ static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *__pyx_v_b, } if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":53 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":53 * * if b.max_val == -1 or i >= b.max_val: * return -1 # <<<<<<<<<<<<<< @@ -18734,7 +18506,7 @@ static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *__pyx_v_b, } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":54 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":54 * if b.max_val == -1 or i >= b.max_val: * return -1 * if i < b.min_val: # <<<<<<<<<<<<<< @@ -18744,7 +18516,7 @@ static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *__pyx_v_b, __pyx_t_3 = (__pyx_v_i < __pyx_v_b->min_val); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":55 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":55 * return -1 * if i < b.min_val: * return b.min_val # <<<<<<<<<<<<<< @@ -18757,7 +18529,7 @@ static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *__pyx_v_b, } __pyx_L4:; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":57 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":57 * return b.min_val * * bitset = b.bitset & ~LOWER_MASK[i] # <<<<<<<<<<<<<< @@ -18766,7 +18538,7 @@ static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *__pyx_v_b, */ __pyx_v_bitset = (__pyx_v_b->bitset & (~(__pyx_v_3_sa_LOWER_MASK[__pyx_v_i]))); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":58 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":58 * * bitset = b.bitset & ~LOWER_MASK[i] * low = i+1 # <<<<<<<<<<<<<< @@ -18775,7 +18547,7 @@ static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *__pyx_v_b, */ __pyx_v_low = (__pyx_v_i + 1); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":59 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":59 * bitset = b.bitset & ~LOWER_MASK[i] * low = i+1 * high = b.max_val+1 # <<<<<<<<<<<<<< @@ -18784,7 +18556,7 @@ static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *__pyx_v_b, */ __pyx_v_high = (__pyx_v_b->max_val + 1); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":60 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":60 * low = i+1 * high = b.max_val+1 * while low < high-1: # <<<<<<<<<<<<<< @@ -18795,7 +18567,7 @@ static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *__pyx_v_b, __pyx_t_3 = (__pyx_v_low < (__pyx_v_high - 1)); if (!__pyx_t_3) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":61 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":61 * high = b.max_val+1 * while low < high-1: * mid = (high + low)/2 # <<<<<<<<<<<<<< @@ -18804,7 +18576,7 @@ static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *__pyx_v_b, */ __pyx_v_mid = __Pyx_div_long((__pyx_v_high + __pyx_v_low), 2); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":62 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":62 * while low < high-1: * mid = (high + low)/2 * mask = ~(LOWER_MASK[high-1] ^ LOWER_MASK[mid-1]) # <<<<<<<<<<<<<< @@ -18813,7 +18585,7 @@ static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *__pyx_v_b, */ __pyx_v_mask = (~((__pyx_v_3_sa_LOWER_MASK[(__pyx_v_high - 1)]) ^ (__pyx_v_3_sa_LOWER_MASK[(__pyx_v_mid - 1)]))); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":63 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":63 * mid = (high + low)/2 * mask = ~(LOWER_MASK[high-1] ^ LOWER_MASK[mid-1]) * if bitset & mask == 0: # <<<<<<<<<<<<<< @@ -18823,7 +18595,7 @@ static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *__pyx_v_b, __pyx_t_3 = ((__pyx_v_bitset & __pyx_v_mask) == 0); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":64 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":64 * mask = ~(LOWER_MASK[high-1] ^ LOWER_MASK[mid-1]) * if bitset & mask == 0: * low = mid # <<<<<<<<<<<<<< @@ -18835,7 +18607,7 @@ static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *__pyx_v_b, } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":66 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":66 * low = mid * else: * bitset = bitset & mask # <<<<<<<<<<<<<< @@ -18844,7 +18616,7 @@ static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *__pyx_v_b, */ __pyx_v_bitset = (__pyx_v_bitset & __pyx_v_mask); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":67 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":67 * else: * bitset = bitset & mask * high = mid # <<<<<<<<<<<<<< @@ -18856,7 +18628,7 @@ static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *__pyx_v_b, __pyx_L7:; } - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":68 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":68 * bitset = bitset & mask * high = mid * return low # <<<<<<<<<<<<<< @@ -18872,7 +18644,7 @@ static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *__pyx_v_b, return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":71 +/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":71 * * * cdef int bitset_insert(_BitSet* b, int i): # <<<<<<<<<<<<<< @@ -18887,7 +18659,7 @@ static int __pyx_f_3_sa_bitset_insert(struct __pyx_t_3_sa__BitSet *__pyx_v_b, in int __pyx_t_1; __Pyx_RefNannySetupContext("bitset_insert", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":74 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":74 * cdef int val * * val = 1 << i # <<<<<<<<<<<<<< @@ -18896,7 +18668,7 @@ static int __pyx_f_3_sa_bitset_insert(struct __pyx_t_3_sa__BitSet *__pyx_v_b, in */ __pyx_v_val = (1 << __pyx_v_i); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":75 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":75 * * val = 1 << i * if b.bitset & val == 0: # <<<<<<<<<<<<<< @@ -18906,7 +18678,7 @@ static int __pyx_f_3_sa_bitset_insert(struct __pyx_t_3_sa__BitSet *__pyx_v_b, in __pyx_t_1 = ((__pyx_v_b->bitset & __pyx_v_val) == 0); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":76 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":76 * val = 1 << i * if b.bitset & val == 0: * b.bitset = b.bitset | val # <<<<<<<<<<<<<< @@ -18915,7 +18687,7 @@ static int __pyx_f_3_sa_bitset_insert(struct __pyx_t_3_sa__BitSet *__pyx_v_b, in */ __pyx_v_b->bitset = (__pyx_v_b->bitset | __pyx_v_val); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":77 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":77 * if b.bitset & val == 0: * b.bitset = b.bitset | val * if b.size == 0: # <<<<<<<<<<<<<< @@ -18925,7 +18697,7 @@ static int __pyx_f_3_sa_bitset_insert(struct __pyx_t_3_sa__BitSet *__pyx_v_b, in __pyx_t_1 = (__pyx_v_b->size == 0); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":78 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":78 * b.bitset = b.bitset | val * if b.size == 0: * b.min_val = i # <<<<<<<<<<<<<< @@ -18934,7 +18706,7 @@ static int __pyx_f_3_sa_bitset_insert(struct __pyx_t_3_sa__BitSet *__pyx_v_b, in */ __pyx_v_b->min_val = __pyx_v_i; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":79 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":79 * if b.size == 0: * b.min_val = i * b.max_val = i # <<<<<<<<<<<<<< @@ -18946,7 +18718,7 @@ static int __pyx_f_3_sa_bitset_insert(struct __pyx_t_3_sa__BitSet *__pyx_v_b, in } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":81 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":81 * b.max_val = i * else: * if i < b.min_val: # <<<<<<<<<<<<<< @@ -18956,7 +18728,7 @@ static int __pyx_f_3_sa_bitset_insert(struct __pyx_t_3_sa__BitSet *__pyx_v_b, in __pyx_t_1 = (__pyx_v_i < __pyx_v_b->min_val); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":82 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":82 * else: * if i < b.min_val: * b.min_val = i # <<<<<<<<<<<<<< @@ -18968,7 +18740,7 @@ static int __pyx_f_3_sa_bitset_insert(struct __pyx_t_3_sa__BitSet *__pyx_v_b, in } __pyx_L5:; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":83 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":83 * if i < b.min_val: * b.min_val = i * if i > b.max_val: # <<<<<<<<<<<<<< @@ -18978,7 +18750,7 @@ static int __pyx_f_3_sa_bitset_insert(struct __pyx_t_3_sa__BitSet *__pyx_v_b, in __pyx_t_1 = (__pyx_v_i > __pyx_v_b->max_val); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":84 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":84 * b.min_val = i * if i > b.max_val: * b.max_val = i # <<<<<<<<<<<<<< @@ -18992,7 +18764,7 @@ static int __pyx_f_3_sa_bitset_insert(struct __pyx_t_3_sa__BitSet *__pyx_v_b, in } __pyx_L4:; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":85 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":85 * if i > b.max_val: * b.max_val = i * b.size = b.size + 1 # <<<<<<<<<<<<<< @@ -19001,7 +18773,7 @@ static int __pyx_f_3_sa_bitset_insert(struct __pyx_t_3_sa__BitSet *__pyx_v_b, in */ __pyx_v_b->size = (__pyx_v_b->size + 1); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":86 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":86 * b.max_val = i * b.size = b.size + 1 * return 1 # <<<<<<<<<<<<<< @@ -19014,7 +18786,7 @@ static int __pyx_f_3_sa_bitset_insert(struct __pyx_t_3_sa__BitSet *__pyx_v_b, in } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":87 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":87 * b.size = b.size + 1 * return 1 * return 0 # <<<<<<<<<<<<<< @@ -19030,7 +18802,7 @@ static int __pyx_f_3_sa_bitset_insert(struct __pyx_t_3_sa__BitSet *__pyx_v_b, in return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":90 +/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":90 * * * cdef int bitset_contains(_BitSet* b, int i): # <<<<<<<<<<<<<< @@ -19045,7 +18817,7 @@ static int __pyx_f_3_sa_bitset_contains(struct __pyx_t_3_sa__BitSet *__pyx_v_b, int __pyx_t_1; __Pyx_RefNannySetupContext("bitset_contains", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":93 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":93 * cdef int val * * val = 1 << i # <<<<<<<<<<<<<< @@ -19054,7 +18826,7 @@ static int __pyx_f_3_sa_bitset_contains(struct __pyx_t_3_sa__BitSet *__pyx_v_b, */ __pyx_v_val = (1 << __pyx_v_i); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":94 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":94 * * val = 1 << i * if b.bitset & val == 0: # <<<<<<<<<<<<<< @@ -19064,7 +18836,7 @@ static int __pyx_f_3_sa_bitset_contains(struct __pyx_t_3_sa__BitSet *__pyx_v_b, __pyx_t_1 = ((__pyx_v_b->bitset & __pyx_v_val) == 0); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":95 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":95 * val = 1 << i * if b.bitset & val == 0: * return 0 # <<<<<<<<<<<<<< @@ -19077,7 +18849,7 @@ static int __pyx_f_3_sa_bitset_contains(struct __pyx_t_3_sa__BitSet *__pyx_v_b, } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":97 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":97 * return 0 * else: * return 1 # <<<<<<<<<<<<<< @@ -19106,7 +18878,7 @@ static PyObject *__pyx_pw_3_sa_14BitSetIterator_1__next__(PyObject *__pyx_v_self return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":104 +/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":104 * cdef int next_val * * def __next__(self): # <<<<<<<<<<<<<< @@ -19125,7 +18897,7 @@ static PyObject *__pyx_pf_3_sa_14BitSetIterator___next__(struct __pyx_obj_3_sa_B int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__next__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":107 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":107 * cdef int ret_val * * if self.next_val == -1: # <<<<<<<<<<<<<< @@ -19135,7 +18907,7 @@ static PyObject *__pyx_pf_3_sa_14BitSetIterator___next__(struct __pyx_obj_3_sa_B __pyx_t_1 = (__pyx_v_self->next_val == -1); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":108 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":108 * * if self.next_val == -1: * raise StopIteration() # <<<<<<<<<<<<<< @@ -19151,7 +18923,7 @@ static PyObject *__pyx_pf_3_sa_14BitSetIterator___next__(struct __pyx_obj_3_sa_B } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":109 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":109 * if self.next_val == -1: * raise StopIteration() * ret_val = self.next_val # <<<<<<<<<<<<<< @@ -19160,7 +18932,7 @@ static PyObject *__pyx_pf_3_sa_14BitSetIterator___next__(struct __pyx_obj_3_sa_B */ __pyx_v_ret_val = __pyx_v_self->next_val; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":110 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":110 * raise StopIteration() * ret_val = self.next_val * self.next_val = bitset_findsucc(self.b, ret_val) # <<<<<<<<<<<<<< @@ -19169,7 +18941,7 @@ static PyObject *__pyx_pf_3_sa_14BitSetIterator___next__(struct __pyx_obj_3_sa_B */ __pyx_v_self->next_val = __pyx_f_3_sa_bitset_findsucc(__pyx_v_self->b, __pyx_v_ret_val); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":111 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":111 * ret_val = self.next_val * self.next_val = bitset_findsucc(self.b, ret_val) * return ret_val # <<<<<<<<<<<<<< @@ -19209,7 +18981,7 @@ static int __pyx_pw_3_sa_6BitSet_1__cinit__(PyObject *__pyx_v_self, PyObject *__ return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":122 +/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":122 * cdef _BitSet* b * * def __cinit__(self): # <<<<<<<<<<<<<< @@ -19222,7 +18994,7 @@ static int __pyx_pf_3_sa_6BitSet___cinit__(struct __pyx_obj_3_sa_BitSet *__pyx_v __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":123 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":123 * * def __cinit__(self): * self.b = new_BitSet() # <<<<<<<<<<<<<< @@ -19245,7 +19017,7 @@ static void __pyx_pw_3_sa_6BitSet_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyFinishContext(); } -/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":125 +/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":125 * self.b = new_BitSet() * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -19257,7 +19029,7 @@ static void __pyx_pf_3_sa_6BitSet_2__dealloc__(struct __pyx_obj_3_sa_BitSet *__p __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":126 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":126 * * def __dealloc__(self): * free(self.b) # <<<<<<<<<<<<<< @@ -19280,7 +19052,7 @@ static PyObject *__pyx_pw_3_sa_6BitSet_5__iter__(PyObject *__pyx_v_self) { return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":128 +/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":128 * free(self.b) * * def __iter__(self): # <<<<<<<<<<<<<< @@ -19298,7 +19070,7 @@ static PyObject *__pyx_pf_3_sa_6BitSet_4__iter__(struct __pyx_obj_3_sa_BitSet *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__iter__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":130 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":130 * def __iter__(self): * cdef BitSetIterator it * it = BitSetIterator() # <<<<<<<<<<<<<< @@ -19310,7 +19082,7 @@ static PyObject *__pyx_pf_3_sa_6BitSet_4__iter__(struct __pyx_obj_3_sa_BitSet *_ __pyx_v_it = ((struct __pyx_obj_3_sa_BitSetIterator *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":131 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":131 * cdef BitSetIterator it * it = BitSetIterator() * it.b = self.b # <<<<<<<<<<<<<< @@ -19319,7 +19091,7 @@ static PyObject *__pyx_pf_3_sa_6BitSet_4__iter__(struct __pyx_obj_3_sa_BitSet *_ */ __pyx_v_it->b = __pyx_v_self->b; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":132 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":132 * it = BitSetIterator() * it.b = self.b * it.next_val = self.b.min_val # <<<<<<<<<<<<<< @@ -19328,7 +19100,7 @@ static PyObject *__pyx_pf_3_sa_6BitSet_4__iter__(struct __pyx_obj_3_sa_BitSet *_ */ __pyx_v_it->next_val = __pyx_v_self->b->min_val; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":133 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":133 * it.b = self.b * it.next_val = self.b.min_val * return it # <<<<<<<<<<<<<< @@ -19364,7 +19136,7 @@ static PyObject *__pyx_pw_3_sa_6BitSet_7insert(PyObject *__pyx_v_self, PyObject return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":135 +/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":135 * return it * * def insert(self, i): # <<<<<<<<<<<<<< @@ -19382,7 +19154,7 @@ static PyObject *__pyx_pf_3_sa_6BitSet_6insert(struct __pyx_obj_3_sa_BitSet *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("insert", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":136 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":136 * * def insert(self, i): * return bitset_insert(self.b, i) # <<<<<<<<<<<<<< @@ -19420,7 +19192,7 @@ static PyObject *__pyx_pw_3_sa_6BitSet_9findsucc(PyObject *__pyx_v_self, PyObjec return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":138 +/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":138 * return bitset_insert(self.b, i) * * def findsucc(self, i): # <<<<<<<<<<<<<< @@ -19438,7 +19210,7 @@ static PyObject *__pyx_pf_3_sa_6BitSet_8findsucc(struct __pyx_obj_3_sa_BitSet *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("findsucc", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":139 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":139 * * def findsucc(self, i): * return bitset_findsucc(self.b, i) # <<<<<<<<<<<<<< @@ -19476,7 +19248,7 @@ static PyObject *__pyx_pw_3_sa_6BitSet_11__str__(PyObject *__pyx_v_self) { return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":141 +/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":141 * return bitset_findsucc(self.b, i) * * def __str__(self): # <<<<<<<<<<<<<< @@ -19495,7 +19267,7 @@ static PyObject *__pyx_pf_3_sa_6BitSet_10__str__(struct __pyx_obj_3_sa_BitSet *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__str__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":142 + /* "/home/paulb/workspace/cdec/python/src/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)+")" # <<<<<<<<<<<<<< @@ -19588,7 +19360,7 @@ static PyObject *__pyx_pw_3_sa_6BitSet_13min(PyObject *__pyx_v_self, CYTHON_UNUS return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":144 +/* "/home/paulb/workspace/cdec/python/src/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): # <<<<<<<<<<<<<< @@ -19605,7 +19377,7 @@ static PyObject *__pyx_pf_3_sa_6BitSet_12min(struct __pyx_obj_3_sa_BitSet *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("min", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":145 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":145 * * def min(self): * return self.b.min_val # <<<<<<<<<<<<<< @@ -19642,7 +19414,7 @@ static PyObject *__pyx_pw_3_sa_6BitSet_15max(PyObject *__pyx_v_self, CYTHON_UNUS return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":147 +/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":147 * return self.b.min_val * * def max(self): # <<<<<<<<<<<<<< @@ -19659,7 +19431,7 @@ static PyObject *__pyx_pf_3_sa_6BitSet_14max(struct __pyx_obj_3_sa_BitSet *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("max", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":148 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":148 * * def max(self): * return self.b.max_val # <<<<<<<<<<<<<< @@ -19696,7 +19468,7 @@ static Py_ssize_t __pyx_pw_3_sa_6BitSet_17__len__(PyObject *__pyx_v_self) { return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":150 +/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":150 * return self.b.max_val * * def __len__(self): # <<<<<<<<<<<<<< @@ -19709,7 +19481,7 @@ static Py_ssize_t __pyx_pf_3_sa_6BitSet_16__len__(struct __pyx_obj_3_sa_BitSet * __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":151 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":151 * * def __len__(self): * return self.b.size # <<<<<<<<<<<<<< @@ -19736,7 +19508,7 @@ static int __pyx_pw_3_sa_6BitSet_19__contains__(PyObject *__pyx_v_self, PyObject return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":153 +/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":153 * return self.b.size * * def __contains__(self, i): # <<<<<<<<<<<<<< @@ -19755,7 +19527,7 @@ static int __pyx_pf_3_sa_6BitSet_18__contains__(struct __pyx_obj_3_sa_BitSet *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__contains__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":154 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":154 * * def __contains__(self, i): * return bool(bitset_contains(self.b, i)) # <<<<<<<<<<<<<< @@ -19781,7 +19553,7 @@ static int __pyx_pf_3_sa_6BitSet_18__contains__(struct __pyx_obj_3_sa_BitSet *__ return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":157 +/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":157 * * * cdef str dec2bin(long i): # <<<<<<<<<<<<<< @@ -19803,7 +19575,7 @@ static PyObject *__pyx_f_3_sa_dec2bin(long __pyx_v_i) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("dec2bin", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":158 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":158 * * cdef str dec2bin(long i): * cdef str result = "" # <<<<<<<<<<<<<< @@ -19813,7 +19585,7 @@ static PyObject *__pyx_f_3_sa_dec2bin(long __pyx_v_i) { __Pyx_INCREF(((PyObject *)__pyx_kp_s_45)); __pyx_v_result = __pyx_kp_s_45; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":160 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":160 * cdef str result = "" * cdef unsigned d * for d in range(MIN_BOTTOM_SIZE): # <<<<<<<<<<<<<< @@ -19824,7 +19596,7 @@ static PyObject *__pyx_f_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/pauldb/workspace/cdec/python/src/sa/veb.pxi":161 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":161 * cdef unsigned d * for d in range(MIN_BOTTOM_SIZE): * if i & LOWER_MASK[0] == 0: # <<<<<<<<<<<<<< @@ -19834,7 +19606,7 @@ static PyObject *__pyx_f_3_sa_dec2bin(long __pyx_v_i) { __pyx_t_3 = ((__pyx_v_i & (__pyx_v_3_sa_LOWER_MASK[0])) == 0); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":162 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":162 * for d in range(MIN_BOTTOM_SIZE): * if i & LOWER_MASK[0] == 0: * result = "0"+result # <<<<<<<<<<<<<< @@ -19850,7 +19622,7 @@ static PyObject *__pyx_f_3_sa_dec2bin(long __pyx_v_i) { } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":164 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":164 * result = "0"+result * else: * result = "1"+result # <<<<<<<<<<<<<< @@ -19865,7 +19637,7 @@ static PyObject *__pyx_f_3_sa_dec2bin(long __pyx_v_i) { } __pyx_L5:; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":165 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":165 * else: * result = "1"+result * i = i >> 1 # <<<<<<<<<<<<<< @@ -19875,7 +19647,7 @@ static PyObject *__pyx_f_3_sa_dec2bin(long __pyx_v_i) { __pyx_v_i = (__pyx_v_i >> 1); } - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":166 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":166 * result = "1"+result * i = i >> 1 * return result # <<<<<<<<<<<<<< @@ -19900,7 +19672,7 @@ static PyObject *__pyx_f_3_sa_dec2bin(long __pyx_v_i) { return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":177 +/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":177 * void** bottom * * cdef _VEB* new_VEB(int n): # <<<<<<<<<<<<<< @@ -19921,7 +19693,7 @@ static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int __pyx_v_n) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("new_VEB", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":181 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":181 * cdef int num_bits, num_top_bits, i * * veb = <_VEB*> malloc(sizeof(_VEB)) # <<<<<<<<<<<<<< @@ -19930,7 +19702,7 @@ static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int __pyx_v_n) { */ __pyx_v_veb = ((struct __pyx_t_3_sa__VEB *)malloc((sizeof(struct __pyx_t_3_sa__VEB)))); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":183 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":183 * veb = <_VEB*> malloc(sizeof(_VEB)) * * num_bits = int(ceil(log(n) / log(2))) # <<<<<<<<<<<<<< @@ -19945,7 +19717,7 @@ static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int __pyx_v_n) { } __pyx_v_num_bits = ((int)ceil((__pyx_t_1 / __pyx_t_2))); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":184 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":184 * * num_bits = int(ceil(log(n) / log(2))) * veb.num_bottom_bits = num_bits/2 # <<<<<<<<<<<<<< @@ -19954,7 +19726,7 @@ static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int __pyx_v_n) { */ __pyx_v_veb->num_bottom_bits = __Pyx_div_long(__pyx_v_num_bits, 2); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":185 + /* "/home/paulb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -19964,7 +19736,7 @@ static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int __pyx_v_n) { __pyx_t_3 = (__pyx_v_veb->num_bottom_bits < __pyx_v_3_sa_MIN_BOTTOM_BITS); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":186 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -19976,7 +19748,7 @@ static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int __pyx_v_n) { } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":187 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -19985,7 +19757,7 @@ static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int __pyx_v_n) { */ __pyx_v_veb->top_universe_size = ((__pyx_v_n >> __pyx_v_veb->num_bottom_bits) + 1); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":189 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":189 * veb.top_universe_size = (n >> veb.num_bottom_bits) + 1 * * veb.bottom = malloc(veb.top_universe_size * sizeof(void*)) # <<<<<<<<<<<<<< @@ -19994,7 +19766,7 @@ static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int __pyx_v_n) { */ __pyx_v_veb->bottom = ((void **)malloc((__pyx_v_veb->top_universe_size * (sizeof(void *))))); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":190 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":190 * * veb.bottom = malloc(veb.top_universe_size * sizeof(void*)) * memset(veb.bottom, 0, veb.top_universe_size * sizeof(void*)) # <<<<<<<<<<<<<< @@ -20003,7 +19775,7 @@ static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int __pyx_v_n) { */ memset(__pyx_v_veb->bottom, 0, (__pyx_v_veb->top_universe_size * (sizeof(void *)))); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":192 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":192 * memset(veb.bottom, 0, veb.top_universe_size * sizeof(void*)) * * if veb.top_universe_size > MIN_BOTTOM_SIZE: # <<<<<<<<<<<<<< @@ -20013,7 +19785,7 @@ static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int __pyx_v_n) { __pyx_t_3 = (__pyx_v_veb->top_universe_size > __pyx_v_3_sa_MIN_BOTTOM_SIZE); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":193 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":193 * * if veb.top_universe_size > MIN_BOTTOM_SIZE: * veb.top = new_VEB(veb.top_universe_size) # <<<<<<<<<<<<<< @@ -20025,7 +19797,7 @@ static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int __pyx_v_n) { } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":195 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":195 * veb.top = new_VEB(veb.top_universe_size) * else: * veb.top = new_BitSet() # <<<<<<<<<<<<<< @@ -20036,7 +19808,7 @@ static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int __pyx_v_n) { } __pyx_L4:; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":197 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":197 * veb.top = new_BitSet() * * veb.max_val = -1 # <<<<<<<<<<<<<< @@ -20045,7 +19817,7 @@ static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int __pyx_v_n) { */ __pyx_v_veb->max_val = -1; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":198 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":198 * * veb.max_val = -1 * veb.min_val = -1 # <<<<<<<<<<<<<< @@ -20054,7 +19826,7 @@ static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int __pyx_v_n) { */ __pyx_v_veb->min_val = -1; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":199 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":199 * veb.max_val = -1 * veb.min_val = -1 * veb.size = 0 # <<<<<<<<<<<<<< @@ -20063,7 +19835,7 @@ static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int __pyx_v_n) { */ __pyx_v_veb->size = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":200 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":200 * veb.min_val = -1 * veb.size = 0 * return veb # <<<<<<<<<<<<<< @@ -20083,7 +19855,7 @@ static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int __pyx_v_n) { return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":203 +/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":203 * * * cdef int VEB_insert(_VEB* veb, int i): # <<<<<<<<<<<<<< @@ -20104,7 +19876,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ int __pyx_t_3; __Pyx_RefNannySetupContext("VEB_insert", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":208 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":208 * cdef int a, b, tmp * * if veb.size == 0: # <<<<<<<<<<<<<< @@ -20114,7 +19886,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ __pyx_t_1 = (__pyx_v_veb->size == 0); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":209 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":209 * * if veb.size == 0: * veb.min_val = i # <<<<<<<<<<<<<< @@ -20123,7 +19895,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ */ __pyx_v_veb->min_val = __pyx_v_i; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":210 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":210 * if veb.size == 0: * veb.min_val = i * veb.max_val = i # <<<<<<<<<<<<<< @@ -20134,7 +19906,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ goto __pyx_L3; } - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":211 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":211 * veb.min_val = i * veb.max_val = i * elif i == veb.min_val or i == veb.max_val: # <<<<<<<<<<<<<< @@ -20150,7 +19922,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ } if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":212 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":212 * veb.max_val = i * elif i == veb.min_val or i == veb.max_val: * return 0 # <<<<<<<<<<<<<< @@ -20163,7 +19935,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":214 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":214 * return 0 * else: * if i < veb.min_val: # <<<<<<<<<<<<<< @@ -20173,7 +19945,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ __pyx_t_3 = (__pyx_v_i < __pyx_v_veb->min_val); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":215 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":215 * else: * if i < veb.min_val: * tmp = i # <<<<<<<<<<<<<< @@ -20182,7 +19954,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ */ __pyx_v_tmp = __pyx_v_i; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":216 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":216 * if i < veb.min_val: * tmp = i * i = veb.min_val # <<<<<<<<<<<<<< @@ -20191,7 +19963,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ */ __pyx_v_i = __pyx_v_veb->min_val; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":217 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":217 * tmp = i * i = veb.min_val * veb.min_val = tmp # <<<<<<<<<<<<<< @@ -20203,7 +19975,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ } __pyx_L4:; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":218 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":218 * i = veb.min_val * veb.min_val = tmp * a = i >> veb.num_bottom_bits # <<<<<<<<<<<<<< @@ -20212,7 +19984,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ */ __pyx_v_a = (__pyx_v_i >> __pyx_v_veb->num_bottom_bits); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":219 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":219 * veb.min_val = tmp * a = i >> veb.num_bottom_bits * b = i & LOWER_MASK[veb.num_bottom_bits-1] # <<<<<<<<<<<<<< @@ -20221,7 +19993,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ */ __pyx_v_b = (__pyx_v_i & (__pyx_v_3_sa_LOWER_MASK[(__pyx_v_veb->num_bottom_bits - 1)])); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":220 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":220 * a = i >> veb.num_bottom_bits * b = i & LOWER_MASK[veb.num_bottom_bits-1] * if veb.bottom[a] == NULL: # <<<<<<<<<<<<<< @@ -20231,7 +20003,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ __pyx_t_3 = ((__pyx_v_veb->bottom[__pyx_v_a]) == NULL); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":221 + /* "/home/paulb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -20241,7 +20013,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ __pyx_t_3 = (__pyx_v_veb->top_universe_size > __pyx_v_3_sa_MIN_BOTTOM_SIZE); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":222 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":222 * if veb.bottom[a] == NULL: * if veb.top_universe_size > MIN_BOTTOM_SIZE: * subv = <_VEB*> veb.top # <<<<<<<<<<<<<< @@ -20250,7 +20022,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ */ __pyx_v_subv = ((struct __pyx_t_3_sa__VEB *)__pyx_v_veb->top); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":223 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":223 * if veb.top_universe_size > MIN_BOTTOM_SIZE: * subv = <_VEB*> veb.top * VEB_insert(subv, a) # <<<<<<<<<<<<<< @@ -20262,7 +20034,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":225 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":225 * VEB_insert(subv, a) * else: * subb = <_BitSet*> veb.top # <<<<<<<<<<<<<< @@ -20271,7 +20043,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ */ __pyx_v_subb = ((struct __pyx_t_3_sa__BitSet *)__pyx_v_veb->top); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":226 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":226 * else: * subb = <_BitSet*> veb.top * bitset_insert(subb, a) # <<<<<<<<<<<<<< @@ -20282,7 +20054,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ } __pyx_L6:; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":227 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":227 * subb = <_BitSet*> veb.top * bitset_insert(subb, a) * if veb.num_bottom_bits > MIN_BOTTOM_BITS: # <<<<<<<<<<<<<< @@ -20292,7 +20064,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ __pyx_t_3 = (__pyx_v_veb->num_bottom_bits > __pyx_v_3_sa_MIN_BOTTOM_BITS); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":228 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -20304,7 +20076,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":230 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":230 * veb.bottom[a] = new_VEB(1 << veb.num_bottom_bits) * else: * veb.bottom[a] = new_BitSet() # <<<<<<<<<<<<<< @@ -20318,7 +20090,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ } __pyx_L5:; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":231 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":231 * else: * veb.bottom[a] = new_BitSet() * if veb.num_bottom_bits > MIN_BOTTOM_BITS: # <<<<<<<<<<<<<< @@ -20328,7 +20100,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ __pyx_t_3 = (__pyx_v_veb->num_bottom_bits > __pyx_v_3_sa_MIN_BOTTOM_BITS); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":232 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":232 * veb.bottom[a] = new_BitSet() * if veb.num_bottom_bits > MIN_BOTTOM_BITS: * subv = <_VEB*> veb.bottom[a] # <<<<<<<<<<<<<< @@ -20337,7 +20109,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ */ __pyx_v_subv = ((struct __pyx_t_3_sa__VEB *)(__pyx_v_veb->bottom[__pyx_v_a])); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":233 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":233 * if veb.num_bottom_bits > MIN_BOTTOM_BITS: * subv = <_VEB*> veb.bottom[a] * if VEB_insert(subv, b) == 0: # <<<<<<<<<<<<<< @@ -20347,7 +20119,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ __pyx_t_3 = (__pyx_f_3_sa_VEB_insert(__pyx_v_subv, __pyx_v_b) == 0); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":234 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":234 * subv = <_VEB*> veb.bottom[a] * if VEB_insert(subv, b) == 0: * return 0 # <<<<<<<<<<<<<< @@ -20363,7 +20135,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":236 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":236 * return 0 * else: * subb = <_BitSet*> veb.bottom[a] # <<<<<<<<<<<<<< @@ -20372,7 +20144,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ */ __pyx_v_subb = ((struct __pyx_t_3_sa__BitSet *)(__pyx_v_veb->bottom[__pyx_v_a])); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":237 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":237 * else: * subb = <_BitSet*> veb.bottom[a] * if bitset_insert(subb, b) == 0: # <<<<<<<<<<<<<< @@ -20382,7 +20154,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ __pyx_t_3 = (__pyx_f_3_sa_bitset_insert(__pyx_v_subb, __pyx_v_b) == 0); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":238 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":238 * subb = <_BitSet*> veb.bottom[a] * if bitset_insert(subb, b) == 0: * return 0 # <<<<<<<<<<<<<< @@ -20397,7 +20169,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ } __pyx_L8:; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":240 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":240 * return 0 * * if i > veb.max_val: # <<<<<<<<<<<<<< @@ -20407,7 +20179,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ __pyx_t_3 = (__pyx_v_i > __pyx_v_veb->max_val); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":241 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":241 * * if i > veb.max_val: * veb.max_val = i # <<<<<<<<<<<<<< @@ -20421,7 +20193,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":242 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":242 * if i > veb.max_val: * veb.max_val = i * veb.size = veb.size + 1 # <<<<<<<<<<<<<< @@ -20430,7 +20202,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ */ __pyx_v_veb->size = (__pyx_v_veb->size + 1); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":243 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":243 * veb.max_val = i * veb.size = veb.size + 1 * return 1 # <<<<<<<<<<<<<< @@ -20446,7 +20218,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":246 +/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":246 * * * cdef del_VEB(_VEB* veb): # <<<<<<<<<<<<<< @@ -20465,7 +20237,7 @@ static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *__pyx_v_veb) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("del_VEB", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":249 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":249 * cdef int i * * if veb.top_universe_size > MIN_BOTTOM_SIZE: # <<<<<<<<<<<<<< @@ -20475,7 +20247,7 @@ static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *__pyx_v_veb) { __pyx_t_1 = (__pyx_v_veb->top_universe_size > __pyx_v_3_sa_MIN_BOTTOM_SIZE); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":250 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":250 * * if veb.top_universe_size > MIN_BOTTOM_SIZE: * i = (<_VEB*> veb.top).min_val # <<<<<<<<<<<<<< @@ -20487,7 +20259,7 @@ static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *__pyx_v_veb) { } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":252 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":252 * i = (<_VEB*> veb.top).min_val * else: * i = (<_BitSet*> veb.top).min_val # <<<<<<<<<<<<<< @@ -20498,7 +20270,7 @@ static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *__pyx_v_veb) { } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":254 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":254 * i = (<_BitSet*> veb.top).min_val * * while i != -1: # <<<<<<<<<<<<<< @@ -20509,7 +20281,7 @@ static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *__pyx_v_veb) { __pyx_t_1 = (__pyx_v_i != -1); if (!__pyx_t_1) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":255 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":255 * * while i != -1: * if veb.num_bottom_bits > MIN_BOTTOM_BITS: # <<<<<<<<<<<<<< @@ -20519,7 +20291,7 @@ static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *__pyx_v_veb) { __pyx_t_1 = (__pyx_v_veb->num_bottom_bits > __pyx_v_3_sa_MIN_BOTTOM_BITS); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":256 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":256 * while i != -1: * if veb.num_bottom_bits > MIN_BOTTOM_BITS: * del_VEB(<_VEB*> veb.bottom[i]) # <<<<<<<<<<<<<< @@ -20533,7 +20305,7 @@ static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *__pyx_v_veb) { } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":258 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":258 * del_VEB(<_VEB*> veb.bottom[i]) * else: * free(<_BitSet*> veb.bottom[i]) # <<<<<<<<<<<<<< @@ -20544,7 +20316,7 @@ static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *__pyx_v_veb) { } __pyx_L6:; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":260 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":260 * free(<_BitSet*> veb.bottom[i]) * * if veb.top_universe_size > MIN_BOTTOM_SIZE: # <<<<<<<<<<<<<< @@ -20554,7 +20326,7 @@ static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *__pyx_v_veb) { __pyx_t_1 = (__pyx_v_veb->top_universe_size > __pyx_v_3_sa_MIN_BOTTOM_SIZE); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":261 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":261 * * if veb.top_universe_size > MIN_BOTTOM_SIZE: * i = VEB_findsucc(<_VEB*> veb.top, i) # <<<<<<<<<<<<<< @@ -20566,7 +20338,7 @@ static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *__pyx_v_veb) { } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":263 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":263 * i = VEB_findsucc(<_VEB*> veb.top, i) * else: * i = bitset_findsucc(<_BitSet*> veb.top, i) # <<<<<<<<<<<<<< @@ -20578,7 +20350,7 @@ static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *__pyx_v_veb) { __pyx_L7:; } - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":265 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":265 * i = bitset_findsucc(<_BitSet*> veb.top, i) * * if veb.top_universe_size > MIN_BOTTOM_SIZE: # <<<<<<<<<<<<<< @@ -20588,7 +20360,7 @@ static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *__pyx_v_veb) { __pyx_t_1 = (__pyx_v_veb->top_universe_size > __pyx_v_3_sa_MIN_BOTTOM_SIZE); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":266 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":266 * * if veb.top_universe_size > MIN_BOTTOM_SIZE: * del_VEB(<_VEB*> veb.top) # <<<<<<<<<<<<<< @@ -20602,7 +20374,7 @@ static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *__pyx_v_veb) { } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":268 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":268 * del_VEB(<_VEB*> veb.top) * else: * free(<_BitSet*> veb.top) # <<<<<<<<<<<<<< @@ -20613,7 +20385,7 @@ static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *__pyx_v_veb) { } __pyx_L8:; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":269 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":269 * else: * free(<_BitSet*> veb.top) * free(veb.bottom) # <<<<<<<<<<<<<< @@ -20622,7 +20394,7 @@ static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *__pyx_v_veb) { */ free(__pyx_v_veb->bottom); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":270 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":270 * free(<_BitSet*> veb.top) * free(veb.bottom) * free(veb) # <<<<<<<<<<<<<< @@ -20643,7 +20415,7 @@ static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *__pyx_v_veb) { return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":273 +/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":273 * * * cdef int VEB_findsucc(_VEB* veb, int i): # <<<<<<<<<<<<<< @@ -20666,7 +20438,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int int __pyx_t_3; __Pyx_RefNannySetupContext("VEB_findsucc", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":278 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":278 * cdef int a, b, j, c, found * * if veb.max_val == -1 or i>=veb.max_val: # <<<<<<<<<<<<<< @@ -20682,7 +20454,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int } if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":279 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":279 * * if veb.max_val == -1 or i>=veb.max_val: * return -1 # <<<<<<<<<<<<<< @@ -20695,7 +20467,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":280 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":280 * if veb.max_val == -1 or i>=veb.max_val: * return -1 * if i < veb.min_val: # <<<<<<<<<<<<<< @@ -20705,7 +20477,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __pyx_t_3 = (__pyx_v_i < __pyx_v_veb->min_val); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":281 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":281 * return -1 * if i < veb.min_val: * return veb.min_val # <<<<<<<<<<<<<< @@ -20718,7 +20490,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int } __pyx_L4:; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":283 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":283 * return veb.min_val * * a = i >> veb.num_bottom_bits # <<<<<<<<<<<<<< @@ -20727,7 +20499,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int */ __pyx_v_a = (__pyx_v_i >> __pyx_v_veb->num_bottom_bits); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":284 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":284 * * a = i >> veb.num_bottom_bits * b = i & LOWER_MASK[veb.num_bottom_bits-1] # <<<<<<<<<<<<<< @@ -20736,7 +20508,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int */ __pyx_v_b = (__pyx_v_i & (__pyx_v_3_sa_LOWER_MASK[(__pyx_v_veb->num_bottom_bits - 1)])); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":285 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":285 * a = i >> veb.num_bottom_bits * b = i & LOWER_MASK[veb.num_bottom_bits-1] * found = 0 # <<<<<<<<<<<<<< @@ -20745,7 +20517,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int */ __pyx_v_found = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":286 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":286 * b = i & LOWER_MASK[veb.num_bottom_bits-1] * found = 0 * if veb.bottom[a] != NULL: # <<<<<<<<<<<<<< @@ -20755,7 +20527,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __pyx_t_3 = ((__pyx_v_veb->bottom[__pyx_v_a]) != NULL); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":287 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":287 * found = 0 * if veb.bottom[a] != NULL: * if veb.num_bottom_bits > MIN_BOTTOM_BITS: # <<<<<<<<<<<<<< @@ -20765,7 +20537,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __pyx_t_3 = (__pyx_v_veb->num_bottom_bits > __pyx_v_3_sa_MIN_BOTTOM_BITS); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":288 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":288 * if veb.bottom[a] != NULL: * if veb.num_bottom_bits > MIN_BOTTOM_BITS: * subv = <_VEB*> veb.bottom[a] # <<<<<<<<<<<<<< @@ -20774,7 +20546,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int */ __pyx_v_subv = ((struct __pyx_t_3_sa__VEB *)(__pyx_v_veb->bottom[__pyx_v_a])); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":289 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":289 * if veb.num_bottom_bits > MIN_BOTTOM_BITS: * subv = <_VEB*> veb.bottom[a] * if subv.max_val > b: # <<<<<<<<<<<<<< @@ -20784,7 +20556,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __pyx_t_3 = (__pyx_v_subv->max_val > __pyx_v_b); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":290 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":290 * subv = <_VEB*> veb.bottom[a] * if subv.max_val > b: * j = (a << veb.num_bottom_bits) + VEB_findsucc(subv, b) # <<<<<<<<<<<<<< @@ -20793,7 +20565,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int */ __pyx_v_j = ((__pyx_v_a << __pyx_v_veb->num_bottom_bits) + __pyx_f_3_sa_VEB_findsucc(__pyx_v_subv, __pyx_v_b)); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":291 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":291 * if subv.max_val > b: * j = (a << veb.num_bottom_bits) + VEB_findsucc(subv, b) * found = 1 # <<<<<<<<<<<<<< @@ -20808,7 +20580,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":293 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":293 * found = 1 * else: * subb = <_BitSet*> veb.bottom[a] # <<<<<<<<<<<<<< @@ -20817,7 +20589,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int */ __pyx_v_subb = ((struct __pyx_t_3_sa__BitSet *)(__pyx_v_veb->bottom[__pyx_v_a])); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":294 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":294 * else: * subb = <_BitSet*> veb.bottom[a] * if subb.max_val > b: # <<<<<<<<<<<<<< @@ -20827,7 +20599,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __pyx_t_3 = (__pyx_v_subb->max_val > __pyx_v_b); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":295 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":295 * subb = <_BitSet*> veb.bottom[a] * if subb.max_val > b: * j = (a << veb.num_bottom_bits) + bitset_findsucc(subb, b) # <<<<<<<<<<<<<< @@ -20836,7 +20608,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int */ __pyx_v_j = ((__pyx_v_a << __pyx_v_veb->num_bottom_bits) + __pyx_f_3_sa_bitset_findsucc(__pyx_v_subb, __pyx_v_b)); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":296 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":296 * if subb.max_val > b: * j = (a << veb.num_bottom_bits) + bitset_findsucc(subb, b) * found = 1 # <<<<<<<<<<<<<< @@ -20853,7 +20625,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int } __pyx_L5:; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":297 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":297 * j = (a << veb.num_bottom_bits) + bitset_findsucc(subb, b) * found = 1 * if found==0: # <<<<<<<<<<<<<< @@ -20863,7 +20635,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __pyx_t_3 = (__pyx_v_found == 0); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":298 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":298 * found = 1 * if found==0: * if veb.top_universe_size > MIN_BOTTOM_SIZE: # <<<<<<<<<<<<<< @@ -20873,7 +20645,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __pyx_t_3 = (__pyx_v_veb->top_universe_size > __pyx_v_3_sa_MIN_BOTTOM_SIZE); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":299 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":299 * if found==0: * if veb.top_universe_size > MIN_BOTTOM_SIZE: * subv = <_VEB*> veb.top # <<<<<<<<<<<<<< @@ -20882,7 +20654,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int */ __pyx_v_subv = ((struct __pyx_t_3_sa__VEB *)__pyx_v_veb->top); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":300 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":300 * if veb.top_universe_size > MIN_BOTTOM_SIZE: * subv = <_VEB*> veb.top * c = VEB_findsucc(subv, a) # <<<<<<<<<<<<<< @@ -20894,7 +20666,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":302 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":302 * c = VEB_findsucc(subv, a) * else: * subb = <_BitSet*> veb.top # <<<<<<<<<<<<<< @@ -20903,7 +20675,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int */ __pyx_v_subb = ((struct __pyx_t_3_sa__BitSet *)__pyx_v_veb->top); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":303 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":303 * else: * subb = <_BitSet*> veb.top * c = bitset_findsucc(subb, a) # <<<<<<<<<<<<<< @@ -20914,7 +20686,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int } __pyx_L10:; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":304 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":304 * subb = <_BitSet*> veb.top * c = bitset_findsucc(subb, a) * if veb.num_bottom_bits > MIN_BOTTOM_BITS: # <<<<<<<<<<<<<< @@ -20924,7 +20696,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __pyx_t_3 = (__pyx_v_veb->num_bottom_bits > __pyx_v_3_sa_MIN_BOTTOM_BITS); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":305 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":305 * c = bitset_findsucc(subb, a) * if veb.num_bottom_bits > MIN_BOTTOM_BITS: * subv = <_VEB*> veb.bottom[c] # <<<<<<<<<<<<<< @@ -20933,7 +20705,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int */ __pyx_v_subv = ((struct __pyx_t_3_sa__VEB *)(__pyx_v_veb->bottom[__pyx_v_c])); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":306 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -20945,7 +20717,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":308 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":308 * j = (c << veb.num_bottom_bits) + subv.min_val * else: * subb = <_BitSet*> veb.bottom[c] # <<<<<<<<<<<<<< @@ -20954,7 +20726,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int */ __pyx_v_subb = ((struct __pyx_t_3_sa__BitSet *)(__pyx_v_veb->bottom[__pyx_v_c])); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":309 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":309 * else: * subb = <_BitSet*> veb.bottom[c] * j = (c << veb.num_bottom_bits) + subb.min_val # <<<<<<<<<<<<<< @@ -20968,7 +20740,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int } __pyx_L9:; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":310 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":310 * subb = <_BitSet*> veb.bottom[c] * j = (c << veb.num_bottom_bits) + subb.min_val * return j # <<<<<<<<<<<<<< @@ -20984,7 +20756,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":313 +/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":313 * * * cdef int VEB_contains(_VEB* veb, int i): # <<<<<<<<<<<<<< @@ -21005,7 +20777,7 @@ static int __pyx_f_3_sa_VEB_contains(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int int __pyx_t_4; __Pyx_RefNannySetupContext("VEB_contains", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":318 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":318 * cdef int a, b * * if veb.size == 0 or i < veb.min_val or i > veb.max_val: # <<<<<<<<<<<<<< @@ -21027,7 +20799,7 @@ static int __pyx_f_3_sa_VEB_contains(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int } if (__pyx_t_2) { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":319 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":319 * * if veb.size == 0 or i < veb.min_val or i > veb.max_val: * return 0 # <<<<<<<<<<<<<< @@ -21040,7 +20812,7 @@ static int __pyx_f_3_sa_VEB_contains(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":321 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":321 * return 0 * * if veb.min_val == i: # <<<<<<<<<<<<<< @@ -21050,7 +20822,7 @@ static int __pyx_f_3_sa_VEB_contains(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __pyx_t_2 = (__pyx_v_veb->min_val == __pyx_v_i); if (__pyx_t_2) { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":322 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":322 * * if veb.min_val == i: * return 1 # <<<<<<<<<<<<<< @@ -21063,7 +20835,7 @@ static int __pyx_f_3_sa_VEB_contains(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":324 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":324 * return 1 * else: * if veb.size == 1: # <<<<<<<<<<<<<< @@ -21073,7 +20845,7 @@ static int __pyx_f_3_sa_VEB_contains(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __pyx_t_2 = (__pyx_v_veb->size == 1); if (__pyx_t_2) { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":325 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":325 * else: * if veb.size == 1: * return 0 # <<<<<<<<<<<<<< @@ -21088,7 +20860,7 @@ static int __pyx_f_3_sa_VEB_contains(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int } __pyx_L4:; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":327 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":327 * return 0 * * a = i >> veb.num_bottom_bits # <<<<<<<<<<<<<< @@ -21097,7 +20869,7 @@ static int __pyx_f_3_sa_VEB_contains(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int */ __pyx_v_a = (__pyx_v_i >> __pyx_v_veb->num_bottom_bits); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":328 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":328 * * a = i >> veb.num_bottom_bits * b = i & LOWER_MASK[veb.num_bottom_bits-1] # <<<<<<<<<<<<<< @@ -21106,7 +20878,7 @@ static int __pyx_f_3_sa_VEB_contains(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int */ __pyx_v_b = (__pyx_v_i & (__pyx_v_3_sa_LOWER_MASK[(__pyx_v_veb->num_bottom_bits - 1)])); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":329 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":329 * a = i >> veb.num_bottom_bits * b = i & LOWER_MASK[veb.num_bottom_bits-1] * if veb.bottom[a] == NULL: # <<<<<<<<<<<<<< @@ -21116,7 +20888,7 @@ static int __pyx_f_3_sa_VEB_contains(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __pyx_t_2 = ((__pyx_v_veb->bottom[__pyx_v_a]) == NULL); if (__pyx_t_2) { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":330 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":330 * b = i & LOWER_MASK[veb.num_bottom_bits-1] * if veb.bottom[a] == NULL: * return 0 # <<<<<<<<<<<<<< @@ -21129,7 +20901,7 @@ static int __pyx_f_3_sa_VEB_contains(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":332 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":332 * return 0 * else: * if veb.num_bottom_bits > MIN_BOTTOM_BITS: # <<<<<<<<<<<<<< @@ -21139,7 +20911,7 @@ static int __pyx_f_3_sa_VEB_contains(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __pyx_t_2 = (__pyx_v_veb->num_bottom_bits > __pyx_v_3_sa_MIN_BOTTOM_BITS); if (__pyx_t_2) { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":333 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":333 * else: * if veb.num_bottom_bits > MIN_BOTTOM_BITS: * subv = <_VEB*> veb.bottom[a] # <<<<<<<<<<<<<< @@ -21148,7 +20920,7 @@ static int __pyx_f_3_sa_VEB_contains(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int */ __pyx_v_subv = ((struct __pyx_t_3_sa__VEB *)(__pyx_v_veb->bottom[__pyx_v_a])); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":334 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":334 * if veb.num_bottom_bits > MIN_BOTTOM_BITS: * subv = <_VEB*> veb.bottom[a] * return VEB_contains(subv, b) # <<<<<<<<<<<<<< @@ -21161,7 +20933,7 @@ static int __pyx_f_3_sa_VEB_contains(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":336 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":336 * return VEB_contains(subv, b) * else: * subb = <_BitSet*> veb.bottom[a] # <<<<<<<<<<<<<< @@ -21170,7 +20942,7 @@ static int __pyx_f_3_sa_VEB_contains(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int */ __pyx_v_subb = ((struct __pyx_t_3_sa__BitSet *)(__pyx_v_veb->bottom[__pyx_v_a])); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":337 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":337 * else: * subb = <_BitSet*> veb.bottom[a] * return bitset_contains(subb, b) # <<<<<<<<<<<<<< @@ -21201,7 +20973,7 @@ static PyObject *__pyx_pw_3_sa_11VEBIterator_1__next__(PyObject *__pyx_v_self) { return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":344 +/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":344 * cdef int next_val * * def __next__(self): # <<<<<<<<<<<<<< @@ -21220,7 +20992,7 @@ static PyObject *__pyx_pf_3_sa_11VEBIterator___next__(struct __pyx_obj_3_sa_VEBI int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__next__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":347 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":347 * cdef int ret_val * * if self.next_val == -1: # <<<<<<<<<<<<<< @@ -21230,7 +21002,7 @@ static PyObject *__pyx_pf_3_sa_11VEBIterator___next__(struct __pyx_obj_3_sa_VEBI __pyx_t_1 = (__pyx_v_self->next_val == -1); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":348 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":348 * * if self.next_val == -1: * raise StopIteration() # <<<<<<<<<<<<<< @@ -21246,7 +21018,7 @@ static PyObject *__pyx_pf_3_sa_11VEBIterator___next__(struct __pyx_obj_3_sa_VEBI } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":349 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":349 * if self.next_val == -1: * raise StopIteration() * ret_val = self.next_val # <<<<<<<<<<<<<< @@ -21255,7 +21027,7 @@ static PyObject *__pyx_pf_3_sa_11VEBIterator___next__(struct __pyx_obj_3_sa_VEBI */ __pyx_v_ret_val = __pyx_v_self->next_val; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":350 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":350 * raise StopIteration() * ret_val = self.next_val * self.next_val = VEB_findsucc(self.v, ret_val) # <<<<<<<<<<<<<< @@ -21264,7 +21036,7 @@ static PyObject *__pyx_pf_3_sa_11VEBIterator___next__(struct __pyx_obj_3_sa_VEBI */ __pyx_v_self->next_val = __pyx_f_3_sa_VEB_findsucc(__pyx_v_self->v, __pyx_v_ret_val); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":351 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":351 * ret_val = self.next_val * self.next_val = VEB_findsucc(self.v, ret_val) * return ret_val # <<<<<<<<<<<<<< @@ -21294,11 +21066,11 @@ static PyObject *__pyx_pf_3_sa_11VEBIterator___next__(struct __pyx_obj_3_sa_VEBI static int __pyx_pw_3_sa_3VEB_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_3_sa_3VEB_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_v_size; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__size,0}; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__size,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -21311,7 +21083,8 @@ static int __pyx_pw_3_sa_3VEB_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx 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--; + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size); + if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { @@ -21337,7 +21110,7 @@ static int __pyx_pw_3_sa_3VEB_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":360 +/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":360 * cdef int _first(self) * * def __cinit__(self, int size): # <<<<<<<<<<<<<< @@ -21350,7 +21123,7 @@ static int __pyx_pf_3_sa_3VEB___cinit__(struct __pyx_obj_3_sa_VEB *__pyx_v_self, __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":361 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":361 * * def __cinit__(self, int size): * self.veb = new_VEB(size) # <<<<<<<<<<<<<< @@ -21373,7 +21146,7 @@ static void __pyx_pw_3_sa_3VEB_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyFinishContext(); } -/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":363 +/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":363 * self.veb = new_VEB(size) * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -21389,7 +21162,7 @@ static void __pyx_pf_3_sa_3VEB_2__dealloc__(struct __pyx_obj_3_sa_VEB *__pyx_v_s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":364 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":364 * * def __dealloc__(self): * del_VEB(self.veb) # <<<<<<<<<<<<<< @@ -21419,7 +21192,7 @@ static PyObject *__pyx_pw_3_sa_3VEB_5__iter__(PyObject *__pyx_v_self) { return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":366 +/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":366 * del_VEB(self.veb) * * def __iter__(self): # <<<<<<<<<<<<<< @@ -21437,7 +21210,7 @@ static PyObject *__pyx_pf_3_sa_3VEB_4__iter__(struct __pyx_obj_3_sa_VEB *__pyx_v int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__iter__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":368 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":368 * def __iter__(self): * cdef VEBIterator it * it = VEBIterator() # <<<<<<<<<<<<<< @@ -21449,7 +21222,7 @@ static PyObject *__pyx_pf_3_sa_3VEB_4__iter__(struct __pyx_obj_3_sa_VEB *__pyx_v __pyx_v_it = ((struct __pyx_obj_3_sa_VEBIterator *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":369 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":369 * cdef VEBIterator it * it = VEBIterator() * it.v = self.veb # <<<<<<<<<<<<<< @@ -21458,7 +21231,7 @@ static PyObject *__pyx_pf_3_sa_3VEB_4__iter__(struct __pyx_obj_3_sa_VEB *__pyx_v */ __pyx_v_it->v = __pyx_v_self->veb; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":370 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":370 * it = VEBIterator() * it.v = self.veb * it.next_val = self.veb.min_val # <<<<<<<<<<<<<< @@ -21467,7 +21240,7 @@ static PyObject *__pyx_pf_3_sa_3VEB_4__iter__(struct __pyx_obj_3_sa_VEB *__pyx_v */ __pyx_v_it->next_val = __pyx_v_self->veb->min_val; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":371 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":371 * it.v = self.veb * it.next_val = self.veb.min_val * return it # <<<<<<<<<<<<<< @@ -21503,7 +21276,7 @@ static PyObject *__pyx_pw_3_sa_3VEB_7insert(PyObject *__pyx_v_self, PyObject *__ return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":373 +/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":373 * return it * * def insert(self, i): # <<<<<<<<<<<<<< @@ -21521,7 +21294,7 @@ static PyObject *__pyx_pf_3_sa_3VEB_6insert(struct __pyx_obj_3_sa_VEB *__pyx_v_s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("insert", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":374 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":374 * * def insert(self, i): * return VEB_insert(self.veb, i) # <<<<<<<<<<<<<< @@ -21548,7 +21321,7 @@ static PyObject *__pyx_pf_3_sa_3VEB_6insert(struct __pyx_obj_3_sa_VEB *__pyx_v_s return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":376 +/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":376 * return VEB_insert(self.veb, i) * * cdef int _insert(self, int i): # <<<<<<<<<<<<<< @@ -21561,7 +21334,7 @@ static int __pyx_f_3_sa_3VEB__insert(struct __pyx_obj_3_sa_VEB *__pyx_v_self, in __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_insert", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":377 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":377 * * cdef int _insert(self, int i): * return VEB_insert(self.veb, i) # <<<<<<<<<<<<<< @@ -21588,7 +21361,7 @@ static PyObject *__pyx_pw_3_sa_3VEB_9findsucc(PyObject *__pyx_v_self, PyObject * return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":379 +/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":379 * return VEB_insert(self.veb, i) * * def findsucc(self, i): # <<<<<<<<<<<<<< @@ -21606,7 +21379,7 @@ static PyObject *__pyx_pf_3_sa_3VEB_8findsucc(struct __pyx_obj_3_sa_VEB *__pyx_v int __pyx_clineno = 0; __Pyx_RefNannySetupContext("findsucc", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":380 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":380 * * def findsucc(self, i): * return VEB_findsucc(self.veb, i) # <<<<<<<<<<<<<< @@ -21633,7 +21406,7 @@ static PyObject *__pyx_pf_3_sa_3VEB_8findsucc(struct __pyx_obj_3_sa_VEB *__pyx_v return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":382 +/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":382 * return VEB_findsucc(self.veb, i) * * cdef int _first(self): # <<<<<<<<<<<<<< @@ -21646,7 +21419,7 @@ static int __pyx_f_3_sa_3VEB__first(struct __pyx_obj_3_sa_VEB *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_first", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":383 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":383 * * cdef int _first(self): * return self.veb.min_val # <<<<<<<<<<<<<< @@ -21662,7 +21435,7 @@ static int __pyx_f_3_sa_3VEB__first(struct __pyx_obj_3_sa_VEB *__pyx_v_self) { return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":385 +/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":385 * return self.veb.min_val * * cdef int _findsucc(self, int i): # <<<<<<<<<<<<<< @@ -21675,7 +21448,7 @@ static int __pyx_f_3_sa_3VEB__findsucc(struct __pyx_obj_3_sa_VEB *__pyx_v_self, __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_findsucc", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":386 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":386 * * cdef int _findsucc(self, int i): * return VEB_findsucc(self.veb, i) # <<<<<<<<<<<<<< @@ -21702,7 +21475,7 @@ static Py_ssize_t __pyx_pw_3_sa_3VEB_11__len__(PyObject *__pyx_v_self) { return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":388 +/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":388 * return VEB_findsucc(self.veb, i) * * def __len__(self): # <<<<<<<<<<<<<< @@ -21715,7 +21488,7 @@ static Py_ssize_t __pyx_pf_3_sa_3VEB_10__len__(struct __pyx_obj_3_sa_VEB *__pyx_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":389 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":389 * * def __len__(self): * return self.veb.size # <<<<<<<<<<<<<< @@ -21742,7 +21515,7 @@ static int __pyx_pw_3_sa_3VEB_13__contains__(PyObject *__pyx_v_self, PyObject *_ return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":391 +/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":391 * return self.veb.size * * def __contains__(self, i): # <<<<<<<<<<<<<< @@ -21758,7 +21531,7 @@ static int __pyx_pf_3_sa_3VEB_12__contains__(struct __pyx_obj_3_sa_VEB *__pyx_v_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__contains__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":392 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":392 * * def __contains__(self, i): * return VEB_contains(self.veb, i) # <<<<<<<<<<<<<< @@ -21781,11 +21554,11 @@ static int __pyx_pf_3_sa_3VEB_12__contains__(struct __pyx_obj_3_sa_VEB *__pyx_v_ static int __pyx_pw_3_sa_3LCP_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_3_sa_3LCP_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_3_sa_SuffixArray *__pyx_v_sa = 0; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__sa,0}; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__sa,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -21798,7 +21571,8 @@ static int __pyx_pw_3_sa_3LCP_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx 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--; + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sa); + if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { @@ -21829,7 +21603,7 @@ static int __pyx_pw_3_sa_3LCP_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":9 +/* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":9 * cdef IntList lcp * * def __cinit__(self, SuffixArray sa): # <<<<<<<<<<<<<< @@ -21858,7 +21632,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self, int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":13 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":13 * cdef IntList rank * * logger.info("Constructing LCP array") # <<<<<<<<<<<<<< @@ -21875,7 +21649,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self, __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":14 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":14 * * logger.info("Constructing LCP array") * self.sa = sa # <<<<<<<<<<<<<< @@ -21888,7 +21662,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self, __Pyx_DECREF(((PyObject *)__pyx_v_self->sa)); __pyx_v_self->sa = __pyx_v_sa; - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":15 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":15 * logger.info("Constructing LCP array") * self.sa = sa * n = self.sa.sa.len # <<<<<<<<<<<<<< @@ -21897,7 +21671,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self, */ __pyx_v_n = __pyx_v_self->sa->sa->len; - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":16 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":16 * self.sa = sa * n = self.sa.sa.len * self.lcp = IntList(initial_len=n) # <<<<<<<<<<<<<< @@ -21919,7 +21693,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self, __pyx_v_self->lcp = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":18 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":18 * self.lcp = IntList(initial_len=n) * * rank = IntList(initial_len=n) # <<<<<<<<<<<<<< @@ -21938,7 +21712,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self, __pyx_v_rank = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":19 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":19 * * rank = IntList(initial_len=n) * for i from 0 <= i < n: # <<<<<<<<<<<<<< @@ -21948,7 +21722,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self, __pyx_t_3 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":20 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":20 * rank = IntList(initial_len=n) * for i from 0 <= i < n: * rank.arr[sa.sa.arr[i]] = i # <<<<<<<<<<<<<< @@ -21958,7 +21732,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self, (__pyx_v_rank->arr[(__pyx_v_sa->sa->arr[__pyx_v_i])]) = __pyx_v_i; } - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":22 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":22 * rank.arr[sa.sa.arr[i]] = i * * h = 0 # <<<<<<<<<<<<<< @@ -21967,7 +21741,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self, */ __pyx_v_h = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":23 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":23 * * h = 0 * for i from 0 <= i < n: # <<<<<<<<<<<<<< @@ -21977,7 +21751,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self, __pyx_t_3 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":24 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":24 * h = 0 * for i from 0 <= i < n: * k = rank.arr[i] # <<<<<<<<<<<<<< @@ -21986,7 +21760,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self, */ __pyx_v_k = (__pyx_v_rank->arr[__pyx_v_i]); - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":25 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":25 * for i from 0 <= i < n: * k = rank.arr[i] * if k == 0: # <<<<<<<<<<<<<< @@ -21996,7 +21770,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self, __pyx_t_4 = (__pyx_v_k == 0); if (__pyx_t_4) { - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":26 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":26 * k = rank.arr[i] * if k == 0: * self.lcp.arr[k] = -1 # <<<<<<<<<<<<<< @@ -22008,7 +21782,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self, } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":28 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":28 * self.lcp.arr[k] = -1 * else: * j = sa.sa.arr[k-1] # <<<<<<<<<<<<<< @@ -22017,7 +21791,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self, */ __pyx_v_j = (__pyx_v_sa->sa->arr[(__pyx_v_k - 1)]); - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":29 + /* "/home/paulb/workspace/cdec/python/src/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]: # <<<<<<<<<<<<<< @@ -22040,7 +21814,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self, } if (!__pyx_t_5) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":30 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -22050,7 +21824,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self, __pyx_v_h = (__pyx_v_h + 1); } - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":31 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -22061,7 +21835,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self, } __pyx_L7:; - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":32 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":32 * h = h+1 * self.lcp.arr[k] = h * if h > 0: # <<<<<<<<<<<<<< @@ -22071,7 +21845,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self, __pyx_t_5 = (__pyx_v_h > 0); if (__pyx_t_5) { - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":33 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":33 * self.lcp.arr[k] = h * if h > 0: * h = h-1 # <<<<<<<<<<<<<< @@ -22084,7 +21858,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self, __pyx_L10:; } - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":34 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":34 * if h > 0: * h = h-1 * logger.info("LCP array completed") # <<<<<<<<<<<<<< @@ -22137,7 +21911,7 @@ static PyObject *__pyx_pw_3_sa_3LCP_3compute_stats(PyObject *__pyx_v_self, PyObj return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":36 +/* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":36 * logger.info("LCP array completed") * * def compute_stats(self, int max_n): # <<<<<<<<<<<<<< @@ -22208,7 +21982,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen __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/pauldb/workspace/cdec/python/src/sa/lcp.pxi":48 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":48 * cdef VEB veb * * N = self.sa.sa.len # <<<<<<<<<<<<<< @@ -22217,7 +21991,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen */ __pyx_cur_scope->__pyx_v_N = __pyx_cur_scope->__pyx_v_self->sa->sa->len; - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":50 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":50 * N = self.sa.sa.len * * ngram_starts = [] # <<<<<<<<<<<<<< @@ -22230,7 +22004,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen __pyx_cur_scope->__pyx_v_ngram_starts = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":51 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":51 * * ngram_starts = [] * for n from 0 <= n < max_n: # <<<<<<<<<<<<<< @@ -22240,7 +22014,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen __pyx_t_2 = __pyx_cur_scope->__pyx_v_max_n; for (__pyx_cur_scope->__pyx_v_n = 0; __pyx_cur_scope->__pyx_v_n < __pyx_t_2; __pyx_cur_scope->__pyx_v_n++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":52 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":52 * ngram_starts = [] * for n from 0 <= n < max_n: * ngram_starts.append(IntList(initial_len=N)) # <<<<<<<<<<<<<< @@ -22260,7 +22034,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":54 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":54 * ngram_starts.append(IntList(initial_len=N)) * * run_start = IntList(initial_len=max_n) # <<<<<<<<<<<<<< @@ -22280,7 +22054,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen __pyx_cur_scope->__pyx_v_run_start = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":55 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":55 * * run_start = IntList(initial_len=max_n) * veb = VEB(N) # <<<<<<<<<<<<<< @@ -22301,7 +22075,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen __pyx_cur_scope->__pyx_v_veb = ((struct __pyx_obj_3_sa_VEB *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":57 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":57 * veb = VEB(N) * * for i from 0 <= i < N: # <<<<<<<<<<<<<< @@ -22311,7 +22085,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen __pyx_t_2 = __pyx_cur_scope->__pyx_v_N; for (__pyx_cur_scope->__pyx_v_i = 0; __pyx_cur_scope->__pyx_v_i < __pyx_t_2; __pyx_cur_scope->__pyx_v_i++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":58 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":58 * * for i from 0 <= i < N: * h = self.lcp.arr[i] # <<<<<<<<<<<<<< @@ -22320,7 +22094,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen */ __pyx_cur_scope->__pyx_v_h = (__pyx_cur_scope->__pyx_v_self->lcp->arr[__pyx_cur_scope->__pyx_v_i]); - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":59 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":59 * for i from 0 <= i < N: * h = self.lcp.arr[i] * if h < 0: # <<<<<<<<<<<<<< @@ -22330,7 +22104,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen __pyx_t_5 = (__pyx_cur_scope->__pyx_v_h < 0); if (__pyx_t_5) { - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":60 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":60 * h = self.lcp.arr[i] * if h < 0: * h = 0 # <<<<<<<<<<<<<< @@ -22342,7 +22116,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen } __pyx_L8:; - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":61 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":61 * if h < 0: * h = 0 * for n from h <= n < max_n: # <<<<<<<<<<<<<< @@ -22352,7 +22126,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen __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/pauldb/workspace/cdec/python/src/sa/lcp.pxi":62 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":62 * h = 0 * for n from h <= n < max_n: * rs = run_start.arr[n] # <<<<<<<<<<<<<< @@ -22361,7 +22135,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen */ __pyx_cur_scope->__pyx_v_rs = (__pyx_cur_scope->__pyx_v_run_start->arr[__pyx_cur_scope->__pyx_v_n]); - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":63 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":63 * for n from h <= n < max_n: * rs = run_start.arr[n] * run_start.arr[n] = i # <<<<<<<<<<<<<< @@ -22370,7 +22144,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen */ (__pyx_cur_scope->__pyx_v_run_start->arr[__pyx_cur_scope->__pyx_v_n]) = __pyx_cur_scope->__pyx_v_i; - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":64 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":64 * rs = run_start.arr[n] * run_start.arr[n] = i * freq = i - rs # <<<<<<<<<<<<<< @@ -22379,7 +22153,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen */ __pyx_cur_scope->__pyx_v_freq = (__pyx_cur_scope->__pyx_v_i - __pyx_cur_scope->__pyx_v_rs); - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":65 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":65 * run_start.arr[n] = i * freq = i - rs * if freq > 1000: # arbitrary, but see note below # <<<<<<<<<<<<<< @@ -22389,7 +22163,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen __pyx_t_5 = (__pyx_cur_scope->__pyx_v_freq > 1000); if (__pyx_t_5) { - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":66 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":66 * freq = i - rs * if freq > 1000: # arbitrary, but see note below * veb._insert(freq) # <<<<<<<<<<<<<< @@ -22398,7 +22172,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen */ ((struct __pyx_vtabstruct_3_sa_VEB *)__pyx_cur_scope->__pyx_v_veb->__pyx_vtab)->_insert(__pyx_cur_scope->__pyx_v_veb, __pyx_cur_scope->__pyx_v_freq); - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":67 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":67 * if freq > 1000: # arbitrary, but see note below * veb._insert(freq) * ngram_start = ngram_starts[n] # <<<<<<<<<<<<<< @@ -22414,7 +22188,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen __pyx_cur_scope->__pyx_v_ngram_start = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":68 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":68 * veb._insert(freq) * ngram_start = ngram_starts[n] * while ngram_start.arr[freq] > 0: # <<<<<<<<<<<<<< @@ -22425,7 +22199,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen __pyx_t_5 = ((__pyx_cur_scope->__pyx_v_ngram_start->arr[__pyx_cur_scope->__pyx_v_freq]) > 0); if (!__pyx_t_5) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":69 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -22435,7 +22209,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen __pyx_cur_scope->__pyx_v_freq = (__pyx_cur_scope->__pyx_v_freq + 1); } - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":70 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -22449,7 +22223,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen } } - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":71 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -22458,7 +22232,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen */ __pyx_cur_scope->__pyx_v_i = __pyx_cur_scope->__pyx_v_veb->veb->min_val; - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":72 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":72 * ngram_start.arr[freq] = rs * i = veb.veb.min_val * while i != -1: # <<<<<<<<<<<<<< @@ -22469,7 +22243,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen __pyx_t_5 = (__pyx_cur_scope->__pyx_v_i != -1); if (!__pyx_t_5) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":73 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":73 * i = veb.veb.min_val * while i != -1: * ii = veb._findsucc(i) # <<<<<<<<<<<<<< @@ -22478,7 +22252,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen */ __pyx_cur_scope->__pyx_v_ii = ((struct __pyx_vtabstruct_3_sa_VEB *)__pyx_cur_scope->__pyx_v_veb->__pyx_vtab)->_findsucc(__pyx_cur_scope->__pyx_v_veb, __pyx_cur_scope->__pyx_v_i); - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":74 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":74 * while i != -1: * ii = veb._findsucc(i) * for n from 0 <= n < max_n: # <<<<<<<<<<<<<< @@ -22488,7 +22262,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen __pyx_t_2 = __pyx_cur_scope->__pyx_v_max_n; for (__pyx_cur_scope->__pyx_v_n = 0; __pyx_cur_scope->__pyx_v_n < __pyx_t_2; __pyx_cur_scope->__pyx_v_n++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":75 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":75 * ii = veb._findsucc(i) * for n from 0 <= n < max_n: * ngram_start = ngram_starts[n] # <<<<<<<<<<<<<< @@ -22504,7 +22278,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen __pyx_cur_scope->__pyx_v_ngram_start = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":76 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":76 * for n from 0 <= n < max_n: * ngram_start = ngram_starts[n] * iii = i # <<<<<<<<<<<<<< @@ -22513,7 +22287,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen */ __pyx_cur_scope->__pyx_v_iii = __pyx_cur_scope->__pyx_v_i; - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":77 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":77 * ngram_start = ngram_starts[n] * iii = i * rs = ngram_start.arr[iii] # <<<<<<<<<<<<<< @@ -22522,7 +22296,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen */ __pyx_cur_scope->__pyx_v_rs = (__pyx_cur_scope->__pyx_v_ngram_start->arr[__pyx_cur_scope->__pyx_v_iii]); - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":78 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":78 * iii = i * rs = ngram_start.arr[iii] * while (ii==-1 or iii < ii) and rs != 0: # <<<<<<<<<<<<<< @@ -22545,7 +22319,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen } if (!__pyx_t_7) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":79 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":79 * rs = ngram_start.arr[iii] * while (ii==-1 or iii < ii) and rs != 0: * j = self.sa.sa.arr[rs] # <<<<<<<<<<<<<< @@ -22554,7 +22328,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen */ __pyx_cur_scope->__pyx_v_j = (__pyx_cur_scope->__pyx_v_self->sa->sa->arr[__pyx_cur_scope->__pyx_v_rs]); - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":80 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":80 * while (ii==-1 or iii < ii) and rs != 0: * j = self.sa.sa.arr[rs] * valid = 1 # <<<<<<<<<<<<<< @@ -22563,7 +22337,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen */ __pyx_cur_scope->__pyx_v_valid = 1; - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":81 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":81 * j = self.sa.sa.arr[rs] * valid = 1 * for k from 0 <= k < n+1: # <<<<<<<<<<<<<< @@ -22573,7 +22347,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen __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/pauldb/workspace/cdec/python/src/sa/lcp.pxi":82 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":82 * valid = 1 * for k from 0 <= k < n+1: * if self.sa.darray.data.arr[j+k] < 2: # <<<<<<<<<<<<<< @@ -22583,7 +22357,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen __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); if (__pyx_t_7) { - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":83 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":83 * for k from 0 <= k < n+1: * if self.sa.darray.data.arr[j+k] < 2: * valid = 0 # <<<<<<<<<<<<<< @@ -22596,7 +22370,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen __pyx_L22:; } - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":84 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":84 * if self.sa.darray.data.arr[j+k] < 2: * valid = 0 * if valid: # <<<<<<<<<<<<<< @@ -22605,7 +22379,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen */ if (__pyx_cur_scope->__pyx_v_valid) { - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":85 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":85 * valid = 0 * if valid: * ngram = tuple([self.sa.darray.data.arr[j+k] for k in range(n+1)]) # <<<<<<<<<<<<<< @@ -22619,7 +22393,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen __pyx_cur_scope->__pyx_v_k = __pyx_t_6; __pyx_t_3 = PyInt_FromLong((__pyx_cur_scope->__pyx_v_self->sa->darray->data->arr[(__pyx_cur_scope->__pyx_v_j + __pyx_cur_scope->__pyx_v_k)])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (unlikely(__Pyx_PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_3 = ((PyObject *)PyList_AsTuple(__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -22631,7 +22405,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen __pyx_cur_scope->__pyx_v_ngram = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":86 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -22668,7 +22442,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen } __pyx_L23:; - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":87 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -22677,7 +22451,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen */ __pyx_cur_scope->__pyx_v_iii = (__pyx_cur_scope->__pyx_v_iii + 1); - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":88 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":88 * yield i, n+1, ngram * iii = iii + 1 * rs = ngram_start.arr[iii] # <<<<<<<<<<<<<< @@ -22687,7 +22461,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen } } - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":89 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":89 * iii = iii + 1 * rs = ngram_start.arr[iii] * i = ii # <<<<<<<<<<<<<< @@ -22704,7 +22478,6 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_generator->resume_label = -1; - __Pyx_Generator_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return NULL; } @@ -22723,7 +22496,7 @@ static int __pyx_pw_3_sa_8Alphabet_1__cinit__(PyObject *__pyx_v_self, PyObject * return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":12 +/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":12 * cdef dict id2sym * * def __cinit__(self): # <<<<<<<<<<<<<< @@ -22740,7 +22513,7 @@ static int __pyx_pf_3_sa_8Alphabet___cinit__(struct __pyx_obj_3_sa_Alphabet *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":13 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":13 * * def __cinit__(self): * self.terminals = StringMap() # <<<<<<<<<<<<<< @@ -22755,7 +22528,7 @@ static int __pyx_pf_3_sa_8Alphabet___cinit__(struct __pyx_obj_3_sa_Alphabet *__p __pyx_v_self->terminals = ((struct __pyx_obj_3_sa_StringMap *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":14 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":14 * def __cinit__(self): * self.terminals = StringMap() * self.nonterminals = StringMap() # <<<<<<<<<<<<<< @@ -22770,7 +22543,7 @@ static int __pyx_pf_3_sa_8Alphabet___cinit__(struct __pyx_obj_3_sa_Alphabet *__p __pyx_v_self->nonterminals = ((struct __pyx_obj_3_sa_StringMap *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":15 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":15 * self.terminals = StringMap() * self.nonterminals = StringMap() * self.id2sym = {} # <<<<<<<<<<<<<< @@ -22785,7 +22558,7 @@ static int __pyx_pf_3_sa_8Alphabet___cinit__(struct __pyx_obj_3_sa_Alphabet *__p __pyx_v_self->id2sym = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":16 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":16 * self.nonterminals = StringMap() * self.id2sym = {} * self.first_nonterminal = -1 # <<<<<<<<<<<<<< @@ -22814,7 +22587,7 @@ static void __pyx_pw_3_sa_8Alphabet_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyFinishContext(); } -/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":18 +/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":18 * self.first_nonterminal = -1 * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -22829,7 +22602,7 @@ static void __pyx_pf_3_sa_8Alphabet_2__dealloc__(CYTHON_UNUSED struct __pyx_obj_ __Pyx_RefNannyFinishContext(); } -/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":21 +/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":21 * pass * * cdef int isvar(self, int sym): # <<<<<<<<<<<<<< @@ -22842,7 +22615,7 @@ static int __pyx_f_3_sa_8Alphabet_isvar(CYTHON_UNUSED struct __pyx_obj_3_sa_Alph __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("isvar", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":22 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":22 * * cdef int isvar(self, int sym): * return sym < 0 # <<<<<<<<<<<<<< @@ -22858,7 +22631,7 @@ static int __pyx_f_3_sa_8Alphabet_isvar(CYTHON_UNUSED struct __pyx_obj_3_sa_Alph return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":24 +/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":24 * return sym < 0 * * cdef int isword(self, int sym): # <<<<<<<<<<<<<< @@ -22871,7 +22644,7 @@ static int __pyx_f_3_sa_8Alphabet_isword(CYTHON_UNUSED struct __pyx_obj_3_sa_Alp __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("isword", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":25 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":25 * * cdef int isword(self, int sym): * return sym >= 0 # <<<<<<<<<<<<<< @@ -22887,7 +22660,7 @@ static int __pyx_f_3_sa_8Alphabet_isword(CYTHON_UNUSED struct __pyx_obj_3_sa_Alp return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":27 +/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":27 * return sym >= 0 * * cdef int getindex(self, int sym): # <<<<<<<<<<<<<< @@ -22900,7 +22673,7 @@ static int __pyx_f_3_sa_8Alphabet_getindex(CYTHON_UNUSED struct __pyx_obj_3_sa_A __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getindex", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":28 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":28 * * cdef int getindex(self, int sym): * return -sym & INDEX_MASK # <<<<<<<<<<<<<< @@ -22916,7 +22689,7 @@ static int __pyx_f_3_sa_8Alphabet_getindex(CYTHON_UNUSED struct __pyx_obj_3_sa_A return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":30 +/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":30 * return -sym & INDEX_MASK * * cdef int setindex(self, int sym, int ind): # <<<<<<<<<<<<<< @@ -22929,7 +22702,7 @@ static int __pyx_f_3_sa_8Alphabet_setindex(CYTHON_UNUSED struct __pyx_obj_3_sa_A __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setindex", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":31 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":31 * * cdef int setindex(self, int sym, int ind): * return -(-sym & ~INDEX_MASK | ind) # <<<<<<<<<<<<<< @@ -22945,7 +22718,7 @@ static int __pyx_f_3_sa_8Alphabet_setindex(CYTHON_UNUSED struct __pyx_obj_3_sa_A return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":33 +/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":33 * return -(-sym & ~INDEX_MASK | ind) * * cdef int clearindex(self, int sym): # <<<<<<<<<<<<<< @@ -22958,7 +22731,7 @@ static int __pyx_f_3_sa_8Alphabet_clearindex(CYTHON_UNUSED struct __pyx_obj_3_sa __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clearindex", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":34 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":34 * * cdef int clearindex(self, int sym): * return -(-sym& ~INDEX_MASK) # <<<<<<<<<<<<<< @@ -22974,7 +22747,7 @@ static int __pyx_f_3_sa_8Alphabet_clearindex(CYTHON_UNUSED struct __pyx_obj_3_sa return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":36 +/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":36 * return -(-sym& ~INDEX_MASK) * * cdef int match(self, int sym1, int sym2): # <<<<<<<<<<<<<< @@ -22987,7 +22760,7 @@ static int __pyx_f_3_sa_8Alphabet_match(struct __pyx_obj_3_sa_Alphabet *__pyx_v_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("match", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":37 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":37 * * cdef int match(self, int sym1, int sym2): * return self.clearindex(sym1) == self.clearindex(sym2); # <<<<<<<<<<<<<< @@ -23003,7 +22776,7 @@ static int __pyx_f_3_sa_8Alphabet_match(struct __pyx_obj_3_sa_Alphabet *__pyx_v_ return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":39 +/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":39 * return self.clearindex(sym1) == self.clearindex(sym2); * * cdef char* tocat(self, int sym): # <<<<<<<<<<<<<< @@ -23016,7 +22789,7 @@ static char *__pyx_f_3_sa_8Alphabet_tocat(struct __pyx_obj_3_sa_Alphabet *__pyx_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("tocat", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":40 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":40 * * cdef char* tocat(self, int sym): * return self.nonterminals.word((-sym >> INDEX_SHIFT)-1) # <<<<<<<<<<<<<< @@ -23032,7 +22805,7 @@ static char *__pyx_f_3_sa_8Alphabet_tocat(struct __pyx_obj_3_sa_Alphabet *__pyx_ return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":42 +/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":42 * return self.nonterminals.word((-sym >> INDEX_SHIFT)-1) * * cdef int fromcat(self, char *s): # <<<<<<<<<<<<<< @@ -23047,7 +22820,7 @@ static int __pyx_f_3_sa_8Alphabet_fromcat(struct __pyx_obj_3_sa_Alphabet *__pyx_ int __pyx_t_1; __Pyx_RefNannySetupContext("fromcat", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":44 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":44 * cdef int fromcat(self, char *s): * cdef int i * i = self.nonterminals.index(s) # <<<<<<<<<<<<<< @@ -23056,7 +22829,7 @@ static int __pyx_f_3_sa_8Alphabet_fromcat(struct __pyx_obj_3_sa_Alphabet *__pyx_ */ __pyx_v_i = ((struct __pyx_vtabstruct_3_sa_StringMap *)__pyx_v_self->nonterminals->__pyx_vtab)->index(__pyx_v_self->nonterminals, __pyx_v_s); - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":45 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":45 * cdef int i * i = self.nonterminals.index(s) * if self.first_nonterminal == -1: # <<<<<<<<<<<<<< @@ -23066,7 +22839,7 @@ static int __pyx_f_3_sa_8Alphabet_fromcat(struct __pyx_obj_3_sa_Alphabet *__pyx_ __pyx_t_1 = (__pyx_v_self->first_nonterminal == -1); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":46 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":46 * i = self.nonterminals.index(s) * if self.first_nonterminal == -1: * self.first_nonterminal = i # <<<<<<<<<<<<<< @@ -23078,7 +22851,7 @@ static int __pyx_f_3_sa_8Alphabet_fromcat(struct __pyx_obj_3_sa_Alphabet *__pyx_ } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":47 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":47 * if self.first_nonterminal == -1: * self.first_nonterminal = i * if i > self.last_nonterminal: # <<<<<<<<<<<<<< @@ -23088,7 +22861,7 @@ static int __pyx_f_3_sa_8Alphabet_fromcat(struct __pyx_obj_3_sa_Alphabet *__pyx_ __pyx_t_1 = (__pyx_v_i > __pyx_v_self->last_nonterminal); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":48 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":48 * self.first_nonterminal = i * if i > self.last_nonterminal: * self.last_nonterminal = i # <<<<<<<<<<<<<< @@ -23100,7 +22873,7 @@ static int __pyx_f_3_sa_8Alphabet_fromcat(struct __pyx_obj_3_sa_Alphabet *__pyx_ } __pyx_L4:; - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":49 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":49 * if i > self.last_nonterminal: * self.last_nonterminal = i * return -(i+1 << INDEX_SHIFT) # <<<<<<<<<<<<<< @@ -23116,7 +22889,7 @@ static int __pyx_f_3_sa_8Alphabet_fromcat(struct __pyx_obj_3_sa_Alphabet *__pyx_ return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":51 +/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":51 * return -(i+1 << INDEX_SHIFT) * * cdef char* tostring(self, int sym): # <<<<<<<<<<<<<< @@ -23139,7 +22912,7 @@ static char *__pyx_f_3_sa_8Alphabet_tostring(struct __pyx_obj_3_sa_Alphabet *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("tostring", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":53 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":53 * cdef char* tostring(self, int sym): * cdef int ind * if self.isvar(sym): # <<<<<<<<<<<<<< @@ -23149,7 +22922,7 @@ static char *__pyx_f_3_sa_8Alphabet_tostring(struct __pyx_obj_3_sa_Alphabet *__p __pyx_t_1 = ((struct __pyx_vtabstruct_3_sa_Alphabet *)__pyx_v_self->__pyx_vtab)->isvar(__pyx_v_self, __pyx_v_sym); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":54 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":54 * cdef int ind * if self.isvar(sym): * if sym in self.id2sym: # <<<<<<<<<<<<<< @@ -23159,24 +22932,19 @@ static char *__pyx_f_3_sa_8Alphabet_tostring(struct __pyx_obj_3_sa_Alphabet *__p __pyx_t_2 = PyInt_FromLong(__pyx_v_sym); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (unlikely(((PyObject *)__pyx_v_self->id2sym) == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - {__pyx_filename = __pyx_f[10]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_3 = (__Pyx_PyDict_Contains(__pyx_t_2, ((PyObject *)__pyx_v_self->id2sym), Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyDict_Contains(((PyObject *)__pyx_v_self->id2sym), __pyx_t_2))); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":55 + /* "/home/paulb/workspace/cdec/python/src/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)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[10]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->id2sym), __pyx_v_sym, sizeof(int), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyBytes_AsString(__pyx_t_2); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -23187,7 +22955,7 @@ static char *__pyx_f_3_sa_8Alphabet_tostring(struct __pyx_obj_3_sa_Alphabet *__p } __pyx_L4:; - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":56 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":56 * if sym in self.id2sym: * return self.id2sym[sym] * ind = self.getindex(sym) # <<<<<<<<<<<<<< @@ -23196,7 +22964,7 @@ static char *__pyx_f_3_sa_8Alphabet_tostring(struct __pyx_obj_3_sa_Alphabet *__p */ __pyx_v_ind = ((struct __pyx_vtabstruct_3_sa_Alphabet *)__pyx_v_self->__pyx_vtab)->getindex(__pyx_v_self, __pyx_v_sym); - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":57 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":57 * return self.id2sym[sym] * ind = self.getindex(sym) * if ind > 0: # <<<<<<<<<<<<<< @@ -23206,7 +22974,7 @@ static char *__pyx_f_3_sa_8Alphabet_tostring(struct __pyx_obj_3_sa_Alphabet *__p __pyx_t_3 = (__pyx_v_ind > 0); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":58 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":58 * ind = self.getindex(sym) * if ind > 0: * self.id2sym[sym] = "[%s,%d]" % (self.tocat(sym), ind) # <<<<<<<<<<<<<< @@ -23228,17 +22996,13 @@ static char *__pyx_f_3_sa_8Alphabet_tostring(struct __pyx_obj_3_sa_Alphabet *__p __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_64), ((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)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[10]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } if (__Pyx_SetItemInt(((PyObject *)__pyx_v_self->id2sym), __pyx_v_sym, ((PyObject *)__pyx_t_5), sizeof(int), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; goto __pyx_L5; } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":60 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":60 * self.id2sym[sym] = "[%s,%d]" % (self.tocat(sym), ind) * else: * self.id2sym[sym] = "[%s]" % self.tocat(sym) # <<<<<<<<<<<<<< @@ -23250,26 +23014,18 @@ static char *__pyx_f_3_sa_8Alphabet_tostring(struct __pyx_obj_3_sa_Alphabet *__p __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_65), ((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)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[10]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } if (__Pyx_SetItemInt(((PyObject *)__pyx_v_self->id2sym), __pyx_v_sym, ((PyObject *)__pyx_t_6), sizeof(int), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; } __pyx_L5:; - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":61 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":61 * else: * self.id2sym[sym] = "[%s]" % self.tocat(sym) * return self.id2sym[sym] # <<<<<<<<<<<<<< * else: * return self.terminals.word(sym) */ - if (unlikely(((PyObject *)__pyx_v_self->id2sym) == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[10]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } __pyx_t_6 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->id2sym), __pyx_v_sym, sizeof(int), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = PyBytes_AsString(__pyx_t_6); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -23280,7 +23036,7 @@ static char *__pyx_f_3_sa_8Alphabet_tostring(struct __pyx_obj_3_sa_Alphabet *__p } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":63 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":63 * return self.id2sym[sym] * else: * return self.terminals.word(sym) # <<<<<<<<<<<<<< @@ -23305,7 +23061,7 @@ static char *__pyx_f_3_sa_8Alphabet_tostring(struct __pyx_obj_3_sa_Alphabet *__p return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":65 +/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":65 * return self.terminals.word(sym) * * cdef int fromstring(self, char *s, bint terminal): # <<<<<<<<<<<<<< @@ -23333,7 +23089,7 @@ static int __pyx_f_3_sa_8Alphabet_fromstring(struct __pyx_obj_3_sa_Alphabet *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fromstring", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":69 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":69 * cdef char *comma * cdef int n * n = strlen(s) # <<<<<<<<<<<<<< @@ -23342,7 +23098,7 @@ static int __pyx_f_3_sa_8Alphabet_fromstring(struct __pyx_obj_3_sa_Alphabet *__p */ __pyx_v_n = strlen(__pyx_v_s); - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":71 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":71 * n = strlen(s) * cdef char *sep * sep = strstr(s,"_SEP_") # <<<<<<<<<<<<<< @@ -23351,7 +23107,7 @@ static int __pyx_f_3_sa_8Alphabet_fromstring(struct __pyx_obj_3_sa_Alphabet *__p */ __pyx_v_sep = strstr(__pyx_v_s, __pyx_k___SEP_); - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":72 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":72 * cdef char *sep * sep = strstr(s,"_SEP_") * if n >= 3 and s[0] == c'[' and s[n-1] == c']' and sep == NULL: # <<<<<<<<<<<<<< @@ -23379,7 +23135,7 @@ static int __pyx_f_3_sa_8Alphabet_fromstring(struct __pyx_obj_3_sa_Alphabet *__p } if (__pyx_t_2) { - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":73 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":73 * sep = strstr(s,"_SEP_") * if n >= 3 and s[0] == c'[' and s[n-1] == c']' and sep == NULL: * if terminal: # <<<<<<<<<<<<<< @@ -23388,7 +23144,7 @@ static int __pyx_f_3_sa_8Alphabet_fromstring(struct __pyx_obj_3_sa_Alphabet *__p */ if (__pyx_v_terminal) { - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":74 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":74 * if n >= 3 and s[0] == c'[' and s[n-1] == c']' and sep == NULL: * if terminal: * s1 = "\\"+s # <<<<<<<<<<<<<< @@ -23403,7 +23159,7 @@ static int __pyx_f_3_sa_8Alphabet_fromstring(struct __pyx_obj_3_sa_Alphabet *__p __pyx_v_s1 = __pyx_t_7; __pyx_t_7 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":75 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":75 * if terminal: * s1 = "\\"+s * return self.terminals.index(s1) # <<<<<<<<<<<<<< @@ -23417,7 +23173,7 @@ static int __pyx_f_3_sa_8Alphabet_fromstring(struct __pyx_obj_3_sa_Alphabet *__p } __pyx_L4:; - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":76 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":76 * s1 = "\\"+s * return self.terminals.index(s1) * s[n-1] = c'\0' # <<<<<<<<<<<<<< @@ -23426,7 +23182,7 @@ static int __pyx_f_3_sa_8Alphabet_fromstring(struct __pyx_obj_3_sa_Alphabet *__p */ (__pyx_v_s[(__pyx_v_n - 1)]) = '\x00'; - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":77 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":77 * return self.terminals.index(s1) * s[n-1] = c'\0' * s = s + 1 # <<<<<<<<<<<<<< @@ -23435,7 +23191,7 @@ static int __pyx_f_3_sa_8Alphabet_fromstring(struct __pyx_obj_3_sa_Alphabet *__p */ __pyx_v_s = (__pyx_v_s + 1); - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":78 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":78 * s[n-1] = c'\0' * s = s + 1 * comma = strrchr(s, c',') # <<<<<<<<<<<<<< @@ -23444,7 +23200,7 @@ static int __pyx_f_3_sa_8Alphabet_fromstring(struct __pyx_obj_3_sa_Alphabet *__p */ __pyx_v_comma = strrchr(__pyx_v_s, ','); - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":79 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":79 * s = s + 1 * comma = strrchr(s, c',') * if comma != NULL: # <<<<<<<<<<<<<< @@ -23454,7 +23210,7 @@ static int __pyx_f_3_sa_8Alphabet_fromstring(struct __pyx_obj_3_sa_Alphabet *__p __pyx_t_2 = (__pyx_v_comma != NULL); if (__pyx_t_2) { - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":80 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":80 * comma = strrchr(s, c',') * if comma != NULL: * comma[0] = c'\0' # <<<<<<<<<<<<<< @@ -23463,7 +23219,7 @@ static int __pyx_f_3_sa_8Alphabet_fromstring(struct __pyx_obj_3_sa_Alphabet *__p */ (__pyx_v_comma[0]) = '\x00'; - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":81 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":81 * if comma != NULL: * comma[0] = c'\0' * return self.setindex(self.fromcat(s), strtol(comma+1, NULL, 10)) # <<<<<<<<<<<<<< @@ -23476,7 +23232,7 @@ static int __pyx_f_3_sa_8Alphabet_fromstring(struct __pyx_obj_3_sa_Alphabet *__p } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":83 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":83 * return self.setindex(self.fromcat(s), strtol(comma+1, NULL, 10)) * else: * return self.fromcat(s) # <<<<<<<<<<<<<< @@ -23491,7 +23247,7 @@ static int __pyx_f_3_sa_8Alphabet_fromstring(struct __pyx_obj_3_sa_Alphabet *__p } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":85 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":85 * return self.fromcat(s) * else: * return self.terminals.index(s) # <<<<<<<<<<<<<< @@ -23527,7 +23283,7 @@ static PyObject *__pyx_pw_3_sa_8Alphabet_9terminals_1__get__(PyObject *__pyx_v_s return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":8 +/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":8 * * cdef class Alphabet: * cdef readonly StringMap terminals, nonterminals # <<<<<<<<<<<<<< @@ -23578,7 +23334,7 @@ static PyObject *__pyx_pf_3_sa_8Alphabet_12nonterminals___get__(struct __pyx_obj return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":89 +/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":89 * cdef Alphabet ALPHABET = Alphabet() * * cdef char* sym_tostring(int sym): # <<<<<<<<<<<<<< @@ -23591,7 +23347,7 @@ static char *__pyx_f_3_sa_sym_tostring(int __pyx_v_sym) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sym_tostring", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":90 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":90 * * cdef char* sym_tostring(int sym): * return ALPHABET.tostring(sym) # <<<<<<<<<<<<<< @@ -23607,7 +23363,7 @@ static char *__pyx_f_3_sa_sym_tostring(int __pyx_v_sym) { return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":92 +/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":92 * return ALPHABET.tostring(sym) * * cdef char* sym_tocat(int sym): # <<<<<<<<<<<<<< @@ -23620,7 +23376,7 @@ static char *__pyx_f_3_sa_sym_tocat(int __pyx_v_sym) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sym_tocat", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":93 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":93 * * cdef char* sym_tocat(int sym): * return ALPHABET.tocat(sym) # <<<<<<<<<<<<<< @@ -23636,7 +23392,7 @@ static char *__pyx_f_3_sa_sym_tocat(int __pyx_v_sym) { return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":95 +/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":95 * return ALPHABET.tocat(sym) * * cdef int sym_isvar(int sym): # <<<<<<<<<<<<<< @@ -23649,7 +23405,7 @@ static int __pyx_f_3_sa_sym_isvar(int __pyx_v_sym) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sym_isvar", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":96 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":96 * * cdef int sym_isvar(int sym): * return ALPHABET.isvar(sym) # <<<<<<<<<<<<<< @@ -23665,7 +23421,7 @@ static int __pyx_f_3_sa_sym_isvar(int __pyx_v_sym) { return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":98 +/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":98 * return ALPHABET.isvar(sym) * * cdef int sym_getindex(int sym): # <<<<<<<<<<<<<< @@ -23678,7 +23434,7 @@ static int __pyx_f_3_sa_sym_getindex(int __pyx_v_sym) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sym_getindex", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":99 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":99 * * cdef int sym_getindex(int sym): * return ALPHABET.getindex(sym) # <<<<<<<<<<<<<< @@ -23694,7 +23450,7 @@ static int __pyx_f_3_sa_sym_getindex(int __pyx_v_sym) { return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":101 +/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":101 * return ALPHABET.getindex(sym) * * cdef int sym_setindex(int sym, int id): # <<<<<<<<<<<<<< @@ -23707,7 +23463,7 @@ static int __pyx_f_3_sa_sym_setindex(int __pyx_v_sym, int __pyx_v_id) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sym_setindex", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":102 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":102 * * cdef int sym_setindex(int sym, int id): * return ALPHABET.setindex(sym, id) # <<<<<<<<<<<<<< @@ -23723,7 +23479,7 @@ static int __pyx_f_3_sa_sym_setindex(int __pyx_v_sym, int __pyx_v_id) { return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":104 +/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":104 * return ALPHABET.setindex(sym, id) * * cdef int sym_fromstring(char* string, bint terminal): # <<<<<<<<<<<<<< @@ -23736,7 +23492,7 @@ static int __pyx_f_3_sa_sym_fromstring(char *__pyx_v_string, int __pyx_v_termina __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sym_fromstring", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":105 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":105 * * cdef int sym_fromstring(char* string, bint terminal): * return ALPHABET.fromstring(string, terminal) # <<<<<<<<<<<<<< @@ -23759,12 +23515,13 @@ static PyObject *__pyx_pw_3_sa_5isvar(PyObject *__pyx_self, PyObject *__pyx_v_sy PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("isvar (wrapper)", 0); + __pyx_self = __pyx_self; __pyx_r = __pyx_pf_3_sa_4isvar(__pyx_self, ((PyObject *)__pyx_v_sym)); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":107 +/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":107 * return ALPHABET.fromstring(string, terminal) * * def isvar(sym): # <<<<<<<<<<<<<< @@ -23782,7 +23539,7 @@ static PyObject *__pyx_pf_3_sa_4isvar(CYTHON_UNUSED PyObject *__pyx_self, PyObje int __pyx_clineno = 0; __Pyx_RefNannySetupContext("isvar", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":108 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":108 * * def isvar(sym): * return sym_isvar(sym) # <<<<<<<<<<<<<< @@ -23816,13 +23573,14 @@ static PyObject *__pyx_pw_3_sa_7make_lattice(PyObject *__pyx_self, PyObject *__p PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("make_lattice (wrapper)", 0); + __pyx_self = __pyx_self; __pyx_r = __pyx_pf_3_sa_6make_lattice(__pyx_self, ((PyObject *)__pyx_v_words)); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_3_sa_12make_lattice_2generator7(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":111 +/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":111 * * def make_lattice(words): * word_ids = (sym_fromstring(word, True) for word in words) # <<<<<<<<<<<<<< @@ -23898,18 +23656,10 @@ static PyObject *__pyx_gb_3_sa_12make_lattice_2generator7(__pyx_GeneratorObject for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 111; __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[10]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; } 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[10]; __pyx_lineno = 111; __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[10]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { @@ -23958,13 +23708,12 @@ static PyObject *__pyx_gb_3_sa_12make_lattice_2generator7(__pyx_GeneratorObject __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_generator->resume_label = -1; - __Pyx_Generator_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return NULL; } static PyObject *__pyx_gb_3_sa_12make_lattice_5generator8(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":112 +/* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -24040,18 +23789,10 @@ static PyObject *__pyx_gb_3_sa_12make_lattice_5generator8(__pyx_GeneratorObject for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 112; __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[10]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; } 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[10]; __pyx_lineno = 112; __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[10]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { @@ -24114,12 +23855,11 @@ static PyObject *__pyx_gb_3_sa_12make_lattice_5generator8(__pyx_GeneratorObject __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_generator->resume_label = -1; - __Pyx_Generator_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return NULL; } -/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":110 +/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":110 * return sym_isvar(sym) * * def make_lattice(words): # <<<<<<<<<<<<<< @@ -24147,7 +23887,7 @@ static PyObject *__pyx_pf_3_sa_6make_lattice(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_INCREF(__pyx_cur_scope->__pyx_v_words); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_words); - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":111 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":111 * * def make_lattice(words): * word_ids = (sym_fromstring(word, True) for word in words) # <<<<<<<<<<<<<< @@ -24160,7 +23900,7 @@ static PyObject *__pyx_pf_3_sa_6make_lattice(CYTHON_UNUSED PyObject *__pyx_self, __pyx_cur_scope->__pyx_v_word_ids = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":112 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -24203,13 +23943,14 @@ static PyObject *__pyx_pw_3_sa_9decode_lattice(PyObject *__pyx_self, PyObject *_ PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("decode_lattice (wrapper)", 0); + __pyx_self = __pyx_self; __pyx_r = __pyx_pf_3_sa_8decode_lattice(__pyx_self, ((PyObject *)__pyx_v_lattice)); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_3_sa_14decode_lattice_2generator9(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":115 +/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":115 * * def decode_lattice(lattice): * return tuple((sym_tostring(sym), weight, dist) for (sym, weight, dist) in arc # <<<<<<<<<<<<<< @@ -24283,7 +24024,7 @@ static PyObject *__pyx_gb_3_sa_14decode_lattice_2generator9(__pyx_GeneratorObjec __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/pauldb/workspace/cdec/python/src/sa/sym.pxi":116 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -24301,7 +24042,7 @@ static PyObject *__pyx_gb_3_sa_14decode_lattice_2generator9(__pyx_GeneratorObjec } for (;;) { - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":115 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":115 * * def decode_lattice(lattice): * return tuple((sym_tostring(sym), weight, dist) for (sym, weight, dist) in arc # <<<<<<<<<<<<<< @@ -24310,18 +24051,10 @@ static PyObject *__pyx_gb_3_sa_14decode_lattice_2generator9(__pyx_GeneratorObjec */ 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[10]; __pyx_lineno = 115; __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[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; } 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[10]; __pyx_lineno = 115; __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[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { @@ -24335,22 +24068,21 @@ static PyObject *__pyx_gb_3_sa_14decode_lattice_2generator9(__pyx_GeneratorObjec } if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { PyObject* sequence = __pyx_t_4; - #if CYTHON_COMPILING_IN_CPYTHON - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 3)) { - if (size > 3) __Pyx_RaiseTooManyValuesError(3); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { + if (unlikely(PyTuple_GET_SIZE(sequence) != 3)) { + if (PyTuple_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3); + else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); } else { + if (unlikely(PyList_GET_SIZE(sequence) != 3)) { + if (PyList_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3); + else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); __pyx_t_7 = PyList_GET_ITEM(sequence, 2); @@ -24358,14 +24090,8 @@ static PyObject *__pyx_gb_3_sa_14decode_lattice_2generator9(__pyx_GeneratorObjec __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); - #else - __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } else - { + } else { Py_ssize_t index = -1; __pyx_t_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); @@ -24378,13 +24104,12 @@ static PyObject *__pyx_gb_3_sa_14decode_lattice_2generator9(__pyx_GeneratorObjec index = 2; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_9 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); + if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L7_unpacking_done:; } @@ -24404,7 +24129,7 @@ static PyObject *__pyx_gb_3_sa_14decode_lattice_2generator9(__pyx_GeneratorObjec __pyx_cur_scope->__pyx_v_dist = __pyx_t_7; __pyx_t_7 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":116 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -24423,18 +24148,10 @@ static PyObject *__pyx_gb_3_sa_14decode_lattice_2generator9(__pyx_GeneratorObjec for (;;) { if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_4)) { if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_4)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_4)) { if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_4)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; } else { __pyx_t_7 = __pyx_t_11(__pyx_t_4); if (unlikely(!__pyx_t_7)) { @@ -24463,18 +24180,10 @@ static PyObject *__pyx_gb_3_sa_14decode_lattice_2generator9(__pyx_GeneratorObjec for (;;) { if (!__pyx_t_13 && PyList_CheckExact(__pyx_t_7)) { if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_7)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_12); __Pyx_INCREF(__pyx_t_6); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_12); __Pyx_INCREF(__pyx_t_6); __pyx_t_12++; } else if (!__pyx_t_13 && PyTuple_CheckExact(__pyx_t_7)) { if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_7)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_12); __Pyx_INCREF(__pyx_t_6); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_12); __Pyx_INCREF(__pyx_t_6); __pyx_t_12++; } else { __pyx_t_6 = __pyx_t_13(__pyx_t_7); if (unlikely(!__pyx_t_6)) { @@ -24492,7 +24201,7 @@ static PyObject *__pyx_gb_3_sa_14decode_lattice_2generator9(__pyx_GeneratorObjec __pyx_cur_scope->__pyx_v_node = __pyx_t_6; __pyx_t_6 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":115 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":115 * * def decode_lattice(lattice): * return tuple((sym_tostring(sym), weight, dist) for (sym, weight, dist) in arc # <<<<<<<<<<<<<< @@ -24568,12 +24277,11 @@ static PyObject *__pyx_gb_3_sa_14decode_lattice_2generator9(__pyx_GeneratorObjec __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_generator->resume_label = -1; - __Pyx_Generator_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return NULL; } -/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":114 +/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":114 * return tuple(((word, None, 1), ) for word in word_ids) * * def decode_lattice(lattice): # <<<<<<<<<<<<<< @@ -24601,7 +24309,7 @@ static PyObject *__pyx_pf_3_sa_8decode_lattice(CYTHON_UNUSED PyObject *__pyx_sel __Pyx_INCREF(__pyx_cur_scope->__pyx_v_lattice); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_lattice); - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":115 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":115 * * def decode_lattice(lattice): * return tuple((sym_tostring(sym), weight, dist) for (sym, weight, dist) in arc # <<<<<<<<<<<<<< @@ -24644,13 +24352,14 @@ static PyObject *__pyx_pw_3_sa_11decode_sentence(PyObject *__pyx_self, PyObject PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("decode_sentence (wrapper)", 0); + __pyx_self = __pyx_self; __pyx_r = __pyx_pf_3_sa_10decode_sentence(__pyx_self, ((PyObject *)__pyx_v_lattice)); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_3_sa_15decode_sentence_2generator10(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":119 +/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":119 * * def decode_sentence(lattice): * return tuple(sym_tostring(sym) for ((sym, _, _),) in lattice) # <<<<<<<<<<<<<< @@ -24732,18 +24441,10 @@ static PyObject *__pyx_gb_3_sa_15decode_sentence_2generator10(__pyx_GeneratorObj for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __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[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; } 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[10]; __pyx_lineno = 119; __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[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { @@ -24757,29 +24458,24 @@ static PyObject *__pyx_gb_3_sa_15decode_sentence_2generator10(__pyx_GeneratorObj } if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { PyObject* sequence = __pyx_t_4; - #if CYTHON_COMPILING_IN_CPYTHON - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 1)) { - if (size > 1) __Pyx_RaiseTooManyValuesError(1); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { + if (unlikely(PyTuple_GET_SIZE(sequence) != 1)) { + if (PyTuple_GET_SIZE(sequence) > 1) __Pyx_RaiseTooManyValuesError(1); + else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); } else { + if (unlikely(PyList_GET_SIZE(sequence) != 1)) { + if (PyList_GET_SIZE(sequence) > 1) __Pyx_RaiseTooManyValuesError(1); + else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } __pyx_t_5 = PyList_GET_ITEM(sequence, 0); } __Pyx_INCREF(__pyx_t_5); - #else - __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } else - { + } else { Py_ssize_t index = -1; __pyx_t_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); @@ -24788,34 +24484,32 @@ static PyObject *__pyx_gb_3_sa_15decode_sentence_2generator10(__pyx_GeneratorObj index = 0; __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), 1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __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; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_7 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); + if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L7_unpacking_done:; } if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { PyObject* sequence = __pyx_t_5; - #if CYTHON_COMPILING_IN_CPYTHON - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 3)) { - if (size > 3) __Pyx_RaiseTooManyValuesError(3); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { + if (unlikely(PyTuple_GET_SIZE(sequence) != 3)) { + if (PyTuple_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3); + else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 2); } else { + if (unlikely(PyList_GET_SIZE(sequence) != 3)) { + if (PyList_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3); + else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_8 = PyList_GET_ITEM(sequence, 1); __pyx_t_9 = PyList_GET_ITEM(sequence, 2); @@ -24823,14 +24517,8 @@ static PyObject *__pyx_gb_3_sa_15decode_sentence_2generator10(__pyx_GeneratorObj __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); - #else - __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_9 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } else - { + } else { Py_ssize_t index = -1; __pyx_t_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); @@ -24843,13 +24531,12 @@ static PyObject *__pyx_gb_3_sa_15decode_sentence_2generator10(__pyx_GeneratorObj index = 2; __pyx_t_9 = __pyx_t_7(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_10), 3) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_7 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); + if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L9_unpacking_done:; } @@ -24905,12 +24592,11 @@ static PyObject *__pyx_gb_3_sa_15decode_sentence_2generator10(__pyx_GeneratorObj __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_generator->resume_label = -1; - __Pyx_Generator_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return NULL; } -/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":118 +/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":118 * for arc in node for node in lattice) * * def decode_sentence(lattice): # <<<<<<<<<<<<<< @@ -24938,7 +24624,7 @@ static PyObject *__pyx_pf_3_sa_10decode_sentence(CYTHON_UNUSED PyObject *__pyx_s __Pyx_INCREF(__pyx_cur_scope->__pyx_v_lattice); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_lattice); - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":119 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":119 * * def decode_sentence(lattice): * return tuple(sym_tostring(sym) for ((sym, _, _),) in lattice) # <<<<<<<<<<<<<< @@ -24981,13 +24667,14 @@ static PyObject *__pyx_pw_3_sa_13encode_words(PyObject *__pyx_self, PyObject *__ PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("encode_words (wrapper)", 0); + __pyx_self = __pyx_self; __pyx_r = __pyx_pf_3_sa_12encode_words(__pyx_self, ((PyObject *)__pyx_v_words)); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_3_sa_12encode_words_2generator11(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":122 +/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":122 * * def encode_words(words): * return tuple(sym_fromstring(word, True) for word in words) # <<<<<<<<<<<<<< @@ -25063,18 +24750,10 @@ static PyObject *__pyx_gb_3_sa_12encode_words_2generator11(__pyx_GeneratorObject for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 122; __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[10]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; } 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[10]; __pyx_lineno = 122; __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[10]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { @@ -25123,12 +24802,11 @@ static PyObject *__pyx_gb_3_sa_12encode_words_2generator11(__pyx_GeneratorObject __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_generator->resume_label = -1; - __Pyx_Generator_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return NULL; } -/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":121 +/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":121 * return tuple(sym_tostring(sym) for ((sym, _, _),) in lattice) * * def encode_words(words): # <<<<<<<<<<<<<< @@ -25156,7 +24834,7 @@ static PyObject *__pyx_pf_3_sa_12encode_words(CYTHON_UNUSED PyObject *__pyx_self __Pyx_INCREF(__pyx_cur_scope->__pyx_v_words); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_words); - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":122 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":122 * * def encode_words(words): * return tuple(sym_fromstring(word, True) for word in words) # <<<<<<<<<<<<<< @@ -25199,13 +24877,14 @@ static PyObject *__pyx_pw_3_sa_15decode_words(PyObject *__pyx_self, PyObject *__ PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("decode_words (wrapper)", 0); + __pyx_self = __pyx_self; __pyx_r = __pyx_pf_3_sa_14decode_words(__pyx_self, ((PyObject *)__pyx_v_syms)); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_3_sa_12decode_words_2generator12(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":125 +/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":125 * * def decode_words(syms): * return tuple(sym_tostring(sym) for sym in syms) # <<<<<<<<<<<<<< @@ -25279,18 +24958,10 @@ static PyObject *__pyx_gb_3_sa_12decode_words_2generator12(__pyx_GeneratorObject for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 125; __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[10]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; } 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[10]; __pyx_lineno = 125; __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[10]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { @@ -25339,12 +25010,11 @@ static PyObject *__pyx_gb_3_sa_12decode_words_2generator12(__pyx_GeneratorObject __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_generator->resume_label = -1; - __Pyx_Generator_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return NULL; } -/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":124 +/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":124 * return tuple(sym_fromstring(word, True) for word in words) * * def decode_words(syms): # <<<<<<<<<<<<<< @@ -25371,7 +25041,7 @@ static PyObject *__pyx_pf_3_sa_14decode_words(CYTHON_UNUSED PyObject *__pyx_self __Pyx_INCREF(__pyx_cur_scope->__pyx_v_syms); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_syms); - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":125 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":125 * * def decode_words(syms): * return tuple(sym_tostring(sym) for sym in syms) # <<<<<<<<<<<<<< @@ -25409,11 +25079,11 @@ static PyObject *__pyx_pf_3_sa_14decode_words(CYTHON_UNUSED PyObject *__pyx_self static int __pyx_pw_3_sa_6Phrase_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_3_sa_6Phrase_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_words = 0; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__words,0}; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__words,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -25426,7 +25096,8 @@ static int __pyx_pw_3_sa_6Phrase_1__cinit__(PyObject *__pyx_v_self, PyObject *__ 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--; + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__words); + if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { @@ -25452,7 +25123,7 @@ static int __pyx_pw_3_sa_6Phrase_1__cinit__(PyObject *__pyx_v_self, PyObject *__ return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":6 +/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":6 * cdef class Phrase: * * def __cinit__(self, words): # <<<<<<<<<<<<<< @@ -25476,7 +25147,7 @@ static int __pyx_pf_3_sa_6Phrase___cinit__(struct __pyx_obj_3_sa_Phrase *__pyx_v int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":8 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":8 * def __cinit__(self, words): * cdef int i, j, n, n_vars * n_vars = 0 # <<<<<<<<<<<<<< @@ -25485,7 +25156,7 @@ static int __pyx_pf_3_sa_6Phrase___cinit__(struct __pyx_obj_3_sa_Phrase *__pyx_v */ __pyx_v_n_vars = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":9 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":9 * cdef int i, j, n, n_vars * n_vars = 0 * n = len(words) # <<<<<<<<<<<<<< @@ -25495,7 +25166,7 @@ static int __pyx_pf_3_sa_6Phrase___cinit__(struct __pyx_obj_3_sa_Phrase *__pyx_v __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/pauldb/workspace/cdec/python/src/sa/rule.pxi":10 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":10 * n_vars = 0 * n = len(words) * self.syms = malloc(n*sizeof(int)) # <<<<<<<<<<<<<< @@ -25504,7 +25175,7 @@ static int __pyx_pf_3_sa_6Phrase___cinit__(struct __pyx_obj_3_sa_Phrase *__pyx_v */ __pyx_v_self->syms = ((int *)malloc((__pyx_v_n * (sizeof(int))))); - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":11 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":11 * n = len(words) * self.syms = malloc(n*sizeof(int)) * for i from 0 <= i < n: # <<<<<<<<<<<<<< @@ -25514,7 +25185,7 @@ static int __pyx_pf_3_sa_6Phrase___cinit__(struct __pyx_obj_3_sa_Phrase *__pyx_v __pyx_t_2 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":12 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":12 * self.syms = malloc(n*sizeof(int)) * for i from 0 <= i < n: * self.syms[i] = words[i] # <<<<<<<<<<<<<< @@ -25527,7 +25198,7 @@ static int __pyx_pf_3_sa_6Phrase___cinit__(struct __pyx_obj_3_sa_Phrase *__pyx_v __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; (__pyx_v_self->syms[__pyx_v_i]) = __pyx_t_4; - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":13 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":13 * for i from 0 <= i < n: * self.syms[i] = words[i] * if sym_isvar(self.syms[i]): # <<<<<<<<<<<<<< @@ -25537,7 +25208,7 @@ static int __pyx_pf_3_sa_6Phrase___cinit__(struct __pyx_obj_3_sa_Phrase *__pyx_v __pyx_t_4 = __pyx_f_3_sa_sym_isvar((__pyx_v_self->syms[__pyx_v_i])); if (__pyx_t_4) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":14 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":14 * self.syms[i] = words[i] * if sym_isvar(self.syms[i]): * n_vars += 1 # <<<<<<<<<<<<<< @@ -25550,7 +25221,7 @@ static int __pyx_pf_3_sa_6Phrase___cinit__(struct __pyx_obj_3_sa_Phrase *__pyx_v __pyx_L5:; } - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":15 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":15 * if sym_isvar(self.syms[i]): * n_vars += 1 * self.n = n # <<<<<<<<<<<<<< @@ -25559,7 +25230,7 @@ static int __pyx_pf_3_sa_6Phrase___cinit__(struct __pyx_obj_3_sa_Phrase *__pyx_v */ __pyx_v_self->n = __pyx_v_n; - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":16 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":16 * n_vars += 1 * self.n = n * self.n_vars = n_vars # <<<<<<<<<<<<<< @@ -25568,7 +25239,7 @@ static int __pyx_pf_3_sa_6Phrase___cinit__(struct __pyx_obj_3_sa_Phrase *__pyx_v */ __pyx_v_self->n_vars = __pyx_v_n_vars; - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":17 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":17 * self.n = n * self.n_vars = n_vars * self.varpos = malloc(n_vars*sizeof(int)) # <<<<<<<<<<<<<< @@ -25577,7 +25248,7 @@ static int __pyx_pf_3_sa_6Phrase___cinit__(struct __pyx_obj_3_sa_Phrase *__pyx_v */ __pyx_v_self->varpos = ((int *)malloc((__pyx_v_n_vars * (sizeof(int))))); - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":18 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":18 * self.n_vars = n_vars * self.varpos = malloc(n_vars*sizeof(int)) * j = 0 # <<<<<<<<<<<<<< @@ -25586,7 +25257,7 @@ static int __pyx_pf_3_sa_6Phrase___cinit__(struct __pyx_obj_3_sa_Phrase *__pyx_v */ __pyx_v_j = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":19 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":19 * self.varpos = malloc(n_vars*sizeof(int)) * j = 0 * for i from 0 <= i < n: # <<<<<<<<<<<<<< @@ -25596,7 +25267,7 @@ static int __pyx_pf_3_sa_6Phrase___cinit__(struct __pyx_obj_3_sa_Phrase *__pyx_v __pyx_t_2 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":20 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":20 * j = 0 * for i from 0 <= i < n: * if sym_isvar(self.syms[i]): # <<<<<<<<<<<<<< @@ -25606,7 +25277,7 @@ static int __pyx_pf_3_sa_6Phrase___cinit__(struct __pyx_obj_3_sa_Phrase *__pyx_v __pyx_t_4 = __pyx_f_3_sa_sym_isvar((__pyx_v_self->syms[__pyx_v_i])); if (__pyx_t_4) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":21 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":21 * for i from 0 <= i < n: * if sym_isvar(self.syms[i]): * self.varpos[j] = i # <<<<<<<<<<<<<< @@ -25615,7 +25286,7 @@ static int __pyx_pf_3_sa_6Phrase___cinit__(struct __pyx_obj_3_sa_Phrase *__pyx_v */ (__pyx_v_self->varpos[__pyx_v_j]) = __pyx_v_i; - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":22 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":22 * if sym_isvar(self.syms[i]): * self.varpos[j] = i * j = j + 1 # <<<<<<<<<<<<<< @@ -25648,7 +25319,7 @@ static void __pyx_pw_3_sa_6Phrase_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyFinishContext(); } -/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":24 +/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":24 * j = j + 1 * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -25660,7 +25331,7 @@ static void __pyx_pf_3_sa_6Phrase_2__dealloc__(struct __pyx_obj_3_sa_Phrase *__p __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":25 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":25 * * def __dealloc__(self): * free(self.syms) # <<<<<<<<<<<<<< @@ -25669,7 +25340,7 @@ static void __pyx_pf_3_sa_6Phrase_2__dealloc__(struct __pyx_obj_3_sa_Phrase *__p */ free(__pyx_v_self->syms); - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":26 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":26 * def __dealloc__(self): * free(self.syms) * free(self.varpos) # <<<<<<<<<<<<<< @@ -25692,7 +25363,7 @@ static PyObject *__pyx_pw_3_sa_6Phrase_5__str__(PyObject *__pyx_v_self) { return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":28 +/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":28 * free(self.varpos) * * def __str__(self): # <<<<<<<<<<<<<< @@ -25716,7 +25387,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_4__str__(struct __pyx_obj_3_sa_Phrase *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__str__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":29 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":29 * * def __str__(self): * strs = [] # <<<<<<<<<<<<<< @@ -25728,7 +25399,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_4__str__(struct __pyx_obj_3_sa_Phrase *__ __pyx_v_strs = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":31 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":31 * strs = [] * cdef int i, s * for i from 0 <= i < self.n: # <<<<<<<<<<<<<< @@ -25738,7 +25409,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_4__str__(struct __pyx_obj_3_sa_Phrase *__ __pyx_t_2 = __pyx_v_self->n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":32 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":32 * cdef int i, s * for i from 0 <= i < self.n: * s = self.syms[i] # <<<<<<<<<<<<<< @@ -25747,7 +25418,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_4__str__(struct __pyx_obj_3_sa_Phrase *__ */ __pyx_v_s = (__pyx_v_self->syms[__pyx_v_i]); - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":33 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":33 * for i from 0 <= i < self.n: * s = self.syms[i] * strs.append(sym_tostring(s)) # <<<<<<<<<<<<<< @@ -25760,7 +25431,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_4__str__(struct __pyx_obj_3_sa_Phrase *__ __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; } - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":34 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":34 * s = self.syms[i] * strs.append(sym_tostring(s)) * return ' '.join(strs) # <<<<<<<<<<<<<< @@ -25810,7 +25481,7 @@ static PyObject *__pyx_pw_3_sa_6Phrase_7handle(PyObject *__pyx_v_self, CYTHON_UN return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":36 +/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":36 * return ' '.join(strs) * * def handle(self): # <<<<<<<<<<<<<< @@ -25834,7 +25505,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_6handle(struct __pyx_obj_3_sa_Phrase *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("handle", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":39 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":39 * """return a hashable representation that normalizes the ordering * of the nonterminal indices""" * norm = [] # <<<<<<<<<<<<<< @@ -25846,7 +25517,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_6handle(struct __pyx_obj_3_sa_Phrase *__p __pyx_v_norm = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":41 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":41 * norm = [] * cdef int i, j, s * i = 1 # <<<<<<<<<<<<<< @@ -25855,7 +25526,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_6handle(struct __pyx_obj_3_sa_Phrase *__p */ __pyx_v_i = 1; - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":42 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":42 * cdef int i, j, s * i = 1 * j = 0 # <<<<<<<<<<<<<< @@ -25864,7 +25535,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_6handle(struct __pyx_obj_3_sa_Phrase *__p */ __pyx_v_j = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":43 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":43 * i = 1 * j = 0 * for j from 0 <= j < self.n: # <<<<<<<<<<<<<< @@ -25874,7 +25545,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_6handle(struct __pyx_obj_3_sa_Phrase *__p __pyx_t_2 = __pyx_v_self->n; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_2; __pyx_v_j++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":44 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":44 * j = 0 * for j from 0 <= j < self.n: * s = self.syms[j] # <<<<<<<<<<<<<< @@ -25883,7 +25554,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_6handle(struct __pyx_obj_3_sa_Phrase *__p */ __pyx_v_s = (__pyx_v_self->syms[__pyx_v_j]); - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":45 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":45 * for j from 0 <= j < self.n: * s = self.syms[j] * if sym_isvar(s): # <<<<<<<<<<<<<< @@ -25893,7 +25564,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_6handle(struct __pyx_obj_3_sa_Phrase *__p __pyx_t_3 = __pyx_f_3_sa_sym_isvar(__pyx_v_s); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":46 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":46 * s = self.syms[j] * if sym_isvar(s): * s = sym_setindex(s,i) # <<<<<<<<<<<<<< @@ -25902,7 +25573,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_6handle(struct __pyx_obj_3_sa_Phrase *__p */ __pyx_v_s = __pyx_f_3_sa_sym_setindex(__pyx_v_s, __pyx_v_i); - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":47 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":47 * if sym_isvar(s): * s = sym_setindex(s,i) * i = i + 1 # <<<<<<<<<<<<<< @@ -25914,7 +25585,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_6handle(struct __pyx_obj_3_sa_Phrase *__p } __pyx_L5:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":48 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":48 * s = sym_setindex(s,i) * i = i + 1 * norm.append(s) # <<<<<<<<<<<<<< @@ -25927,7 +25598,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_6handle(struct __pyx_obj_3_sa_Phrase *__p __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":49 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":49 * i = i + 1 * norm.append(s) * return tuple(norm) # <<<<<<<<<<<<<< @@ -25965,7 +25636,7 @@ static PyObject *__pyx_pw_3_sa_6Phrase_9strhandle(PyObject *__pyx_v_self, CYTHON return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":51 +/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":51 * return tuple(norm) * * def strhandle(self): # <<<<<<<<<<<<<< @@ -25992,7 +25663,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_8strhandle(struct __pyx_obj_3_sa_Phrase * int __pyx_clineno = 0; __Pyx_RefNannySetupContext("strhandle", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":52 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":52 * * def strhandle(self): * strs = [] # <<<<<<<<<<<<<< @@ -26004,7 +25675,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_8strhandle(struct __pyx_obj_3_sa_Phrase * __pyx_v_strs = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":53 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":53 * def strhandle(self): * strs = [] * norm = [] # <<<<<<<<<<<<<< @@ -26016,7 +25687,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_8strhandle(struct __pyx_obj_3_sa_Phrase * __pyx_v_norm = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":55 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":55 * norm = [] * cdef int i, j, s * i = 1 # <<<<<<<<<<<<<< @@ -26025,7 +25696,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_8strhandle(struct __pyx_obj_3_sa_Phrase * */ __pyx_v_i = 1; - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":56 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":56 * cdef int i, j, s * i = 1 * j = 0 # <<<<<<<<<<<<<< @@ -26034,7 +25705,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_8strhandle(struct __pyx_obj_3_sa_Phrase * */ __pyx_v_j = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":57 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":57 * i = 1 * j = 0 * for j from 0 <= j < self.n: # <<<<<<<<<<<<<< @@ -26044,7 +25715,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_8strhandle(struct __pyx_obj_3_sa_Phrase * __pyx_t_2 = __pyx_v_self->n; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_2; __pyx_v_j++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":58 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":58 * j = 0 * for j from 0 <= j < self.n: * s = self.syms[j] # <<<<<<<<<<<<<< @@ -26053,7 +25724,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_8strhandle(struct __pyx_obj_3_sa_Phrase * */ __pyx_v_s = (__pyx_v_self->syms[__pyx_v_j]); - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":59 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":59 * for j from 0 <= j < self.n: * s = self.syms[j] * if sym_isvar(s): # <<<<<<<<<<<<<< @@ -26063,7 +25734,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_8strhandle(struct __pyx_obj_3_sa_Phrase * __pyx_t_3 = __pyx_f_3_sa_sym_isvar(__pyx_v_s); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":60 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":60 * s = self.syms[j] * if sym_isvar(s): * s = sym_setindex(s,i) # <<<<<<<<<<<<<< @@ -26072,7 +25743,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_8strhandle(struct __pyx_obj_3_sa_Phrase * */ __pyx_v_s = __pyx_f_3_sa_sym_setindex(__pyx_v_s, __pyx_v_i); - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":61 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":61 * if sym_isvar(s): * s = sym_setindex(s,i) * i = i + 1 # <<<<<<<<<<<<<< @@ -26084,7 +25755,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_8strhandle(struct __pyx_obj_3_sa_Phrase * } __pyx_L5:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":62 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":62 * s = sym_setindex(s,i) * i = i + 1 * norm.append(sym_tostring(s)) # <<<<<<<<<<<<<< @@ -26097,7 +25768,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_8strhandle(struct __pyx_obj_3_sa_Phrase * __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; } - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":63 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":63 * i = i + 1 * norm.append(sym_tostring(s)) * return ' '.join(norm) # <<<<<<<<<<<<<< @@ -26147,7 +25818,7 @@ static PyObject *__pyx_pw_3_sa_6Phrase_11arity(PyObject *__pyx_v_self, CYTHON_UN return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":65 +/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":65 * return ' '.join(norm) * * def arity(self): # <<<<<<<<<<<<<< @@ -26164,7 +25835,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_10arity(struct __pyx_obj_3_sa_Phrase *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("arity", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":66 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":66 * * def arity(self): * return self.n_vars # <<<<<<<<<<<<<< @@ -26201,7 +25872,7 @@ static PyObject *__pyx_pw_3_sa_6Phrase_13getvarpos(PyObject *__pyx_v_self, PyObj return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":68 +/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":68 * return self.n_vars * * def getvarpos(self, i): # <<<<<<<<<<<<<< @@ -26221,26 +25892,28 @@ static PyObject *__pyx_pf_3_sa_6Phrase_12getvarpos(struct __pyx_obj_3_sa_Phrase int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getvarpos", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":69 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":69 * * def getvarpos(self, i): * if 0 <= i < self.n_vars: # <<<<<<<<<<<<<< * return self.varpos[i] * else: */ - __pyx_t_1 = PyObject_RichCompare(__pyx_int_0, __pyx_v_i, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_int_0, __pyx_v_i, Py_LE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_IsTrue(__pyx_t_1)) { __Pyx_DECREF(__pyx_t_1); __pyx_t_2 = PyInt_FromLong(__pyx_v_self->n_vars); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_RichCompare(__pyx_v_i, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_i, __pyx_t_2, Py_LT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":70 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":70 * def getvarpos(self, i): * if 0 <= i < self.n_vars: * return self.varpos[i] # <<<<<<<<<<<<<< @@ -26258,7 +25931,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_12getvarpos(struct __pyx_obj_3_sa_Phrase } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":72 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":72 * return self.varpos[i] * else: * raise IndexError # <<<<<<<<<<<<<< @@ -26294,7 +25967,7 @@ static PyObject *__pyx_pw_3_sa_6Phrase_15getvar(PyObject *__pyx_v_self, PyObject return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":74 +/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":74 * raise IndexError * * def getvar(self, i): # <<<<<<<<<<<<<< @@ -26314,26 +25987,28 @@ static PyObject *__pyx_pf_3_sa_6Phrase_14getvar(struct __pyx_obj_3_sa_Phrase *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getvar", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":75 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":75 * * def getvar(self, i): * if 0 <= i < self.n_vars: # <<<<<<<<<<<<<< * return self.syms[self.varpos[i]] * else: */ - __pyx_t_1 = PyObject_RichCompare(__pyx_int_0, __pyx_v_i, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_int_0, __pyx_v_i, Py_LE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_IsTrue(__pyx_t_1)) { __Pyx_DECREF(__pyx_t_1); __pyx_t_2 = PyInt_FromLong(__pyx_v_self->n_vars); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_RichCompare(__pyx_v_i, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_i, __pyx_t_2, Py_LT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":76 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":76 * def getvar(self, i): * if 0 <= i < self.n_vars: * return self.syms[self.varpos[i]] # <<<<<<<<<<<<<< @@ -26351,7 +26026,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_14getvar(struct __pyx_obj_3_sa_Phrase *__ } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":78 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":78 * return self.syms[self.varpos[i]] * else: * raise IndexError # <<<<<<<<<<<<<< @@ -26376,7 +26051,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_14getvar(struct __pyx_obj_3_sa_Phrase *__ return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":80 +/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":80 * raise IndexError * * cdef int chunkpos(self, int k): # <<<<<<<<<<<<<< @@ -26390,7 +26065,7 @@ int __pyx_f_3_sa_6Phrase_chunkpos(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, in int __pyx_t_1; __Pyx_RefNannySetupContext("chunkpos", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":81 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":81 * * cdef int chunkpos(self, int k): * if k == 0: # <<<<<<<<<<<<<< @@ -26400,7 +26075,7 @@ int __pyx_f_3_sa_6Phrase_chunkpos(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, in __pyx_t_1 = (__pyx_v_k == 0); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":82 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":82 * cdef int chunkpos(self, int k): * if k == 0: * return 0 # <<<<<<<<<<<<<< @@ -26413,7 +26088,7 @@ int __pyx_f_3_sa_6Phrase_chunkpos(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, in } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":84 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":84 * return 0 * else: * return self.varpos[k-1]+1 # <<<<<<<<<<<<<< @@ -26431,7 +26106,7 @@ int __pyx_f_3_sa_6Phrase_chunkpos(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, in return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":86 +/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":86 * return self.varpos[k-1]+1 * * cdef int chunklen(self, int k): # <<<<<<<<<<<<<< @@ -26445,7 +26120,7 @@ int __pyx_f_3_sa_6Phrase_chunklen(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, in int __pyx_t_1; __Pyx_RefNannySetupContext("chunklen", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":87 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":87 * * cdef int chunklen(self, int k): * if self.n_vars == 0: # <<<<<<<<<<<<<< @@ -26455,7 +26130,7 @@ int __pyx_f_3_sa_6Phrase_chunklen(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, in __pyx_t_1 = (__pyx_v_self->n_vars == 0); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":88 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":88 * cdef int chunklen(self, int k): * if self.n_vars == 0: * return self.n # <<<<<<<<<<<<<< @@ -26467,7 +26142,7 @@ int __pyx_f_3_sa_6Phrase_chunklen(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, in goto __pyx_L3; } - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":89 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":89 * if self.n_vars == 0: * return self.n * elif k == 0: # <<<<<<<<<<<<<< @@ -26477,7 +26152,7 @@ int __pyx_f_3_sa_6Phrase_chunklen(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, in __pyx_t_1 = (__pyx_v_k == 0); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":90 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":90 * return self.n * elif k == 0: * return self.varpos[0] # <<<<<<<<<<<<<< @@ -26489,7 +26164,7 @@ int __pyx_f_3_sa_6Phrase_chunklen(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, in goto __pyx_L3; } - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":91 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":91 * elif k == 0: * return self.varpos[0] * elif k == self.n_vars: # <<<<<<<<<<<<<< @@ -26499,7 +26174,7 @@ int __pyx_f_3_sa_6Phrase_chunklen(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, in __pyx_t_1 = (__pyx_v_k == __pyx_v_self->n_vars); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":92 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":92 * return self.varpos[0] * elif k == self.n_vars: * return self.n-self.varpos[k-1]-1 # <<<<<<<<<<<<<< @@ -26512,7 +26187,7 @@ int __pyx_f_3_sa_6Phrase_chunklen(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, in } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":94 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":94 * return self.n-self.varpos[k-1]-1 * else: * return self.varpos[k]-self.varpos[k-1]-1 # <<<<<<<<<<<<<< @@ -26541,7 +26216,7 @@ static PyObject *__pyx_pw_3_sa_6Phrase_17clen(PyObject *__pyx_v_self, PyObject * return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":96 +/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":96 * return self.varpos[k]-self.varpos[k-1]-1 * * def clen(self, k): # <<<<<<<<<<<<<< @@ -26559,7 +26234,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_16clen(struct __pyx_obj_3_sa_Phrase *__py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clen", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":97 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":97 * * def clen(self, k): * return self.chunklen(k) # <<<<<<<<<<<<<< @@ -26597,7 +26272,7 @@ static PyObject *__pyx_pw_3_sa_6Phrase_19getchunk(PyObject *__pyx_v_self, PyObje return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":99 +/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":99 * return self.chunklen(k) * * def getchunk(self, ci): # <<<<<<<<<<<<<< @@ -26620,7 +26295,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_18getchunk(struct __pyx_obj_3_sa_Phrase * int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getchunk", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":101 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":101 * def getchunk(self, ci): * cdef int start, stop * start = self.chunkpos(ci) # <<<<<<<<<<<<<< @@ -26630,7 +26305,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_18getchunk(struct __pyx_obj_3_sa_Phrase * __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_ci); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_start = ((struct __pyx_vtabstruct_3_sa_Phrase *)__pyx_v_self->__pyx_vtab)->chunkpos(__pyx_v_self, __pyx_t_1); - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":102 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":102 * cdef int start, stop * start = self.chunkpos(ci) * stop = start+self.chunklen(ci) # <<<<<<<<<<<<<< @@ -26640,7 +26315,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_18getchunk(struct __pyx_obj_3_sa_Phrase * __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_ci); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_stop = (__pyx_v_start + ((struct __pyx_vtabstruct_3_sa_Phrase *)__pyx_v_self->__pyx_vtab)->chunklen(__pyx_v_self, __pyx_t_1)); - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":103 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":103 * start = self.chunkpos(ci) * stop = start+self.chunklen(ci) * chunk = [] # <<<<<<<<<<<<<< @@ -26652,7 +26327,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_18getchunk(struct __pyx_obj_3_sa_Phrase * __pyx_v_chunk = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":104 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":104 * stop = start+self.chunklen(ci) * chunk = [] * for i from start <= i < stop: # <<<<<<<<<<<<<< @@ -26662,7 +26337,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_18getchunk(struct __pyx_obj_3_sa_Phrase * __pyx_t_1 = __pyx_v_stop; for (__pyx_v_i = __pyx_v_start; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":105 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":105 * chunk = [] * for i from start <= i < stop: * chunk.append(self.syms[i]) # <<<<<<<<<<<<<< @@ -26675,7 +26350,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_18getchunk(struct __pyx_obj_3_sa_Phrase * __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":106 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":106 * for i from start <= i < stop: * chunk.append(self.syms[i]) * return chunk # <<<<<<<<<<<<<< @@ -26713,7 +26388,7 @@ static int __pyx_pw_3_sa_6Phrase_21__cmp__(PyObject *__pyx_v_self, PyObject *__p } #endif /*!(#if PY_MAJOR_VERSION < 3)*/ -/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":108 +/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":108 * return chunk * * def __cmp__(self, other): # <<<<<<<<<<<<<< @@ -26736,7 +26411,7 @@ static int __pyx_pf_3_sa_6Phrase_20__cmp__(struct __pyx_obj_3_sa_Phrase *__pyx_v int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cmp__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":111 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":111 * cdef Phrase otherp * cdef int i * otherp = other # <<<<<<<<<<<<<< @@ -26747,7 +26422,7 @@ static int __pyx_pf_3_sa_6Phrase_20__cmp__(struct __pyx_obj_3_sa_Phrase *__pyx_v __Pyx_INCREF(__pyx_v_other); __pyx_v_otherp = ((struct __pyx_obj_3_sa_Phrase *)__pyx_v_other); - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":112 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":112 * cdef int i * otherp = other * for i from 0 <= i < min(self.n, otherp.n): # <<<<<<<<<<<<<< @@ -26764,7 +26439,7 @@ static int __pyx_pf_3_sa_6Phrase_20__cmp__(struct __pyx_obj_3_sa_Phrase *__pyx_v __pyx_t_1 = __pyx_t_3; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":113 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":113 * otherp = other * for i from 0 <= i < min(self.n, otherp.n): * if self.syms[i] < otherp.syms[i]: # <<<<<<<<<<<<<< @@ -26774,7 +26449,7 @@ static int __pyx_pf_3_sa_6Phrase_20__cmp__(struct __pyx_obj_3_sa_Phrase *__pyx_v __pyx_t_4 = ((__pyx_v_self->syms[__pyx_v_i]) < (__pyx_v_otherp->syms[__pyx_v_i])); if (__pyx_t_4) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":114 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":114 * for i from 0 <= i < min(self.n, otherp.n): * if self.syms[i] < otherp.syms[i]: * return -1 # <<<<<<<<<<<<<< @@ -26786,7 +26461,7 @@ static int __pyx_pf_3_sa_6Phrase_20__cmp__(struct __pyx_obj_3_sa_Phrase *__pyx_v goto __pyx_L5; } - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":115 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":115 * if self.syms[i] < otherp.syms[i]: * return -1 * elif self.syms[i] > otherp.syms[i]: # <<<<<<<<<<<<<< @@ -26796,7 +26471,7 @@ static int __pyx_pf_3_sa_6Phrase_20__cmp__(struct __pyx_obj_3_sa_Phrase *__pyx_v __pyx_t_4 = ((__pyx_v_self->syms[__pyx_v_i]) > (__pyx_v_otherp->syms[__pyx_v_i])); if (__pyx_t_4) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":116 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":116 * return -1 * elif self.syms[i] > otherp.syms[i]: * return 1 # <<<<<<<<<<<<<< @@ -26810,7 +26485,7 @@ static int __pyx_pf_3_sa_6Phrase_20__cmp__(struct __pyx_obj_3_sa_Phrase *__pyx_v __pyx_L5:; } - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":117 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":117 * elif self.syms[i] > otherp.syms[i]: * return 1 * if self.n < otherp.n: # <<<<<<<<<<<<<< @@ -26820,7 +26495,7 @@ static int __pyx_pf_3_sa_6Phrase_20__cmp__(struct __pyx_obj_3_sa_Phrase *__pyx_v __pyx_t_4 = (__pyx_v_self->n < __pyx_v_otherp->n); if (__pyx_t_4) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":118 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":118 * return 1 * if self.n < otherp.n: * return -1 # <<<<<<<<<<<<<< @@ -26832,7 +26507,7 @@ static int __pyx_pf_3_sa_6Phrase_20__cmp__(struct __pyx_obj_3_sa_Phrase *__pyx_v goto __pyx_L6; } - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":119 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":119 * if self.n < otherp.n: * return -1 * elif self.n > otherp.n: # <<<<<<<<<<<<<< @@ -26842,7 +26517,7 @@ static int __pyx_pf_3_sa_6Phrase_20__cmp__(struct __pyx_obj_3_sa_Phrase *__pyx_v __pyx_t_4 = (__pyx_v_self->n > __pyx_v_otherp->n); if (__pyx_t_4) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":120 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":120 * return -1 * elif self.n > otherp.n: * return 1 # <<<<<<<<<<<<<< @@ -26855,7 +26530,7 @@ static int __pyx_pf_3_sa_6Phrase_20__cmp__(struct __pyx_obj_3_sa_Phrase *__pyx_v } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":122 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":122 * return 1 * else: * return 0 # <<<<<<<<<<<<<< @@ -26890,7 +26565,7 @@ static Py_hash_t __pyx_pw_3_sa_6Phrase_23__hash__(PyObject *__pyx_v_self) { return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":124 +/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":124 * return 0 * * def __hash__(self): # <<<<<<<<<<<<<< @@ -26907,7 +26582,7 @@ static Py_hash_t __pyx_pf_3_sa_6Phrase_22__hash__(struct __pyx_obj_3_sa_Phrase * int __pyx_t_2; __Pyx_RefNannySetupContext("__hash__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":127 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":127 * cdef int i * cdef unsigned h * h = 0 # <<<<<<<<<<<<<< @@ -26916,7 +26591,7 @@ static Py_hash_t __pyx_pf_3_sa_6Phrase_22__hash__(struct __pyx_obj_3_sa_Phrase * */ __pyx_v_h = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":128 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":128 * cdef unsigned h * h = 0 * for i from 0 <= i < self.n: # <<<<<<<<<<<<<< @@ -26926,7 +26601,7 @@ static Py_hash_t __pyx_pf_3_sa_6Phrase_22__hash__(struct __pyx_obj_3_sa_Phrase * __pyx_t_1 = __pyx_v_self->n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":129 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":129 * h = 0 * for i from 0 <= i < self.n: * if self.syms[i] > 0: # <<<<<<<<<<<<<< @@ -26936,7 +26611,7 @@ static Py_hash_t __pyx_pf_3_sa_6Phrase_22__hash__(struct __pyx_obj_3_sa_Phrase * __pyx_t_2 = ((__pyx_v_self->syms[__pyx_v_i]) > 0); if (__pyx_t_2) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":130 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":130 * for i from 0 <= i < self.n: * if self.syms[i] > 0: * h = (h << 1) + self.syms[i] # <<<<<<<<<<<<<< @@ -26948,7 +26623,7 @@ static Py_hash_t __pyx_pf_3_sa_6Phrase_22__hash__(struct __pyx_obj_3_sa_Phrase * } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":132 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":132 * h = (h << 1) + self.syms[i] * else: * h = (h << 1) + -self.syms[i] # <<<<<<<<<<<<<< @@ -26960,7 +26635,7 @@ static Py_hash_t __pyx_pf_3_sa_6Phrase_22__hash__(struct __pyx_obj_3_sa_Phrase * __pyx_L5:; } - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":133 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":133 * else: * h = (h << 1) + -self.syms[i] * return h # <<<<<<<<<<<<<< @@ -26988,7 +26663,7 @@ static Py_ssize_t __pyx_pw_3_sa_6Phrase_25__len__(PyObject *__pyx_v_self) { return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":135 +/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":135 * return h * * def __len__(self): # <<<<<<<<<<<<<< @@ -27001,7 +26676,7 @@ static Py_ssize_t __pyx_pf_3_sa_6Phrase_24__len__(struct __pyx_obj_3_sa_Phrase * __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":136 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":136 * * def __len__(self): * return self.n # <<<<<<<<<<<<<< @@ -27028,7 +26703,7 @@ static PyObject *__pyx_pw_3_sa_6Phrase_27__getitem__(PyObject *__pyx_v_self, PyO return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":138 +/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":138 * return self.n * * def __getitem__(self, i): # <<<<<<<<<<<<<< @@ -27046,7 +26721,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_26__getitem__(struct __pyx_obj_3_sa_Phras int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":139 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":139 * * def __getitem__(self, i): * return self.syms[i] # <<<<<<<<<<<<<< @@ -27085,7 +26760,7 @@ static PyObject *__pyx_pw_3_sa_6Phrase_29__iter__(PyObject *__pyx_v_self) { return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":141 +/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":141 * return self.syms[i] * * def __iter__(self): # <<<<<<<<<<<<<< @@ -27147,7 +26822,7 @@ static PyObject *__pyx_gb_3_sa_6Phrase_30generator2(__pyx_GeneratorObject *__pyx __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":143 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":143 * def __iter__(self): * cdef int i * for i from 0 <= i < self.n: # <<<<<<<<<<<<<< @@ -27157,7 +26832,7 @@ static PyObject *__pyx_gb_3_sa_6Phrase_30generator2(__pyx_GeneratorObject *__pyx __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/pauldb/workspace/cdec/python/src/sa/rule.pxi":144 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":144 * cdef int i * for i from 0 <= i < self.n: * yield self.syms[i] # <<<<<<<<<<<<<< @@ -27186,7 +26861,6 @@ static PyObject *__pyx_gb_3_sa_6Phrase_30generator2(__pyx_GeneratorObject *__pyx __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_generator->resume_label = -1; - __Pyx_Generator_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return NULL; } @@ -27196,11 +26870,11 @@ static PyObject *__pyx_pw_3_sa_6Phrase_32subst(PyObject *__pyx_v_self, PyObject static PyObject *__pyx_pw_3_sa_6Phrase_32subst(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_start = 0; PyObject *__pyx_v_children = 0; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__start,&__pyx_n_s__children,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("subst (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__start,&__pyx_n_s__children,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -27214,10 +26888,12 @@ static PyObject *__pyx_pw_3_sa_6Phrase_32subst(PyObject *__pyx_v_self, PyObject 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--; + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start); + if (likely(values[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--; + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__children); + if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("subst", 1, 2, 2, 1); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -27247,7 +26923,7 @@ static PyObject *__pyx_pw_3_sa_6Phrase_32subst(PyObject *__pyx_v_self, PyObject return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":146 +/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":146 * yield self.syms[i] * * def subst(self, start, children): # <<<<<<<<<<<<<< @@ -27270,7 +26946,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_31subst(struct __pyx_obj_3_sa_Phrase *__p __Pyx_RefNannySetupContext("subst", 0); __Pyx_INCREF(__pyx_v_start); - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":148 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":148 * def subst(self, start, children): * cdef int i * for i from 0 <= i < self.n: # <<<<<<<<<<<<<< @@ -27280,7 +26956,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_31subst(struct __pyx_obj_3_sa_Phrase *__p __pyx_t_1 = __pyx_v_self->n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":149 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":149 * cdef int i * for i from 0 <= i < self.n: * if sym_isvar(self.syms[i]): # <<<<<<<<<<<<<< @@ -27290,7 +26966,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_31subst(struct __pyx_obj_3_sa_Phrase *__p __pyx_t_2 = __pyx_f_3_sa_sym_isvar((__pyx_v_self->syms[__pyx_v_i])); if (__pyx_t_2) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":150 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":150 * for i from 0 <= i < self.n: * if sym_isvar(self.syms[i]): * start = start + children[sym_getindex(self.syms[i])-1] # <<<<<<<<<<<<<< @@ -27310,7 +26986,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_31subst(struct __pyx_obj_3_sa_Phrase *__p } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":152 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":152 * start = start + children[sym_getindex(self.syms[i])-1] * else: * start = start + (self.syms[i],) # <<<<<<<<<<<<<< @@ -27334,7 +27010,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_31subst(struct __pyx_obj_3_sa_Phrase *__p __pyx_L5:; } - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":153 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":153 * else: * start = start + (self.syms[i],) * return start # <<<<<<<<<<<<<< @@ -27371,7 +27047,7 @@ static PyObject *__pyx_pw_3_sa_6Phrase_5words_1__get__(PyObject *__pyx_v_self) { return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":156 +/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":156 * * property words: * def __get__(self): # <<<<<<<<<<<<<< @@ -27395,7 +27071,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_5words___get__(struct __pyx_obj_3_sa_Phra int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":157 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":157 * property words: * def __get__(self): * return [sym_tostring(w) for w in self if not sym_isvar(w)] # <<<<<<<<<<<<<< @@ -27416,18 +27092,10 @@ static PyObject *__pyx_pf_3_sa_6Phrase_5words___get__(struct __pyx_obj_3_sa_Phra for (;;) { if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; } else { __pyx_t_5 = __pyx_t_4(__pyx_t_2); if (unlikely(!__pyx_t_5)) { @@ -27448,7 +27116,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_5words___get__(struct __pyx_obj_3_sa_Phra __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_w); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = PyBytes_FromString(__pyx_f_3_sa_sym_tostring(__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - if (unlikely(__Pyx_PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; goto __pyx_L5; } @@ -27483,14 +27151,14 @@ static int __pyx_pw_3_sa_4Rule_1__cinit__(PyObject *__pyx_v_self, PyObject *__py struct __pyx_obj_3_sa_Phrase *__pyx_v_e = 0; PyObject *__pyx_v_scores = 0; PyObject *__pyx_v_word_alignments = 0; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__lhs,&__pyx_n_s__f,&__pyx_n_s__e,&__pyx_n_s__scores,&__pyx_n_s__word_alignments,0}; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__lhs,&__pyx_n_s__f,&__pyx_n_s__e,&__pyx_n_s__scores,&__pyx_n_s__word_alignments,0}; PyObject* values[5] = {0,0,0,0,0}; - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":161 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":161 * cdef class Rule: * * def __cinit__(self, int lhs, Phrase f, Phrase e, scores=None, word_alignments=None): # <<<<<<<<<<<<<< @@ -27514,15 +27182,18 @@ static int __pyx_pw_3_sa_4Rule_1__cinit__(PyObject *__pyx_v_self, PyObject *__py 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--; + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lhs); + if (likely(values[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--; + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f); + if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e)) != 0)) kw_args--; + values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e); + if (likely(values[2])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -27587,7 +27258,7 @@ static int __pyx_pf_3_sa_4Rule___cinit__(struct __pyx_obj_3_sa_Rule *__pyx_v_sel int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":162 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -27616,7 +27287,7 @@ static int __pyx_pf_3_sa_4Rule___cinit__(struct __pyx_obj_3_sa_Rule *__pyx_v_sel } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":163 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":163 * 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 # <<<<<<<<<<<<<< @@ -27625,7 +27296,7 @@ static int __pyx_pf_3_sa_4Rule___cinit__(struct __pyx_obj_3_sa_Rule *__pyx_v_sel */ __pyx_v_self->lhs = __pyx_v_lhs; - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":164 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":164 * if not sym_isvar(lhs): raise Exception('Invalid LHS symbol: %d' % lhs) * self.lhs = lhs * self.f = f # <<<<<<<<<<<<<< @@ -27638,7 +27309,7 @@ static int __pyx_pf_3_sa_4Rule___cinit__(struct __pyx_obj_3_sa_Rule *__pyx_v_sel __Pyx_DECREF(((PyObject *)__pyx_v_self->f)); __pyx_v_self->f = __pyx_v_f; - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":165 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":165 * self.lhs = lhs * self.f = f * self.e = e # <<<<<<<<<<<<<< @@ -27651,7 +27322,7 @@ static int __pyx_pf_3_sa_4Rule___cinit__(struct __pyx_obj_3_sa_Rule *__pyx_v_sel __Pyx_DECREF(((PyObject *)__pyx_v_self->e)); __pyx_v_self->e = __pyx_v_e; - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":166 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":166 * self.f = f * self.e = e * self.word_alignments = word_alignments # <<<<<<<<<<<<<< @@ -27664,7 +27335,7 @@ static int __pyx_pf_3_sa_4Rule___cinit__(struct __pyx_obj_3_sa_Rule *__pyx_v_sel __Pyx_DECREF(__pyx_v_self->word_alignments); __pyx_v_self->word_alignments = __pyx_v_word_alignments; - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":167 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":167 * self.e = e * self.word_alignments = word_alignments * self.scores = scores # <<<<<<<<<<<<<< @@ -27701,7 +27372,7 @@ static Py_hash_t __pyx_pw_3_sa_4Rule_3__hash__(PyObject *__pyx_v_self) { return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":169 +/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":169 * self.scores = scores * * def __hash__(self): # <<<<<<<<<<<<<< @@ -27720,7 +27391,7 @@ static Py_hash_t __pyx_pf_3_sa_4Rule_2__hash__(struct __pyx_obj_3_sa_Rule *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__hash__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":170 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":170 * * def __hash__(self): * return hash((self.lhs, self.f, self.e)) # <<<<<<<<<<<<<< @@ -27776,7 +27447,7 @@ static int __pyx_pw_3_sa_4Rule_5__cmp__(PyObject *__pyx_v_self, PyObject *__pyx_ } #endif /*!(#if PY_MAJOR_VERSION < 3)*/ -/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":172 +/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":172 * return hash((self.lhs, self.f, self.e)) * * def __cmp__(self, Rule other): # <<<<<<<<<<<<<< @@ -27797,7 +27468,7 @@ static int __pyx_pf_3_sa_4Rule_4__cmp__(struct __pyx_obj_3_sa_Rule *__pyx_v_self int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cmp__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":173 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":173 * * def __cmp__(self, Rule other): * return cmp((self.lhs, self.f, self.e, self.word_alignments), # <<<<<<<<<<<<<< @@ -27821,7 +27492,7 @@ static int __pyx_pf_3_sa_4Rule_4__cmp__(struct __pyx_obj_3_sa_Rule *__pyx_v_self __Pyx_GIVEREF(__pyx_v_self->word_alignments); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":174 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":174 * 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)) # <<<<<<<<<<<<<< @@ -27890,7 +27561,7 @@ static PyObject *__pyx_pw_3_sa_4Rule_7fmerge(PyObject *__pyx_v_self, PyObject *_ return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":176 +/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":176 * (other.lhs, other.f, other.e, self.word_alignments)) * * def fmerge(self, Phrase f): # <<<<<<<<<<<<<< @@ -27908,19 +27579,20 @@ static PyObject *__pyx_pf_3_sa_4Rule_6fmerge(struct __pyx_obj_3_sa_Rule *__pyx_v int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fmerge", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":177 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":177 * * def fmerge(self, Phrase f): * if self.f == f: # <<<<<<<<<<<<<< * self.f = f * */ - __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_self->f), ((PyObject *)__pyx_v_f), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_self->f), ((PyObject *)__pyx_v_f), Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":178 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":178 * def fmerge(self, Phrase f): * if self.f == f: * self.f = f # <<<<<<<<<<<<<< @@ -27959,7 +27631,7 @@ static PyObject *__pyx_pw_3_sa_4Rule_9arity(PyObject *__pyx_v_self, CYTHON_UNUSE return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":180 +/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":180 * self.f = f * * def arity(self): # <<<<<<<<<<<<<< @@ -27977,7 +27649,7 @@ static PyObject *__pyx_pf_3_sa_4Rule_8arity(struct __pyx_obj_3_sa_Rule *__pyx_v_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("arity", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":181 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":181 * * def arity(self): * return self.f.arity() # <<<<<<<<<<<<<< @@ -28019,7 +27691,7 @@ static PyObject *__pyx_pw_3_sa_4Rule_11__str__(PyObject *__pyx_v_self) { } static PyObject *__pyx_gb_3_sa_4Rule_7__str___2generator13(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":187 +/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":187 * 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())) # <<<<<<<<<<<<<< @@ -28100,18 +27772,10 @@ static PyObject *__pyx_gb_3_sa_4Rule_7__str___2generator13(__pyx_GeneratorObject for (;;) { if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; } else { __pyx_t_2 = __pyx_t_4(__pyx_t_1); if (unlikely(!__pyx_t_2)) { @@ -28159,12 +27823,11 @@ static PyObject *__pyx_gb_3_sa_4Rule_7__str___2generator13(__pyx_GeneratorObject __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_generator->resume_label = -1; - __Pyx_Generator_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return NULL; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":183 +/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":183 * return self.f.arity() * * def __str__(self): # <<<<<<<<<<<<<< @@ -28198,7 +27861,7 @@ static PyObject *__pyx_pf_3_sa_4Rule_10__str__(struct __pyx_obj_3_sa_Rule *__pyx __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self); - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":185 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":185 * def __str__(self): * cdef unsigned i * fields = [sym_tostring(self.lhs), str(self.f), str(self.e), str(self.scores)] # <<<<<<<<<<<<<< @@ -28248,7 +27911,7 @@ static PyObject *__pyx_pf_3_sa_4Rule_10__str__(struct __pyx_obj_3_sa_Rule *__pyx __pyx_v_fields = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":186 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":186 * cdef unsigned i * fields = [sym_tostring(self.lhs), str(self.f), str(self.e), str(self.scores)] * if self.word_alignments is not None: # <<<<<<<<<<<<<< @@ -28258,7 +27921,7 @@ static PyObject *__pyx_pf_3_sa_4Rule_10__str__(struct __pyx_obj_3_sa_Rule *__pyx __pyx_t_6 = (__pyx_cur_scope->__pyx_v_self->word_alignments != Py_None); if (__pyx_t_6) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":187 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":187 * 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())) # <<<<<<<<<<<<<< @@ -28284,7 +27947,7 @@ static PyObject *__pyx_pf_3_sa_4Rule_10__str__(struct __pyx_obj_3_sa_Rule *__pyx } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":188 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":188 * if self.word_alignments is not None: * fields.append(' '.join('%d-%d' % a for a in self.alignments())) * return ' ||| '.join(fields) # <<<<<<<<<<<<<< @@ -28337,7 +28000,7 @@ static PyObject *__pyx_pw_3_sa_4Rule_13alignments(PyObject *__pyx_v_self, CYTHON return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":190 +/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":190 * return ' ||| '.join(fields) * * def alignments(self): # <<<<<<<<<<<<<< @@ -28403,7 +28066,7 @@ static PyObject *__pyx_gb_3_sa_4Rule_14generator3(__pyx_GeneratorObject *__pyx_g __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":191 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":191 * * def alignments(self): * for point in self.word_alignments: # <<<<<<<<<<<<<< @@ -28420,18 +28083,10 @@ static PyObject *__pyx_gb_3_sa_4Rule_14generator3(__pyx_GeneratorObject *__pyx_g for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 191; __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[7]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; } 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[7]; __pyx_lineno = 191; __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[7]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { @@ -28449,7 +28104,7 @@ static PyObject *__pyx_gb_3_sa_4Rule_14generator3(__pyx_GeneratorObject *__pyx_g __pyx_cur_scope->__pyx_v_point = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":192 + /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":192 * def alignments(self): * for point in self.word_alignments: * yield point/65536, point%65536 # <<<<<<<<<<<<<< @@ -28497,7 +28152,6 @@ static PyObject *__pyx_gb_3_sa_4Rule_14generator3(__pyx_GeneratorObject *__pyx_g __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_generator->resume_label = -1; - __Pyx_Generator_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return NULL; } @@ -28564,7 +28218,7 @@ static PyObject *__pyx_pf_3_sa_4Rule_1e___get__(struct __pyx_obj_3_sa_Rule *__py return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":21 +/* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":21 * int arr_len * * cdef _Trie_Node* new_trie_node(): # <<<<<<<<<<<<<< @@ -28578,7 +28232,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_new_trie_node(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("new_trie_node", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":23 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":23 * cdef _Trie_Node* new_trie_node(): * cdef _Trie_Node* node * node = <_Trie_Node*> malloc(sizeof(_Trie_Node)) # <<<<<<<<<<<<<< @@ -28587,7 +28241,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_new_trie_node(void) { */ __pyx_v_node = ((struct __pyx_t_3_sa__Trie_Node *)malloc((sizeof(struct __pyx_t_3_sa__Trie_Node)))); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":24 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":24 * cdef _Trie_Node* node * node = <_Trie_Node*> malloc(sizeof(_Trie_Node)) * node.root = NULL # <<<<<<<<<<<<<< @@ -28596,7 +28250,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_new_trie_node(void) { */ __pyx_v_node->root = NULL; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":25 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":25 * node = <_Trie_Node*> malloc(sizeof(_Trie_Node)) * node.root = NULL * node.arr_len = 0 # <<<<<<<<<<<<<< @@ -28605,7 +28259,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_new_trie_node(void) { */ __pyx_v_node->arr_len = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":26 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":26 * node.root = NULL * node.arr_len = 0 * node.arr = malloc(sizeof(0*sizeof(int))) # <<<<<<<<<<<<<< @@ -28614,7 +28268,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_new_trie_node(void) { */ __pyx_v_node->arr = ((int *)malloc((sizeof((0 * (sizeof(int))))))); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":27 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":27 * node.arr_len = 0 * node.arr = malloc(sizeof(0*sizeof(int))) * return node # <<<<<<<<<<<<<< @@ -28630,7 +28284,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_new_trie_node(void) { return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":29 +/* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":29 * return node * * cdef _Trie_Edge* new_trie_edge(int val): # <<<<<<<<<<<<<< @@ -28644,7 +28298,7 @@ static struct __pyx_t_3_sa__Trie_Edge *__pyx_f_3_sa_new_trie_edge(int __pyx_v_va __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("new_trie_edge", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":31 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":31 * cdef _Trie_Edge* new_trie_edge(int val): * cdef _Trie_Edge* edge * edge = <_Trie_Edge*> malloc(sizeof(_Trie_Edge)) # <<<<<<<<<<<<<< @@ -28653,7 +28307,7 @@ static struct __pyx_t_3_sa__Trie_Edge *__pyx_f_3_sa_new_trie_edge(int __pyx_v_va */ __pyx_v_edge = ((struct __pyx_t_3_sa__Trie_Edge *)malloc((sizeof(struct __pyx_t_3_sa__Trie_Edge)))); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":32 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":32 * cdef _Trie_Edge* edge * edge = <_Trie_Edge*> malloc(sizeof(_Trie_Edge)) * edge.node = new_trie_node() # <<<<<<<<<<<<<< @@ -28662,7 +28316,7 @@ static struct __pyx_t_3_sa__Trie_Edge *__pyx_f_3_sa_new_trie_edge(int __pyx_v_va */ __pyx_v_edge->node = __pyx_f_3_sa_new_trie_node(); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":33 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":33 * edge = <_Trie_Edge*> malloc(sizeof(_Trie_Edge)) * edge.node = new_trie_node() * edge.bigger = NULL # <<<<<<<<<<<<<< @@ -28671,7 +28325,7 @@ static struct __pyx_t_3_sa__Trie_Edge *__pyx_f_3_sa_new_trie_edge(int __pyx_v_va */ __pyx_v_edge->bigger = NULL; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":34 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":34 * edge.node = new_trie_node() * edge.bigger = NULL * edge.smaller = NULL # <<<<<<<<<<<<<< @@ -28680,7 +28334,7 @@ static struct __pyx_t_3_sa__Trie_Edge *__pyx_f_3_sa_new_trie_edge(int __pyx_v_va */ __pyx_v_edge->smaller = NULL; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":35 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":35 * edge.bigger = NULL * edge.smaller = NULL * edge.val = val # <<<<<<<<<<<<<< @@ -28689,7 +28343,7 @@ static struct __pyx_t_3_sa__Trie_Edge *__pyx_f_3_sa_new_trie_edge(int __pyx_v_va */ __pyx_v_edge->val = __pyx_v_val; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":36 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":36 * edge.smaller = NULL * edge.val = val * return edge # <<<<<<<<<<<<<< @@ -28705,7 +28359,7 @@ static struct __pyx_t_3_sa__Trie_Edge *__pyx_f_3_sa_new_trie_edge(int __pyx_v_va return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":38 +/* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":38 * return edge * * cdef free_trie_node(_Trie_Node* node): # <<<<<<<<<<<<<< @@ -28723,7 +28377,7 @@ static PyObject *__pyx_f_3_sa_free_trie_node(struct __pyx_t_3_sa__Trie_Node *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("free_trie_node", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":39 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":39 * * cdef free_trie_node(_Trie_Node* node): * if node != NULL: # <<<<<<<<<<<<<< @@ -28733,7 +28387,7 @@ static PyObject *__pyx_f_3_sa_free_trie_node(struct __pyx_t_3_sa__Trie_Node *__p __pyx_t_1 = (__pyx_v_node != NULL); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":40 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":40 * cdef free_trie_node(_Trie_Node* node): * if node != NULL: * free_trie_edge(node.root) # <<<<<<<<<<<<<< @@ -28744,7 +28398,7 @@ static PyObject *__pyx_f_3_sa_free_trie_node(struct __pyx_t_3_sa__Trie_Node *__p __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":41 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":41 * if node != NULL: * free_trie_edge(node.root) * free(node.arr) # <<<<<<<<<<<<<< @@ -28768,7 +28422,7 @@ static PyObject *__pyx_f_3_sa_free_trie_node(struct __pyx_t_3_sa__Trie_Node *__p return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":43 +/* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":43 * free(node.arr) * * cdef free_trie_edge(_Trie_Edge* edge): # <<<<<<<<<<<<<< @@ -28786,7 +28440,7 @@ static PyObject *__pyx_f_3_sa_free_trie_edge(struct __pyx_t_3_sa__Trie_Edge *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("free_trie_edge", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":44 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":44 * * cdef free_trie_edge(_Trie_Edge* edge): * if edge != NULL: # <<<<<<<<<<<<<< @@ -28796,7 +28450,7 @@ static PyObject *__pyx_f_3_sa_free_trie_edge(struct __pyx_t_3_sa__Trie_Edge *__p __pyx_t_1 = (__pyx_v_edge != NULL); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":45 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":45 * cdef free_trie_edge(_Trie_Edge* edge): * if edge != NULL: * free_trie_node(edge.node) # <<<<<<<<<<<<<< @@ -28807,7 +28461,7 @@ static PyObject *__pyx_f_3_sa_free_trie_edge(struct __pyx_t_3_sa__Trie_Edge *__p __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":46 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":46 * if edge != NULL: * free_trie_node(edge.node) * free_trie_edge(edge.bigger) # <<<<<<<<<<<<<< @@ -28818,7 +28472,7 @@ static PyObject *__pyx_f_3_sa_free_trie_edge(struct __pyx_t_3_sa__Trie_Edge *__p __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":47 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":47 * free_trie_node(edge.node) * free_trie_edge(edge.bigger) * free_trie_edge(edge.smaller) # <<<<<<<<<<<<<< @@ -28844,7 +28498,7 @@ static PyObject *__pyx_f_3_sa_free_trie_edge(struct __pyx_t_3_sa__Trie_Edge *__p return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":49 +/* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":49 * free_trie_edge(edge.smaller) * * cdef _Trie_Node* trie_find(_Trie_Node* node, int val): # <<<<<<<<<<<<<< @@ -28861,7 +28515,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_find(struct __pyx_t_3_s int __pyx_t_3; __Pyx_RefNannySetupContext("trie_find", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":51 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":51 * cdef _Trie_Node* trie_find(_Trie_Node* node, int val): * cdef _Trie_Edge* cur * cur = node.root # <<<<<<<<<<<<<< @@ -28870,7 +28524,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_find(struct __pyx_t_3_s */ __pyx_v_cur = __pyx_v_node->root; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":52 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":52 * cdef _Trie_Edge* cur * cur = node.root * while cur != NULL and cur.val != val: # <<<<<<<<<<<<<< @@ -28887,7 +28541,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_find(struct __pyx_t_3_s } if (!__pyx_t_3) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":53 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":53 * cur = node.root * while cur != NULL and cur.val != val: * if val > cur.val: # <<<<<<<<<<<<<< @@ -28897,7 +28551,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_find(struct __pyx_t_3_s __pyx_t_3 = (__pyx_v_val > __pyx_v_cur->val); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":54 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":54 * while cur != NULL and cur.val != val: * if val > cur.val: * cur = cur.bigger # <<<<<<<<<<<<<< @@ -28908,7 +28562,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_find(struct __pyx_t_3_s goto __pyx_L5; } - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":55 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":55 * if val > cur.val: * cur = cur.bigger * elif val < cur.val: # <<<<<<<<<<<<<< @@ -28918,7 +28572,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_find(struct __pyx_t_3_s __pyx_t_3 = (__pyx_v_val < __pyx_v_cur->val); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":56 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":56 * cur = cur.bigger * elif val < cur.val: * cur = cur.smaller # <<<<<<<<<<<<<< @@ -28931,7 +28585,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_find(struct __pyx_t_3_s __pyx_L5:; } - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":57 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":57 * elif val < cur.val: * cur = cur.smaller * if cur == NULL: # <<<<<<<<<<<<<< @@ -28941,7 +28595,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_find(struct __pyx_t_3_s __pyx_t_3 = (__pyx_v_cur == NULL); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":58 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":58 * cur = cur.smaller * if cur == NULL: * return NULL # <<<<<<<<<<<<<< @@ -28954,7 +28608,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_find(struct __pyx_t_3_s } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":60 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":60 * return NULL * else: * return cur.node # <<<<<<<<<<<<<< @@ -28972,7 +28626,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_find(struct __pyx_t_3_s return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":62 +/* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":62 * return cur.node * * cdef trie_node_data_append(_Trie_Node* node, int val): # <<<<<<<<<<<<<< @@ -28986,7 +28640,7 @@ static PyObject *__pyx_f_3_sa_trie_node_data_append(struct __pyx_t_3_sa__Trie_No __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("trie_node_data_append", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":64 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":64 * cdef trie_node_data_append(_Trie_Node* node, int val): * cdef int new_len * new_len = node.arr_len + 1 # <<<<<<<<<<<<<< @@ -28995,7 +28649,7 @@ static PyObject *__pyx_f_3_sa_trie_node_data_append(struct __pyx_t_3_sa__Trie_No */ __pyx_v_new_len = (__pyx_v_node->arr_len + 1); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":65 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":65 * cdef int new_len * new_len = node.arr_len + 1 * node.arr = realloc(node.arr, new_len*sizeof(int)) # <<<<<<<<<<<<<< @@ -29004,7 +28658,7 @@ static PyObject *__pyx_f_3_sa_trie_node_data_append(struct __pyx_t_3_sa__Trie_No */ __pyx_v_node->arr = ((int *)realloc(__pyx_v_node->arr, (__pyx_v_new_len * (sizeof(int))))); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":66 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -29013,7 +28667,7 @@ static PyObject *__pyx_f_3_sa_trie_node_data_append(struct __pyx_t_3_sa__Trie_No */ (__pyx_v_node->arr[__pyx_v_node->arr_len]) = __pyx_v_val; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":67 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":67 * node.arr = realloc(node.arr, new_len*sizeof(int)) * node.arr[node.arr_len] = val * node.arr_len = new_len # <<<<<<<<<<<<<< @@ -29028,7 +28682,7 @@ static PyObject *__pyx_f_3_sa_trie_node_data_append(struct __pyx_t_3_sa__Trie_No return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":69 +/* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":69 * node.arr_len = new_len * * cdef trie_node_data_extend(_Trie_Node* node, int* vals, int num_vals): # <<<<<<<<<<<<<< @@ -29042,7 +28696,7 @@ static PyObject *__pyx_f_3_sa_trie_node_data_extend(struct __pyx_t_3_sa__Trie_No __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("trie_node_data_extend", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":71 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -29051,7 +28705,7 @@ static PyObject *__pyx_f_3_sa_trie_node_data_extend(struct __pyx_t_3_sa__Trie_No */ __pyx_v_new_len = (__pyx_v_node->arr_len + __pyx_v_num_vals); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":72 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":72 * cdef int new_len * new_len = node.arr_len + num_vals * node.arr = realloc(node.arr, new_len*sizeof(int)) # <<<<<<<<<<<<<< @@ -29060,7 +28714,7 @@ static PyObject *__pyx_f_3_sa_trie_node_data_extend(struct __pyx_t_3_sa__Trie_No */ __pyx_v_node->arr = ((int *)realloc(__pyx_v_node->arr, (__pyx_v_new_len * (sizeof(int))))); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":73 + /* "/home/paulb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -29069,7 +28723,7 @@ static PyObject *__pyx_f_3_sa_trie_node_data_extend(struct __pyx_t_3_sa__Trie_No */ memcpy((__pyx_v_node->arr + __pyx_v_node->arr_len), __pyx_v_vals, (__pyx_v_num_vals * (sizeof(int)))); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":74 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -29084,7 +28738,7 @@ static PyObject *__pyx_f_3_sa_trie_node_data_extend(struct __pyx_t_3_sa__Trie_No return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":77 +/* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":77 * * * cdef _Trie_Node* trie_insert(_Trie_Node* node, int val): # <<<<<<<<<<<<<< @@ -29101,7 +28755,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_insert(struct __pyx_t_3 int __pyx_t_3; __Pyx_RefNannySetupContext("trie_insert", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":79 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":79 * cdef _Trie_Node* trie_insert(_Trie_Node* node, int val): * cdef _Trie_Edge** cur * cur = &node.root # <<<<<<<<<<<<<< @@ -29110,7 +28764,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_insert(struct __pyx_t_3 */ __pyx_v_cur = (&__pyx_v_node->root); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":80 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":80 * cdef _Trie_Edge** cur * cur = &node.root * while cur[0] != NULL and cur[0].val != val: # <<<<<<<<<<<<<< @@ -29127,7 +28781,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_insert(struct __pyx_t_3 } if (!__pyx_t_3) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":81 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":81 * cur = &node.root * while cur[0] != NULL and cur[0].val != val: * if val > cur[0].val: # <<<<<<<<<<<<<< @@ -29137,7 +28791,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_insert(struct __pyx_t_3 __pyx_t_3 = (__pyx_v_val > (__pyx_v_cur[0])->val); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":82 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":82 * while cur[0] != NULL and cur[0].val != val: * if val > cur[0].val: * cur = &cur[0].bigger # <<<<<<<<<<<<<< @@ -29148,7 +28802,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_insert(struct __pyx_t_3 goto __pyx_L5; } - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":83 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":83 * if val > cur[0].val: * cur = &cur[0].bigger * elif val < cur[0].val: # <<<<<<<<<<<<<< @@ -29158,7 +28812,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_insert(struct __pyx_t_3 __pyx_t_3 = (__pyx_v_val < (__pyx_v_cur[0])->val); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":84 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":84 * cur = &cur[0].bigger * elif val < cur[0].val: * cur = &cur[0].smaller # <<<<<<<<<<<<<< @@ -29171,7 +28825,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_insert(struct __pyx_t_3 __pyx_L5:; } - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":85 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":85 * elif val < cur[0].val: * cur = &cur[0].smaller * if cur[0] == NULL: # <<<<<<<<<<<<<< @@ -29181,7 +28835,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_insert(struct __pyx_t_3 __pyx_t_3 = ((__pyx_v_cur[0]) == NULL); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":86 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":86 * cur = &cur[0].smaller * if cur[0] == NULL: * cur[0] = new_trie_edge(val) # <<<<<<<<<<<<<< @@ -29193,7 +28847,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_insert(struct __pyx_t_3 } __pyx_L6:; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":87 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":87 * if cur[0] == NULL: * cur[0] = new_trie_edge(val) * return cur[0].node # <<<<<<<<<<<<<< @@ -29209,7 +28863,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_insert(struct __pyx_t_3 return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":89 +/* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":89 * return cur[0].node * * cdef trie_node_to_map(_Trie_Node* node, result, prefix, int include_zeros): # <<<<<<<<<<<<<< @@ -29229,7 +28883,7 @@ static PyObject *__pyx_f_3_sa_trie_node_to_map(struct __pyx_t_3_sa__Trie_Node *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("trie_node_to_map", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":92 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":92 * cdef IntList arr * * if include_zeros or node.arr_len > 0: # <<<<<<<<<<<<<< @@ -29244,7 +28898,7 @@ static PyObject *__pyx_f_3_sa_trie_node_to_map(struct __pyx_t_3_sa__Trie_Node *_ } if (__pyx_t_2) { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":93 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":93 * * if include_zeros or node.arr_len > 0: * arr = IntList() # <<<<<<<<<<<<<< @@ -29256,7 +28910,7 @@ static PyObject *__pyx_f_3_sa_trie_node_to_map(struct __pyx_t_3_sa__Trie_Node *_ __pyx_v_arr = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":94 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":94 * if include_zeros or node.arr_len > 0: * arr = IntList() * free(arr.arr) # <<<<<<<<<<<<<< @@ -29265,7 +28919,7 @@ static PyObject *__pyx_f_3_sa_trie_node_to_map(struct __pyx_t_3_sa__Trie_Node *_ */ free(__pyx_v_arr->arr); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":95 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":95 * arr = IntList() * free(arr.arr) * arr.arr = malloc(node.arr_len * sizeof(int)) # <<<<<<<<<<<<<< @@ -29274,7 +28928,7 @@ static PyObject *__pyx_f_3_sa_trie_node_to_map(struct __pyx_t_3_sa__Trie_Node *_ */ __pyx_v_arr->arr = ((int *)malloc((__pyx_v_node->arr_len * (sizeof(int))))); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":96 + /* "/home/paulb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -29283,7 +28937,7 @@ static PyObject *__pyx_f_3_sa_trie_node_to_map(struct __pyx_t_3_sa__Trie_Node *_ */ memcpy(__pyx_v_arr->arr, __pyx_v_node->arr, (__pyx_v_node->arr_len * (sizeof(int)))); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":97 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -29292,7 +28946,7 @@ static PyObject *__pyx_f_3_sa_trie_node_to_map(struct __pyx_t_3_sa__Trie_Node *_ */ __pyx_v_arr->len = __pyx_v_node->arr_len; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":98 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":98 * memcpy(arr.arr, node.arr, node.arr_len * sizeof(int)) * arr.len = node.arr_len * arr.size = node.arr_len # <<<<<<<<<<<<<< @@ -29301,7 +28955,7 @@ static PyObject *__pyx_f_3_sa_trie_node_to_map(struct __pyx_t_3_sa__Trie_Node *_ */ __pyx_v_arr->size = __pyx_v_node->arr_len; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":99 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":99 * arr.len = node.arr_len * arr.size = node.arr_len * result[prefix] = arr # <<<<<<<<<<<<<< @@ -29313,7 +28967,7 @@ static PyObject *__pyx_f_3_sa_trie_node_to_map(struct __pyx_t_3_sa__Trie_Node *_ } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":100 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":100 * arr.size = node.arr_len * result[prefix] = arr * trie_edge_to_map(node.root, result, prefix, include_zeros) # <<<<<<<<<<<<<< @@ -29337,7 +28991,7 @@ static PyObject *__pyx_f_3_sa_trie_node_to_map(struct __pyx_t_3_sa__Trie_Node *_ return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":102 +/* "/home/paulb/workspace/cdec/python/src/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): # <<<<<<<<<<<<<< @@ -29357,7 +29011,7 @@ static PyObject *__pyx_f_3_sa_trie_edge_to_map(struct __pyx_t_3_sa__Trie_Edge *_ __Pyx_RefNannySetupContext("trie_edge_to_map", 0); __Pyx_INCREF(__pyx_v_prefix); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":103 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":103 * * cdef trie_edge_to_map(_Trie_Edge* edge, result, prefix, int include_zeros): * if edge != NULL: # <<<<<<<<<<<<<< @@ -29367,7 +29021,7 @@ static PyObject *__pyx_f_3_sa_trie_edge_to_map(struct __pyx_t_3_sa__Trie_Edge *_ __pyx_t_1 = (__pyx_v_edge != NULL); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":104 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -29378,7 +29032,7 @@ static PyObject *__pyx_f_3_sa_trie_edge_to_map(struct __pyx_t_3_sa__Trie_Edge *_ __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":105 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -29389,7 +29043,7 @@ static PyObject *__pyx_f_3_sa_trie_edge_to_map(struct __pyx_t_3_sa__Trie_Edge *_ __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":106 + /* "/home/paulb/workspace/cdec/python/src/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,) # <<<<<<<<<<<<<< @@ -29410,7 +29064,7 @@ static PyObject *__pyx_f_3_sa_trie_edge_to_map(struct __pyx_t_3_sa__Trie_Edge *_ __pyx_v_prefix = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":107 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -29442,11 +29096,11 @@ static PyObject *__pyx_f_3_sa_trie_edge_to_map(struct __pyx_t_3_sa__Trie_Edge *_ static int __pyx_pw_3_sa_7TrieMap_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_3_sa_7TrieMap_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_v_alphabet_size; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__alphabet_size,0}; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__alphabet_size,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -29459,7 +29113,8 @@ static int __pyx_pw_3_sa_7TrieMap_1__cinit__(PyObject *__pyx_v_self, PyObject *_ 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--; + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__alphabet_size); + if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { @@ -29485,7 +29140,7 @@ static int __pyx_pw_3_sa_7TrieMap_1__cinit__(PyObject *__pyx_v_self, PyObject *_ return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":114 +/* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":114 * cdef int V * * def __cinit__(self, int alphabet_size): # <<<<<<<<<<<<<< @@ -29498,7 +29153,7 @@ static int __pyx_pf_3_sa_7TrieMap___cinit__(struct __pyx_obj_3_sa_TrieMap *__pyx __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":115 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":115 * * def __cinit__(self, int alphabet_size): * self.V = alphabet_size # <<<<<<<<<<<<<< @@ -29507,7 +29162,7 @@ static int __pyx_pf_3_sa_7TrieMap___cinit__(struct __pyx_obj_3_sa_TrieMap *__pyx */ __pyx_v_self->V = __pyx_v_alphabet_size; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":116 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":116 * def __cinit__(self, int alphabet_size): * self.V = alphabet_size * self.root = <_Trie_Node**> malloc(self.V * sizeof(_Trie_Node*)) # <<<<<<<<<<<<<< @@ -29516,7 +29171,7 @@ static int __pyx_pf_3_sa_7TrieMap___cinit__(struct __pyx_obj_3_sa_TrieMap *__pyx */ __pyx_v_self->root = ((struct __pyx_t_3_sa__Trie_Node **)malloc((__pyx_v_self->V * (sizeof(struct __pyx_t_3_sa__Trie_Node *))))); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":117 + /* "/home/paulb/workspace/cdec/python/src/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*)) # <<<<<<<<<<<<<< @@ -29539,7 +29194,7 @@ static void __pyx_pw_3_sa_7TrieMap_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyFinishContext(); } -/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":120 +/* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":120 * * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -29558,7 +29213,7 @@ static void __pyx_pf_3_sa_7TrieMap_2__dealloc__(struct __pyx_obj_3_sa_TrieMap *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":122 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":122 * def __dealloc__(self): * cdef int i * for i from 0 <= i < self.V: # <<<<<<<<<<<<<< @@ -29568,7 +29223,7 @@ static void __pyx_pf_3_sa_7TrieMap_2__dealloc__(struct __pyx_obj_3_sa_TrieMap *_ __pyx_t_1 = __pyx_v_self->V; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":123 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":123 * cdef int i * for i from 0 <= i < self.V: * if self.root[i] != NULL: # <<<<<<<<<<<<<< @@ -29578,7 +29233,7 @@ static void __pyx_pf_3_sa_7TrieMap_2__dealloc__(struct __pyx_obj_3_sa_TrieMap *_ __pyx_t_2 = ((__pyx_v_self->root[__pyx_v_i]) != NULL); if (__pyx_t_2) { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":124 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":124 * for i from 0 <= i < self.V: * if self.root[i] != NULL: * free_trie_node(self.root[i]) # <<<<<<<<<<<<<< @@ -29593,7 +29248,7 @@ static void __pyx_pf_3_sa_7TrieMap_2__dealloc__(struct __pyx_obj_3_sa_TrieMap *_ __pyx_L5:; } - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":125 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":125 * if self.root[i] != NULL: * free_trie_node(self.root[i]) * free(self.root) # <<<<<<<<<<<<<< @@ -29621,7 +29276,7 @@ static PyObject *__pyx_pw_3_sa_7TrieMap_5insert(PyObject *__pyx_v_self, PyObject return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":128 +/* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":128 * * * def insert(self, pattern): # <<<<<<<<<<<<<< @@ -29644,7 +29299,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_4insert(struct __pyx_obj_3_sa_TrieMap *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("insert", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":131 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":131 * cdef int* p * cdef int i, l * l = len(pattern) # <<<<<<<<<<<<<< @@ -29654,7 +29309,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_4insert(struct __pyx_obj_3_sa_TrieMap *_ __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/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":132 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":132 * cdef int i, l * l = len(pattern) * p = malloc(l*sizeof(int)) # <<<<<<<<<<<<<< @@ -29663,7 +29318,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_4insert(struct __pyx_obj_3_sa_TrieMap *_ */ __pyx_v_p = ((int *)malloc((__pyx_v_l * (sizeof(int))))); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":133 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":133 * l = len(pattern) * p = malloc(l*sizeof(int)) * for i from 0 <= i < l: # <<<<<<<<<<<<<< @@ -29673,7 +29328,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_4insert(struct __pyx_obj_3_sa_TrieMap *_ __pyx_t_2 = __pyx_v_l; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":134 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":134 * p = malloc(l*sizeof(int)) * for i from 0 <= i < l: * p[i] = pattern[i] # <<<<<<<<<<<<<< @@ -29687,7 +29342,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_4insert(struct __pyx_obj_3_sa_TrieMap *_ (__pyx_v_p[__pyx_v_i]) = __pyx_t_4; } - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":135 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":135 * for i from 0 <= i < l: * p[i] = pattern[i] * self._insert(p,l) # <<<<<<<<<<<<<< @@ -29696,7 +29351,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_4insert(struct __pyx_obj_3_sa_TrieMap *_ */ ((struct __pyx_vtabstruct_3_sa_TrieMap *)__pyx_v_self->__pyx_vtab)->_insert(__pyx_v_self, __pyx_v_p, __pyx_v_l); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":136 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":136 * p[i] = pattern[i] * self._insert(p,l) * free(p) # <<<<<<<<<<<<<< @@ -29717,7 +29372,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_4insert(struct __pyx_obj_3_sa_TrieMap *_ return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":139 +/* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":139 * * * cdef _Trie_Node* _insert(self, int* pattern, int pattern_len): # <<<<<<<<<<<<<< @@ -29734,7 +29389,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_7TrieMap__insert(struct __py int __pyx_t_2; __Pyx_RefNannySetupContext("_insert", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":142 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":142 * cdef int i * cdef _Trie_Node* node * if self.root[pattern[0]] == NULL: # <<<<<<<<<<<<<< @@ -29744,7 +29399,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_7TrieMap__insert(struct __py __pyx_t_1 = ((__pyx_v_self->root[(__pyx_v_pattern[0])]) == NULL); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":143 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":143 * cdef _Trie_Node* node * if self.root[pattern[0]] == NULL: * self.root[pattern[0]] = new_trie_node() # <<<<<<<<<<<<<< @@ -29756,7 +29411,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_7TrieMap__insert(struct __py } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":144 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":144 * if self.root[pattern[0]] == NULL: * self.root[pattern[0]] = new_trie_node() * node = self.root[pattern[0]] # <<<<<<<<<<<<<< @@ -29765,7 +29420,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_7TrieMap__insert(struct __py */ __pyx_v_node = (__pyx_v_self->root[(__pyx_v_pattern[0])]); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":145 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":145 * self.root[pattern[0]] = new_trie_node() * node = self.root[pattern[0]] * for i from 1 <= i < pattern_len: # <<<<<<<<<<<<<< @@ -29775,7 +29430,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_7TrieMap__insert(struct __py __pyx_t_2 = __pyx_v_pattern_len; for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":146 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":146 * node = self.root[pattern[0]] * for i from 1 <= i < pattern_len: * node = trie_insert(node, pattern[i]) # <<<<<<<<<<<<<< @@ -29785,7 +29440,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_7TrieMap__insert(struct __py __pyx_v_node = __pyx_f_3_sa_trie_insert(__pyx_v_node, (__pyx_v_pattern[__pyx_v_i])); } - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":147 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":147 * for i from 1 <= i < pattern_len: * node = trie_insert(node, pattern[i]) * return node # <<<<<<<<<<<<<< @@ -29812,7 +29467,7 @@ static PyObject *__pyx_pw_3_sa_7TrieMap_7contains(PyObject *__pyx_v_self, PyObje return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":149 +/* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":149 * return node * * def contains(self, pattern): # <<<<<<<<<<<<<< @@ -29837,7 +29492,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_6contains(struct __pyx_obj_3_sa_TrieMap int __pyx_clineno = 0; __Pyx_RefNannySetupContext("contains", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":153 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":153 * cdef int i, l * cdef _Trie_Node* node * l = len(pattern) # <<<<<<<<<<<<<< @@ -29847,7 +29502,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_6contains(struct __pyx_obj_3_sa_TrieMap __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/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":154 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":154 * cdef _Trie_Node* node * l = len(pattern) * p = malloc(l*sizeof(int)) # <<<<<<<<<<<<<< @@ -29856,7 +29511,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_6contains(struct __pyx_obj_3_sa_TrieMap */ __pyx_v_p = ((int *)malloc((__pyx_v_l * (sizeof(int))))); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":155 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":155 * l = len(pattern) * p = malloc(l*sizeof(int)) * for i from 0 <= i < l: # <<<<<<<<<<<<<< @@ -29866,7 +29521,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_6contains(struct __pyx_obj_3_sa_TrieMap __pyx_t_2 = __pyx_v_l; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":156 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":156 * p = malloc(l*sizeof(int)) * for i from 0 <= i < l: * p[i] = pattern[i] # <<<<<<<<<<<<<< @@ -29880,7 +29535,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_6contains(struct __pyx_obj_3_sa_TrieMap (__pyx_v_p[__pyx_v_i]) = __pyx_t_4; } - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":157 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":157 * for i from 0 <= i < l: * p[i] = pattern[i] * node = self._contains(p,l) # <<<<<<<<<<<<<< @@ -29889,7 +29544,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_6contains(struct __pyx_obj_3_sa_TrieMap */ __pyx_v_node = ((struct __pyx_vtabstruct_3_sa_TrieMap *)__pyx_v_self->__pyx_vtab)->_contains(__pyx_v_self, __pyx_v_p, __pyx_v_l); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":158 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":158 * p[i] = pattern[i] * node = self._contains(p,l) * free(p) # <<<<<<<<<<<<<< @@ -29898,7 +29553,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_6contains(struct __pyx_obj_3_sa_TrieMap */ free(__pyx_v_p); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":159 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":159 * node = self._contains(p,l) * free(p) * if node == NULL: # <<<<<<<<<<<<<< @@ -29908,7 +29563,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_6contains(struct __pyx_obj_3_sa_TrieMap __pyx_t_5 = (__pyx_v_node == NULL); if (__pyx_t_5) { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":160 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":160 * free(p) * if node == NULL: * return False # <<<<<<<<<<<<<< @@ -29925,7 +29580,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_6contains(struct __pyx_obj_3_sa_TrieMap } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":162 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":162 * return False * else: * return True # <<<<<<<<<<<<<< @@ -29953,7 +29608,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_6contains(struct __pyx_obj_3_sa_TrieMap return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":164 +/* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":164 * return True * * cdef _Trie_Node* _contains(self, int* pattern, int pattern_len): # <<<<<<<<<<<<<< @@ -29971,7 +29626,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_7TrieMap__contains(struct __ int __pyx_t_3; __Pyx_RefNannySetupContext("_contains", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":167 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":167 * cdef int i * cdef _Trie_Node* node * node = self.root[pattern[0]] # <<<<<<<<<<<<<< @@ -29980,7 +29635,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_7TrieMap__contains(struct __ */ __pyx_v_node = (__pyx_v_self->root[(__pyx_v_pattern[0])]); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":168 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":168 * cdef _Trie_Node* node * node = self.root[pattern[0]] * i = 1 # <<<<<<<<<<<<<< @@ -29989,7 +29644,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_7TrieMap__contains(struct __ */ __pyx_v_i = 1; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":169 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":169 * node = self.root[pattern[0]] * i = 1 * while node != NULL and i < pattern_len: # <<<<<<<<<<<<<< @@ -30006,7 +29661,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_7TrieMap__contains(struct __ } if (!__pyx_t_3) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":170 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":170 * i = 1 * while node != NULL and i < pattern_len: * node = trie_find(node, pattern[i]) # <<<<<<<<<<<<<< @@ -30015,7 +29670,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_7TrieMap__contains(struct __ */ __pyx_v_node = __pyx_f_3_sa_trie_find(__pyx_v_node, (__pyx_v_pattern[__pyx_v_i])); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":171 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":171 * while node != NULL and i < pattern_len: * node = trie_find(node, pattern[i]) * i = i+1 # <<<<<<<<<<<<<< @@ -30025,7 +29680,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_7TrieMap__contains(struct __ __pyx_v_i = (__pyx_v_i + 1); } - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":172 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":172 * node = trie_find(node, pattern[i]) * i = i+1 * return node # <<<<<<<<<<<<<< @@ -30052,7 +29707,7 @@ static PyObject *__pyx_pw_3_sa_7TrieMap_9toMap(PyObject *__pyx_v_self, PyObject return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":174 +/* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":174 * return node * * def toMap(self, flag): # <<<<<<<<<<<<<< @@ -30075,7 +29730,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_8toMap(struct __pyx_obj_3_sa_TrieMap *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toMap", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":177 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":177 * cdef int i, include_zeros * * if flag: # <<<<<<<<<<<<<< @@ -30085,7 +29740,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_8toMap(struct __pyx_obj_3_sa_TrieMap *__ __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/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":178 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":178 * * if flag: * include_zeros=1 # <<<<<<<<<<<<<< @@ -30097,7 +29752,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_8toMap(struct __pyx_obj_3_sa_TrieMap *__ } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":180 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":180 * include_zeros=1 * else: * include_zeros=0 # <<<<<<<<<<<<<< @@ -30108,7 +29763,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_8toMap(struct __pyx_obj_3_sa_TrieMap *__ } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":181 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":181 * else: * include_zeros=0 * result = {} # <<<<<<<<<<<<<< @@ -30120,7 +29775,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_8toMap(struct __pyx_obj_3_sa_TrieMap *__ __pyx_v_result = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":182 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":182 * include_zeros=0 * result = {} * for i from 0 <= i < self.V: # <<<<<<<<<<<<<< @@ -30130,7 +29785,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_8toMap(struct __pyx_obj_3_sa_TrieMap *__ __pyx_t_3 = __pyx_v_self->V; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":183 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":183 * result = {} * for i from 0 <= i < self.V: * if self.root[i] != NULL: # <<<<<<<<<<<<<< @@ -30140,7 +29795,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_8toMap(struct __pyx_obj_3_sa_TrieMap *__ __pyx_t_1 = ((__pyx_v_self->root[__pyx_v_i]) != NULL); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":184 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -30163,7 +29818,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_8toMap(struct __pyx_obj_3_sa_TrieMap *__ __pyx_L6:; } - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":185 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":185 * if self.root[i] != NULL: * trie_node_to_map(self.root[i], result, (i,), include_zeros) * return result # <<<<<<<<<<<<<< @@ -30201,14 +29856,14 @@ static int __pyx_pw_3_sa_14Precomputation_1__cinit__(PyObject *__pyx_v_self, PyO PyObject *__pyx_v_max_nonterminals = 0; PyObject *__pyx_v_train_max_initial_size = 0; PyObject *__pyx_v_train_min_gap_size = 0; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fsarray,&__pyx_n_s__from_stats,&__pyx_n_s__from_binary,&__pyx_n_s__precompute_rank,&__pyx_n_s_70,&__pyx_n_s__max_length,&__pyx_n_s__max_nonterminals,&__pyx_n_s_71,&__pyx_n_s__train_min_gap_size,0}; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fsarray,&__pyx_n_s__from_stats,&__pyx_n_s__from_binary,&__pyx_n_s__precompute_rank,&__pyx_n_s_70,&__pyx_n_s__max_length,&__pyx_n_s__max_nonterminals,&__pyx_n_s_71,&__pyx_n_s__train_min_gap_size,0}; PyObject* values[9] = {0,0,0,0,0,0,0,0,0}; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":200 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":200 * cdef write_map(self, m, FILE* f) * * def __cinit__(self, fsarray=None, from_stats=None, from_binary=None, # <<<<<<<<<<<<<< @@ -30342,7 +29997,7 @@ static int __pyx_pf_3_sa_14Precomputation___cinit__(struct __pyx_obj_3_sa_Precom int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":204 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -30352,7 +30007,7 @@ static int __pyx_pf_3_sa_14Precomputation___cinit__(struct __pyx_obj_3_sa_Precom __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_v_self->precompute_rank = __pyx_t_1; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":205 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -30362,7 +30017,7 @@ static int __pyx_pf_3_sa_14Precomputation___cinit__(struct __pyx_obj_3_sa_Precom __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_v_self->precompute_secondary_rank = __pyx_t_1; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":206 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":206 * self.precompute_rank = precompute_rank * self.precompute_secondary_rank = precompute_secondary_rank * self.max_length = max_length # <<<<<<<<<<<<<< @@ -30372,7 +30027,7 @@ static int __pyx_pf_3_sa_14Precomputation___cinit__(struct __pyx_obj_3_sa_Precom __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_v_self->max_length = __pyx_t_1; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":207 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":207 * self.precompute_secondary_rank = precompute_secondary_rank * self.max_length = max_length * self.max_nonterminals = max_nonterminals # <<<<<<<<<<<<<< @@ -30382,7 +30037,7 @@ static int __pyx_pf_3_sa_14Precomputation___cinit__(struct __pyx_obj_3_sa_Precom __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_v_self->max_nonterminals = __pyx_t_1; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":208 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":208 * self.max_length = max_length * self.max_nonterminals = max_nonterminals * self.train_max_initial_size = train_max_initial_size # <<<<<<<<<<<<<< @@ -30392,7 +30047,7 @@ static int __pyx_pf_3_sa_14Precomputation___cinit__(struct __pyx_obj_3_sa_Precom __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_v_self->train_max_initial_size = __pyx_t_1; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":209 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -30402,7 +30057,7 @@ static int __pyx_pf_3_sa_14Precomputation___cinit__(struct __pyx_obj_3_sa_Precom __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_v_self->train_min_gap_size = __pyx_t_1; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":210 + /* "/home/paulb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -30412,7 +30067,7 @@ static int __pyx_pf_3_sa_14Precomputation___cinit__(struct __pyx_obj_3_sa_Precom __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/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":211 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":211 * self.train_min_gap_size = train_min_gap_size * if from_binary: * self.read_binary(from_binary) # <<<<<<<<<<<<<< @@ -30434,7 +30089,7 @@ static int __pyx_pf_3_sa_14Precomputation___cinit__(struct __pyx_obj_3_sa_Precom goto __pyx_L3; } - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":212 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":212 * if from_binary: * self.read_binary(from_binary) * elif from_stats: # <<<<<<<<<<<<<< @@ -30444,7 +30099,7 @@ static int __pyx_pf_3_sa_14Precomputation___cinit__(struct __pyx_obj_3_sa_Precom __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/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":213 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":213 * self.read_binary(from_binary) * elif from_stats: * self.precompute(from_stats, fsarray) # <<<<<<<<<<<<<< @@ -30504,7 +30159,7 @@ static PyObject *__pyx_pw_3_sa_14Precomputation_3read_binary(PyObject *__pyx_v_s return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":216 +/* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":216 * * * def read_binary(self, char* filename): # <<<<<<<<<<<<<< @@ -30522,7 +30177,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_2read_binary(struct __pyx_obj_3_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("read_binary", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":218 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":218 * def read_binary(self, char* filename): * cdef FILE* f * f = fopen(filename, "r") # <<<<<<<<<<<<<< @@ -30531,7 +30186,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_2read_binary(struct __pyx_obj_3_ */ __pyx_v_f = fopen(__pyx_v_filename, __pyx_k__r); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":219 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":219 * cdef FILE* f * f = fopen(filename, "r") * fread(&(self.precompute_rank), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -30540,7 +30195,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_2read_binary(struct __pyx_obj_3_ */ fread((&__pyx_v_self->precompute_rank), (sizeof(int)), 1, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":220 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -30549,7 +30204,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_2read_binary(struct __pyx_obj_3_ */ fread((&__pyx_v_self->precompute_secondary_rank), (sizeof(int)), 1, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":221 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -30558,7 +30213,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_2read_binary(struct __pyx_obj_3_ */ fread((&__pyx_v_self->max_length), (sizeof(int)), 1, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":222 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -30567,7 +30222,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_2read_binary(struct __pyx_obj_3_ */ fread((&__pyx_v_self->max_nonterminals), (sizeof(int)), 1, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":223 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -30576,7 +30231,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_2read_binary(struct __pyx_obj_3_ */ fread((&__pyx_v_self->train_max_initial_size), (sizeof(int)), 1, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":224 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -30585,7 +30240,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_2read_binary(struct __pyx_obj_3_ */ fread((&__pyx_v_self->train_min_gap_size), (sizeof(int)), 1, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":225 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -30600,7 +30255,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_2read_binary(struct __pyx_obj_3_ __pyx_v_self->precomputed_index = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":226 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -30615,7 +30270,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_2read_binary(struct __pyx_obj_3_ __pyx_v_self->precomputed_collocations = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":227 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":227 * self.precomputed_index = self.read_map(f) * self.precomputed_collocations = self.read_map(f) * fclose(f) # <<<<<<<<<<<<<< @@ -30657,7 +30312,7 @@ static PyObject *__pyx_pw_3_sa_14Precomputation_5write_binary(PyObject *__pyx_v_ return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":230 +/* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":230 * * * def write_binary(self, char* filename): # <<<<<<<<<<<<<< @@ -30676,7 +30331,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_4write_binary(struct __pyx_obj_3 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_binary", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":232 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":232 * def write_binary(self, char* filename): * cdef FILE* f * f = fopen(filename, "w") # <<<<<<<<<<<<<< @@ -30685,7 +30340,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_4write_binary(struct __pyx_obj_3 */ __pyx_v_f = fopen(__pyx_v_filename, __pyx_k__w); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":233 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":233 * cdef FILE* f * f = fopen(filename, "w") * fwrite(&(self.precompute_rank), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -30694,7 +30349,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_4write_binary(struct __pyx_obj_3 */ fwrite((&__pyx_v_self->precompute_rank), (sizeof(int)), 1, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":234 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -30703,7 +30358,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_4write_binary(struct __pyx_obj_3 */ fwrite((&__pyx_v_self->precompute_secondary_rank), (sizeof(int)), 1, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":235 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -30712,7 +30367,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_4write_binary(struct __pyx_obj_3 */ fwrite((&__pyx_v_self->max_length), (sizeof(int)), 1, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":236 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -30721,7 +30376,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_4write_binary(struct __pyx_obj_3 */ fwrite((&__pyx_v_self->max_nonterminals), (sizeof(int)), 1, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":237 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -30730,7 +30385,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_4write_binary(struct __pyx_obj_3 */ fwrite((&__pyx_v_self->train_max_initial_size), (sizeof(int)), 1, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":238 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -30739,7 +30394,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_4write_binary(struct __pyx_obj_3 */ fwrite((&__pyx_v_self->train_min_gap_size), (sizeof(int)), 1, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":239 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -30753,7 +30408,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_4write_binary(struct __pyx_obj_3 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":240 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -30767,7 +30422,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_4write_binary(struct __pyx_obj_3 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":241 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":241 * self.write_map(self.precomputed_index, f) * self.write_map(self.precomputed_collocations, f) * fclose(f) # <<<<<<<<<<<<<< @@ -30789,7 +30444,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_4write_binary(struct __pyx_obj_3 return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":244 +/* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":244 * * * cdef write_map(self, m, FILE* f): # <<<<<<<<<<<<<< @@ -30808,19 +30463,21 @@ static PyObject *__pyx_f_3_sa_14Precomputation_write_map(CYTHON_UNUSED struct __ __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; PyObject *__pyx_t_2 = NULL; - Py_ssize_t __pyx_t_3; - int __pyx_t_4; + PyObject *__pyx_t_3 = NULL; + PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; - int __pyx_t_7; - Py_ssize_t __pyx_t_8; - PyObject *(*__pyx_t_9)(PyObject *); + PyObject *__pyx_t_7 = NULL; + PyObject *(*__pyx_t_8)(PyObject *); + Py_ssize_t __pyx_t_9; + PyObject *(*__pyx_t_10)(PyObject *); + int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_map", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":248 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":248 * cdef IntList arr * * N = len(m) # <<<<<<<<<<<<<< @@ -30830,7 +30487,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_write_map(CYTHON_UNUSED struct __ __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/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":249 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":249 * * N = len(m) * fwrite(&(N), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -30839,29 +30496,87 @@ static PyObject *__pyx_f_3_sa_14Precomputation_write_map(CYTHON_UNUSED struct __ */ fwrite((&__pyx_v_N), (sizeof(int)), 1, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":250 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":250 * N = len(m) * fwrite(&(N), sizeof(int), 1, f) * for pattern, val in m.iteritems(): # <<<<<<<<<<<<<< * N = len(pattern) * fwrite(&(N), sizeof(int), 1, f) */ - __pyx_t_1 = 0; - if (unlikely(__pyx_v_m == Py_None)) { - PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems"); - {__pyx_filename = __pyx_f[11]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_v_m, __pyx_n_s__iteritems); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) { + __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_1 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; } - __pyx_t_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_GOTREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_2); - __pyx_t_2 = __pyx_t_5; - __pyx_t_5 = 0; - while (1) { - __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_3, &__pyx_t_1, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4); - if (unlikely(__pyx_t_7 == 0)) break; - if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + for (;;) { + if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) { + if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_2)) break; + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; + } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) { + if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; + } else { + __pyx_t_3 = __pyx_t_4(__pyx_t_2); + if (unlikely(!__pyx_t_3)) { + if (PyErr_Occurred()) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[11]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_3); + } + if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { + PyObject* sequence = __pyx_t_3; + if (likely(PyTuple_CheckExact(sequence))) { + if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { + if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); + else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[11]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); + } else { + if (unlikely(PyList_GET_SIZE(sequence) != 2)) { + if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); + else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[11]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = PyList_GET_ITEM(sequence, 0); + __pyx_t_6 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; + index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L6_unpacking_done; + __pyx_L5_unpacking_failed:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); + if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[11]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L6_unpacking_done:; + } __Pyx_XDECREF(__pyx_v_pattern); __pyx_v_pattern = __pyx_t_5; __pyx_t_5 = 0; @@ -30869,17 +30584,17 @@ static PyObject *__pyx_f_3_sa_14Precomputation_write_map(CYTHON_UNUSED struct __ __pyx_v_val = __pyx_t_6; __pyx_t_6 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":251 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":251 * fwrite(&(N), sizeof(int), 1, f) * for pattern, val in m.iteritems(): * N = len(pattern) # <<<<<<<<<<<<<< * fwrite(&(N), sizeof(int), 1, f) * for word_id in pattern: */ - __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; + __pyx_t_9 = PyObject_Length(__pyx_v_pattern); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_N = __pyx_t_9; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":252 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":252 * for pattern, val in m.iteritems(): * N = len(pattern) * fwrite(&(N), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -30888,7 +30603,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_write_map(CYTHON_UNUSED struct __ */ fwrite((&__pyx_v_N), (sizeof(int)), 1, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":253 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":253 * N = len(pattern) * fwrite(&(N), sizeof(int), 1, f) * for word_id in pattern: # <<<<<<<<<<<<<< @@ -30896,54 +30611,46 @@ static PyObject *__pyx_f_3_sa_14Precomputation_write_map(CYTHON_UNUSED struct __ * fwrite(&(i), sizeof(int), 1, f) */ if (PyList_CheckExact(__pyx_v_pattern) || PyTuple_CheckExact(__pyx_v_pattern)) { - __pyx_t_6 = __pyx_v_pattern; __Pyx_INCREF(__pyx_t_6); __pyx_t_8 = 0; - __pyx_t_9 = NULL; + __pyx_t_3 = __pyx_v_pattern; __Pyx_INCREF(__pyx_t_3); __pyx_t_9 = 0; + __pyx_t_10 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_pattern); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 = Py_TYPE(__pyx_t_6)->tp_iternext; + __pyx_t_9 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_pattern); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_10 = Py_TYPE(__pyx_t_3)->tp_iternext; } for (;;) { - if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_6)) { - if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_6)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_6)) { - if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_6)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + if (!__pyx_t_10 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_3)) break; + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++; + } else if (!__pyx_t_10 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++; } else { - __pyx_t_5 = __pyx_t_9(__pyx_t_6); - if (unlikely(!__pyx_t_5)) { + __pyx_t_6 = __pyx_t_10(__pyx_t_3); + if (unlikely(!__pyx_t_6)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[11]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } - __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); } __Pyx_XDECREF(__pyx_v_word_id); - __pyx_v_word_id = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_v_word_id = __pyx_t_6; + __pyx_t_6 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":254 + /* "/home/paulb/workspace/cdec/python/src/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_v_i = __pyx_t_7; + __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_v_word_id); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_i = __pyx_t_11; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":255 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":255 * for word_id in pattern: * i = word_id * fwrite(&(i), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -30952,9 +30659,9 @@ static PyObject *__pyx_f_3_sa_14Precomputation_write_map(CYTHON_UNUSED struct __ */ fwrite((&__pyx_v_i), (sizeof(int)), 1, __pyx_v_f); } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":256 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":256 * i = word_id * fwrite(&(i), sizeof(int), 1, f) * arr = val # <<<<<<<<<<<<<< @@ -30966,7 +30673,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_write_map(CYTHON_UNUSED struct __ __Pyx_XDECREF(((PyObject *)__pyx_v_arr)); __pyx_v_arr = ((struct __pyx_obj_3_sa_IntList *)__pyx_v_val); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":257 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":257 * fwrite(&(i), sizeof(int), 1, f) * arr = val * arr.write_handle(f) # <<<<<<<<<<<<<< @@ -30981,8 +30688,10 @@ static PyObject *__pyx_f_3_sa_14Precomputation_write_map(CYTHON_UNUSED struct __ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("_sa.Precomputation.write_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; @@ -30995,7 +30704,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_write_map(CYTHON_UNUSED struct __ return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":260 +/* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":260 * * * cdef read_map(self, FILE* f): # <<<<<<<<<<<<<< @@ -31023,7 +30732,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_read_map(CYTHON_UNUSED struct __p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("read_map", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":264 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":264 * cdef IntList arr * * m = {} # <<<<<<<<<<<<<< @@ -31035,7 +30744,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_read_map(CYTHON_UNUSED struct __p __pyx_v_m = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":265 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":265 * * m = {} * fread(&(N), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -31044,7 +30753,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_read_map(CYTHON_UNUSED struct __p */ fread((&__pyx_v_N), (sizeof(int)), 1, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":266 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":266 * m = {} * fread(&(N), sizeof(int), 1, f) * for j from 0 <= j < N: # <<<<<<<<<<<<<< @@ -31054,7 +30763,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_read_map(CYTHON_UNUSED struct __p __pyx_t_2 = __pyx_v_N; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_2; __pyx_v_j++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":267 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":267 * fread(&(N), sizeof(int), 1, f) * for j from 0 <= j < N: * fread(&(i), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -31063,7 +30772,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_read_map(CYTHON_UNUSED struct __p */ fread((&__pyx_v_i), (sizeof(int)), 1, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":268 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":268 * for j from 0 <= j < N: * fread(&(i), sizeof(int), 1, f) * key = () # <<<<<<<<<<<<<< @@ -31074,7 +30783,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_read_map(CYTHON_UNUSED struct __p __Pyx_XDECREF(((PyObject *)__pyx_v_key)); __pyx_v_key = __pyx_empty_tuple; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":269 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":269 * fread(&(i), sizeof(int), 1, f) * key = () * for k from 0 <= k < i: # <<<<<<<<<<<<<< @@ -31084,7 +30793,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_read_map(CYTHON_UNUSED struct __p __pyx_t_3 = __pyx_v_i; for (__pyx_v_k = 0; __pyx_v_k < __pyx_t_3; __pyx_v_k++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":270 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":270 * key = () * for k from 0 <= k < i: * fread(&(word_id), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -31093,7 +30802,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_read_map(CYTHON_UNUSED struct __p */ fread((&__pyx_v_word_id), (sizeof(int)), 1, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":271 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":271 * for k from 0 <= k < i: * fread(&(word_id), sizeof(int), 1, f) * key = key + (word_id,) # <<<<<<<<<<<<<< @@ -31115,7 +30824,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_read_map(CYTHON_UNUSED struct __p __pyx_t_1 = 0; } - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":272 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":272 * fread(&(word_id), sizeof(int), 1, f) * key = key + (word_id,) * arr = IntList() # <<<<<<<<<<<<<< @@ -31128,7 +30837,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_read_map(CYTHON_UNUSED struct __p __pyx_v_arr = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":273 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":273 * key = key + (word_id,) * arr = IntList() * arr.read_handle(f) # <<<<<<<<<<<<<< @@ -31137,7 +30846,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_read_map(CYTHON_UNUSED struct __p */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_arr->__pyx_vtab)->read_handle(__pyx_v_arr, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":274 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":274 * arr = IntList() * arr.read_handle(f) * m[key] = arr # <<<<<<<<<<<<<< @@ -31147,7 +30856,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_read_map(CYTHON_UNUSED struct __p 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;} } - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":275 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":275 * arr.read_handle(f) * m[key] = arr * return m # <<<<<<<<<<<<<< @@ -31180,11 +30889,11 @@ static PyObject *__pyx_pw_3_sa_14Precomputation_7precompute(PyObject *__pyx_v_se static PyObject *__pyx_pw_3_sa_14Precomputation_7precompute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_stats = 0; struct __pyx_obj_3_sa_SuffixArray *__pyx_v_sarray = 0; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__stats,&__pyx_n_s__sarray,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("precompute (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__stats,&__pyx_n_s__sarray,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -31198,10 +30907,12 @@ static PyObject *__pyx_pw_3_sa_14Precomputation_7precompute(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__stats)) != 0)) kw_args--; + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__stats); + if (likely(values[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--; + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sarray); + if (likely(values[1])) 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;} } @@ -31236,7 +30947,7 @@ static PyObject *__pyx_pw_3_sa_14Precomputation_7precompute(PyObject *__pyx_v_se return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":278 +/* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":278 * * * def precompute(self, stats, SuffixArray sarray): # <<<<<<<<<<<<<< @@ -31322,7 +31033,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("precompute", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":280 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -31332,7 +31043,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __Pyx_INCREF(((PyObject *)__pyx_v_sarray->darray)); __pyx_v_darray = __pyx_v_sarray->darray; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":285 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":285 * cdef _Trie_Node* node * * data = darray.data # <<<<<<<<<<<<<< @@ -31342,7 +31053,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __Pyx_INCREF(((PyObject *)__pyx_v_darray->data)); __pyx_v_data = __pyx_v_darray->data; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":287 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":287 * data = darray.data * * frequent_patterns = TrieMap(len(darray.id2word)) # <<<<<<<<<<<<<< @@ -31366,7 +31077,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_frequent_patterns = ((struct __pyx_obj_3_sa_TrieMap *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":288 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":288 * * frequent_patterns = TrieMap(len(darray.id2word)) * super_frequent_patterns = TrieMap(len(darray.id2word)) # <<<<<<<<<<<<<< @@ -31390,7 +31101,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_super_frequent_patterns = ((struct __pyx_obj_3_sa_TrieMap *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":289 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":289 * frequent_patterns = TrieMap(len(darray.id2word)) * super_frequent_patterns = TrieMap(len(darray.id2word)) * collocations = TrieMap(len(darray.id2word)) # <<<<<<<<<<<<<< @@ -31414,7 +31125,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_collocations = ((struct __pyx_obj_3_sa_TrieMap *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":291 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":291 * collocations = TrieMap(len(darray.id2word)) * * I_set = set() # <<<<<<<<<<<<<< @@ -31426,7 +31137,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_I_set = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":292 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":292 * * I_set = set() * J_set = set() # <<<<<<<<<<<<<< @@ -31438,7 +31149,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_J_set = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":293 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":293 * I_set = set() * J_set = set() * J2_set = set() # <<<<<<<<<<<<<< @@ -31450,7 +31161,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_J2_set = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":294 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":294 * J_set = set() * J2_set = set() * IJ_set = set() # <<<<<<<<<<<<<< @@ -31462,7 +31173,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_IJ_set = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":295 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":295 * J2_set = set() * IJ_set = set() * pattern_rank = {} # <<<<<<<<<<<<<< @@ -31474,7 +31185,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_pattern_rank = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":297 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":297 * pattern_rank = {} * * logger.info("Precomputing frequent intersections") # <<<<<<<<<<<<<< @@ -31491,7 +31202,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":298 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":298 * * logger.info("Precomputing frequent intersections") * cdef float start_time = monitor_cpu() # <<<<<<<<<<<<<< @@ -31507,7 +31218,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_start_time = __pyx_t_4; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":300 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":300 * cdef float start_time = monitor_cpu() * * max_pattern_len = 0 # <<<<<<<<<<<<<< @@ -31516,7 +31227,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ __pyx_v_max_pattern_len = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":301 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":301 * * max_pattern_len = 0 * for rank, (_, _, phrase) in enumerate(stats): # <<<<<<<<<<<<<< @@ -31536,18 +31247,10 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s 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_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; } 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_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; } else { __pyx_t_6 = __pyx_t_5(__pyx_t_1); if (unlikely(!__pyx_t_6)) { @@ -31561,22 +31264,21 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s } if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { PyObject* sequence = __pyx_t_6; - #if CYTHON_COMPILING_IN_CPYTHON - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 3)) { - if (size > 3) __Pyx_RaiseTooManyValuesError(3); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { + if (unlikely(PyTuple_GET_SIZE(sequence) != 3)) { + if (PyTuple_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3); + else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 2); } else { + if (unlikely(PyList_GET_SIZE(sequence) != 3)) { + if (PyList_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3); + else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } __pyx_t_7 = PyList_GET_ITEM(sequence, 0); __pyx_t_8 = PyList_GET_ITEM(sequence, 1); __pyx_t_9 = PyList_GET_ITEM(sequence, 2); @@ -31584,14 +31286,8 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); - #else - __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_9 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } else - { + } else { Py_ssize_t index = -1; __pyx_t_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); @@ -31604,13 +31300,12 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s index = 2; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 3) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_11 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); + if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L6_unpacking_done:; } @@ -31632,7 +31327,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_t_3 = __pyx_t_6; __pyx_t_6 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":302 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":302 * max_pattern_len = 0 * for rank, (_, _, phrase) in enumerate(stats): * if rank >= self.precompute_rank: # <<<<<<<<<<<<<< @@ -31641,13 +31336,14 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ __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_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_t_9 = PyObject_RichCompare(__pyx_v_rank, __pyx_t_6, Py_GE); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_12) { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":303 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":303 * for rank, (_, _, phrase) in enumerate(stats): * if rank >= self.precompute_rank: * break # <<<<<<<<<<<<<< @@ -31659,7 +31355,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s } __pyx_L7:; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":304 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":304 * if rank >= self.precompute_rank: * break * max_pattern_len = max(max_pattern_len, len(phrase)) # <<<<<<<<<<<<<< @@ -31675,7 +31371,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s } __pyx_v_max_pattern_len = __pyx_t_15; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":305 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":305 * break * max_pattern_len = max(max_pattern_len, len(phrase)) * frequent_patterns.insert(phrase) # <<<<<<<<<<<<<< @@ -31695,7 +31391,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":306 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":306 * max_pattern_len = max(max_pattern_len, len(phrase)) * frequent_patterns.insert(phrase) * I_set.add(phrase) # <<<<<<<<<<<<<< @@ -31704,7 +31400,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ __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/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":307 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":307 * frequent_patterns.insert(phrase) * I_set.add(phrase) * pattern_rank[phrase] = rank # <<<<<<<<<<<<<< @@ -31713,7 +31409,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ 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;} - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":308 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":308 * I_set.add(phrase) * pattern_rank[phrase] = rank * if rank < self.precompute_secondary_rank: # <<<<<<<<<<<<<< @@ -31722,13 +31418,14 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ __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_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_t_6 = PyObject_RichCompare(__pyx_v_rank, __pyx_t_8, Py_LT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_12) { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":309 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":309 * pattern_rank[phrase] = rank * if rank < self.precompute_secondary_rank: * super_frequent_patterns.insert(phrase) # <<<<<<<<<<<<<< @@ -31748,7 +31445,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":310 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":310 * if rank < self.precompute_secondary_rank: * super_frequent_patterns.insert(phrase) * J_set.add(phrase) # <<<<<<<<<<<<<< @@ -31764,7 +31461,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":312 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":312 * J_set.add(phrase) * * queue = IntList(increment=1000) # <<<<<<<<<<<<<< @@ -31780,7 +31477,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_queue = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":314 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":314 * queue = IntList(increment=1000) * * logger.info(" Computing inverted indexes...") # <<<<<<<<<<<<<< @@ -31797,7 +31494,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":315 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":315 * * logger.info(" Computing inverted indexes...") * N = len(data) # <<<<<<<<<<<<<< @@ -31807,7 +31504,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __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/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":316 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":316 * logger.info(" Computing inverted indexes...") * N = len(data) * for i from 0 <= i < N: # <<<<<<<<<<<<<< @@ -31817,7 +31514,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_t_14 = __pyx_v_N; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_14; __pyx_v_i++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":317 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":317 * N = len(data) * for i from 0 <= i < N: * sa_word_id = data.arr[i] # <<<<<<<<<<<<<< @@ -31826,7 +31523,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ __pyx_v_sa_word_id = (__pyx_v_data->arr[__pyx_v_i]); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":318 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":318 * for i from 0 <= i < N: * sa_word_id = data.arr[i] * if sa_word_id == 1: # <<<<<<<<<<<<<< @@ -31836,7 +31533,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_t_12 = (__pyx_v_sa_word_id == 1); if (__pyx_t_12) { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":319 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":319 * sa_word_id = data.arr[i] * if sa_word_id == 1: * queue._append(-1) # <<<<<<<<<<<<<< @@ -31848,7 +31545,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":321 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":321 * queue._append(-1) * else: * for l from 1 <= l <= max_pattern_len: # <<<<<<<<<<<<<< @@ -31858,7 +31555,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_t_17 = __pyx_v_max_pattern_len; for (__pyx_v_l = 1; __pyx_v_l <= __pyx_t_17; __pyx_v_l++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":322 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":322 * else: * for l from 1 <= l <= max_pattern_len: * node = frequent_patterns._contains(data.arr+i, l) # <<<<<<<<<<<<<< @@ -31867,7 +31564,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ __pyx_v_node = ((struct __pyx_vtabstruct_3_sa_TrieMap *)__pyx_v_frequent_patterns->__pyx_vtab)->_contains(__pyx_v_frequent_patterns, (__pyx_v_data->arr + __pyx_v_i), __pyx_v_l); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":323 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":323 * for l from 1 <= l <= max_pattern_len: * node = frequent_patterns._contains(data.arr+i, l) * if node == NULL: # <<<<<<<<<<<<<< @@ -31877,7 +31574,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_t_12 = (__pyx_v_node == NULL); if (__pyx_t_12) { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":324 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":324 * node = frequent_patterns._contains(data.arr+i, l) * if node == NULL: * break # <<<<<<<<<<<<<< @@ -31889,7 +31586,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s } __pyx_L14:; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":325 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":325 * if node == NULL: * break * queue._append(i) # <<<<<<<<<<<<<< @@ -31898,7 +31595,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_queue->__pyx_vtab)->_append(__pyx_v_queue, __pyx_v_i); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":326 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":326 * break * queue._append(i) * queue._append(l) # <<<<<<<<<<<<<< @@ -31907,7 +31604,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_queue->__pyx_vtab)->_append(__pyx_v_queue, __pyx_v_l); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":327 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":327 * queue._append(i) * queue._append(l) * trie_node_data_append(node, i) # <<<<<<<<<<<<<< @@ -31923,7 +31620,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_L11:; } - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":329 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":329 * trie_node_data_append(node, i) * * logger.info(" Computing collocations...") # <<<<<<<<<<<<<< @@ -31940,7 +31637,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":330 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":330 * * logger.info(" Computing collocations...") * N = len(queue) # <<<<<<<<<<<<<< @@ -31950,7 +31647,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __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/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":331 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":331 * logger.info(" Computing collocations...") * N = len(queue) * ptr1 = 0 # <<<<<<<<<<<<<< @@ -31959,7 +31656,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ __pyx_v_ptr1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":332 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":332 * N = len(queue) * ptr1 = 0 * sent_count = 0 # <<<<<<<<<<<<<< @@ -31968,7 +31665,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ __pyx_v_sent_count = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":333 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":333 * ptr1 = 0 * sent_count = 0 * while ptr1 < N: # main loop # <<<<<<<<<<<<<< @@ -31979,7 +31676,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_t_12 = (__pyx_v_ptr1 < __pyx_v_N); if (!__pyx_t_12) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":334 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":334 * sent_count = 0 * while ptr1 < N: # main loop * i1 = queue.arr[ptr1] # <<<<<<<<<<<<<< @@ -31988,7 +31685,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ __pyx_v_i1 = (__pyx_v_queue->arr[__pyx_v_ptr1]); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":335 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":335 * while ptr1 < N: # main loop * i1 = queue.arr[ptr1] * if i1 > -1: # <<<<<<<<<<<<<< @@ -31998,7 +31695,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_t_12 = (__pyx_v_i1 > -1); if (__pyx_t_12) { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":336 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":336 * i1 = queue.arr[ptr1] * if i1 > -1: * l1 = queue.arr[ptr1+1] # <<<<<<<<<<<<<< @@ -32007,7 +31704,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ __pyx_v_l1 = (__pyx_v_queue->arr[(__pyx_v_ptr1 + 1)]); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":337 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":337 * if i1 > -1: * l1 = queue.arr[ptr1+1] * ptr2 = ptr1 + 2 # <<<<<<<<<<<<<< @@ -32016,7 +31713,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ __pyx_v_ptr2 = (__pyx_v_ptr1 + 2); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":338 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":338 * l1 = queue.arr[ptr1+1] * ptr2 = ptr1 + 2 * while ptr2 < N: # <<<<<<<<<<<<<< @@ -32027,7 +31724,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_t_12 = (__pyx_v_ptr2 < __pyx_v_N); if (!__pyx_t_12) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":339 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":339 * ptr2 = ptr1 + 2 * while ptr2 < N: * i2 = queue.arr[ptr2] # <<<<<<<<<<<<<< @@ -32036,7 +31733,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ __pyx_v_i2 = (__pyx_v_queue->arr[__pyx_v_ptr2]); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":340 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":340 * while ptr2 < N: * i2 = queue.arr[ptr2] * if i2 == -1 or i2 - i1 >= self.train_max_initial_size: # <<<<<<<<<<<<<< @@ -32052,7 +31749,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s } if (__pyx_t_19) { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":341 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":341 * i2 = queue.arr[ptr2] * if i2 == -1 or i2 - i1 >= self.train_max_initial_size: * break # <<<<<<<<<<<<<< @@ -32064,7 +31761,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s } __pyx_L20:; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":342 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":342 * if i2 == -1 or i2 - i1 >= self.train_max_initial_size: * break * l2 = queue.arr[ptr2+1] # <<<<<<<<<<<<<< @@ -32073,7 +31770,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ __pyx_v_l2 = (__pyx_v_queue->arr[(__pyx_v_ptr2 + 1)]); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":343 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":343 * break * l2 = queue.arr[ptr2+1] * if (i2 - i1 - l1 >= self.train_min_gap_size and # <<<<<<<<<<<<<< @@ -32083,7 +31780,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_t_19 = (((__pyx_v_i2 - __pyx_v_i1) - __pyx_v_l1) >= __pyx_v_self->train_min_gap_size); if (__pyx_t_19) { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":344 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -32093,7 +31790,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_t_12 = (((__pyx_v_i2 + __pyx_v_l2) - __pyx_v_i1) <= __pyx_v_self->train_max_initial_size); if (__pyx_t_12) { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":345 + /* "/home/paulb/workspace/cdec/python/src/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): # <<<<<<<<<<<<<< @@ -32111,7 +31808,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s } if (__pyx_t_12) { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":346 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -32120,7 +31817,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ __pyx_v_node = ((struct __pyx_vtabstruct_3_sa_TrieMap *)__pyx_v_collocations->__pyx_vtab)->_insert(__pyx_v_collocations, (__pyx_v_data->arr + __pyx_v_i1), __pyx_v_l1); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":347 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":347 * l1+l2+1 <= self.max_length): * node = collocations._insert(data.arr+i1, l1) * node = trie_insert(node, -1) # <<<<<<<<<<<<<< @@ -32129,7 +31826,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ __pyx_v_node = __pyx_f_3_sa_trie_insert(__pyx_v_node, -1); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":348 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":348 * node = collocations._insert(data.arr+i1, l1) * node = trie_insert(node, -1) * for i from i2 <= i < i2+l2: # <<<<<<<<<<<<<< @@ -32139,7 +31836,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __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/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":349 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":349 * node = trie_insert(node, -1) * for i from i2 <= i < i2+l2: * node = trie_insert(node, data.arr[i]) # <<<<<<<<<<<<<< @@ -32149,7 +31846,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_node = __pyx_f_3_sa_trie_insert(__pyx_v_node, (__pyx_v_data->arr[__pyx_v_i])); } - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":350 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":350 * for i from i2 <= i < i2+l2: * node = trie_insert(node, data.arr[i]) * trie_node_data_append(node, i1) # <<<<<<<<<<<<<< @@ -32160,7 +31857,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":351 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":351 * node = trie_insert(node, data.arr[i]) * trie_node_data_append(node, i1) * trie_node_data_append(node, i2) # <<<<<<<<<<<<<< @@ -32171,7 +31868,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":352 + /* "/home/paulb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -32181,7 +31878,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_t_12 = (((struct __pyx_vtabstruct_3_sa_TrieMap *)__pyx_v_super_frequent_patterns->__pyx_vtab)->_contains(__pyx_v_super_frequent_patterns, (__pyx_v_data->arr + __pyx_v_i2), __pyx_v_l2) != NULL); if (__pyx_t_12) { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":353 + /* "/home/paulb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -32191,7 +31888,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_t_12 = (((struct __pyx_vtabstruct_3_sa_TrieMap *)__pyx_v_super_frequent_patterns->__pyx_vtab)->_contains(__pyx_v_super_frequent_patterns, (__pyx_v_data->arr + __pyx_v_i1), __pyx_v_l1) != NULL); if (__pyx_t_12) { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":354 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -32203,7 +31900,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":356 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":356 * is_super = 1 * else: * is_super = 0 # <<<<<<<<<<<<<< @@ -32214,7 +31911,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s } __pyx_L25:; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":357 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":357 * else: * is_super = 0 * ptr3 = ptr2 + 2 # <<<<<<<<<<<<<< @@ -32223,7 +31920,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ __pyx_v_ptr3 = (__pyx_v_ptr2 + 2); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":358 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":358 * is_super = 0 * ptr3 = ptr2 + 2 * while ptr3 < N: # <<<<<<<<<<<<<< @@ -32234,7 +31931,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_t_12 = (__pyx_v_ptr3 < __pyx_v_N); if (!__pyx_t_12) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":359 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":359 * ptr3 = ptr2 + 2 * while ptr3 < N: * i3 = queue.arr[ptr3] # <<<<<<<<<<<<<< @@ -32243,7 +31940,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ __pyx_v_i3 = (__pyx_v_queue->arr[__pyx_v_ptr3]); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":360 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":360 * while ptr3 < N: * i3 = queue.arr[ptr3] * if i3 == -1 or i3 - i1 >= self.train_max_initial_size: # <<<<<<<<<<<<<< @@ -32259,7 +31956,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s } if (__pyx_t_20) { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":361 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":361 * i3 = queue.arr[ptr3] * if i3 == -1 or i3 - i1 >= self.train_max_initial_size: * break # <<<<<<<<<<<<<< @@ -32271,7 +31968,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s } __pyx_L28:; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":362 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":362 * if i3 == -1 or i3 - i1 >= self.train_max_initial_size: * break * l3 = queue.arr[ptr3+1] # <<<<<<<<<<<<<< @@ -32280,7 +31977,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ __pyx_v_l3 = (__pyx_v_queue->arr[(__pyx_v_ptr3 + 1)]); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":363 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":363 * break * l3 = queue.arr[ptr3+1] * if (i3 - i2 - l2 >= self.train_min_gap_size and # <<<<<<<<<<<<<< @@ -32290,7 +31987,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_t_20 = (((__pyx_v_i3 - __pyx_v_i2) - __pyx_v_l2) >= __pyx_v_self->train_min_gap_size); if (__pyx_t_20) { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":364 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -32300,7 +31997,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_t_12 = (((__pyx_v_i3 + __pyx_v_l3) - __pyx_v_i1) <= __pyx_v_self->train_max_initial_size); if (__pyx_t_12) { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":365 + /* "/home/paulb/workspace/cdec/python/src/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): # <<<<<<<<<<<<<< @@ -32318,7 +32015,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s } if (__pyx_t_12) { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":366 + /* "/home/paulb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -32333,7 +32030,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s } if (__pyx_t_20) { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":367 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -32342,7 +32039,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ __pyx_v_node = ((struct __pyx_vtabstruct_3_sa_TrieMap *)__pyx_v_collocations->__pyx_vtab)->_insert(__pyx_v_collocations, (__pyx_v_data->arr + __pyx_v_i1), __pyx_v_l1); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":368 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -32351,7 +32048,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ __pyx_v_node = __pyx_f_3_sa_trie_insert(__pyx_v_node, -1); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":369 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":369 * node = collocations._insert(data.arr+i1, l1) * node = trie_insert(node, -1) * for i from i2 <= i < i2+l2: # <<<<<<<<<<<<<< @@ -32361,7 +32058,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __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/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":370 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":370 * node = trie_insert(node, -1) * for i from i2 <= i < i2+l2: * node = trie_insert(node, data.arr[i]) # <<<<<<<<<<<<<< @@ -32371,7 +32068,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_node = __pyx_f_3_sa_trie_insert(__pyx_v_node, (__pyx_v_data->arr[__pyx_v_i])); } - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":371 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":371 * for i from i2 <= i < i2+l2: * node = trie_insert(node, data.arr[i]) * node = trie_insert(node, -1) # <<<<<<<<<<<<<< @@ -32380,7 +32077,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ __pyx_v_node = __pyx_f_3_sa_trie_insert(__pyx_v_node, -1); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":372 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":372 * node = trie_insert(node, data.arr[i]) * node = trie_insert(node, -1) * for i from i3 <= i < i3+l3: # <<<<<<<<<<<<<< @@ -32390,7 +32087,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __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/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":373 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":373 * node = trie_insert(node, -1) * for i from i3 <= i < i3+l3: * node = trie_insert(node, data.arr[i]) # <<<<<<<<<<<<<< @@ -32400,7 +32097,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_node = __pyx_f_3_sa_trie_insert(__pyx_v_node, (__pyx_v_data->arr[__pyx_v_i])); } - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":374 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":374 * for i from i3 <= i < i3+l3: * node = trie_insert(node, data.arr[i]) * trie_node_data_append(node, i1) # <<<<<<<<<<<<<< @@ -32411,7 +32108,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":375 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":375 * node = trie_insert(node, data.arr[i]) * trie_node_data_append(node, i1) * trie_node_data_append(node, i2) # <<<<<<<<<<<<<< @@ -32422,7 +32119,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":376 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":376 * trie_node_data_append(node, i1) * trie_node_data_append(node, i2) * trie_node_data_append(node, i3) # <<<<<<<<<<<<<< @@ -32439,7 +32136,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s } __pyx_L29:; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":377 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":377 * trie_node_data_append(node, i2) * trie_node_data_append(node, i3) * ptr3 = ptr3 + 2 # <<<<<<<<<<<<<< @@ -32456,7 +32153,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s } __pyx_L21:; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":378 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":378 * trie_node_data_append(node, i3) * ptr3 = ptr3 + 2 * ptr2 = ptr2 + 2 # <<<<<<<<<<<<<< @@ -32467,7 +32164,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s } __pyx_L19_break:; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":379 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":379 * ptr3 = ptr3 + 2 * ptr2 = ptr2 + 2 * ptr1 = ptr1 + 2 # <<<<<<<<<<<<<< @@ -32479,7 +32176,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":381 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":381 * ptr1 = ptr1 + 2 * else: * sent_count = sent_count + 1 # <<<<<<<<<<<<<< @@ -32488,7 +32185,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ __pyx_v_sent_count = (__pyx_v_sent_count + 1); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":382 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":382 * else: * sent_count = sent_count + 1 * if sent_count % 10000 == 0: # <<<<<<<<<<<<<< @@ -32498,7 +32195,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_t_20 = (__Pyx_mod_long(__pyx_v_sent_count, 10000) == 0); if (__pyx_t_20) { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":383 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":383 * sent_count = sent_count + 1 * if sent_count % 10000 == 0: * logger.debug(" %d sentences", sent_count) # <<<<<<<<<<<<<< @@ -32529,7 +32226,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s } __pyx_L35:; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":384 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":384 * if sent_count % 10000 == 0: * logger.debug(" %d sentences", sent_count) * ptr1 = ptr1 + 1 # <<<<<<<<<<<<<< @@ -32541,7 +32238,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_L17:; } - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":386 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":386 * ptr1 = ptr1 + 1 * * self.precomputed_collocations = collocations.toMap(False) # <<<<<<<<<<<<<< @@ -32567,7 +32264,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_self->precomputed_collocations = __pyx_t_9; __pyx_t_9 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":387 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":387 * * self.precomputed_collocations = collocations.toMap(False) * self.precomputed_index = frequent_patterns.toMap(True) # <<<<<<<<<<<<<< @@ -32593,7 +32290,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_self->precomputed_index = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":389 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":389 * self.precomputed_index = frequent_patterns.toMap(True) * * x = 0 # <<<<<<<<<<<<<< @@ -32603,7 +32300,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __Pyx_INCREF(__pyx_int_0); __pyx_v_x = __pyx_int_0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":390 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":390 * * x = 0 * for pattern1 in J_set: # <<<<<<<<<<<<<< @@ -32629,7 +32326,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_pattern1 = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":391 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":391 * x = 0 * for pattern1 in J_set: * for pattern2 in J_set: # <<<<<<<<<<<<<< @@ -32655,7 +32352,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_pattern2 = __pyx_t_9; __pyx_t_9 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":392 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":392 * for pattern1 in J_set: * for pattern2 in J_set: * if len(pattern1) + len(pattern2) + 1 < self.max_length: # <<<<<<<<<<<<<< @@ -32667,7 +32364,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_t_20 = (((__pyx_t_2 + __pyx_t_15) + 1) < __pyx_v_self->max_length); if (__pyx_t_20) { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":393 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":393 * for pattern2 in J_set: * if len(pattern1) + len(pattern2) + 1 < self.max_length: * combined_pattern = pattern1 + (-1,) + pattern2 # <<<<<<<<<<<<<< @@ -32683,7 +32380,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_combined_pattern = __pyx_t_8; __pyx_t_8 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":394 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":394 * if len(pattern1) + len(pattern2) + 1 < self.max_length: * combined_pattern = pattern1 + (-1,) + pattern2 * J2_set.add(combined_pattern) # <<<<<<<<<<<<<< @@ -32699,7 +32396,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":396 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":396 * J2_set.add(combined_pattern) * * for pattern1 in I_set: # <<<<<<<<<<<<<< @@ -32725,7 +32422,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_pattern1 = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":397 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":397 * * for pattern1 in I_set: * for pattern2 in I_set: # <<<<<<<<<<<<<< @@ -32751,7 +32448,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_pattern2 = __pyx_t_8; __pyx_t_8 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":398 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":398 * for pattern1 in I_set: * for pattern2 in I_set: * x = x+1 # <<<<<<<<<<<<<< @@ -32764,7 +32461,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_x = __pyx_t_8; __pyx_t_8 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":399 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":399 * for pattern2 in I_set: * x = x+1 * if len(pattern1) + len(pattern2) + 1 <= self.max_length: # <<<<<<<<<<<<<< @@ -32776,7 +32473,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_t_20 = (((__pyx_t_15 + __pyx_t_2) + 1) <= __pyx_v_self->max_length); if (__pyx_t_20) { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":400 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":400 * x = x+1 * if len(pattern1) + len(pattern2) + 1 <= self.max_length: * combined_pattern = pattern1 + (-1,) + pattern2 # <<<<<<<<<<<<<< @@ -32792,7 +32489,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_combined_pattern = __pyx_t_9; __pyx_t_9 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":401 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":401 * if len(pattern1) + len(pattern2) + 1 <= self.max_length: * combined_pattern = pattern1 + (-1,) + pattern2 * IJ_set.add(combined_pattern) # <<<<<<<<<<<<<< @@ -32808,7 +32505,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":403 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":403 * IJ_set.add(combined_pattern) * * for pattern1 in I_set: # <<<<<<<<<<<<<< @@ -32834,7 +32531,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_pattern1 = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":404 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":404 * * for pattern1 in I_set: * for pattern2 in J2_set: # <<<<<<<<<<<<<< @@ -32860,7 +32557,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_pattern2 = __pyx_t_9; __pyx_t_9 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":405 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":405 * for pattern1 in I_set: * for pattern2 in J2_set: * x = x+2 # <<<<<<<<<<<<<< @@ -32873,7 +32570,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_x = __pyx_t_9; __pyx_t_9 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":406 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":406 * for pattern2 in J2_set: * x = x+2 * if len(pattern1) + len(pattern2) + 1<= self.max_length: # <<<<<<<<<<<<<< @@ -32885,7 +32582,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_t_20 = (((__pyx_t_2 + __pyx_t_15) + 1) <= __pyx_v_self->max_length); if (__pyx_t_20) { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":407 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":407 * x = x+2 * if len(pattern1) + len(pattern2) + 1<= self.max_length: * combined_pattern = pattern1 + (-1,) + pattern2 # <<<<<<<<<<<<<< @@ -32901,7 +32598,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_combined_pattern = __pyx_t_8; __pyx_t_8 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":408 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":408 * if len(pattern1) + len(pattern2) + 1<= self.max_length: * combined_pattern = pattern1 + (-1,) + pattern2 * IJ_set.add(combined_pattern) # <<<<<<<<<<<<<< @@ -32910,7 +32607,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ __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/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":409 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":409 * combined_pattern = pattern1 + (-1,) + pattern2 * IJ_set.add(combined_pattern) * combined_pattern = pattern2 + (-1,) + pattern1 # <<<<<<<<<<<<<< @@ -32926,7 +32623,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_combined_pattern = __pyx_t_9; __pyx_t_9 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":410 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":410 * IJ_set.add(combined_pattern) * combined_pattern = pattern2 + (-1,) + pattern1 * IJ_set.add(combined_pattern) # <<<<<<<<<<<<<< @@ -32942,17 +32639,17 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":412 + /* "/home/paulb/workspace/cdec/python/src/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(((PyObject *)__pyx_v_pattern_rank)); __pyx_v_N = __pyx_t_15; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":413 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":413 * * N = len(pattern_rank) * cost_by_rank = IntList(initial_len=N) # <<<<<<<<<<<<<< @@ -32971,7 +32668,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_cost_by_rank = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":414 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":414 * N = len(pattern_rank) * cost_by_rank = IntList(initial_len=N) * count_by_rank = IntList(initial_len=N) # <<<<<<<<<<<<<< @@ -32990,47 +32687,105 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_count_by_rank = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":415 + /* "/home/paulb/workspace/cdec/python/src/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(): # <<<<<<<<<<<<<< * if pattern not in IJ_set: * s = "" */ - __pyx_t_15 = 0; - if (unlikely(__pyx_v_self->precomputed_collocations == Py_None)) { - PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems"); - {__pyx_filename = __pyx_f[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_t_3 = PyObject_GetAttr(__pyx_v_self->precomputed_collocations, __pyx_n_s__iteritems); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); 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; - 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); - 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_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_15 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_15 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_3)) break; + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; + } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; + } else { + __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(); + else {__pyx_filename = __pyx_f[11]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + if (likely(PyTuple_CheckExact(sequence))) { + if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { + if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); + else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[11]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); + } else { + if (unlikely(PyList_GET_SIZE(sequence) != 2)) { + if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); + else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[11]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = PyList_GET_ITEM(sequence, 0); + __pyx_t_8 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_11 = Py_TYPE(__pyx_t_6)->tp_iternext; + index = 0; __pyx_t_9 = __pyx_t_11(__pyx_t_6); if (unlikely(!__pyx_t_9)) goto __pyx_L53_unpacking_failed; + __Pyx_GOTREF(__pyx_t_9); + index = 1; __pyx_t_8 = __pyx_t_11(__pyx_t_6); if (unlikely(!__pyx_t_8)) goto __pyx_L53_unpacking_failed; + __Pyx_GOTREF(__pyx_t_8); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_6), 2) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L54_unpacking_done; + __pyx_L53_unpacking_failed:; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); + if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[11]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L54_unpacking_done:; + } __Pyx_XDECREF(__pyx_v_pattern); - __pyx_v_pattern = __pyx_t_1; - __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_v_arr); - __pyx_v_arr = __pyx_t_9; + __pyx_v_pattern = __pyx_t_9; __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_v_arr); + __pyx_v_arr = __pyx_t_8; + __pyx_t_8 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":416 + /* "/home/paulb/workspace/cdec/python/src/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_NegateNonNeg(PySequence_Contains(((PyObject *)__pyx_v_IJ_set), __pyx_v_pattern))); if (unlikely(__pyx_t_20 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_20) { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":417 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":417 * for pattern, arr in self.precomputed_collocations.iteritems(): * if pattern not in IJ_set: * s = "" # <<<<<<<<<<<<<< @@ -33041,7 +32796,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __Pyx_XDECREF(__pyx_v_s); __pyx_v_s = ((PyObject *)__pyx_kp_s_45); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":418 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":418 * if pattern not in IJ_set: * s = "" * for word_id in pattern: # <<<<<<<<<<<<<< @@ -33049,124 +32804,117 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s * 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_5 = NULL; + __pyx_t_1 = __pyx_v_pattern; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + __pyx_t_21 = 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_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_pattern); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_21 = Py_TYPE(__pyx_t_1)->tp_iternext; } for (;;) { - if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_9)) { - if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_9)) 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;} - #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;} - #endif - } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_9)) { - if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_9)) 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;} - #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;} - #endif + if (!__pyx_t_21 && PyList_CheckExact(__pyx_t_1)) { + if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_8); __pyx_t_2++; + } else if (!__pyx_t_21 && PyTuple_CheckExact(__pyx_t_1)) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_8); __pyx_t_2++; } else { - __pyx_t_1 = __pyx_t_5(__pyx_t_9); - if (unlikely(!__pyx_t_1)) { + __pyx_t_8 = __pyx_t_21(__pyx_t_1); + if (unlikely(!__pyx_t_8)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[11]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } - __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_8); } __Pyx_XDECREF(__pyx_v_word_id); - __pyx_v_word_id = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_v_word_id = __pyx_t_8; + __pyx_t_8 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":419 + /* "/home/paulb/workspace/cdec/python/src/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_20 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_20 < 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_8 = PyObject_RichCompare(__pyx_v_word_id, __pyx_int_neg_1, Py_EQ); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_20 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_20) { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":420 + /* "/home/paulb/workspace/cdec/python/src/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_83)); 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_t_8 = PyNumber_Add(__pyx_v_s, ((PyObject *)__pyx_kp_s_83)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_v_s); - __pyx_v_s = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L56; + __pyx_v_s = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L58; } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":422 + /* "/home/paulb/workspace/cdec/python/src/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_8 = PyObject_GetItem(__pyx_v_darray->id2word, __pyx_v_word_id); if (!__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_67)); 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_t_9 = PyNumber_Add(__pyx_v_s, __pyx_t_8); 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_t_8 = PyNumber_Add(__pyx_t_9, ((PyObject *)__pyx_kp_s_67)); 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_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_v_s); - __pyx_v_s = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_v_s = __pyx_t_8; + __pyx_t_8 = 0; } - __pyx_L56:; + __pyx_L58:; } - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":423 + /* "/home/paulb/workspace/cdec/python/src/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_GetName(__pyx_m, __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 = PyObject_GetAttr(__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_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); 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_t_8 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__warn); 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_t_1 = PyTuple_New(2); 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_GOTREF(__pyx_t_9); __Pyx_INCREF(((PyObject *)__pyx_kp_s_84)); - PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_kp_s_84)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_84)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_84)); __Pyx_INCREF(__pyx_v_s); - PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_s); + PyTuple_SET_ITEM(__pyx_t_1, 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_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; + __pyx_t_9 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_1), NULL); 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_DECREF(__pyx_t_8); __pyx_t_8 = 0; - goto __pyx_L53; + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L55; } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":425 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":425 * logger.warn("ERROR: unexpected pattern %s in set of precomputed collocations", s) * else: * chunk = () # <<<<<<<<<<<<<< @@ -33177,7 +32925,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __Pyx_XDECREF(((PyObject *)__pyx_v_chunk)); __pyx_v_chunk = __pyx_empty_tuple; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":426 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":426 * else: * chunk = () * max_rank = 0 # <<<<<<<<<<<<<< @@ -33186,7 +32934,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ __pyx_v_max_rank = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":427 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":427 * chunk = () * max_rank = 0 * arity = 0 # <<<<<<<<<<<<<< @@ -33197,7 +32945,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __Pyx_XDECREF(__pyx_v_arity); __pyx_v_arity = __pyx_int_0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":428 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":428 * max_rank = 0 * arity = 0 * for word_id in pattern: # <<<<<<<<<<<<<< @@ -33205,99 +32953,93 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s * max_rank = max(max_rank, pattern_rank[chunk]) */ if (PyList_CheckExact(__pyx_v_pattern) || PyTuple_CheckExact(__pyx_v_pattern)) { - __pyx_t_8 = __pyx_v_pattern; __Pyx_INCREF(__pyx_t_8); __pyx_t_13 = 0; - __pyx_t_5 = NULL; + __pyx_t_9 = __pyx_v_pattern; __Pyx_INCREF(__pyx_t_9); __pyx_t_2 = 0; + __pyx_t_21 = NULL; } else { - __pyx_t_13 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_pattern); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = Py_TYPE(__pyx_t_8)->tp_iternext; + __pyx_t_2 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_pattern); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_21 = Py_TYPE(__pyx_t_9)->tp_iternext; } for (;;) { - 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;} - #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;} - #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;} - #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;} - #endif + if (!__pyx_t_21 && PyList_CheckExact(__pyx_t_9)) { + if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_9)) break; + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; + } else if (!__pyx_t_21 && PyTuple_CheckExact(__pyx_t_9)) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_9)) break; + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; } else { - __pyx_t_9 = __pyx_t_5(__pyx_t_8); - if (unlikely(!__pyx_t_9)) { + __pyx_t_1 = __pyx_t_21(__pyx_t_9); + if (unlikely(!__pyx_t_1)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[11]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } - __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF(__pyx_v_word_id); - __pyx_v_word_id = __pyx_t_9; - __pyx_t_9 = 0; + __pyx_v_word_id = __pyx_t_1; + __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":429 + /* "/home/paulb/workspace/cdec/python/src/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_20 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_20 < 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_1 = PyObject_RichCompare(__pyx_v_word_id, __pyx_int_neg_1, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_20 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_20) { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":430 + /* "/home/paulb/workspace/cdec/python/src/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_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_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_pattern_rank), ((PyObject *)__pyx_v_chunk)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_14 = __pyx_v_max_rank; + __pyx_t_6 = PyInt_FromLong(__pyx_t_14); 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_1, __pyx_t_6, Py_GT); 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_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_20 < 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_20) { - __Pyx_INCREF(__pyx_t_9); - __pyx_t_1 = __pyx_t_9; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_8 = __pyx_t_1; } 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 = PyInt_FromLong(__pyx_t_14); 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_8 = __pyx_t_7; __pyx_t_7 = 0; } - __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; + __pyx_t_14 = __Pyx_PyInt_AsInt(__pyx_t_8); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_v_max_rank = __pyx_t_14; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":431 + /* "/home/paulb/workspace/cdec/python/src/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_t_8 = PyNumber_Add(__pyx_v_arity, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_v_arity); - __pyx_v_arity = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_v_arity = __pyx_t_8; + __pyx_t_8 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":432 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":432 * max_rank = max(max_rank, pattern_rank[chunk]) * arity = arity + 1 * chunk = () # <<<<<<<<<<<<<< @@ -33307,104 +33049,105 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __Pyx_INCREF(((PyObject *)__pyx_empty_tuple)); __Pyx_DECREF(((PyObject *)__pyx_v_chunk)); __pyx_v_chunk = __pyx_empty_tuple; - goto __pyx_L59; + goto __pyx_L61; } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":434 + /* "/home/paulb/workspace/cdec/python/src/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_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_word_id); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_word_id); + PyTuple_SET_ITEM(__pyx_t_8, 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_t_1 = PyNumber_Add(((PyObject *)__pyx_v_chunk), ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_chunk)); - __pyx_v_chunk = __pyx_t_9; - __pyx_t_9 = 0; + __pyx_v_chunk = __pyx_t_1; + __pyx_t_1 = 0; } - __pyx_L59:; + __pyx_L61:; } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":435 + /* "/home/paulb/workspace/cdec/python/src/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_9 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_pattern_rank), ((PyObject *)__pyx_v_chunk)); if (!__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_14 = __pyx_v_max_rank; + __pyx_t_8 = PyInt_FromLong(__pyx_t_14); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_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_7 = PyObject_RichCompare(__pyx_t_9, __pyx_t_8, Py_GT); 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_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_20 < 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_20) { - __Pyx_INCREF(__pyx_t_8); - __pyx_t_9 = __pyx_t_8; + __Pyx_INCREF(__pyx_t_9); + __pyx_t_1 = __pyx_t_9; } 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 = PyInt_FromLong(__pyx_t_14); 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_1 = __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_v_max_rank = __pyx_t_17; + __pyx_t_14 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__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_v_max_rank = __pyx_t_14; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":436 + /* "/home/paulb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< * count_by_rank.arr[max_rank] = count_by_rank.arr[max_rank] + (len(arr)/(arity+1)) * */ - __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)); + __pyx_t_2 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + (__pyx_v_cost_by_rank->arr[__pyx_v_max_rank]) = ((__pyx_v_cost_by_rank->arr[__pyx_v_max_rank]) + (4 * __pyx_t_2)); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":437 + /* "/home/paulb/workspace/cdec/python/src/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_t_1 = PyInt_FromLong((__pyx_v_count_by_rank->arr[__pyx_v_max_rank])); 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_2 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_2); 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_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_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_t_9, __pyx_t_7); 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_DECREF(__pyx_t_9); __pyx_t_9 = 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_1, __pyx_t_8); 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_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_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_14 = __Pyx_PyInt_AsInt(__pyx_t_7); if (unlikely((__pyx_t_14 == (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_v_count_by_rank->arr[__pyx_v_max_rank]) = __pyx_t_14; } - __pyx_L53:; + __pyx_L55:; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":439 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":439 * count_by_rank.arr[max_rank] = count_by_rank.arr[max_rank] + (len(arr)/(arity+1)) * * cumul_cost = 0 # <<<<<<<<<<<<<< @@ -33414,7 +33157,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __Pyx_INCREF(__pyx_int_0); __pyx_v_cumul_cost = __pyx_int_0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":440 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":440 * * cumul_cost = 0 * cumul_count = 0 # <<<<<<<<<<<<<< @@ -33424,7 +33167,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __Pyx_INCREF(__pyx_int_0); __pyx_v_cumul_count = __pyx_int_0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":441 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":441 * cumul_cost = 0 * cumul_count = 0 * for i from 0 <= i < N: # <<<<<<<<<<<<<< @@ -33434,7 +33177,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_t_14 = __pyx_v_N; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_14; __pyx_v_i++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":442 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":442 * cumul_count = 0 * for i from 0 <= i < N: * cumul_cost = cumul_cost + cost_by_rank.arr[i] # <<<<<<<<<<<<<< @@ -33450,7 +33193,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_cumul_cost = __pyx_t_7; __pyx_t_7 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":443 + /* "/home/paulb/workspace/cdec/python/src/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] # <<<<<<<<<<<<<< @@ -33466,7 +33209,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_cumul_count = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":444 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -33480,140 +33223,140 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __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_t_8 = PyInt_FromLong((__pyx_v_count_by_rank->arr[__pyx_v_i])); 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_t_1 = PyInt_FromLong((__pyx_v_cost_by_rank->arr[__pyx_v_i])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 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 = PyTuple_New(6); 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_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_85)); - PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_kp_s_85)); + PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_kp_s_85)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_85)); - PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_9); - __Pyx_GIVEREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_cumul_count); - PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_v_cumul_count); + PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_v_cumul_count); __Pyx_GIVEREF(__pyx_v_cumul_count); __Pyx_INCREF(__pyx_v_cumul_cost); - PyTuple_SET_ITEM(__pyx_t_8, 5, __pyx_v_cumul_cost); + PyTuple_SET_ITEM(__pyx_t_9, 5, __pyx_v_cumul_cost); __Pyx_GIVEREF(__pyx_v_cumul_cost); __pyx_t_3 = 0; + __pyx_t_8 = 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_1 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_9), NULL); 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_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(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":446 + /* "/home/paulb/workspace/cdec/python/src/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_1 = __pyx_v_self->precomputed_collocations; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_15 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_15); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_num_found_patterns = __pyx_t_1; + __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":447 + /* "/home/paulb/workspace/cdec/python/src/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_1 = PyObject_GetIter(((PyObject *)__pyx_v_IJ_set)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 447; __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_8 = __pyx_t_5(__pyx_t_9); - if (unlikely(!__pyx_t_8)) { + __pyx_t_9 = __pyx_t_5(__pyx_t_1); + if (unlikely(!__pyx_t_9)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[11]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } - __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_9); } __Pyx_XDECREF(__pyx_v_pattern); - __pyx_v_pattern = __pyx_t_8; - __pyx_t_8 = 0; + __pyx_v_pattern = __pyx_t_9; + __pyx_t_9 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":448 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":448 * 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_20 = (__Pyx_PySequence_Contains(__pyx_v_pattern, __pyx_v_self->precomputed_collocations, Py_NE)); if (unlikely(__pyx_t_20 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_20 = (__Pyx_NegateNonNeg(PySequence_Contains(__pyx_v_self->precomputed_collocations, __pyx_v_pattern))); if (unlikely(__pyx_t_20 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_20) { - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":449 + /* "/home/paulb/workspace/cdec/python/src/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_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_GOTREF(__pyx_t_8); - if (PyObject_SetItem(__pyx_v_self->precomputed_collocations, __pyx_v_pattern, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - goto __pyx_L64; + __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyObject_SetItem(__pyx_v_self->precomputed_collocations, __pyx_v_pattern, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L66; } - __pyx_L64:; + __pyx_L66:; } - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":451 + /* "/home/paulb/workspace/cdec/python/src/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_GetName(__pyx_m, __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_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); 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_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_9); 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_9); __pyx_t_9 = 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/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":452 + /* "/home/paulb/workspace/cdec/python/src/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_GetName(__pyx_m, __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 = PyObject_GetAttr(__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_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); 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_t_1 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __pyx_v_self->precomputed_collocations; + __Pyx_INCREF(__pyx_t_9); + __pyx_t_15 = PyObject_Length(__pyx_t_9); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_15); 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_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_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_GOTREF(__pyx_t_7); __Pyx_INCREF(((PyObject *)__pyx_kp_s_86)); @@ -33622,74 +33365,74 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __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_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_x); PyTuple_SET_ITEM(__pyx_t_7, 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_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = 0; + __pyx_t_9 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_7), NULL); 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_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":453 + /* "/home/paulb/workspace/cdec/python/src/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_GetName(__pyx_m, __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 = PyObject_GetAttr(__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_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); 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_t_7 = PyObject_GetAttr(__pyx_t_9, __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_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_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __pyx_v_self->precomputed_index; + __Pyx_INCREF(__pyx_t_9); + __pyx_t_15 = PyObject_Length(__pyx_t_9); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_15); 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_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_kp_s_87)); - PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_kp_s_87)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_87)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_87)); - 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); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_1), NULL); 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_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_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":454 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":454 * logger.info("Precomputed collocations for %d patterns out of %d possible (upper bound %d)", num_found_patterns, len(self.precomputed_collocations), x) * logger.info("Precomputed inverted index for %d patterns ", len(self.precomputed_index)) * logger.info("Precomputation took %f seconds", (stop_time - start_time)) # <<<<<<<<<<<<<< */ - __pyx_t_8 = __Pyx_GetName(__pyx_m, __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 = PyObject_GetAttr(__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_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); 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_t_1 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyFloat_FromDouble((__pyx_v_stop_time - __pyx_v_start_time)); 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_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)); - 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_9); __pyx_t_9 = 0; + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_7), NULL); 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_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; @@ -33744,14 +33487,14 @@ static int __pyx_pw_3_sa_11SuffixArray_1__cinit__(PyObject *__pyx_v_self, PyObje PyObject *__pyx_v_from_binary = 0; PyObject *__pyx_v_from_text = 0; PyObject *__pyx_v_side = 0; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__from_binary,&__pyx_n_s__from_text,&__pyx_n_s__side,0}; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__from_binary,&__pyx_n_s__from_text,&__pyx_n_s__side,0}; PyObject* values[3] = {0,0,0}; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":11 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":11 * cdef IntList ha * * def __cinit__(self, from_binary=None, from_text=None, side=None): # <<<<<<<<<<<<<< @@ -33830,7 +33573,7 @@ static int __pyx_pf_3_sa_11SuffixArray___cinit__(struct __pyx_obj_3_sa_SuffixArr int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":12 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":12 * * def __cinit__(self, from_binary=None, from_text=None, side=None): * self.darray = DataArray() # <<<<<<<<<<<<<< @@ -33845,7 +33588,7 @@ static int __pyx_pf_3_sa_11SuffixArray___cinit__(struct __pyx_obj_3_sa_SuffixArr __pyx_v_self->darray = ((struct __pyx_obj_3_sa_DataArray *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":13 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":13 * def __cinit__(self, from_binary=None, from_text=None, side=None): * self.darray = DataArray() * self.sa = IntList() # <<<<<<<<<<<<<< @@ -33860,7 +33603,7 @@ static int __pyx_pf_3_sa_11SuffixArray___cinit__(struct __pyx_obj_3_sa_SuffixArr __pyx_v_self->sa = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":14 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":14 * self.darray = DataArray() * self.sa = IntList() * self.ha = IntList() # <<<<<<<<<<<<<< @@ -33875,7 +33618,7 @@ static int __pyx_pf_3_sa_11SuffixArray___cinit__(struct __pyx_obj_3_sa_SuffixArr __pyx_v_self->ha = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":15 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":15 * self.sa = IntList() * self.ha = IntList() * if from_binary: # <<<<<<<<<<<<<< @@ -33885,7 +33628,7 @@ static int __pyx_pf_3_sa_11SuffixArray___cinit__(struct __pyx_obj_3_sa_SuffixArr __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/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":16 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":16 * self.ha = IntList() * if from_binary: * self.read_binary(from_binary) # <<<<<<<<<<<<<< @@ -33907,7 +33650,7 @@ static int __pyx_pf_3_sa_11SuffixArray___cinit__(struct __pyx_obj_3_sa_SuffixArr goto __pyx_L3; } - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":17 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":17 * if from_binary: * self.read_binary(from_binary) * elif from_text: # <<<<<<<<<<<<<< @@ -33917,7 +33660,7 @@ static int __pyx_pf_3_sa_11SuffixArray___cinit__(struct __pyx_obj_3_sa_SuffixArr __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/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":18 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":18 * self.read_binary(from_binary) * elif from_text: * self.read_text(from_text, side) # <<<<<<<<<<<<<< @@ -33967,7 +33710,7 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_3__getitem__(PyObject *__pyx_v_self return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":20 +/* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":20 * self.read_text(from_text, side) * * def __getitem__(self, i): # <<<<<<<<<<<<<< @@ -33985,7 +33728,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_2__getitem__(struct __pyx_obj_3_sa_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":21 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":21 * * def __getitem__(self, i): * return self.sa.arr[i] # <<<<<<<<<<<<<< @@ -34018,11 +33761,11 @@ static char __pyx_doc_3_sa_11SuffixArray_4read_text[] = "Constructs suffix array static PyObject *__pyx_pw_3_sa_11SuffixArray_5read_text(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_filename = 0; PyObject *__pyx_v_side = 0; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__filename,&__pyx_n_s__side,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("read_text (wrapper)", 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; @@ -34036,10 +33779,12 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_5read_text(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__filename)) != 0)) kw_args--; + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__filename); + if (likely(values[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--; + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__side); + if (likely(values[1])) 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;} } @@ -34069,7 +33814,7 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_5read_text(PyObject *__pyx_v_self, return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":23 +/* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":23 * return self.sa.arr[i] * * def read_text(self, filename, side): # <<<<<<<<<<<<<< @@ -34110,7 +33855,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su int __pyx_clineno = 0; __Pyx_RefNannySetupContext("read_text", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":29 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":29 * cdef IntList isa, word_count * * self.darray = DataArray(from_text=filename, side=side, use_sent_id=True) # <<<<<<<<<<<<<< @@ -34134,7 +33879,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __pyx_v_self->darray = ((struct __pyx_obj_3_sa_DataArray *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":30 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":30 * * self.darray = DataArray(from_text=filename, side=side, use_sent_id=True) * N = len(self.darray) # <<<<<<<<<<<<<< @@ -34147,7 +33892,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_N = __pyx_t_3; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":31 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -34160,7 +33905,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_V = __pyx_t_3; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":33 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":33 * V = len(self.darray.id2word) * * self.sa = IntList(initial_len=N) # <<<<<<<<<<<<<< @@ -34182,7 +33927,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __pyx_v_self->sa = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":34 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":34 * * self.sa = IntList(initial_len=N) * self.ha = IntList(initial_len=V+1) # <<<<<<<<<<<<<< @@ -34204,7 +33949,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __pyx_v_self->ha = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":36 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":36 * self.ha = IntList(initial_len=V+1) * * isa = IntList(initial_len=N) # <<<<<<<<<<<<<< @@ -34223,7 +33968,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __pyx_v_isa = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":37 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":37 * * isa = IntList(initial_len=N) * word_count = IntList(initial_len=V+1) # <<<<<<<<<<<<<< @@ -34242,7 +33987,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __pyx_v_word_count = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":40 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":40 * * '''Step 1: bucket sort data''' * cdef float sort_start_time = monitor_cpu() # <<<<<<<<<<<<<< @@ -34258,7 +34003,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_sort_start_time = __pyx_t_4; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":41 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":41 * '''Step 1: bucket sort data''' * cdef float sort_start_time = monitor_cpu() * cdef float start_time = sort_start_time # <<<<<<<<<<<<<< @@ -34267,7 +34012,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su */ __pyx_v_start_time = __pyx_v_sort_start_time; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":42 + /* "/home/paulb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -34277,7 +34022,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __pyx_t_5 = __pyx_v_N; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":43 + /* "/home/paulb/workspace/cdec/python/src/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] # <<<<<<<<<<<<<< @@ -34286,7 +34031,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su */ __pyx_v_a_i = (__pyx_v_self->darray->data->arr[__pyx_v_i]); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":44 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -34296,7 +34041,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su (__pyx_v_word_count->arr[__pyx_v_a_i]) = ((__pyx_v_word_count->arr[__pyx_v_a_i]) + 1); } - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":46 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":46 * word_count.arr[a_i] = word_count.arr[a_i] + 1 * * n = 0 # <<<<<<<<<<<<<< @@ -34305,7 +34050,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su */ __pyx_v_n = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":47 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":47 * * n = 0 * for i from 0 <= i < V+1: # <<<<<<<<<<<<<< @@ -34315,7 +34060,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __pyx_t_6 = (__pyx_v_V + 1); for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":48 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":48 * n = 0 * for i from 0 <= i < V+1: * self.ha.arr[i] = n # <<<<<<<<<<<<<< @@ -34324,7 +34069,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su */ (__pyx_v_self->ha->arr[__pyx_v_i]) = __pyx_v_n; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":49 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":49 * for i from 0 <= i < V+1: * self.ha.arr[i] = n * n = n + word_count.arr[i] # <<<<<<<<<<<<<< @@ -34333,7 +34078,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su */ __pyx_v_n = (__pyx_v_n + (__pyx_v_word_count->arr[__pyx_v_i])); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":50 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":50 * self.ha.arr[i] = n * n = n + word_count.arr[i] * word_count.arr[i] = 0 # <<<<<<<<<<<<<< @@ -34343,7 +34088,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su (__pyx_v_word_count->arr[__pyx_v_i]) = 0; } - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":52 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":52 * word_count.arr[i] = 0 * * for i from 0 <= i < N: # <<<<<<<<<<<<<< @@ -34353,7 +34098,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __pyx_t_5 = __pyx_v_N; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":53 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":53 * * for i from 0 <= i < N: * a_i = self.darray.data.arr[i] # <<<<<<<<<<<<<< @@ -34362,7 +34107,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su */ __pyx_v_a_i = (__pyx_v_self->darray->data->arr[__pyx_v_i]); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":54 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -34371,7 +34116,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su */ (__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/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":55 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -34380,7 +34125,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su */ (__pyx_v_isa->arr[__pyx_v_i]) = ((__pyx_v_self->ha->arr[(__pyx_v_a_i + 1)]) - 1); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":56 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -34390,7 +34135,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su (__pyx_v_word_count->arr[__pyx_v_a_i]) = ((__pyx_v_word_count->arr[__pyx_v_a_i]) + 1); } - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":59 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":59 * * '''Determine size of initial runs''' * current_run = 0 # <<<<<<<<<<<<<< @@ -34399,7 +34144,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su */ __pyx_v_current_run = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":60 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":60 * '''Determine size of initial runs''' * current_run = 0 * for i from 0 <= i < V+1: # <<<<<<<<<<<<<< @@ -34409,7 +34154,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __pyx_t_6 = (__pyx_v_V + 1); for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":61 + /* "/home/paulb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -34425,7 +34170,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su } if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":62 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -34437,7 +34182,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":64 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":64 * current_run = current_run + 1 * else: * if current_run > 0: # <<<<<<<<<<<<<< @@ -34447,7 +34192,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __pyx_t_9 = (__pyx_v_current_run > 0); if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":65 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":65 * else: * if current_run > 0: * self.sa.arr[self.ha.arr[i] - current_run] = -current_run # <<<<<<<<<<<<<< @@ -34456,7 +34201,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su */ (__pyx_v_self->sa->arr[((__pyx_v_self->ha->arr[__pyx_v_i]) - __pyx_v_current_run)]) = (-__pyx_v_current_run); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":66 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":66 * if current_run > 0: * self.sa.arr[self.ha.arr[i] - current_run] = -current_run * current_run = 0 # <<<<<<<<<<<<<< @@ -34471,7 +34216,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __pyx_L11:; } - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":68 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":68 * current_run = 0 * * logger.info(" Bucket sort took %f seconds", (monitor_cpu() - sort_start_time)) # <<<<<<<<<<<<<< @@ -34508,7 +34253,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":71 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":71 * * '''Step 2: prefix-doubling sort''' * h = 1 # <<<<<<<<<<<<<< @@ -34517,7 +34262,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su */ __pyx_v_h = 1; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":72 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":72 * '''Step 2: prefix-doubling sort''' * h = 1 * while self.sa.arr[0] != -N: # <<<<<<<<<<<<<< @@ -34528,7 +34273,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __pyx_t_9 = ((__pyx_v_self->sa->arr[0]) != (-__pyx_v_N)); if (!__pyx_t_9) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":73 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":73 * h = 1 * while self.sa.arr[0] != -N: * sort_start_time = monitor_cpu() # <<<<<<<<<<<<<< @@ -34544,7 +34289,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_sort_start_time = __pyx_t_4; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":74 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":74 * while self.sa.arr[0] != -N: * sort_start_time = monitor_cpu() * logger.debug(" Refining, sort depth = %d", h) # <<<<<<<<<<<<<< @@ -34572,7 +34317,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":75 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":75 * sort_start_time = monitor_cpu() * logger.debug(" Refining, sort depth = %d", h) * i = 0 # <<<<<<<<<<<<<< @@ -34581,7 +34326,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su */ __pyx_v_i = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":76 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":76 * logger.debug(" Refining, sort depth = %d", h) * i = 0 * skip = 0 # <<<<<<<<<<<<<< @@ -34590,7 +34335,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su */ __pyx_v_skip = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":77 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":77 * i = 0 * skip = 0 * while i < N: # <<<<<<<<<<<<<< @@ -34601,7 +34346,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __pyx_t_9 = (__pyx_v_i < __pyx_v_N); if (!__pyx_t_9) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":78 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":78 * skip = 0 * while i < N: * if self.sa.arr[i] < 0: # <<<<<<<<<<<<<< @@ -34611,7 +34356,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __pyx_t_9 = ((__pyx_v_self->sa->arr[__pyx_v_i]) < 0); if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":79 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":79 * while i < N: * if self.sa.arr[i] < 0: * skip = skip + self.sa.arr[i] # <<<<<<<<<<<<<< @@ -34620,7 +34365,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su */ __pyx_v_skip = (__pyx_v_skip + (__pyx_v_self->sa->arr[__pyx_v_i])); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":80 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":80 * if self.sa.arr[i] < 0: * skip = skip + self.sa.arr[i] * i = i - self.sa.arr[i] # <<<<<<<<<<<<<< @@ -34632,7 +34377,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":82 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":82 * i = i - self.sa.arr[i] * else: * if skip < 0: # <<<<<<<<<<<<<< @@ -34642,7 +34387,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __pyx_t_9 = (__pyx_v_skip < 0); if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":83 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":83 * else: * if skip < 0: * self.sa.arr[i+skip] = skip # <<<<<<<<<<<<<< @@ -34651,7 +34396,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su */ (__pyx_v_self->sa->arr[(__pyx_v_i + __pyx_v_skip)]) = __pyx_v_skip; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":84 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":84 * if skip < 0: * self.sa.arr[i+skip] = skip * skip = 0 # <<<<<<<<<<<<<< @@ -34663,7 +34408,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su } __pyx_L18:; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":85 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":85 * self.sa.arr[i+skip] = skip * skip = 0 * j = isa.arr[self.sa.arr[i]] # <<<<<<<<<<<<<< @@ -34672,7 +34417,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su */ __pyx_v_j = (__pyx_v_isa->arr[(__pyx_v_self->sa->arr[__pyx_v_i])]); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":86 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":86 * skip = 0 * j = isa.arr[self.sa.arr[i]] * self.q3sort(i, j, h, isa) # <<<<<<<<<<<<<< @@ -34707,7 +34452,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":87 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":87 * j = isa.arr[self.sa.arr[i]] * self.q3sort(i, j, h, isa) * i = j+1 # <<<<<<<<<<<<<< @@ -34719,7 +34464,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __pyx_L17:; } - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":88 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":88 * self.q3sort(i, j, h, isa) * i = j+1 * if skip < 0: # <<<<<<<<<<<<<< @@ -34729,7 +34474,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __pyx_t_9 = (__pyx_v_skip < 0); if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":89 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":89 * i = j+1 * if skip < 0: * self.sa.arr[i+skip] = skip # <<<<<<<<<<<<<< @@ -34741,7 +34486,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su } __pyx_L19:; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":90 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":90 * if skip < 0: * self.sa.arr[i+skip] = skip * h = h * 2 # <<<<<<<<<<<<<< @@ -34750,7 +34495,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su */ __pyx_v_h = (__pyx_v_h * 2); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":91 + /* "/home/paulb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -34788,7 +34533,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":94 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":94 * * '''Step 3: read off suffix array from inverse suffix array''' * logger.info(" Finalizing sort...") # <<<<<<<<<<<<<< @@ -34805,7 +34550,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":95 + /* "/home/paulb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -34815,7 +34560,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __pyx_t_5 = __pyx_v_N; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":96 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":96 * logger.info(" Finalizing sort...") * for i from 0 <= i < N: * j = isa.arr[i] # <<<<<<<<<<<<<< @@ -34824,7 +34569,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su */ __pyx_v_j = (__pyx_v_isa->arr[__pyx_v_i]); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":97 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":97 * for i from 0 <= i < N: * j = isa.arr[i] * self.sa.arr[j] = i # <<<<<<<<<<<<<< @@ -34834,7 +34579,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su (__pyx_v_self->sa->arr[__pyx_v_j]) = __pyx_v_i; } - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":98 + /* "/home/paulb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -34898,11 +34643,11 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_7q3sort(PyObject *__pyx_v_self, PyO int __pyx_v_h; struct __pyx_obj_3_sa_IntList *__pyx_v_isa = 0; PyObject *__pyx_v_pad = 0; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__i,&__pyx_n_s__j,&__pyx_n_s__h,&__pyx_n_s__isa,&__pyx_n_s__pad,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("q3sort (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__i,&__pyx_n_s__j,&__pyx_n_s__h,&__pyx_n_s__isa,&__pyx_n_s__pad,0}; PyObject* values[5] = {0,0,0,0,0}; values[4] = ((PyObject *)__pyx_kp_s_45); if (unlikely(__pyx_kwds)) { @@ -34920,20 +34665,24 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_7q3sort(PyObject *__pyx_v_self, PyO 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--; + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__i); + if (likely(values[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--; + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__j); + if (likely(values[1])) 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--; + values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__h); + if (likely(values[2])) 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--; + values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__isa); + if (likely(values[3])) 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;} } @@ -34981,7 +34730,7 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_7q3sort(PyObject *__pyx_v_self, PyO return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":100 +/* "/home/paulb/workspace/cdec/python/src/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=""): # <<<<<<<<<<<<<< @@ -35011,7 +34760,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi int __pyx_clineno = 0; __Pyx_RefNannySetupContext("q3sort", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":107 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":107 * cdef int k, midpoint, pval, phead, ptail, tmp * * if j-i < -1: # <<<<<<<<<<<<<< @@ -35021,7 +34770,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi __pyx_t_1 = ((__pyx_v_j - __pyx_v_i) < -1); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":108 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":108 * * if j-i < -1: * raise Exception("Unexpected condition found in q3sort: sort from %d to %d" % (i,j)) # <<<<<<<<<<<<<< @@ -35058,7 +34807,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":109 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -35068,7 +34817,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi __pyx_t_1 = ((__pyx_v_j - __pyx_v_i) == -1); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":110 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -35082,7 +34831,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi } __pyx_L4:; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":111 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":111 * if j-i == -1: # recursive base case -- empty interval * return * if (j-i == 0): # recursive base case -- singleton interval # <<<<<<<<<<<<<< @@ -35092,7 +34841,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi __pyx_t_1 = ((__pyx_v_j - __pyx_v_i) == 0); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":112 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":112 * return * if (j-i == 0): # recursive base case -- singleton interval * isa.arr[self.sa.arr[i]] = i # <<<<<<<<<<<<<< @@ -35101,7 +34850,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi */ (__pyx_v_isa->arr[(__pyx_v_self->sa->arr[__pyx_v_i])]) = __pyx_v_i; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":113 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -35110,7 +34859,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi */ (__pyx_v_self->sa->arr[__pyx_v_i]) = -1; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":114 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":114 * isa.arr[self.sa.arr[i]] = i * self.sa.arr[i] = -1 * return # <<<<<<<<<<<<<< @@ -35124,7 +34873,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi } __pyx_L5:; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":123 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -35133,7 +34882,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi */ __pyx_v_midpoint = __Pyx_div_long((__pyx_v_i + __pyx_v_j), 2); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":124 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":124 * # may need to be reconsidered as well. * midpoint = (i+j)/2 * pval = isa.arr[self.sa.arr[midpoint] + h] # <<<<<<<<<<<<<< @@ -35142,7 +34891,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi */ __pyx_v_pval = (__pyx_v_isa->arr[((__pyx_v_self->sa->arr[__pyx_v_midpoint]) + __pyx_v_h)]); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":125 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":125 * midpoint = (i+j)/2 * pval = isa.arr[self.sa.arr[midpoint] + h] * if i != midpoint: # <<<<<<<<<<<<<< @@ -35152,7 +34901,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi __pyx_t_1 = (__pyx_v_i != __pyx_v_midpoint); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":126 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":126 * pval = isa.arr[self.sa.arr[midpoint] + h] * if i != midpoint: * tmp = self.sa.arr[midpoint] # <<<<<<<<<<<<<< @@ -35161,7 +34910,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi */ __pyx_v_tmp = (__pyx_v_self->sa->arr[__pyx_v_midpoint]); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":127 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":127 * if i != midpoint: * tmp = self.sa.arr[midpoint] * self.sa.arr[midpoint] = self.sa.arr[i] # <<<<<<<<<<<<<< @@ -35170,7 +34919,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi */ (__pyx_v_self->sa->arr[__pyx_v_midpoint]) = (__pyx_v_self->sa->arr[__pyx_v_i]); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":128 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":128 * tmp = self.sa.arr[midpoint] * self.sa.arr[midpoint] = self.sa.arr[i] * self.sa.arr[i] = tmp # <<<<<<<<<<<<<< @@ -35182,7 +34931,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi } __pyx_L6:; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":129 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":129 * self.sa.arr[midpoint] = self.sa.arr[i] * self.sa.arr[i] = tmp * phead = i # <<<<<<<<<<<<<< @@ -35191,7 +34940,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi */ __pyx_v_phead = __pyx_v_i; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":130 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":130 * self.sa.arr[i] = tmp * phead = i * ptail = i # <<<<<<<<<<<<<< @@ -35200,7 +34949,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi */ __pyx_v_ptail = __pyx_v_i; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":134 + /* "/home/paulb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -35210,7 +34959,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi __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/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":135 + /* "/home/paulb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -35220,7 +34969,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi __pyx_t_1 = ((__pyx_v_isa->arr[((__pyx_v_self->sa->arr[__pyx_v_k]) + __pyx_v_h)]) < __pyx_v_pval); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":136 + /* "/home/paulb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -35230,7 +34979,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi __pyx_t_1 = (__pyx_v_k > (__pyx_v_ptail + 1)); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":137 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":137 * if isa.arr[self.sa.arr[k] + h] < pval: * if k > ptail+1: * tmp = self.sa.arr[phead] # <<<<<<<<<<<<<< @@ -35239,7 +34988,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi */ __pyx_v_tmp = (__pyx_v_self->sa->arr[__pyx_v_phead]); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":138 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":138 * if k > ptail+1: * tmp = self.sa.arr[phead] * self.sa.arr[phead] = self.sa.arr[k] # <<<<<<<<<<<<<< @@ -35248,7 +34997,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi */ (__pyx_v_self->sa->arr[__pyx_v_phead]) = (__pyx_v_self->sa->arr[__pyx_v_k]); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":139 + /* "/home/paulb/workspace/cdec/python/src/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] # <<<<<<<<<<<<<< @@ -35257,7 +35006,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi */ (__pyx_v_self->sa->arr[__pyx_v_k]) = (__pyx_v_self->sa->arr[(__pyx_v_ptail + 1)]); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":140 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -35269,7 +35018,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":142 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":142 * self.sa.arr[ptail+1] = tmp * else: # k == ptail+1 * tmp = self.sa.arr[phead] # <<<<<<<<<<<<<< @@ -35278,7 +35027,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi */ __pyx_v_tmp = (__pyx_v_self->sa->arr[__pyx_v_phead]); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":143 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":143 * else: # k == ptail+1 * tmp = self.sa.arr[phead] * self.sa.arr[phead] = self.sa.arr[k] # <<<<<<<<<<<<<< @@ -35287,7 +35036,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi */ (__pyx_v_self->sa->arr[__pyx_v_phead]) = (__pyx_v_self->sa->arr[__pyx_v_k]); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":144 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":144 * tmp = self.sa.arr[phead] * self.sa.arr[phead] = self.sa.arr[k] * self.sa.arr[k] = tmp # <<<<<<<<<<<<<< @@ -35298,7 +35047,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi } __pyx_L10:; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":145 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":145 * self.sa.arr[phead] = self.sa.arr[k] * self.sa.arr[k] = tmp * phead = phead + 1 # <<<<<<<<<<<<<< @@ -35307,7 +35056,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi */ __pyx_v_phead = (__pyx_v_phead + 1); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":146 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":146 * self.sa.arr[k] = tmp * phead = phead + 1 * ptail = ptail + 1 # <<<<<<<<<<<<<< @@ -35319,7 +35068,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":148 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":148 * ptail = ptail + 1 * else: * if isa.arr[self.sa.arr[k] + h] == pval: # <<<<<<<<<<<<<< @@ -35329,7 +35078,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi __pyx_t_1 = ((__pyx_v_isa->arr[((__pyx_v_self->sa->arr[__pyx_v_k]) + __pyx_v_h)]) == __pyx_v_pval); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":149 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":149 * else: * if isa.arr[self.sa.arr[k] + h] == pval: * if k > ptail+1: # <<<<<<<<<<<<<< @@ -35339,7 +35088,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi __pyx_t_1 = (__pyx_v_k > (__pyx_v_ptail + 1)); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":150 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":150 * if isa.arr[self.sa.arr[k] + h] == pval: * if k > ptail+1: * tmp = self.sa.arr[ptail+1] # <<<<<<<<<<<<<< @@ -35348,7 +35097,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi */ __pyx_v_tmp = (__pyx_v_self->sa->arr[(__pyx_v_ptail + 1)]); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":151 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":151 * if k > ptail+1: * tmp = self.sa.arr[ptail+1] * self.sa.arr[ptail+1] = self.sa.arr[k] # <<<<<<<<<<<<<< @@ -35357,7 +35106,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi */ (__pyx_v_self->sa->arr[(__pyx_v_ptail + 1)]) = (__pyx_v_self->sa->arr[__pyx_v_k]); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":152 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -35369,7 +35118,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi } __pyx_L12:; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":153 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":153 * self.sa.arr[ptail+1] = self.sa.arr[k] * self.sa.arr[k] = tmp * ptail = ptail + 1 # <<<<<<<<<<<<<< @@ -35384,7 +35133,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi __pyx_L9:; } - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":156 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":156 * * # recursively sort smaller suffixes * self.q3sort(i, phead-1, h, isa, pad+" ") # <<<<<<<<<<<<<< @@ -35424,7 +35173,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":160 + /* "/home/paulb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -35434,7 +35183,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi __pyx_t_5 = (__pyx_v_ptail + 1); for (__pyx_v_k = __pyx_v_phead; __pyx_v_k < __pyx_t_5; __pyx_v_k++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":161 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -35444,7 +35193,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi (__pyx_v_isa->arr[(__pyx_v_self->sa->arr[__pyx_v_k])]) = __pyx_v_ptail; } - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":162 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":162 * for k from phead <= k < ptail+1: * isa.arr[self.sa.arr[k]] = ptail * if phead == ptail: # <<<<<<<<<<<<<< @@ -35454,7 +35203,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi __pyx_t_1 = (__pyx_v_phead == __pyx_v_ptail); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":163 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":163 * isa.arr[self.sa.arr[k]] = ptail * if phead == ptail: * self.sa.arr[phead] = -1 # <<<<<<<<<<<<<< @@ -35466,7 +35215,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi } __pyx_L15:; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":166 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":166 * * # recursively sort larger suffixes * self.q3sort(ptail+1, j, h, isa, pad+" ") # <<<<<<<<<<<<<< @@ -35544,7 +35293,7 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_9write_text(PyObject *__pyx_v_self, return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":169 +/* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":169 * * * def write_text(self, char* filename): # <<<<<<<<<<<<<< @@ -35563,7 +35312,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_8write_text(struct __pyx_obj_3_sa_S int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_text", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":170 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":170 * * def write_text(self, char* filename): * self.darray.write_text(filename) # <<<<<<<<<<<<<< @@ -35620,7 +35369,7 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_11read_binary(PyObject *__pyx_v_sel return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":172 +/* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":172 * self.darray.write_text(filename) * * def read_binary(self, char* filename): # <<<<<<<<<<<<<< @@ -35634,7 +35383,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_binary(struct __pyx_obj_3_sa __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("read_binary", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":174 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":174 * def read_binary(self, char* filename): * cdef FILE *f * f = fopen(filename, "r") # <<<<<<<<<<<<<< @@ -35643,7 +35392,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_binary(struct __pyx_obj_3_sa */ __pyx_v_f = fopen(__pyx_v_filename, __pyx_k__r); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":175 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":175 * cdef FILE *f * f = fopen(filename, "r") * self.darray.read_handle(f) # <<<<<<<<<<<<<< @@ -35652,7 +35401,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_binary(struct __pyx_obj_3_sa */ ((struct __pyx_vtabstruct_3_sa_DataArray *)__pyx_v_self->darray->__pyx_vtab)->read_handle(__pyx_v_self->darray, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":176 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":176 * f = fopen(filename, "r") * self.darray.read_handle(f) * self.sa.read_handle(f) # <<<<<<<<<<<<<< @@ -35661,7 +35410,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_binary(struct __pyx_obj_3_sa */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->sa->__pyx_vtab)->read_handle(__pyx_v_self->sa, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":177 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":177 * self.darray.read_handle(f) * self.sa.read_handle(f) * self.ha.read_handle(f) # <<<<<<<<<<<<<< @@ -35670,7 +35419,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_binary(struct __pyx_obj_3_sa */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->ha->__pyx_vtab)->read_handle(__pyx_v_self->ha, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":178 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":178 * self.sa.read_handle(f) * self.ha.read_handle(f) * fclose(f) # <<<<<<<<<<<<<< @@ -35706,7 +35455,7 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_13write_binary(PyObject *__pyx_v_se return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":180 +/* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":180 * fclose(f) * * def write_binary(self, char* filename): # <<<<<<<<<<<<<< @@ -35720,7 +35469,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12write_binary(struct __pyx_obj_3_s __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("write_binary", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":182 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":182 * def write_binary(self, char* filename): * cdef FILE* f * f = fopen(filename, "w") # <<<<<<<<<<<<<< @@ -35729,7 +35478,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12write_binary(struct __pyx_obj_3_s */ __pyx_v_f = fopen(__pyx_v_filename, __pyx_k__w); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":183 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":183 * cdef FILE* f * f = fopen(filename, "w") * self.darray.write_handle(f) # <<<<<<<<<<<<<< @@ -35738,7 +35487,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12write_binary(struct __pyx_obj_3_s */ ((struct __pyx_vtabstruct_3_sa_DataArray *)__pyx_v_self->darray->__pyx_vtab)->write_handle(__pyx_v_self->darray, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":184 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":184 * f = fopen(filename, "w") * self.darray.write_handle(f) * self.sa.write_handle(f) # <<<<<<<<<<<<<< @@ -35747,7 +35496,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12write_binary(struct __pyx_obj_3_s */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->sa->__pyx_vtab)->write_handle(__pyx_v_self->sa, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":185 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":185 * self.darray.write_handle(f) * self.sa.write_handle(f) * self.ha.write_handle(f) # <<<<<<<<<<<<<< @@ -35756,7 +35505,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12write_binary(struct __pyx_obj_3_s */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->ha->__pyx_vtab)->write_handle(__pyx_v_self->ha, __pyx_v_f); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":186 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":186 * self.sa.write_handle(f) * self.ha.write_handle(f) * fclose(f) # <<<<<<<<<<<<<< @@ -35792,7 +35541,7 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_15write_enhanced(PyObject *__pyx_v_ return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":188 +/* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":188 * fclose(f) * * def write_enhanced(self, char* filename): # <<<<<<<<<<<<<< @@ -35824,7 +35573,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_14write_enhanced(struct __pyx_obj_3 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_enhanced", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":189 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":189 * * def write_enhanced(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -35864,7 +35613,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_14write_enhanced(struct __pyx_obj_3 __pyx_v_f = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":190 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":190 * def write_enhanced(self, char* filename): * with open(filename, "w") as f: * self.darray.write_enhanced_handle(f) # <<<<<<<<<<<<<< @@ -35884,7 +35633,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_14write_enhanced(struct __pyx_obj_3 __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":191 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":191 * with open(filename, "w") as f: * self.darray.write_enhanced_handle(f) * for a_i in self.sa: # <<<<<<<<<<<<<< @@ -35902,18 +35651,10 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_14write_enhanced(struct __pyx_obj_3 for (;;) { if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_2)) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #endif + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_2)) { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #endif + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; } else { __pyx_t_1 = __pyx_t_9(__pyx_t_2); if (unlikely(!__pyx_t_1)) { @@ -35929,7 +35670,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_14write_enhanced(struct __pyx_obj_3 __pyx_v_a_i = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":192 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":192 * self.darray.write_enhanced_handle(f) * for a_i in self.sa: * f.write("%d " % a_i) # <<<<<<<<<<<<<< @@ -35953,7 +35694,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_14write_enhanced(struct __pyx_obj_3 } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":193 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":193 * for a_i in self.sa: * f.write("%d " % a_i) * f.write("\n") # <<<<<<<<<<<<<< @@ -35967,7 +35708,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_14write_enhanced(struct __pyx_obj_3 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":194 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":194 * f.write("%d " % a_i) * f.write("\n") * for w_i in self.ha: # <<<<<<<<<<<<<< @@ -35985,18 +35726,10 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_14write_enhanced(struct __pyx_obj_3 for (;;) { if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_4)) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_4)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #endif + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_4)) { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_4)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - #endif + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; } else { __pyx_t_2 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_2)) { @@ -36012,7 +35745,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_14write_enhanced(struct __pyx_obj_3 __pyx_v_w_i = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":195 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":195 * f.write("\n") * for w_i in self.ha: * f.write("%d " % w_i) # <<<<<<<<<<<<<< @@ -36036,7 +35769,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_14write_enhanced(struct __pyx_obj_3 } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":196 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":196 * for w_i in self.ha: * f.write("%d " % w_i) * f.write("\n") # <<<<<<<<<<<<<< @@ -36060,7 +35793,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_14write_enhanced(struct __pyx_obj_3 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":189 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":189 * * def write_enhanced(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -36158,7 +35891,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_14write_enhanced(struct __pyx_obj_3 return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":198 +/* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":198 * f.write("\n") * * cdef int __search_high(self, int word_id, int offset, int low, int high): # <<<<<<<<<<<<<< @@ -36173,7 +35906,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_high(struct __pyx_obj_3_sa_Suffix int __pyx_t_1; __Pyx_RefNannySetupContext("__search_high", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":201 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":201 * cdef int midpoint * * if low >= high: # <<<<<<<<<<<<<< @@ -36183,7 +35916,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_high(struct __pyx_obj_3_sa_Suffix __pyx_t_1 = (__pyx_v_low >= __pyx_v_high); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":202 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":202 * * if low >= high: * return high # <<<<<<<<<<<<<< @@ -36196,7 +35929,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_high(struct __pyx_obj_3_sa_Suffix } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":203 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":203 * if low >= high: * return high * midpoint = (high + low) / 2 # <<<<<<<<<<<<<< @@ -36205,7 +35938,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_high(struct __pyx_obj_3_sa_Suffix */ __pyx_v_midpoint = __Pyx_div_long((__pyx_v_high + __pyx_v_low), 2); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":204 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":204 * return high * midpoint = (high + low) / 2 * if self.darray.data.arr[self.sa.arr[midpoint] + offset] == word_id: # <<<<<<<<<<<<<< @@ -36215,7 +35948,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_high(struct __pyx_obj_3_sa_Suffix __pyx_t_1 = ((__pyx_v_self->darray->data->arr[((__pyx_v_self->sa->arr[__pyx_v_midpoint]) + __pyx_v_offset)]) == __pyx_v_word_id); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":205 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -36228,7 +35961,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_high(struct __pyx_obj_3_sa_Suffix } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":207 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -36246,7 +35979,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_high(struct __pyx_obj_3_sa_Suffix return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":209 +/* "/home/paulb/workspace/cdec/python/src/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): # <<<<<<<<<<<<<< @@ -36261,7 +35994,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_low(struct __pyx_obj_3_sa_SuffixA int __pyx_t_1; __Pyx_RefNannySetupContext("__search_low", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":212 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":212 * cdef int midpoint * * if low >= high: # <<<<<<<<<<<<<< @@ -36271,7 +36004,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_low(struct __pyx_obj_3_sa_SuffixA __pyx_t_1 = (__pyx_v_low >= __pyx_v_high); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":213 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":213 * * if low >= high: * return high # <<<<<<<<<<<<<< @@ -36284,7 +36017,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_low(struct __pyx_obj_3_sa_SuffixA } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":214 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":214 * if low >= high: * return high * midpoint = (high + low) / 2 # <<<<<<<<<<<<<< @@ -36293,7 +36026,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_low(struct __pyx_obj_3_sa_SuffixA */ __pyx_v_midpoint = __Pyx_div_long((__pyx_v_high + __pyx_v_low), 2); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":215 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":215 * return high * midpoint = (high + low) / 2 * if self.darray.data.arr[self.sa.arr[midpoint] + offset] == word_id: # <<<<<<<<<<<<<< @@ -36303,7 +36036,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_low(struct __pyx_obj_3_sa_SuffixA __pyx_t_1 = ((__pyx_v_self->darray->data->arr[((__pyx_v_self->sa->arr[__pyx_v_midpoint]) + __pyx_v_offset)]) == __pyx_v_word_id); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":216 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -36316,7 +36049,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_low(struct __pyx_obj_3_sa_SuffixA } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":218 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -36334,7 +36067,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_low(struct __pyx_obj_3_sa_SuffixA return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":220 +/* "/home/paulb/workspace/cdec/python/src/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): # <<<<<<<<<<<<<< @@ -36353,7 +36086,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___get_range(struct __pyx_obj_3_sa_Su int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get_range", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":221 + /* "/home/paulb/workspace/cdec/python/src/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), # <<<<<<<<<<<<<< @@ -36364,7 +36097,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___get_range(struct __pyx_obj_3_sa_Su __pyx_t_1 = PyInt_FromLong(((struct __pyx_vtabstruct_3_sa_SuffixArray *)__pyx_v_self->__pyx_vtab)->__pyx___search_low(__pyx_v_self, __pyx_v_word_id, __pyx_v_offset, __pyx_v_low, __pyx_v_midpoint)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":222 + /* "/home/paulb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -36399,7 +36132,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___get_range(struct __pyx_obj_3_sa_Su return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":224 +/* "/home/paulb/workspace/cdec/python/src/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): # <<<<<<<<<<<<<< @@ -36420,7 +36153,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___lookup_helper(struct __pyx_obj_3_s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__lookup_helper", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":227 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":227 * cdef int midpoint * * if offset == 0: # <<<<<<<<<<<<<< @@ -36430,7 +36163,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___lookup_helper(struct __pyx_obj_3_s __pyx_t_1 = (__pyx_v_offset == 0); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":228 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":228 * * if offset == 0: * return (self.ha.arr[word_id], self.ha.arr[word_id+1]) # <<<<<<<<<<<<<< @@ -36457,7 +36190,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___lookup_helper(struct __pyx_obj_3_s } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":229 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":229 * if offset == 0: * return (self.ha.arr[word_id], self.ha.arr[word_id+1]) * if low >= high: # <<<<<<<<<<<<<< @@ -36467,7 +36200,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___lookup_helper(struct __pyx_obj_3_s __pyx_t_1 = (__pyx_v_low >= __pyx_v_high); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":230 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":230 * return (self.ha.arr[word_id], self.ha.arr[word_id+1]) * if low >= high: * return None # <<<<<<<<<<<<<< @@ -36482,7 +36215,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___lookup_helper(struct __pyx_obj_3_s } __pyx_L4:; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":232 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":232 * return None * * midpoint = (high + low) / 2 # <<<<<<<<<<<<<< @@ -36491,7 +36224,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___lookup_helper(struct __pyx_obj_3_s */ __pyx_v_midpoint = __Pyx_div_long((__pyx_v_high + __pyx_v_low), 2); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":233 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":233 * * midpoint = (high + low) / 2 * if self.darray.data.arr[self.sa.arr[midpoint] + offset] == word_id: # <<<<<<<<<<<<<< @@ -36501,7 +36234,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___lookup_helper(struct __pyx_obj_3_s __pyx_t_1 = ((__pyx_v_self->darray->data->arr[((__pyx_v_self->sa->arr[__pyx_v_midpoint]) + __pyx_v_offset)]) == __pyx_v_word_id); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":234 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -36518,7 +36251,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___lookup_helper(struct __pyx_obj_3_s } __pyx_L5:; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":235 + /* "/home/paulb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -36528,7 +36261,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___lookup_helper(struct __pyx_obj_3_s __pyx_t_1 = ((__pyx_v_self->darray->data->arr[((__pyx_v_self->sa->arr[__pyx_v_midpoint]) + __pyx_v_offset)]) > __pyx_v_word_id); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":236 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -36545,7 +36278,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___lookup_helper(struct __pyx_obj_3_s } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":238 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -36582,11 +36315,11 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_17lookup(PyObject *__pyx_v_self, Py int __pyx_v_offset; int __pyx_v_low; int __pyx_v_high; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__word,&__pyx_n_s__offset,&__pyx_n_s__low,&__pyx_n_s__high,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lookup (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__word,&__pyx_n_s__offset,&__pyx_n_s__low,&__pyx_n_s__high,0}; PyObject* values[4] = {0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -36602,20 +36335,24 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_17lookup(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__word)) != 0)) kw_args--; + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__word); + if (likely(values[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--; + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__offset); + if (likely(values[1])) 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--; + values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__low); + if (likely(values[2])) 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--; + values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__high); + if (likely(values[3])) 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;} } @@ -36649,7 +36386,7 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_17lookup(PyObject *__pyx_v_self, Py return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":240 +/* "/home/paulb/workspace/cdec/python/src/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): # <<<<<<<<<<<<<< @@ -36670,7 +36407,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_16lookup(struct __pyx_obj_3_sa_Suff int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lookup", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":242 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":242 * def lookup(self, word, int offset, int low, int high): * cdef int wordid * if low == -1: # <<<<<<<<<<<<<< @@ -36680,7 +36417,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_16lookup(struct __pyx_obj_3_sa_Suff __pyx_t_1 = (__pyx_v_low == -1); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":243 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":243 * cdef int wordid * if low == -1: * low = 0 # <<<<<<<<<<<<<< @@ -36692,7 +36429,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_16lookup(struct __pyx_obj_3_sa_Suff } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":244 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":244 * if low == -1: * low = 0 * if high == -1: # <<<<<<<<<<<<<< @@ -36702,7 +36439,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_16lookup(struct __pyx_obj_3_sa_Suff __pyx_t_1 = (__pyx_v_high == -1); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":245 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":245 * low = 0 * if high == -1: * high = len(self.sa) # <<<<<<<<<<<<<< @@ -36718,17 +36455,17 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_16lookup(struct __pyx_obj_3_sa_Suff } __pyx_L4:; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":246 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":246 * if high == -1: * 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) */ - __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_word, __pyx_v_self->darray->word2id, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PySequence_Contains(__pyx_v_self->darray->word2id, __pyx_v_word))); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":247 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":247 * high = len(self.sa) * if word in self.darray.word2id: * word_id = self.darray.word2id[word] # <<<<<<<<<<<<<< @@ -36740,7 +36477,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_16lookup(struct __pyx_obj_3_sa_Suff __pyx_v_word_id = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":248 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -36758,7 +36495,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_16lookup(struct __pyx_obj_3_sa_Suff } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":250 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":250 * return self.__lookup_helper(word_id, offset, low, high) * else: * return None # <<<<<<<<<<<<<< @@ -36797,7 +36534,7 @@ static int __pyx_pw_3_sa_8TrieNode_1__cinit__(PyObject *__pyx_v_self, PyObject * return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":49 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":49 * cdef public children * * def __cinit__(self): # <<<<<<<<<<<<<< @@ -36814,7 +36551,7 @@ static int __pyx_pf_3_sa_8TrieNode___cinit__(struct __pyx_obj_3_sa_TrieNode *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":50 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":50 * * def __cinit__(self): * self.children = {} # <<<<<<<<<<<<<< @@ -36851,7 +36588,7 @@ static PyObject *__pyx_pw_3_sa_8TrieNode_8children_1__get__(PyObject *__pyx_v_se return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":47 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":47 * * cdef class TrieNode: * cdef public children # <<<<<<<<<<<<<< @@ -36933,14 +36670,14 @@ static int __pyx_pw_3_sa_16ExtendedTrieNode_1__cinit__(PyObject *__pyx_v_self, P PyObject *__pyx_v_phrase = 0; PyObject *__pyx_v_phrase_location = 0; PyObject *__pyx_v_suffix_link = 0; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__phrase,&__pyx_n_s__phrase_location,&__pyx_n_s__suffix_link,0}; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__phrase,&__pyx_n_s__phrase_location,&__pyx_n_s__suffix_link,0}; PyObject* values[3] = {0,0,0}; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":57 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":57 * cdef public suffix_link * * def __cinit__(self, phrase=None, phrase_location=None, suffix_link=None): # <<<<<<<<<<<<<< @@ -37012,7 +36749,7 @@ static int __pyx_pf_3_sa_16ExtendedTrieNode___cinit__(struct __pyx_obj_3_sa_Exte __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":58 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":58 * * def __cinit__(self, phrase=None, phrase_location=None, suffix_link=None): * self.phrase = phrase # <<<<<<<<<<<<<< @@ -37025,7 +36762,7 @@ static int __pyx_pf_3_sa_16ExtendedTrieNode___cinit__(struct __pyx_obj_3_sa_Exte __Pyx_DECREF(__pyx_v_self->phrase); __pyx_v_self->phrase = __pyx_v_phrase; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":59 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":59 * def __cinit__(self, phrase=None, phrase_location=None, suffix_link=None): * self.phrase = phrase * self.phrase_location = phrase_location # <<<<<<<<<<<<<< @@ -37038,7 +36775,7 @@ static int __pyx_pf_3_sa_16ExtendedTrieNode___cinit__(struct __pyx_obj_3_sa_Exte __Pyx_DECREF(__pyx_v_self->phrase_location); __pyx_v_self->phrase_location = __pyx_v_phrase_location; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":60 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":60 * self.phrase = phrase * self.phrase_location = phrase_location * self.suffix_link = suffix_link # <<<<<<<<<<<<<< @@ -37067,7 +36804,7 @@ static PyObject *__pyx_pw_3_sa_16ExtendedTrieNode_6phrase_1__get__(PyObject *__p return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":53 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":53 * * cdef class ExtendedTrieNode(TrieNode): * cdef public phrase # <<<<<<<<<<<<<< @@ -37154,7 +36891,7 @@ static PyObject *__pyx_pw_3_sa_16ExtendedTrieNode_15phrase_location_1__get__(PyO return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":54 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":54 * cdef class ExtendedTrieNode(TrieNode): * cdef public phrase * cdef public phrase_location # <<<<<<<<<<<<<< @@ -37241,7 +36978,7 @@ static PyObject *__pyx_pw_3_sa_16ExtendedTrieNode_11suffix_link_1__get__(PyObjec return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":55 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":55 * cdef public phrase * cdef public phrase_location * cdef public suffix_link # <<<<<<<<<<<<<< @@ -37321,11 +37058,11 @@ static int __pyx_pf_3_sa_16ExtendedTrieNode_11suffix_link_4__del__(struct __pyx_ static int __pyx_pw_3_sa_9TrieTable_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_3_sa_9TrieTable_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_extended = 0; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__extended,0}; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__extended,0}; PyObject* values[1] = {0}; values[0] = __pyx_k_99; if (unlikely(__pyx_kwds)) { @@ -37369,7 +37106,7 @@ static int __pyx_pw_3_sa_9TrieTable_1__cinit__(PyObject *__pyx_v_self, PyObject return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":67 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":67 * cdef public int count * cdef public root * def __cinit__(self, extended=False): # <<<<<<<<<<<<<< @@ -37388,7 +37125,7 @@ static int __pyx_pf_3_sa_9TrieTable___cinit__(struct __pyx_obj_3_sa_TrieTable *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":68 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":68 * cdef public root * def __cinit__(self, extended=False): * self.count = 0 # <<<<<<<<<<<<<< @@ -37397,7 +37134,7 @@ static int __pyx_pf_3_sa_9TrieTable___cinit__(struct __pyx_obj_3_sa_TrieTable *_ */ __pyx_v_self->count = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":69 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":69 * def __cinit__(self, extended=False): * self.count = 0 * self.extended = extended # <<<<<<<<<<<<<< @@ -37407,7 +37144,7 @@ static int __pyx_pf_3_sa_9TrieTable___cinit__(struct __pyx_obj_3_sa_TrieTable *_ __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 = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->extended = __pyx_t_1; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":70 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":70 * self.count = 0 * self.extended = extended * if extended: # <<<<<<<<<<<<<< @@ -37417,7 +37154,7 @@ static int __pyx_pf_3_sa_9TrieTable___cinit__(struct __pyx_obj_3_sa_TrieTable *_ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_extended); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":71 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":71 * self.extended = extended * if extended: * self.root = ExtendedTrieNode() # <<<<<<<<<<<<<< @@ -37435,7 +37172,7 @@ static int __pyx_pf_3_sa_9TrieTable___cinit__(struct __pyx_obj_3_sa_TrieTable *_ } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":73 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":73 * self.root = ExtendedTrieNode() * else: * self.root = TrieNode() # <<<<<<<<<<<<<< @@ -37474,7 +37211,7 @@ static PyObject *__pyx_pw_3_sa_9TrieTable_8extended_1__get__(PyObject *__pyx_v_s return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":64 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":64 * * cdef class TrieTable: * cdef public int extended # <<<<<<<<<<<<<< @@ -37552,7 +37289,7 @@ static PyObject *__pyx_pw_3_sa_9TrieTable_5count_1__get__(PyObject *__pyx_v_self return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":65 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":65 * cdef class TrieTable: * cdef public int extended * cdef public int count # <<<<<<<<<<<<<< @@ -37630,7 +37367,7 @@ static PyObject *__pyx_pw_3_sa_9TrieTable_4root_1__get__(PyObject *__pyx_v_self) return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":66 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":66 * cdef public int extended * cdef public int count * cdef public root # <<<<<<<<<<<<<< @@ -37706,7 +37443,7 @@ static int __pyx_pf_3_sa_9TrieTable_4root_4__del__(struct __pyx_obj_3_sa_TrieTab return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":93 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":93 * * # returns true if sent_id is contained * cdef int contains(self, int sent_id): # <<<<<<<<<<<<<< @@ -37719,7 +37456,7 @@ static int __pyx_f_3_sa_14PhraseLocation_contains(CYTHON_UNUSED struct __pyx_obj __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("contains", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":94 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":94 * # returns true if sent_id is contained * cdef int contains(self, int sent_id): * return 1 # <<<<<<<<<<<<<< @@ -37744,14 +37481,14 @@ static int __pyx_pw_3_sa_14PhraseLocation_1__cinit__(PyObject *__pyx_v_self, PyO int __pyx_v_arr_high; PyObject *__pyx_v_arr = 0; int __pyx_v_num_subpatterns; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__sa_low,&__pyx_n_s__sa_high,&__pyx_n_s__arr_low,&__pyx_n_s__arr_high,&__pyx_n_s__arr,&__pyx_n_s__num_subpatterns,0}; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__sa_low,&__pyx_n_s__sa_high,&__pyx_n_s__arr_low,&__pyx_n_s__arr_high,&__pyx_n_s__arr,&__pyx_n_s__num_subpatterns,0}; PyObject* values[6] = {0,0,0,0,0,0}; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":97 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":97 * * 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): # <<<<<<<<<<<<<< @@ -37808,6 +37545,26 @@ static int __pyx_pw_3_sa_14PhraseLocation_1__cinit__(PyObject *__pyx_v_self, PyO 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 = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } + if (values[0]) { + } else { + __pyx_v_sa_low = ((int)-1); + } + if (values[1]) { + } else { + __pyx_v_sa_high = ((int)-1); + } + if (values[2]) { + } else { + __pyx_v_arr_low = ((int)-1); + } + if (values[3]) { + } else { + __pyx_v_arr_high = ((int)-1); + } + if (values[5]) { + } else { + __pyx_v_num_subpatterns = ((int)1); + } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); @@ -37860,7 +37617,7 @@ static int __pyx_pw_3_sa_14PhraseLocation_1__cinit__(PyObject *__pyx_v_self, PyO return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":96 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":96 * return 1 * * def __cinit__(self, int sa_low=-1, int sa_high=-1, int arr_low=-1, int arr_high=-1, # <<<<<<<<<<<<<< @@ -37876,7 +37633,7 @@ static int __pyx_pf_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_3_sa_Phrase int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":98 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":98 * 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 # <<<<<<<<<<<<<< @@ -37885,7 +37642,7 @@ static int __pyx_pf_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_3_sa_Phrase */ __pyx_v_self->sa_low = __pyx_v_sa_low; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":99 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":99 * arr=None, int num_subpatterns=1): * self.sa_low = sa_low * self.sa_high = sa_high # <<<<<<<<<<<<<< @@ -37894,7 +37651,7 @@ static int __pyx_pf_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_3_sa_Phrase */ __pyx_v_self->sa_high = __pyx_v_sa_high; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":100 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":100 * self.sa_low = sa_low * self.sa_high = sa_high * self.arr_low = arr_low # <<<<<<<<<<<<<< @@ -37903,7 +37660,7 @@ static int __pyx_pf_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_3_sa_Phrase */ __pyx_v_self->arr_low = __pyx_v_arr_low; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":101 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":101 * self.sa_high = sa_high * self.arr_low = arr_low * self.arr_high = arr_high # <<<<<<<<<<<<<< @@ -37912,7 +37669,7 @@ static int __pyx_pf_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_3_sa_Phrase */ __pyx_v_self->arr_high = __pyx_v_arr_high; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":102 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":102 * self.arr_low = arr_low * self.arr_high = arr_high * self.arr = arr # <<<<<<<<<<<<<< @@ -37926,7 +37683,7 @@ static int __pyx_pf_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_3_sa_Phrase __Pyx_DECREF(((PyObject *)__pyx_v_self->arr)); __pyx_v_self->arr = ((struct __pyx_obj_3_sa_IntList *)__pyx_v_arr); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":103 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":103 * self.arr_high = arr_high * self.arr = arr * self.num_subpatterns = num_subpatterns # <<<<<<<<<<<<<< @@ -37950,11 +37707,11 @@ static int __pyx_pw_3_sa_7Sampler_1__cinit__(PyObject *__pyx_v_self, PyObject *_ static int __pyx_pw_3_sa_7Sampler_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_v_sample_size; struct __pyx_obj_3_sa_SuffixArray *__pyx_v_fsarray = 0; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__sample_size,&__pyx_n_s__fsarray,0}; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__sample_size,&__pyx_n_s__fsarray,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -37968,10 +37725,12 @@ static int __pyx_pw_3_sa_7Sampler_1__cinit__(PyObject *__pyx_v_self, PyObject *_ 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--; + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sample_size); + if (likely(values[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--; + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fsarray); + if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -38006,7 +37765,7 @@ static int __pyx_pw_3_sa_7Sampler_1__cinit__(PyObject *__pyx_v_self, PyObject *_ return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":113 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":113 * cdef IntList sa * * def __cinit__(self, int sample_size, SuffixArray fsarray): # <<<<<<<<<<<<<< @@ -38026,7 +37785,7 @@ static int __pyx_pf_3_sa_7Sampler___cinit__(struct __pyx_obj_3_sa_Sampler *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":114 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":114 * * def __cinit__(self, int sample_size, SuffixArray fsarray): * self.sample_size = sample_size # <<<<<<<<<<<<<< @@ -38035,7 +37794,7 @@ static int __pyx_pf_3_sa_7Sampler___cinit__(struct __pyx_obj_3_sa_Sampler *__pyx */ __pyx_v_self->sample_size = __pyx_v_sample_size; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":115 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":115 * def __cinit__(self, int sample_size, SuffixArray fsarray): * self.sample_size = sample_size * self.sa = fsarray.sa # <<<<<<<<<<<<<< @@ -38048,7 +37807,7 @@ static int __pyx_pf_3_sa_7Sampler___cinit__(struct __pyx_obj_3_sa_Sampler *__pyx __Pyx_DECREF(((PyObject *)__pyx_v_self->sa)); __pyx_v_self->sa = __pyx_v_fsarray->sa; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":116 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":116 * self.sample_size = sample_size * self.sa = fsarray.sa * if sample_size > 0: # <<<<<<<<<<<<<< @@ -38058,7 +37817,7 @@ static int __pyx_pf_3_sa_7Sampler___cinit__(struct __pyx_obj_3_sa_Sampler *__pyx __pyx_t_1 = (__pyx_v_sample_size > 0); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":117 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":117 * self.sa = fsarray.sa * if sample_size > 0: * logger.info("Sampling strategy: uniform, max sample size = %d", sample_size) # <<<<<<<<<<<<<< @@ -38089,7 +37848,7 @@ static int __pyx_pf_3_sa_7Sampler___cinit__(struct __pyx_obj_3_sa_Sampler *__pyx } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":119 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":119 * logger.info("Sampling strategy: uniform, max sample size = %d", sample_size) * else: * logger.info("Sampling strategy: no sampling") # <<<<<<<<<<<<<< @@ -38138,7 +37897,7 @@ static PyObject *__pyx_pw_3_sa_7Sampler_3sample(PyObject *__pyx_v_self, PyObject return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":121 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":121 * logger.info("Sampling strategy: no sampling") * * def sample(self, PhraseLocation phrase_location): # <<<<<<<<<<<<<< @@ -38165,7 +37924,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sample", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":134 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":134 * cdef int num_locations, val, j * * sample = IntList() # <<<<<<<<<<<<<< @@ -38177,7 +37936,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_ __pyx_v_sample = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":135 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":135 * * sample = IntList() * if phrase_location.arr is None: # <<<<<<<<<<<<<< @@ -38187,7 +37946,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_ __pyx_t_2 = (((PyObject *)__pyx_v_phrase_location->arr) == Py_None); if (__pyx_t_2) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":136 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":136 * sample = IntList() * if phrase_location.arr is None: * num_locations = phrase_location.sa_high - phrase_location.sa_low # <<<<<<<<<<<<<< @@ -38196,7 +37955,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_ */ __pyx_v_num_locations = (__pyx_v_phrase_location->sa_high - __pyx_v_phrase_location->sa_low); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":137 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":137 * 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: # <<<<<<<<<<<<<< @@ -38212,7 +37971,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_ } if (__pyx_t_4) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":138 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":138 * 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) # <<<<<<<<<<<<<< @@ -38224,7 +37983,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_ } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":140 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":140 * sample._extend_arr(self.sa.arr + phrase_location.sa_low, num_locations) * else: * stepsize = float(num_locations)/float(self.sample_size) # <<<<<<<<<<<<<< @@ -38237,7 +37996,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_ } __pyx_v_stepsize = (((double)__pyx_v_num_locations) / ((double)__pyx_v_self->sample_size)); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":141 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":141 * else: * stepsize = float(num_locations)/float(self.sample_size) * i = phrase_location.sa_low # <<<<<<<<<<<<<< @@ -38246,7 +38005,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_ */ __pyx_v_i = __pyx_v_phrase_location->sa_low; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":142 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":142 * 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: # <<<<<<<<<<<<<< @@ -38263,7 +38022,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_ } if (!__pyx_t_3) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":145 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":145 * '''Note: int(i) not guaranteed to have the desired * effect, according to the python documentation''' * if fmod(i,1.0) > 0.5: # <<<<<<<<<<<<<< @@ -38273,7 +38032,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_ __pyx_t_3 = (fmod(__pyx_v_i, 1.0) > 0.5); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":146 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":146 * effect, according to the python documentation''' * if fmod(i,1.0) > 0.5: * val = int(ceil(i)) # <<<<<<<<<<<<<< @@ -38285,7 +38044,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_ } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":148 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":148 * val = int(ceil(i)) * else: * val = int(floor(i)) # <<<<<<<<<<<<<< @@ -38296,7 +38055,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_ } __pyx_L7:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":149 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":149 * else: * val = int(floor(i)) * sample._append(self.sa.arr[val]) # <<<<<<<<<<<<<< @@ -38305,7 +38064,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_ */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_sample->__pyx_vtab)->_append(__pyx_v_sample, (__pyx_v_self->sa->arr[__pyx_v_val])); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":150 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":150 * val = int(floor(i)) * sample._append(self.sa.arr[val]) * i = i + stepsize # <<<<<<<<<<<<<< @@ -38320,7 +38079,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_ } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":152 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":152 * i = i + stepsize * else: * num_locations = (phrase_location.arr_high - phrase_location.arr_low) / phrase_location.num_subpatterns # <<<<<<<<<<<<<< @@ -38338,7 +38097,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_ } __pyx_v_num_locations = __Pyx_div_int(__pyx_t_5, __pyx_v_phrase_location->num_subpatterns); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":153 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":153 * 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: # <<<<<<<<<<<<<< @@ -38354,7 +38113,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_ } if (__pyx_t_2) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":154 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":154 * 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 # <<<<<<<<<<<<<< @@ -38368,7 +38127,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_ } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":156 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":156 * sample = phrase_location.arr * else: * stepsize = float(num_locations)/float(self.sample_size) # <<<<<<<<<<<<<< @@ -38381,7 +38140,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_ } __pyx_v_stepsize = (((double)__pyx_v_num_locations) / ((double)__pyx_v_self->sample_size)); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":157 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":157 * else: * stepsize = float(num_locations)/float(self.sample_size) * i = phrase_location.arr_low # <<<<<<<<<<<<<< @@ -38390,7 +38149,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_ */ __pyx_v_i = __pyx_v_phrase_location->arr_low; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":158 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":158 * 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: # <<<<<<<<<<<<<< @@ -38407,7 +38166,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_ } if (!__pyx_t_4) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":161 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":161 * '''Note: int(i) not guaranteed to have the desired * effect, according to the python documentation''' * if fmod(i,1.0) > 0.5: # <<<<<<<<<<<<<< @@ -38417,7 +38176,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_ __pyx_t_4 = (fmod(__pyx_v_i, 1.0) > 0.5); if (__pyx_t_4) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":162 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":162 * effect, according to the python documentation''' * if fmod(i,1.0) > 0.5: * val = int(ceil(i)) # <<<<<<<<<<<<<< @@ -38429,7 +38188,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_ } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":164 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":164 * val = int(ceil(i)) * else: * val = int(floor(i)) # <<<<<<<<<<<<<< @@ -38440,7 +38199,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_ } __pyx_L11:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":165 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":165 * else: * val = int(floor(i)) * j = phrase_location.arr_low + (val*phrase_location.num_subpatterns) # <<<<<<<<<<<<<< @@ -38449,7 +38208,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_ */ __pyx_v_j = (__pyx_v_phrase_location->arr_low + (__pyx_v_val * __pyx_v_phrase_location->num_subpatterns)); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":166 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":166 * 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) # <<<<<<<<<<<<<< @@ -38458,7 +38217,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_ */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_sample->__pyx_vtab)->_extend_arr(__pyx_v_sample, (__pyx_v_phrase_location->arr->arr + __pyx_v_j), __pyx_v_phrase_location->num_subpatterns); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":167 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":167 * 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 # <<<<<<<<<<<<<< @@ -38472,7 +38231,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_ } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":168 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":168 * sample._extend_arr(phrase_location.arr.arr + j, phrase_location.num_subpatterns) * i = i + stepsize * return sample # <<<<<<<<<<<<<< @@ -38497,7 +38256,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_ return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":180 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":180 * * * cdef void assign_matching(Matching* m, int* arr, int start, int step, int* sent_id_arr): # <<<<<<<<<<<<<< @@ -38509,7 +38268,7 @@ static void __pyx_f_3_sa_assign_matching(struct __pyx_t_3_sa_Matching *__pyx_v_m __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("assign_matching", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":181 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":181 * * cdef void assign_matching(Matching* m, int* arr, int start, int step, int* sent_id_arr): * m.arr = arr # <<<<<<<<<<<<<< @@ -38518,7 +38277,7 @@ static void __pyx_f_3_sa_assign_matching(struct __pyx_t_3_sa_Matching *__pyx_v_m */ __pyx_v_m->arr = __pyx_v_arr; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":182 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":182 * cdef void assign_matching(Matching* m, int* arr, int start, int step, int* sent_id_arr): * m.arr = arr * m.start = start # <<<<<<<<<<<<<< @@ -38527,7 +38286,7 @@ static void __pyx_f_3_sa_assign_matching(struct __pyx_t_3_sa_Matching *__pyx_v_m */ __pyx_v_m->start = __pyx_v_start; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":183 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":183 * m.arr = arr * m.start = start * m.end = start + step # <<<<<<<<<<<<<< @@ -38536,7 +38295,7 @@ static void __pyx_f_3_sa_assign_matching(struct __pyx_t_3_sa_Matching *__pyx_v_m */ __pyx_v_m->end = (__pyx_v_start + __pyx_v_step); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":184 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":184 * m.start = start * m.end = start + step * m.sent_id = sent_id_arr[arr[start]] # <<<<<<<<<<<<<< @@ -38545,7 +38304,7 @@ static void __pyx_f_3_sa_assign_matching(struct __pyx_t_3_sa_Matching *__pyx_v_m */ __pyx_v_m->sent_id = (__pyx_v_sent_id_arr[(__pyx_v_arr[__pyx_v_start])]); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":185 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":185 * m.end = start + step * m.sent_id = sent_id_arr[arr[start]] * m.size = step # <<<<<<<<<<<<<< @@ -38557,7 +38316,7 @@ static void __pyx_f_3_sa_assign_matching(struct __pyx_t_3_sa_Matching *__pyx_v_m __Pyx_RefNannyFinishContext(); } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":188 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":188 * * * cdef int* append_combined_matching(int* arr, Matching* loc1, Matching* loc2, # <<<<<<<<<<<<<< @@ -38574,7 +38333,7 @@ static int *__pyx_f_3_sa_append_combined_matching(int *__pyx_v_arr, struct __pyx int __pyx_t_2; __Pyx_RefNannySetupContext("append_combined_matching", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":192 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":192 * cdef int i, new_len * * new_len = result_len[0] + num_subpatterns # <<<<<<<<<<<<<< @@ -38583,7 +38342,7 @@ static int *__pyx_f_3_sa_append_combined_matching(int *__pyx_v_arr, struct __pyx */ __pyx_v_new_len = ((__pyx_v_result_len[0]) + __pyx_v_num_subpatterns); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":193 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":193 * * new_len = result_len[0] + num_subpatterns * arr = realloc(arr, new_len*sizeof(int)) # <<<<<<<<<<<<<< @@ -38592,7 +38351,7 @@ static int *__pyx_f_3_sa_append_combined_matching(int *__pyx_v_arr, struct __pyx */ __pyx_v_arr = ((int *)realloc(__pyx_v_arr, (__pyx_v_new_len * (sizeof(int))))); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":195 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":195 * arr = realloc(arr, new_len*sizeof(int)) * * for i from 0 <= i < loc1.size: # <<<<<<<<<<<<<< @@ -38602,7 +38361,7 @@ static int *__pyx_f_3_sa_append_combined_matching(int *__pyx_v_arr, struct __pyx __pyx_t_1 = __pyx_v_loc1->size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":196 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":196 * * for i from 0 <= i < loc1.size: * arr[result_len[0]+i] = loc1.arr[loc1.start+i] # <<<<<<<<<<<<<< @@ -38612,7 +38371,7 @@ static int *__pyx_f_3_sa_append_combined_matching(int *__pyx_v_arr, struct __pyx (__pyx_v_arr[((__pyx_v_result_len[0]) + __pyx_v_i)]) = (__pyx_v_loc1->arr[(__pyx_v_loc1->start + __pyx_v_i)]); } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":197 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":197 * for i from 0 <= i < loc1.size: * arr[result_len[0]+i] = loc1.arr[loc1.start+i] * if num_subpatterns > loc1.size: # <<<<<<<<<<<<<< @@ -38622,7 +38381,7 @@ static int *__pyx_f_3_sa_append_combined_matching(int *__pyx_v_arr, struct __pyx __pyx_t_2 = (__pyx_v_num_subpatterns > __pyx_v_loc1->size); if (__pyx_t_2) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":198 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":198 * arr[result_len[0]+i] = loc1.arr[loc1.start+i] * if num_subpatterns > loc1.size: * arr[new_len-1] = loc2.arr[loc2.end-1] # <<<<<<<<<<<<<< @@ -38634,7 +38393,7 @@ static int *__pyx_f_3_sa_append_combined_matching(int *__pyx_v_arr, struct __pyx } __pyx_L5:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":199 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":199 * if num_subpatterns > loc1.size: * arr[new_len-1] = loc2.arr[loc2.end-1] * result_len[0] = new_len # <<<<<<<<<<<<<< @@ -38643,7 +38402,7 @@ static int *__pyx_f_3_sa_append_combined_matching(int *__pyx_v_arr, struct __pyx */ (__pyx_v_result_len[0]) = __pyx_v_new_len; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":200 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":200 * arr[new_len-1] = loc2.arr[loc2.end-1] * result_len[0] = new_len * return arr # <<<<<<<<<<<<<< @@ -38659,7 +38418,7 @@ static int *__pyx_f_3_sa_append_combined_matching(int *__pyx_v_arr, struct __pyx return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":203 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":203 * * * cdef int* extend_arr(int* arr, int* arr_len, int* appendix, int appendix_len): # <<<<<<<<<<<<<< @@ -38673,7 +38432,7 @@ static int *__pyx_f_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr_len, int __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("extend_arr", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":206 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":206 * cdef int new_len * * new_len = arr_len[0] + appendix_len # <<<<<<<<<<<<<< @@ -38682,7 +38441,7 @@ static int *__pyx_f_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr_len, int */ __pyx_v_new_len = ((__pyx_v_arr_len[0]) + __pyx_v_appendix_len); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":207 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":207 * * new_len = arr_len[0] + appendix_len * arr = realloc(arr, new_len*sizeof(int)) # <<<<<<<<<<<<<< @@ -38691,7 +38450,7 @@ static int *__pyx_f_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr_len, int */ __pyx_v_arr = ((int *)realloc(__pyx_v_arr, (__pyx_v_new_len * (sizeof(int))))); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":208 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":208 * new_len = arr_len[0] + appendix_len * arr = realloc(arr, new_len*sizeof(int)) * memcpy(arr+arr_len[0], appendix, appendix_len*sizeof(int)) # <<<<<<<<<<<<<< @@ -38700,7 +38459,7 @@ static int *__pyx_f_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr_len, int */ memcpy((__pyx_v_arr + (__pyx_v_arr_len[0])), __pyx_v_appendix, (__pyx_v_appendix_len * (sizeof(int)))); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":209 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":209 * arr = realloc(arr, new_len*sizeof(int)) * memcpy(arr+arr_len[0], appendix, appendix_len*sizeof(int)) * arr_len[0] = new_len # <<<<<<<<<<<<<< @@ -38709,7 +38468,7 @@ static int *__pyx_f_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr_len, int */ (__pyx_v_arr_len[0]) = __pyx_v_new_len; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":210 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":210 * memcpy(arr+arr_len[0], appendix, appendix_len*sizeof(int)) * arr_len[0] = new_len * return arr # <<<<<<<<<<<<<< @@ -38725,7 +38484,7 @@ static int *__pyx_f_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr_len, int return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":212 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":212 * return arr * * cdef int median(int low, int high, int step): # <<<<<<<<<<<<<< @@ -38742,7 +38501,7 @@ static int __pyx_f_3_sa_median(int __pyx_v_low, int __pyx_v_high, int __pyx_v_st int __pyx_clineno = 0; __Pyx_RefNannySetupContext("median", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":213 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":213 * * cdef int median(int low, int high, int step): * return low + (((high - low)/step)/2)*step # <<<<<<<<<<<<<< @@ -38771,7 +38530,7 @@ static int __pyx_f_3_sa_median(int __pyx_v_low, int __pyx_v_high, int __pyx_v_st return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":216 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":216 * * * cdef void find_comparable_matchings(int low, int high, int* arr, int step, int loc, int* loc_minus, int* loc_plus): # <<<<<<<<<<<<<< @@ -38786,7 +38545,7 @@ static void __pyx_f_3_sa_find_comparable_matchings(int __pyx_v_low, int __pyx_v_ int __pyx_t_3; __Pyx_RefNannySetupContext("find_comparable_matchings", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":220 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":220 * # in which all matchings have the same first index as the one * # starting at loc * loc_plus[0] = loc + step # <<<<<<<<<<<<<< @@ -38795,7 +38554,7 @@ static void __pyx_f_3_sa_find_comparable_matchings(int __pyx_v_low, int __pyx_v_ */ (__pyx_v_loc_plus[0]) = (__pyx_v_loc + __pyx_v_step); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":221 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":221 * # starting at loc * loc_plus[0] = loc + step * while loc_plus[0] < high and arr[loc_plus[0]] == arr[loc]: # <<<<<<<<<<<<<< @@ -38812,7 +38571,7 @@ static void __pyx_f_3_sa_find_comparable_matchings(int __pyx_v_low, int __pyx_v_ } if (!__pyx_t_3) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":222 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":222 * loc_plus[0] = loc + step * while loc_plus[0] < high and arr[loc_plus[0]] == arr[loc]: * loc_plus[0] = loc_plus[0] + step # <<<<<<<<<<<<<< @@ -38822,7 +38581,7 @@ static void __pyx_f_3_sa_find_comparable_matchings(int __pyx_v_low, int __pyx_v_ (__pyx_v_loc_plus[0]) = ((__pyx_v_loc_plus[0]) + __pyx_v_step); } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":223 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":223 * while loc_plus[0] < high and arr[loc_plus[0]] == arr[loc]: * loc_plus[0] = loc_plus[0] + step * loc_minus[0] = loc # <<<<<<<<<<<<<< @@ -38831,7 +38590,7 @@ static void __pyx_f_3_sa_find_comparable_matchings(int __pyx_v_low, int __pyx_v_ */ (__pyx_v_loc_minus[0]) = __pyx_v_loc; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":224 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":224 * 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]: # <<<<<<<<<<<<<< @@ -38848,7 +38607,7 @@ static void __pyx_f_3_sa_find_comparable_matchings(int __pyx_v_low, int __pyx_v_ } if (!__pyx_t_2) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":225 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":225 * 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 # <<<<<<<<<<<<<< @@ -38885,14 +38644,14 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_ int __pyx_v_use_baeza_yates; int __pyx_v_use_collocations; int __pyx_v_use_index; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__alignment,&__pyx_n_s__by_slack_factor,&__pyx_n_s__category,&__pyx_n_s__max_chunks,&__pyx_n_s__max_initial_size,&__pyx_n_s__max_length,&__pyx_n_s__max_nonterminals,&__pyx_n_s__max_target_chunks,&__pyx_n_s__max_target_length,&__pyx_n_s__min_gap_size,&__pyx_n_s__precompute_file,&__pyx_n_s_70,&__pyx_n_s__precompute_rank,&__pyx_n_s_103,&__pyx_n_s_104,&__pyx_n_s_71,&__pyx_n_s__train_min_gap_size,&__pyx_n_s__tight_phrases,&__pyx_n_s__use_baeza_yates,&__pyx_n_s__use_collocations,&__pyx_n_s__use_index,0}; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__alignment,&__pyx_n_s__by_slack_factor,&__pyx_n_s__category,&__pyx_n_s__max_chunks,&__pyx_n_s__max_initial_size,&__pyx_n_s__max_length,&__pyx_n_s__max_nonterminals,&__pyx_n_s__max_target_chunks,&__pyx_n_s__max_target_length,&__pyx_n_s__min_gap_size,&__pyx_n_s__precompute_file,&__pyx_n_s_70,&__pyx_n_s__precompute_rank,&__pyx_n_s_103,&__pyx_n_s_104,&__pyx_n_s_71,&__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/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":296 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":296 * 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, # <<<<<<<<<<<<<< @@ -38901,7 +38660,7 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_ */ values[3] = ((PyObject *)Py_None); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":304 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":304 * 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, # <<<<<<<<<<<<<< @@ -38910,7 +38669,7 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_ */ values[7] = ((PyObject *)Py_None); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":306 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":306 * 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, # <<<<<<<<<<<<<< @@ -38919,7 +38678,7 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_ */ values[8] = ((PyObject *)Py_None); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":310 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":310 * unsigned min_gap_size=2, * # filename of file containing precomputed collocations * precompute_file=None, # <<<<<<<<<<<<<< @@ -38958,7 +38717,8 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(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__alignment)) != 0)) kw_args--; + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__alignment); + if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 0) { @@ -39064,6 +38824,126 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_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 = 288; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } + if (values[1]) { + } else { + + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":292 + * Alignment alignment, + * # parameter for double-binary search; doesn't seem to matter much + * float by_slack_factor=1.0, # <<<<<<<<<<<<<< + * # name of generic nonterminal used by Hiero + * char* category="[X]", + */ + __pyx_v_by_slack_factor = ((float)1.0); + } + if (values[2]) { + } else { + __pyx_v_category = ((char *)__pyx_k_105); + } + if (values[4]) { + } else { + __pyx_v_max_initial_size = ((unsigned int)10); + } + if (values[5]) { + } else { + __pyx_v_max_length = ((unsigned int)5); + } + if (values[6]) { + } else { + __pyx_v_max_nonterminals = ((unsigned int)2); + } + if (values[9]) { + } else { + __pyx_v_min_gap_size = ((unsigned int)2); + } + if (values[11]) { + } else { + __pyx_v_precompute_secondary_rank = ((unsigned int)20); + } + if (values[12]) { + } else { + __pyx_v_precompute_rank = ((unsigned int)100); + } + if (values[13]) { + } else { + + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":316 + * unsigned precompute_rank=100, + * # require extracted rules to have at least one aligned word + * bint require_aligned_terminal=True, # <<<<<<<<<<<<<< + * # require each contiguous chunk of extracted rules to have at least one aligned word + * bint require_aligned_chunks=False, + */ + __pyx_v_require_aligned_terminal = ((int)1); + } + if (values[14]) { + } else { + + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":318 + * bint require_aligned_terminal=True, + * # require each contiguous chunk of extracted rules to have at least one aligned word + * bint require_aligned_chunks=False, # <<<<<<<<<<<<<< + * # maximum span of a grammar rule extracted from TRAINING DATA + * unsigned train_max_initial_size=10, + */ + __pyx_v_require_aligned_chunks = ((int)0); + } + if (values[15]) { + } else { + __pyx_v_train_max_initial_size = ((unsigned int)10); + } + if (values[16]) { + } else { + __pyx_v_train_min_gap_size = ((unsigned int)2); + } + if (values[17]) { + } else { + + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":324 + * unsigned train_min_gap_size=2, + * # False if phrases should be loose (better but slower), True otherwise + * bint tight_phrases=True, # <<<<<<<<<<<<<< + * # True to require use of double-binary alg, false otherwise + * bint use_baeza_yates=True, + */ + __pyx_v_tight_phrases = ((int)1); + } + if (values[18]) { + } else { + + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":326 + * bint tight_phrases=True, + * # True to require use of double-binary alg, false otherwise + * bint use_baeza_yates=True, # <<<<<<<<<<<<<< + * # True to enable used of precomputed collocations + * bint use_collocations=True, + */ + __pyx_v_use_baeza_yates = ((int)1); + } + if (values[19]) { + } else { + + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":328 + * bint use_baeza_yates=True, + * # True to enable used of precomputed collocations + * bint use_collocations=True, # <<<<<<<<<<<<<< + * # True to enable use of precomputed inverted indices + * bint use_index=True): + */ + __pyx_v_use_collocations = ((int)1); + } + if (values[20]) { + } else { + + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":330 + * bint use_collocations=True, + * # True to enable use of precomputed inverted indices + * bint use_index=True): # <<<<<<<<<<<<<< + * '''Note: we make a distinction between the min_gap_size + * and max_initial_size used in test and train. The latter + */ + __pyx_v_use_index = ((int)1); + } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20); @@ -39096,7 +38976,7 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_ __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 = 292; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":292 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":292 * Alignment alignment, * # parameter for double-binary search; doesn't seem to matter much * float by_slack_factor=1.0, # <<<<<<<<<<<<<< @@ -39148,7 +39028,7 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_ __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 = 316; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":316 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":316 * unsigned precompute_rank=100, * # require extracted rules to have at least one aligned word * bint require_aligned_terminal=True, # <<<<<<<<<<<<<< @@ -39161,7 +39041,7 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_ __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 = 318; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":318 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":318 * bint require_aligned_terminal=True, * # require each contiguous chunk of extracted rules to have at least one aligned word * bint require_aligned_chunks=False, # <<<<<<<<<<<<<< @@ -39184,7 +39064,7 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_ __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 = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":324 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":324 * unsigned train_min_gap_size=2, * # False if phrases should be loose (better but slower), True otherwise * bint tight_phrases=True, # <<<<<<<<<<<<<< @@ -39197,7 +39077,7 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_ __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 = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":326 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":326 * bint tight_phrases=True, * # True to require use of double-binary alg, false otherwise * bint use_baeza_yates=True, # <<<<<<<<<<<<<< @@ -39210,7 +39090,7 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_ __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 = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":328 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":328 * bint use_baeza_yates=True, * # True to enable used of precomputed collocations * bint use_collocations=True, # <<<<<<<<<<<<<< @@ -39223,7 +39103,7 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_ __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 = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":330 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":330 * bint use_collocations=True, * # True to enable use of precomputed inverted indices * bint use_index=True): # <<<<<<<<<<<<<< @@ -39258,12 +39138,13 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_9__cinit___lambda1(PyOb PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda1 (wrapper)", 0); + __pyx_self = __pyx_self; __pyx_r = __pyx_lambda_funcdef_lambda1(__pyx_self); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":406 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":406 * self.phrases_f = defaultdict(int) * self.phrases_e = defaultdict(int) * self.phrases_fe = defaultdict(lambda: defaultdict(int)) # <<<<<<<<<<<<<< @@ -39318,12 +39199,13 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_9__cinit___1lambda2(PyO PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda2 (wrapper)", 0); + __pyx_self = __pyx_self; __pyx_r = __pyx_lambda_funcdef_lambda2(__pyx_self); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":407 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":407 * self.phrases_e = defaultdict(int) * self.phrases_fe = defaultdict(lambda: defaultdict(int)) * self.phrases_al = defaultdict(lambda: defaultdict(tuple)) # <<<<<<<<<<<<<< @@ -39378,12 +39260,13 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_9__cinit___2lambda3(PyO PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda3 (wrapper)", 0); + __pyx_self = __pyx_self; __pyx_r = __pyx_lambda_funcdef_lambda3(__pyx_self); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":412 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":412 * self.bilex_f = defaultdict(int) * self.bilex_e = defaultdict(int) * self.bilex_fe = defaultdict(lambda: defaultdict(int)) # <<<<<<<<<<<<<< @@ -39431,7 +39314,7 @@ static PyObject *__pyx_lambda_funcdef_lambda3(CYTHON_UNUSED PyObject *__pyx_self return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":288 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":288 * cdef bilex_fe * * def __cinit__(self, # <<<<<<<<<<<<<< @@ -39452,7 +39335,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":336 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":336 * 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 # <<<<<<<<<<<<<< @@ -39475,7 +39358,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ __pyx_v_self->rules = ((struct __pyx_obj_3_sa_TrieTable *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":337 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":337 * them to be the same, therefore we don't either.''' * self.rules = TrieTable(True) # cache * self.rules.root = ExtendedTrieNode(phrase_location=PhraseLocation()) # <<<<<<<<<<<<<< @@ -39497,7 +39380,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ __pyx_v_self->rules->root = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":338 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":338 * self.rules = TrieTable(True) # cache * self.rules.root = ExtendedTrieNode(phrase_location=PhraseLocation()) * if alignment is None: # <<<<<<<<<<<<<< @@ -39507,7 +39390,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ __pyx_t_3 = (((PyObject *)__pyx_v_alignment) == Py_None); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":339 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":339 * self.rules.root = ExtendedTrieNode(phrase_location=PhraseLocation()) * if alignment is None: * raise Exception("Must specify an alignment object") # <<<<<<<<<<<<<< @@ -39523,7 +39406,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":340 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":340 * if alignment is None: * raise Exception("Must specify an alignment object") * self.alignment = alignment # <<<<<<<<<<<<<< @@ -39536,7 +39419,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ __Pyx_DECREF(((PyObject *)__pyx_v_self->alignment)); __pyx_v_self->alignment = __pyx_v_alignment; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":344 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":344 * # grammar parameters and settings * # NOTE: setting max_nonterminals > 2 is not currently supported in Hiero * self.max_length = max_length # <<<<<<<<<<<<<< @@ -39545,7 +39428,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ */ __pyx_v_self->max_length = __pyx_v_max_length; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":345 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":345 * # NOTE: setting max_nonterminals > 2 is not currently supported in Hiero * self.max_length = max_length * self.max_nonterminals = max_nonterminals # <<<<<<<<<<<<<< @@ -39554,7 +39437,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ */ __pyx_v_self->max_nonterminals = __pyx_v_max_nonterminals; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":346 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":346 * self.max_length = max_length * self.max_nonterminals = max_nonterminals * self.max_initial_size = max_initial_size # <<<<<<<<<<<<<< @@ -39563,7 +39446,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ */ __pyx_v_self->max_initial_size = __pyx_v_max_initial_size; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":347 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":347 * self.max_nonterminals = max_nonterminals * self.max_initial_size = max_initial_size * self.train_max_initial_size = train_max_initial_size # <<<<<<<<<<<<<< @@ -39572,7 +39455,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ */ __pyx_v_self->train_max_initial_size = __pyx_v_train_max_initial_size; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":348 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":348 * self.max_initial_size = max_initial_size * self.train_max_initial_size = train_max_initial_size * self.min_gap_size = min_gap_size # <<<<<<<<<<<<<< @@ -39581,7 +39464,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ */ __pyx_v_self->min_gap_size = __pyx_v_min_gap_size; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":349 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":349 * 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 # <<<<<<<<<<<<<< @@ -39590,7 +39473,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ */ __pyx_v_self->train_min_gap_size = __pyx_v_train_min_gap_size; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":350 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":350 * self.min_gap_size = min_gap_size * self.train_min_gap_size = train_min_gap_size * self.category = sym_fromstring(category, False) # <<<<<<<<<<<<<< @@ -39599,7 +39482,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ */ __pyx_v_self->category = __pyx_f_3_sa_sym_fromstring(__pyx_v_category, 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":352 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":352 * self.category = sym_fromstring(category, False) * * if max_chunks is None: # <<<<<<<<<<<<<< @@ -39609,7 +39492,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ __pyx_t_3 = (__pyx_v_max_chunks == Py_None); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":353 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":353 * * if max_chunks is None: * self.max_chunks = self.max_nonterminals + 1 # <<<<<<<<<<<<<< @@ -39621,7 +39504,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":355 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":355 * self.max_chunks = self.max_nonterminals + 1 * else: * self.max_chunks = max_chunks # <<<<<<<<<<<<<< @@ -39633,7 +39516,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ } __pyx_L4:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":357 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":357 * self.max_chunks = max_chunks * * if max_target_chunks is None: # <<<<<<<<<<<<<< @@ -39643,7 +39526,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ __pyx_t_3 = (__pyx_v_max_target_chunks == Py_None); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":358 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":358 * * if max_target_chunks is None: * self.max_target_chunks = self.max_nonterminals + 1 # <<<<<<<<<<<<<< @@ -39655,7 +39538,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":360 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":360 * self.max_target_chunks = self.max_nonterminals + 1 * else: * self.max_target_chunks = max_target_chunks # <<<<<<<<<<<<<< @@ -39667,7 +39550,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ } __pyx_L5:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":362 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":362 * self.max_target_chunks = max_target_chunks * * if max_target_length is None: # <<<<<<<<<<<<<< @@ -39677,7 +39560,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ __pyx_t_3 = (__pyx_v_max_target_length == Py_None); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":363 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":363 * * if max_target_length is None: * self.max_target_length = max_initial_size # <<<<<<<<<<<<<< @@ -39689,7 +39572,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":365 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":365 * self.max_target_length = max_initial_size * else: * self.max_target_length = max_target_length # <<<<<<<<<<<<<< @@ -39701,7 +39584,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ } __pyx_L6:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":368 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":368 * * # algorithmic parameters and settings * self.precomputed_collocations = {} # <<<<<<<<<<<<<< @@ -39716,7 +39599,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ __pyx_v_self->precomputed_collocations = ((PyObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":369 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":369 * # algorithmic parameters and settings * self.precomputed_collocations = {} * self.precomputed_index = {} # <<<<<<<<<<<<<< @@ -39731,7 +39614,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ __pyx_v_self->precomputed_index = ((PyObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":370 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":370 * self.precomputed_collocations = {} * self.precomputed_index = {} * self.use_index = use_index # <<<<<<<<<<<<<< @@ -39740,7 +39623,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ */ __pyx_v_self->use_index = __pyx_v_use_index; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":371 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":371 * self.precomputed_index = {} * self.use_index = use_index * self.use_collocations = use_collocations # <<<<<<<<<<<<<< @@ -39749,7 +39632,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ */ __pyx_v_self->use_collocations = __pyx_v_use_collocations; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":372 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":372 * self.use_index = use_index * self.use_collocations = use_collocations * self.max_rank = {} # <<<<<<<<<<<<<< @@ -39764,7 +39647,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ __pyx_v_self->max_rank = ((PyObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":373 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":373 * self.use_collocations = use_collocations * self.max_rank = {} * self.precompute_file = precompute_file # <<<<<<<<<<<<<< @@ -39777,7 +39660,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ __Pyx_DECREF(__pyx_v_self->precompute_file); __pyx_v_self->precompute_file = __pyx_v_precompute_file; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":374 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":374 * self.max_rank = {} * self.precompute_file = precompute_file * self.precompute_rank = precompute_rank # <<<<<<<<<<<<<< @@ -39786,7 +39669,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ */ __pyx_v_self->precompute_rank = __pyx_v_precompute_rank; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":375 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":375 * self.precompute_file = precompute_file * self.precompute_rank = precompute_rank * self.precompute_secondary_rank = precompute_secondary_rank # <<<<<<<<<<<<<< @@ -39795,7 +39678,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ */ __pyx_v_self->precompute_secondary_rank = __pyx_v_precompute_secondary_rank; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":376 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":376 * self.precompute_rank = precompute_rank * self.precompute_secondary_rank = precompute_secondary_rank * self.use_baeza_yates = use_baeza_yates # <<<<<<<<<<<<<< @@ -39804,7 +39687,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ */ __pyx_v_self->use_baeza_yates = __pyx_v_use_baeza_yates; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":377 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":377 * self.precompute_secondary_rank = precompute_secondary_rank * self.use_baeza_yates = use_baeza_yates * self.by_slack_factor = by_slack_factor # <<<<<<<<<<<<<< @@ -39813,7 +39696,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ */ __pyx_v_self->by_slack_factor = __pyx_v_by_slack_factor; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":378 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":378 * self.use_baeza_yates = use_baeza_yates * self.by_slack_factor = by_slack_factor * self.tight_phrases = tight_phrases # <<<<<<<<<<<<<< @@ -39822,7 +39705,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ */ __pyx_v_self->tight_phrases = __pyx_v_tight_phrases; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":380 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":380 * self.tight_phrases = tight_phrases * * if require_aligned_chunks: # <<<<<<<<<<<<<< @@ -39831,7 +39714,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ */ if (__pyx_v_require_aligned_chunks) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":382 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":382 * if require_aligned_chunks: * # one condition is a stronger version of the other. * self.require_aligned_chunks = self.require_aligned_terminal = True # <<<<<<<<<<<<<< @@ -39843,7 +39726,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ goto __pyx_L7; } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":383 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":383 * # one condition is a stronger version of the other. * self.require_aligned_chunks = self.require_aligned_terminal = True * elif require_aligned_terminal: # <<<<<<<<<<<<<< @@ -39852,7 +39735,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ */ if (__pyx_v_require_aligned_terminal) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":384 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":384 * self.require_aligned_chunks = self.require_aligned_terminal = True * elif require_aligned_terminal: * self.require_aligned_chunks = False # <<<<<<<<<<<<<< @@ -39861,7 +39744,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ */ __pyx_v_self->require_aligned_chunks = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":385 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":385 * elif require_aligned_terminal: * self.require_aligned_chunks = False * self.require_aligned_terminal = True # <<<<<<<<<<<<<< @@ -39873,7 +39756,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":387 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":387 * self.require_aligned_terminal = True * else: * self.require_aligned_chunks = self.require_aligned_terminal = False # <<<<<<<<<<<<<< @@ -39885,7 +39768,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ } __pyx_L7:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":390 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":390 * * # diagnostics * self.prev_norm_prefix = () # <<<<<<<<<<<<<< @@ -39898,7 +39781,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ __Pyx_DECREF(__pyx_v_self->prev_norm_prefix); __pyx_v_self->prev_norm_prefix = ((PyObject *)__pyx_empty_tuple); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":392 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":392 * self.prev_norm_prefix = () * * self.findexes = IntList(initial_len=10) # <<<<<<<<<<<<<< @@ -39917,7 +39800,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ __pyx_v_self->findexes = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":393 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":393 * * self.findexes = IntList(initial_len=10) * self.findexes1 = IntList(initial_len=10) # <<<<<<<<<<<<<< @@ -39936,7 +39819,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ __pyx_v_self->findexes1 = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":398 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":398 * * # True after data is added * self.online = False # <<<<<<<<<<<<<< @@ -39945,7 +39828,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ */ __pyx_v_self->online = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":401 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":401 * * # Keep track of everything that can be sampled: * self.samples_f = defaultdict(int) # <<<<<<<<<<<<<< @@ -39969,7 +39852,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ __pyx_v_self->samples_f = __pyx_t_5; __pyx_t_5 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":404 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":404 * * # Phrase counts * self.phrases_f = defaultdict(int) # <<<<<<<<<<<<<< @@ -39993,7 +39876,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ __pyx_v_self->phrases_f = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":405 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":405 * # Phrase counts * self.phrases_f = defaultdict(int) * self.phrases_e = defaultdict(int) # <<<<<<<<<<<<<< @@ -40017,7 +39900,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ __pyx_v_self->phrases_e = __pyx_t_5; __pyx_t_5 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":406 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":406 * self.phrases_f = defaultdict(int) * self.phrases_e = defaultdict(int) * self.phrases_fe = defaultdict(lambda: defaultdict(int)) # <<<<<<<<<<<<<< @@ -40043,7 +39926,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ __pyx_v_self->phrases_fe = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":407 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":407 * self.phrases_e = defaultdict(int) * self.phrases_fe = defaultdict(lambda: defaultdict(int)) * self.phrases_al = defaultdict(lambda: defaultdict(tuple)) # <<<<<<<<<<<<<< @@ -40069,7 +39952,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ __pyx_v_self->phrases_al = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":410 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":410 * * # Bilexical counts * self.bilex_f = defaultdict(int) # <<<<<<<<<<<<<< @@ -40093,7 +39976,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ __pyx_v_self->bilex_f = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":411 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":411 * # Bilexical counts * self.bilex_f = defaultdict(int) * self.bilex_e = defaultdict(int) # <<<<<<<<<<<<<< @@ -40117,7 +40000,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ __pyx_v_self->bilex_e = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":412 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":412 * self.bilex_f = defaultdict(int) * self.bilex_e = defaultdict(int) * self.bilex_fe = defaultdict(lambda: defaultdict(int)) # <<<<<<<<<<<<<< @@ -40164,11 +40047,11 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_3configure(PyObject *__ struct __pyx_obj_3_sa_DataArray *__pyx_v_edarray = 0; struct __pyx_obj_3_sa_Sampler *__pyx_v_sampler = 0; struct __pyx_obj_3_sa_Scorer *__pyx_v_scorer = 0; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fsarray,&__pyx_n_s__edarray,&__pyx_n_s__sampler,&__pyx_n_s__scorer,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("configure (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fsarray,&__pyx_n_s__edarray,&__pyx_n_s__sampler,&__pyx_n_s__scorer,0}; PyObject* values[4] = {0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -40184,20 +40067,24 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_3configure(PyObject *__ 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--; + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fsarray); + if (likely(values[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--; + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__edarray); + if (likely(values[1])) kw_args--; else { __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--; + values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sampler); + if (likely(values[2])) kw_args--; else { __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--; + values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__scorer); + if (likely(values[3])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("configure", 1, 4, 4, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -40239,7 +40126,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_3configure(PyObject *__ return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":414 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":414 * self.bilex_fe = defaultdict(lambda: defaultdict(int)) * * def configure(self, SuffixArray fsarray, DataArray edarray, # <<<<<<<<<<<<<< @@ -40257,7 +40144,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_2configure(struct __pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("configure", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":419 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":419 * Here we also use it to precompute the most expensive intersections * in the corpus quickly.''' * self.fsa = fsarray # <<<<<<<<<<<<<< @@ -40270,7 +40157,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_2configure(struct __pyx __Pyx_DECREF(((PyObject *)__pyx_v_self->fsa)); __pyx_v_self->fsa = __pyx_v_fsarray; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":420 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":420 * in the corpus quickly.''' * self.fsa = fsarray * self.fda = fsarray.darray # <<<<<<<<<<<<<< @@ -40283,7 +40170,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_2configure(struct __pyx __Pyx_DECREF(((PyObject *)__pyx_v_self->fda)); __pyx_v_self->fda = __pyx_v_fsarray->darray; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":421 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":421 * self.fsa = fsarray * self.fda = fsarray.darray * self.eda = edarray # <<<<<<<<<<<<<< @@ -40296,7 +40183,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_2configure(struct __pyx __Pyx_DECREF(((PyObject *)__pyx_v_self->eda)); __pyx_v_self->eda = __pyx_v_edarray; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":422 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":422 * self.fda = fsarray.darray * self.eda = edarray * self.fid2symid = self.set_idmap(self.fda) # <<<<<<<<<<<<<< @@ -40315,7 +40202,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_2configure(struct __pyx __pyx_v_self->fid2symid = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":423 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":423 * self.eda = edarray * self.fid2symid = self.set_idmap(self.fda) * self.eid2symid = self.set_idmap(self.eda) # <<<<<<<<<<<<<< @@ -40334,7 +40221,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_2configure(struct __pyx __pyx_v_self->eid2symid = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":424 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":424 * self.fid2symid = self.set_idmap(self.fda) * self.eid2symid = self.set_idmap(self.eda) * self.precompute() # <<<<<<<<<<<<<< @@ -40348,7 +40235,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_2configure(struct __pyx __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":425 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":425 * self.eid2symid = self.set_idmap(self.eda) * self.precompute() * self.sampler = sampler # <<<<<<<<<<<<<< @@ -40361,7 +40248,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_2configure(struct __pyx __Pyx_DECREF(((PyObject *)__pyx_v_self->sampler)); __pyx_v_self->sampler = __pyx_v_sampler; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":426 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":426 * self.precompute() * self.sampler = sampler * self.scorer = scorer # <<<<<<<<<<<<<< @@ -40387,7 +40274,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_2configure(struct __pyx return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":428 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":428 * self.scorer = scorer * * cdef set_idmap(self, DataArray darray): # <<<<<<<<<<<<<< @@ -40412,7 +40299,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_set_idmap(CYTHON_UNUSED int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_idmap", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":432 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":432 * cdef IntList idmap * * N = len(darray.id2word) # <<<<<<<<<<<<<< @@ -40425,7 +40312,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_set_idmap(CYTHON_UNUSED __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_N = __pyx_t_2; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":433 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":433 * * N = len(darray.id2word) * idmap = IntList(initial_len=N) # <<<<<<<<<<<<<< @@ -40444,7 +40331,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_set_idmap(CYTHON_UNUSED __pyx_v_idmap = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":434 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":434 * N = len(darray.id2word) * idmap = IntList(initial_len=N) * for word_id from 0 <= word_id < N: # <<<<<<<<<<<<<< @@ -40454,7 +40341,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_set_idmap(CYTHON_UNUSED __pyx_t_4 = __pyx_v_N; for (__pyx_v_word_id = 0; __pyx_v_word_id < __pyx_t_4; __pyx_v_word_id++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":435 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -40467,7 +40354,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_set_idmap(CYTHON_UNUSED __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_new_word_id = __pyx_f_3_sa_sym_fromstring(__pyx_t_5, 1); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":436 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -40477,7 +40364,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_set_idmap(CYTHON_UNUSED (__pyx_v_idmap->arr[__pyx_v_word_id]) = __pyx_v_new_word_id; } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":437 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":437 * new_word_id = sym_fromstring(darray.id2word[word_id], True) * idmap.arr[word_id] = new_word_id * return idmap # <<<<<<<<<<<<<< @@ -40514,7 +40401,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_5pattern2phrase(PyObjec return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":440 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":440 * * * def pattern2phrase(self, pattern): # <<<<<<<<<<<<<< @@ -40542,7 +40429,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_4pattern2phrase(struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pattern2phrase", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":442 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":442 * def pattern2phrase(self, pattern): * # pattern is a tuple, which we must convert to a hiero Phrase * result = () # <<<<<<<<<<<<<< @@ -40552,7 +40439,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_4pattern2phrase(struct __Pyx_INCREF(((PyObject *)__pyx_empty_tuple)); __pyx_v_result = __pyx_empty_tuple; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":443 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":443 * # pattern is a tuple, which we must convert to a hiero Phrase * result = () * arity = 0 # <<<<<<<<<<<<<< @@ -40562,7 +40449,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_4pattern2phrase(struct __Pyx_INCREF(__pyx_int_0); __pyx_v_arity = __pyx_int_0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":444 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":444 * result = () * arity = 0 * for word_id in pattern: # <<<<<<<<<<<<<< @@ -40580,18 +40467,10 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_4pattern2phrase(struct for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; 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 = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; } 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 = 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 = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { @@ -40607,19 +40486,20 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_4pattern2phrase(struct __pyx_v_word_id = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":445 + /* "/home/paulb/workspace/cdec/python/src/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 = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_word_id, __pyx_int_neg_1, Py_EQ); 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_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/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":446 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":446 * for word_id in pattern: * if word_id == -1: * arity = arity + 1 # <<<<<<<<<<<<<< @@ -40632,7 +40512,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_4pattern2phrase(struct __pyx_v_arity = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":447 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":447 * if word_id == -1: * arity = arity + 1 * new_id = sym_setindex(self.category, arity) # <<<<<<<<<<<<<< @@ -40645,7 +40525,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_4pattern2phrase(struct } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":449 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":449 * new_id = sym_setindex(self.category, arity) * else: * new_id = sym_fromstring(self.fda.id2word[word_id], True) # <<<<<<<<<<<<<< @@ -40660,7 +40540,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_4pattern2phrase(struct } __pyx_L5:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":450 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":450 * else: * new_id = sym_fromstring(self.fda.id2word[word_id], True) * result = result + (new_id,) # <<<<<<<<<<<<<< @@ -40683,7 +40563,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_4pattern2phrase(struct } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":451 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":451 * new_id = sym_fromstring(self.fda.id2word[word_id], True) * result = result + (new_id,) * return Phrase(result) # <<<<<<<<<<<<<< @@ -40731,7 +40611,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_7pattern2phrase_plus(Py return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":453 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":453 * return Phrase(result) * * def pattern2phrase_plus(self, pattern): # <<<<<<<<<<<<<< @@ -40761,7 +40641,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_6pattern2phrase_plus(st int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pattern2phrase_plus", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":456 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":456 * # returns a list containing both the pattern, and pattern * # suffixed/prefixed with the NT category. * patterns = [] # <<<<<<<<<<<<<< @@ -40773,7 +40653,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_6pattern2phrase_plus(st __pyx_v_patterns = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":457 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":457 * # suffixed/prefixed with the NT category. * patterns = [] * result = () # <<<<<<<<<<<<<< @@ -40783,7 +40663,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_6pattern2phrase_plus(st __Pyx_INCREF(((PyObject *)__pyx_empty_tuple)); __pyx_v_result = __pyx_empty_tuple; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":458 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":458 * patterns = [] * result = () * arity = 0 # <<<<<<<<<<<<<< @@ -40793,7 +40673,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_6pattern2phrase_plus(st __Pyx_INCREF(__pyx_int_0); __pyx_v_arity = __pyx_int_0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":459 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":459 * result = () * arity = 0 * for word_id in pattern: # <<<<<<<<<<<<<< @@ -40811,18 +40691,10 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_6pattern2phrase_plus(st for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; 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 = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; } 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 = 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 = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { @@ -40838,19 +40710,20 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_6pattern2phrase_plus(st __pyx_v_word_id = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":460 + /* "/home/paulb/workspace/cdec/python/src/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 = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_word_id, __pyx_int_neg_1, Py_EQ); 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_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/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":461 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":461 * for word_id in pattern: * if word_id == -1: * arity = arity + 1 # <<<<<<<<<<<<<< @@ -40863,7 +40736,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_6pattern2phrase_plus(st __pyx_v_arity = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":462 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":462 * if word_id == -1: * arity = arity + 1 * new_id = sym_setindex(self.category, arity) # <<<<<<<<<<<<<< @@ -40876,7 +40749,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_6pattern2phrase_plus(st } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":464 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":464 * new_id = sym_setindex(self.category, arity) * else: * new_id = sym_fromstring(self.fda.id2word[word_id], True) # <<<<<<<<<<<<<< @@ -40891,7 +40764,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_6pattern2phrase_plus(st } __pyx_L5:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":465 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":465 * else: * new_id = sym_fromstring(self.fda.id2word[word_id], True) * result = result + (new_id,) # <<<<<<<<<<<<<< @@ -40914,7 +40787,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_6pattern2phrase_plus(st } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":466 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":466 * new_id = sym_fromstring(self.fda.id2word[word_id], True) * result = result + (new_id,) * patterns.append(Phrase(result)) # <<<<<<<<<<<<<< @@ -40932,7 +40805,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_6pattern2phrase_plus(st __pyx_t_9 = 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/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":467 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":467 * result = result + (new_id,) * patterns.append(Phrase(result)) * patterns.append(Phrase(result + (sym_setindex(self.category, 1),))) # <<<<<<<<<<<<<< @@ -40960,7 +40833,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_6pattern2phrase_plus(st __pyx_t_9 = 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/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":468 + /* "/home/paulb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -40988,7 +40861,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_6pattern2phrase_plus(st __pyx_t_9 = 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/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":469 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":469 * patterns.append(Phrase(result + (sym_setindex(self.category, 1),))) * patterns.append(Phrase((sym_setindex(self.category, 1),) + result)) * return patterns # <<<<<<<<<<<<<< @@ -41029,7 +40902,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_9precompute(PyObject *_ return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":471 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":471 * return patterns * * def precompute(self): # <<<<<<<<<<<<<< @@ -41053,9 +40926,9 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; Py_ssize_t __pyx_t_6; - Py_ssize_t __pyx_t_7; - int __pyx_t_8; - int __pyx_t_9; + PyObject *(*__pyx_t_7)(PyObject *); + PyObject *__pyx_t_8 = NULL; + PyObject *(*__pyx_t_9)(PyObject *); Py_ssize_t __pyx_t_10; PyObject *(*__pyx_t_11)(PyObject *); int __pyx_lineno = 0; @@ -41063,7 +40936,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("precompute", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":474 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":474 * cdef Precomputation pre * * if self.precompute_file is not None: # <<<<<<<<<<<<<< @@ -41073,7 +40946,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py __pyx_t_1 = (__pyx_v_self->precompute_file != Py_None); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":475 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":475 * * if self.precompute_file is not None: * start_time = monitor_cpu() # <<<<<<<<<<<<<< @@ -41088,7 +40961,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py __pyx_v_start_time = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":476 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -41114,7 +40987,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":477 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -41130,7 +41003,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py __pyx_v_pre = ((struct __pyx_obj_3_sa_Precomputation *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":479 + /* "/home/paulb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -41140,7 +41013,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py __pyx_t_1 = (__pyx_v_pre->max_nonterminals != __pyx_v_self->max_nonterminals); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":480 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -41176,7 +41049,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py } __pyx_L4:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":481 + /* "/home/paulb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -41186,7 +41059,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py __pyx_t_1 = (__pyx_v_pre->max_length != __pyx_v_self->max_length); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":482 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -41222,7 +41095,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py } __pyx_L5:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":483 + /* "/home/paulb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -41232,7 +41105,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py __pyx_t_1 = (__pyx_v_pre->train_max_initial_size != __pyx_v_self->train_max_initial_size); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":484 + /* "/home/paulb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -41269,7 +41142,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py } __pyx_L6:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":485 + /* "/home/paulb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -41279,7 +41152,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py __pyx_t_1 = (__pyx_v_pre->train_min_gap_size != __pyx_v_self->train_min_gap_size); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":486 + /* "/home/paulb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -41316,7 +41189,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py } __pyx_L7:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":487 + /* "/home/paulb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -41325,7 +41198,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py */ if (__pyx_v_self->use_index) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":488 + /* "/home/paulb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -41357,59 +41230,117 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":489 + /* "/home/paulb/workspace/cdec/python/src/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(): # <<<<<<<<<<<<<< * phrases = self.pattern2phrase_plus(pattern) * for phrase in phrases: */ - __pyx_t_6 = 0; - if (unlikely(__pyx_v_pre->precomputed_index == Py_None)) { - PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_3 = __Pyx_dict_iterator(__pyx_v_pre->precomputed_index, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_7), (&__pyx_t_8)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_v_pre->precomputed_index, __pyx_n_s__iteritems); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __pyx_t_5 = __pyx_t_3; - __pyx_t_3 = 0; - while (1) { - __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_5, __pyx_t_7, &__pyx_t_6, &__pyx_t_3, &__pyx_t_4, NULL, __pyx_t_8); - if (unlikely(__pyx_t_9 == 0)) break; - if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) { + __pyx_t_5 = __pyx_t_3; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + } else { + __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + for (;;) { + if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_5)) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break; + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; + } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_5)) { + if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break; + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; + } else { + __pyx_t_3 = __pyx_t_7(__pyx_t_5); + if (unlikely(!__pyx_t_3)) { + if (PyErr_Occurred()) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_3); + } + if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { + PyObject* sequence = __pyx_t_3; + if (likely(PyTuple_CheckExact(sequence))) { + if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { + if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); + else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + } else { + if (unlikely(PyList_GET_SIZE(sequence) != 2)) { + if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); + else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = PyList_GET_ITEM(sequence, 0); + __pyx_t_2 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext; + index = 0; __pyx_t_4 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_4)) goto __pyx_L11_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + index = 1; __pyx_t_2 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L11_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L12_unpacking_done; + __pyx_L11_unpacking_failed:; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); + if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L12_unpacking_done:; + } __Pyx_XDECREF(__pyx_v_pattern); - __pyx_v_pattern = __pyx_t_3; - __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_v_arr); - __pyx_v_arr = __pyx_t_4; + __pyx_v_pattern = __pyx_t_4; __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_v_arr); + __pyx_v_arr = __pyx_t_2; + __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":490 + /* "/home/paulb/workspace/cdec/python/src/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_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__pattern2phrase_plus); 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_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__pattern2phrase_plus); 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_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_pattern); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_pattern); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_pattern); __Pyx_GIVEREF(__pyx_v_pattern); - __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 490; __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_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); 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_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_v_phrases); - __pyx_v_phrases = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_v_phrases = __pyx_t_4; + __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":491 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":491 * for pattern, arr in pre.precomputed_index.iteritems(): * phrases = self.pattern2phrase_plus(pattern) * for phrase in phrases: # <<<<<<<<<<<<<< @@ -41417,44 +41348,36 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py * if self.use_collocations: */ if (PyList_CheckExact(__pyx_v_phrases) || PyTuple_CheckExact(__pyx_v_phrases)) { - __pyx_t_2 = __pyx_v_phrases; __Pyx_INCREF(__pyx_t_2); __pyx_t_10 = 0; + __pyx_t_4 = __pyx_v_phrases; __Pyx_INCREF(__pyx_t_4); __pyx_t_10 = 0; __pyx_t_11 = NULL; } else { - __pyx_t_10 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_phrases); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_11 = Py_TYPE(__pyx_t_2)->tp_iternext; + __pyx_t_10 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_phrases); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_11 = Py_TYPE(__pyx_t_4)->tp_iternext; } for (;;) { - if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_2)) { - if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_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[8]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_2)) { - if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_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[8]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_4)) { + if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_4)) break; + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; + } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_4)) { + if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; } else { - __pyx_t_3 = __pyx_t_11(__pyx_t_2); - if (unlikely(!__pyx_t_3)) { + __pyx_t_2 = __pyx_t_11(__pyx_t_4); + if (unlikely(!__pyx_t_2)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } - __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_2); } __Pyx_XDECREF(__pyx_v_phrase); - __pyx_v_phrase = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_phrase = __pyx_t_2; + __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":492 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":492 * phrases = self.pattern2phrase_plus(pattern) * for phrase in phrases: * self.precomputed_index[phrase] = arr # <<<<<<<<<<<<<< @@ -41463,14 +41386,14 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py */ if (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_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L8; } __pyx_L8:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":493 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":493 * for phrase in phrases: * self.precomputed_index[phrase] = arr * if self.use_collocations: # <<<<<<<<<<<<<< @@ -41479,7 +41402,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py */ if (__pyx_v_self->use_collocations) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":494 + /* "/home/paulb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -41488,60 +41411,118 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py */ __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__info); 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_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __pyx_v_pre->precomputed_collocations; __Pyx_INCREF(__pyx_t_5); - __pyx_t_7 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 494; __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 = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_kp_s_114)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_114)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_114)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_114)); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 494; __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_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":495 + /* "/home/paulb/workspace/cdec/python/src/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(): # <<<<<<<<<<<<<< * phrase = self.pattern2phrase(pattern) * self.precomputed_collocations[phrase] = arr */ - __pyx_t_7 = 0; - if (unlikely(__pyx_v_pre->precomputed_collocations == Py_None)) { - PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_v_pre->precomputed_collocations, __pyx_n_s__iteritems); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + } else { + __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; } - __pyx_t_3 = __Pyx_dict_iterator(__pyx_v_pre->precomputed_collocations, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_6), (&__pyx_t_8)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __pyx_t_5 = __pyx_t_3; - __pyx_t_3 = 0; - while (1) { - __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_5, __pyx_t_6, &__pyx_t_7, &__pyx_t_3, &__pyx_t_2, NULL, __pyx_t_8); - if (unlikely(__pyx_t_9 == 0)) break; - if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_5)) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break; + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; + } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_5)) { + if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break; + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; + } else { + __pyx_t_2 = __pyx_t_7(__pyx_t_5); + if (unlikely(!__pyx_t_2)) { + if (PyErr_Occurred()) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + if (likely(PyTuple_CheckExact(sequence))) { + if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { + if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); + else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + if (unlikely(PyList_GET_SIZE(sequence) != 2)) { + if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); + else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext; + index = 0; __pyx_t_4 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_4)) goto __pyx_L18_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L18_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L19_unpacking_done; + __pyx_L18_unpacking_failed:; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); + if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L19_unpacking_done:; + } __Pyx_XDECREF(__pyx_v_pattern); - __pyx_v_pattern = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_pattern = __pyx_t_4; + __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_v_arr); - __pyx_v_arr = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_v_arr = __pyx_t_3; + __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":496 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -41563,7 +41544,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py __pyx_v_phrase = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":497 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":497 * for pattern, arr in pre.precomputed_collocations.iteritems(): * phrase = self.pattern2phrase(pattern) * self.precomputed_collocations[phrase] = arr # <<<<<<<<<<<<<< @@ -41573,11 +41554,11 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py if (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_5); __pyx_t_5 = 0; - goto __pyx_L13; + goto __pyx_L15; } - __pyx_L13:; + __pyx_L15:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":498 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":498 * phrase = self.pattern2phrase(pattern) * self.precomputed_collocations[phrase] = arr * stop_time = monitor_cpu() # <<<<<<<<<<<<<< @@ -41592,7 +41573,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py __pyx_v_stop_time = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":499 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":499 * self.precomputed_collocations[phrase] = arr * stop_time = monitor_cpu() * logger.info("Processing precomputations took %f seconds", stop_time - start_time) # <<<<<<<<<<<<<< @@ -41630,6 +41611,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.precompute", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -41656,7 +41638,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_11get_precomputed_collo return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":502 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":502 * * * def get_precomputed_collocation(self, phrase): # <<<<<<<<<<<<<< @@ -41678,17 +41660,17 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_10get_precomputed_collo int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_precomputed_collocation", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":503 + /* "/home/paulb/workspace/cdec/python/src/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 = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PySequence_Contains(__pyx_v_self->precomputed_collocations, __pyx_v_phrase))); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":504 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":504 * def get_precomputed_collocation(self, phrase): * if phrase in self.precomputed_collocations: * arr = self.precomputed_collocations[phrase] # <<<<<<<<<<<<<< @@ -41700,7 +41682,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_10get_precomputed_collo __pyx_v_arr = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":505 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -41737,7 +41719,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_10get_precomputed_collo } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":506 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -41764,7 +41746,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_10get_precomputed_collo return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":509 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":509 * * * cdef int* baeza_yates_helper(self, int low1, int high1, int* arr1, int step1, # <<<<<<<<<<<<<< @@ -41810,7 +41792,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("baeza_yates_helper", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":522 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":522 * cdef Matching loc1, loc2 * * result = malloc(0*sizeof(int*)) # <<<<<<<<<<<<<< @@ -41819,7 +41801,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_result = ((int *)malloc((0 * (sizeof(int *))))); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":524 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":524 * result = malloc(0*sizeof(int*)) * * d_first = 0 # <<<<<<<<<<<<<< @@ -41828,7 +41810,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_d_first = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":525 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":525 * * d_first = 0 * if high1 - low1 > high2 - low2: # <<<<<<<<<<<<<< @@ -41838,7 +41820,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p __pyx_t_1 = ((__pyx_v_high1 - __pyx_v_low1) > (__pyx_v_high2 - __pyx_v_low2)); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":526 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":526 * d_first = 0 * if high1 - low1 > high2 - low2: * d_first = 1 # <<<<<<<<<<<<<< @@ -41850,7 +41832,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":530 + /* "/home/paulb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -41866,7 +41848,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p } if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":531 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":531 * # Case 1: one of the sets is empty * if low1 >= high1 or low2 >= high2: * return result # <<<<<<<<<<<<<< @@ -41879,7 +41861,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p } __pyx_L4:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":534 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":534 * * # Case 2: sets are non-overlapping * assign_matching(&loc1, arr1, high1-step1, step1, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -41888,7 +41870,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_f_3_sa_assign_matching((&__pyx_v_loc1), __pyx_v_arr1, (__pyx_v_high1 - __pyx_v_step1), __pyx_v_step1, __pyx_v_self->fda->sent_id->arr); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":535 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -41897,7 +41879,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_f_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_low2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":536 + /* "/home/paulb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -41907,7 +41889,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p __pyx_t_3 = (((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last) == -1); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":537 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -41920,7 +41902,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p } __pyx_L5:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":539 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":539 * return result * * assign_matching(&loc1, arr1, low1, step1, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -41929,7 +41911,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_f_3_sa_assign_matching((&__pyx_v_loc1), __pyx_v_arr1, __pyx_v_low1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":540 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -41938,7 +41920,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_f_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, (__pyx_v_high2 - __pyx_v_step2), __pyx_v_step2, __pyx_v_self->fda->sent_id->arr); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":541 + /* "/home/paulb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -41948,7 +41930,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p __pyx_t_3 = (((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last) == 1); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":542 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -41961,7 +41943,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p } __pyx_L6:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":546 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -41979,7 +41961,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p } __pyx_v_qsetsize = __Pyx_div_int(__pyx_t_4, __pyx_v_step1); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":547 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":547 * # We use mergesort instead in this case * qsetsize = (high1-low1) / step1 * dsetsize = (high2-low2) / step2 # <<<<<<<<<<<<<< @@ -41997,7 +41979,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p } __pyx_v_dsetsize = __Pyx_div_int(__pyx_t_4, __pyx_v_step2); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":548 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":548 * qsetsize = (high1-low1) / step1 * dsetsize = (high2-low2) / step2 * if d_first: # <<<<<<<<<<<<<< @@ -42006,7 +41988,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ if (__pyx_v_d_first) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":549 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":549 * dsetsize = (high2-low2) / step2 * if d_first: * tmp = qsetsize # <<<<<<<<<<<<<< @@ -42015,7 +41997,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_tmp = __pyx_v_qsetsize; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":550 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":550 * if d_first: * tmp = qsetsize * qsetsize = dsetsize # <<<<<<<<<<<<<< @@ -42024,7 +42006,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_qsetsize = __pyx_v_dsetsize; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":551 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":551 * tmp = qsetsize * qsetsize = dsetsize * dsetsize = tmp # <<<<<<<<<<<<<< @@ -42036,7 +42018,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p } __pyx_L7:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":553 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":553 * dsetsize = tmp * * if self.by_slack_factor * qsetsize * log(dsetsize) / log(2) > dsetsize: # <<<<<<<<<<<<<< @@ -42052,7 +42034,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p __pyx_t_3 = ((__pyx_t_5 / __pyx_t_6) > __pyx_v_dsetsize); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":554 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":554 * * if self.by_slack_factor * qsetsize * log(dsetsize) / log(2) > dsetsize: * free(result) # <<<<<<<<<<<<<< @@ -42061,7 +42043,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ free(__pyx_v_result); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":555 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -42074,7 +42056,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p } __pyx_L8:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":559 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":559 * # binary search. There are two flavors, depending on * # whether the queryset or dataset is first * if d_first: # <<<<<<<<<<<<<< @@ -42083,7 +42065,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ if (__pyx_v_d_first) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":560 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":560 * # whether the queryset or dataset is first * if d_first: * med2 = median(low2, high2, step2) # <<<<<<<<<<<<<< @@ -42092,7 +42074,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_med2 = __pyx_f_3_sa_median(__pyx_v_low2, __pyx_v_high2, __pyx_v_step2); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":561 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":561 * if d_first: * med2 = median(low2, high2, step2) * assign_matching(&loc2, arr2, med2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -42101,7 +42083,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_f_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_med2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":563 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":563 * assign_matching(&loc2, arr2, med2, step2, self.fda.sent_id.arr) * * search_low = low1 # <<<<<<<<<<<<<< @@ -42110,7 +42092,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_search_low = __pyx_v_low1; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":564 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":564 * * search_low = low1 * search_high = high1 # <<<<<<<<<<<<<< @@ -42119,7 +42101,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_search_high = __pyx_v_high1; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":565 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":565 * search_low = low1 * search_high = high1 * while search_low < search_high: # <<<<<<<<<<<<<< @@ -42130,7 +42112,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p __pyx_t_3 = (__pyx_v_search_low < __pyx_v_search_high); if (!__pyx_t_3) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":566 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":566 * search_high = high1 * while search_low < search_high: * med1 = median(search_low, search_high, step1) # <<<<<<<<<<<<<< @@ -42139,7 +42121,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_med1 = __pyx_f_3_sa_median(__pyx_v_search_low, __pyx_v_search_high, __pyx_v_step1); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":567 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -42148,7 +42130,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_f_3_sa_find_comparable_matchings(__pyx_v_low1, __pyx_v_high1, __pyx_v_arr1, __pyx_v_step1, __pyx_v_med1, (&__pyx_v_med1_minus), (&__pyx_v_med1_plus)); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":568 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -42157,7 +42139,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_comparison = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings_set(__pyx_v_self, __pyx_v_med1_minus, __pyx_v_med1_plus, __pyx_v_arr1, __pyx_v_step1, (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":571 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":571 * if comparison == -1: * search_low = med1_plus * elif comparison == 1: # <<<<<<<<<<<<<< @@ -42166,7 +42148,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ switch (__pyx_v_comparison) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":569 + /* "/home/paulb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -42175,7 +42157,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ case -1: - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":570 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -42185,7 +42167,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p __pyx_v_search_low = __pyx_v_med1_plus; break; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":571 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":571 * if comparison == -1: * search_low = med1_plus * elif comparison == 1: # <<<<<<<<<<<<<< @@ -42194,7 +42176,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ case 1: - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":572 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":572 * search_low = med1_plus * elif comparison == 1: * search_high = med1_minus # <<<<<<<<<<<<<< @@ -42205,7 +42187,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p break; default: - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":574 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":574 * search_high = med1_minus * else: * break # <<<<<<<<<<<<<< @@ -42221,7 +42203,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":576 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":576 * break * else: * med1 = median(low1, high1, step1) # <<<<<<<<<<<<<< @@ -42230,7 +42212,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_med1 = __pyx_f_3_sa_median(__pyx_v_low1, __pyx_v_high1, __pyx_v_step1); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":577 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":577 * else: * med1 = median(low1, high1, step1) * find_comparable_matchings(low1, high1, arr1, step1, med1, &med1_minus, &med1_plus) # <<<<<<<<<<<<<< @@ -42239,7 +42221,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_f_3_sa_find_comparable_matchings(__pyx_v_low1, __pyx_v_high1, __pyx_v_arr1, __pyx_v_step1, __pyx_v_med1, (&__pyx_v_med1_minus), (&__pyx_v_med1_plus)); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":579 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":579 * find_comparable_matchings(low1, high1, arr1, step1, med1, &med1_minus, &med1_plus) * * search_low = low2 # <<<<<<<<<<<<<< @@ -42248,7 +42230,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_search_low = __pyx_v_low2; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":580 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":580 * * search_low = low2 * search_high = high2 # <<<<<<<<<<<<<< @@ -42257,7 +42239,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_search_high = __pyx_v_high2; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":581 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":581 * search_low = low2 * search_high = high2 * while search_low < search_high: # <<<<<<<<<<<<<< @@ -42268,7 +42250,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p __pyx_t_3 = (__pyx_v_search_low < __pyx_v_search_high); if (!__pyx_t_3) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":582 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":582 * search_high = high2 * while search_low < search_high: * med2 = median(search_low, search_high, step2) # <<<<<<<<<<<<<< @@ -42277,7 +42259,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_med2 = __pyx_f_3_sa_median(__pyx_v_search_low, __pyx_v_search_high, __pyx_v_step2); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":583 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -42286,7 +42268,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_f_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_med2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":584 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -42295,7 +42277,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_comparison = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings_set(__pyx_v_self, __pyx_v_med1_minus, __pyx_v_med1_plus, __pyx_v_arr1, __pyx_v_step1, (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":587 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":587 * if comparison == -1: * search_high = med2 * elif comparison == 1: # <<<<<<<<<<<<<< @@ -42304,7 +42286,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ switch (__pyx_v_comparison) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":585 + /* "/home/paulb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -42313,7 +42295,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ case -1: - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":586 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -42323,7 +42305,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p __pyx_v_search_high = __pyx_v_med2; break; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":587 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":587 * if comparison == -1: * search_high = med2 * elif comparison == 1: # <<<<<<<<<<<<<< @@ -42332,7 +42314,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ case 1: - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":588 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":588 * search_high = med2 * elif comparison == 1: * search_low = med2 + step2 # <<<<<<<<<<<<<< @@ -42343,7 +42325,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p break; default: - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":590 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":590 * search_low = med2 + step2 * else: * break # <<<<<<<<<<<<<< @@ -42358,7 +42340,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p } __pyx_L9:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":592 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":592 * break * * med_result_len = 0 # <<<<<<<<<<<<<< @@ -42367,7 +42349,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_med_result_len = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":593 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":593 * * med_result_len = 0 * med_result = malloc(0*sizeof(int*)) # <<<<<<<<<<<<<< @@ -42376,7 +42358,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_med_result = ((int *)malloc((0 * (sizeof(int *))))); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":594 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":594 * med_result_len = 0 * med_result = malloc(0*sizeof(int*)) * if search_high > search_low: # <<<<<<<<<<<<<< @@ -42386,7 +42368,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p __pyx_t_3 = (__pyx_v_search_high > __pyx_v_search_low); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":600 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -42395,7 +42377,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_med2_minus = __pyx_v_med2; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":601 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":601 * # subsequently throw all of them away. * med2_minus = med2 * med2_plus = med2 + step2 # <<<<<<<<<<<<<< @@ -42404,7 +42386,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_med2_plus = (__pyx_v_med2 + __pyx_v_step2); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":602 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":602 * med2_minus = med2 * med2_plus = med2 + step2 * i1 = med1_minus # <<<<<<<<<<<<<< @@ -42413,7 +42395,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_i1 = __pyx_v_med1_minus; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":603 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":603 * med2_plus = med2 + step2 * i1 = med1_minus * while i1 < med1_plus: # <<<<<<<<<<<<<< @@ -42424,7 +42406,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p __pyx_t_3 = (__pyx_v_i1 < __pyx_v_med1_plus); if (!__pyx_t_3) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":604 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":604 * i1 = med1_minus * while i1 < med1_plus: * assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -42433,7 +42415,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_f_3_sa_assign_matching((&__pyx_v_loc1), __pyx_v_arr1, __pyx_v_i1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":605 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":605 * while i1 < med1_plus: * assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr) * while med2_minus-step2 >= low2: # <<<<<<<<<<<<<< @@ -42444,7 +42426,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p __pyx_t_3 = ((__pyx_v_med2_minus - __pyx_v_step2) >= __pyx_v_low2); if (!__pyx_t_3) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":606 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -42453,7 +42435,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_f_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, (__pyx_v_med2_minus - __pyx_v_step2), __pyx_v_step2, __pyx_v_self->fda->sent_id->arr); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":607 + /* "/home/paulb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -42463,7 +42445,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p __pyx_t_3 = (((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last) < 1); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":608 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -42475,7 +42457,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":610 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":610 * med2_minus = med2_minus - step2 * else: * break # <<<<<<<<<<<<<< @@ -42488,7 +42470,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p } __pyx_L18_break:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":611 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":611 * else: * break * i2 = med2_minus # <<<<<<<<<<<<<< @@ -42497,7 +42479,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_i2 = __pyx_v_med2_minus; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":612 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":612 * break * i2 = med2_minus * while i2 < high2: # <<<<<<<<<<<<<< @@ -42508,7 +42490,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p __pyx_t_3 = (__pyx_v_i2 < __pyx_v_high2); if (!__pyx_t_3) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":613 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":613 * i2 = med2_minus * while i2 < high2: * assign_matching(&loc2, arr2, i2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -42517,7 +42499,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_f_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_i2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":614 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -42526,7 +42508,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_comparison = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":615 + /* "/home/paulb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -42536,7 +42518,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p __pyx_t_3 = (__pyx_v_comparison == 0); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":617 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -42548,7 +42530,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p } __pyx_L22:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":618 + /* "/home/paulb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -42558,7 +42540,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p __pyx_t_3 = (__pyx_v_comparison == -1); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":619 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -42570,7 +42552,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p } __pyx_L23:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":620 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":620 * if comparison == -1: * break * i2 = i2 + step2 # <<<<<<<<<<<<<< @@ -42581,7 +42563,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p } __pyx_L21_break:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":621 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":621 * break * i2 = i2 + step2 * if i2 > med2_plus: # <<<<<<<<<<<<<< @@ -42591,7 +42573,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p __pyx_t_3 = (__pyx_v_i2 > __pyx_v_med2_plus); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":622 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":622 * i2 = i2 + step2 * if i2 > med2_plus: * med2_plus = i2 # <<<<<<<<<<<<<< @@ -42603,7 +42585,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p } __pyx_L24:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":623 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":623 * if i2 > med2_plus: * med2_plus = i2 * i1 = i1 + step1 # <<<<<<<<<<<<<< @@ -42613,7 +42595,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p __pyx_v_i1 = (__pyx_v_i1 + __pyx_v_step1); } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":625 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":625 * i1 = i1 + step1 * * tmp = med1_minus # <<<<<<<<<<<<<< @@ -42622,7 +42604,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_tmp = __pyx_v_med1_minus; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":626 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":626 * * tmp = med1_minus * med1_minus = med1_plus # <<<<<<<<<<<<<< @@ -42631,7 +42613,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_med1_minus = __pyx_v_med1_plus; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":627 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":627 * tmp = med1_minus * med1_minus = med1_plus * med1_plus = tmp # <<<<<<<<<<<<<< @@ -42643,7 +42625,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":630 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":630 * else: * # No match; need to figure out the point of division in D and Q * med2_minus = med2 # <<<<<<<<<<<<<< @@ -42652,7 +42634,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_med2_minus = __pyx_v_med2; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":631 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":631 * # No match; need to figure out the point of division in D and Q * med2_minus = med2 * med2_plus = med2 # <<<<<<<<<<<<<< @@ -42661,7 +42643,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_med2_plus = __pyx_v_med2; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":632 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":632 * med2_minus = med2 * med2_plus = med2 * if d_first: # <<<<<<<<<<<<<< @@ -42670,7 +42652,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ if (__pyx_v_d_first) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":633 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":633 * med2_plus = med2 * if d_first: * med2_minus = med2_minus + step2 # <<<<<<<<<<<<<< @@ -42679,7 +42661,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_med2_minus = (__pyx_v_med2_minus + __pyx_v_step2); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":634 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":634 * if d_first: * med2_minus = med2_minus + step2 * if comparison == -1: # <<<<<<<<<<<<<< @@ -42689,7 +42671,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p __pyx_t_3 = (__pyx_v_comparison == -1); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":635 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":635 * med2_minus = med2_minus + step2 * if comparison == -1: * med1_minus = med1_plus # <<<<<<<<<<<<<< @@ -42701,7 +42683,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p } __pyx_L26:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":636 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":636 * if comparison == -1: * med1_minus = med1_plus * if comparison == 1: # <<<<<<<<<<<<<< @@ -42711,7 +42693,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p __pyx_t_3 = (__pyx_v_comparison == 1); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":637 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":637 * med1_minus = med1_plus * if comparison == 1: * med1_plus = med1_minus # <<<<<<<<<<<<<< @@ -42726,7 +42708,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":639 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":639 * med1_plus = med1_minus * else: * tmp = med1_minus # <<<<<<<<<<<<<< @@ -42735,7 +42717,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_tmp = __pyx_v_med1_minus; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":640 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":640 * else: * tmp = med1_minus * med1_minus = med1_plus # <<<<<<<<<<<<<< @@ -42744,7 +42726,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_med1_minus = __pyx_v_med1_plus; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":641 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":641 * tmp = med1_minus * med1_minus = med1_plus * med1_plus = tmp # <<<<<<<<<<<<<< @@ -42753,7 +42735,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_med1_plus = __pyx_v_tmp; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":642 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":642 * med1_minus = med1_plus * med1_plus = tmp * if comparison == 1: # <<<<<<<<<<<<<< @@ -42763,7 +42745,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p __pyx_t_3 = (__pyx_v_comparison == 1); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":643 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":643 * med1_plus = tmp * if comparison == 1: * med2_minus = med2_minus + step2 # <<<<<<<<<<<<<< @@ -42772,7 +42754,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_med2_minus = (__pyx_v_med2_minus + __pyx_v_step2); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":644 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":644 * if comparison == 1: * med2_minus = med2_minus + step2 * med2_plus = med2_plus + step2 # <<<<<<<<<<<<<< @@ -42788,7 +42770,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p } __pyx_L14:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":646 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":646 * med2_plus = med2_plus + step2 * * low_result_len = 0 # <<<<<<<<<<<<<< @@ -42797,7 +42779,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_low_result_len = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":647 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -42806,7 +42788,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_low_result = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->baeza_yates_helper(__pyx_v_self, __pyx_v_low1, __pyx_v_med1_plus, __pyx_v_arr1, __pyx_v_step1, __pyx_v_low2, __pyx_v_med2_plus, __pyx_v_arr2, __pyx_v_step2, __pyx_v_offset_by_one, __pyx_v_len_last, __pyx_v_num_subpatterns, (&__pyx_v_low_result_len)); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":648 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -42815,7 +42797,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_high_result_len = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":649 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -42824,7 +42806,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_high_result = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->baeza_yates_helper(__pyx_v_self, __pyx_v_med1_minus, __pyx_v_high1, __pyx_v_arr1, __pyx_v_step1, __pyx_v_med2_minus, __pyx_v_high2, __pyx_v_arr2, __pyx_v_step2, __pyx_v_offset_by_one, __pyx_v_len_last, __pyx_v_num_subpatterns, (&__pyx_v_high_result_len)); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":651 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -42833,7 +42815,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_result = __pyx_f_3_sa_extend_arr(__pyx_v_result, __pyx_v_result_len, __pyx_v_low_result, __pyx_v_low_result_len); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":652 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -42842,7 +42824,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_result = __pyx_f_3_sa_extend_arr(__pyx_v_result, __pyx_v_result_len, __pyx_v_med_result, __pyx_v_med_result_len); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":653 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -42851,7 +42833,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_result = __pyx_f_3_sa_extend_arr(__pyx_v_result, __pyx_v_result_len, __pyx_v_high_result, __pyx_v_high_result_len); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":654 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -42860,7 +42842,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ free(__pyx_v_low_result); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":655 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":655 * result = extend_arr(result, result_len, high_result, high_result_len) * free(low_result) * free(med_result) # <<<<<<<<<<<<<< @@ -42869,7 +42851,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ free(__pyx_v_med_result); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":656 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":656 * free(low_result) * free(med_result) * free(high_result) # <<<<<<<<<<<<<< @@ -42878,7 +42860,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ free(__pyx_v_high_result); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":658 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":658 * free(high_result) * * return result # <<<<<<<<<<<<<< @@ -42898,7 +42880,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":662 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":662 * * * cdef long compare_matchings_set(self, int i1_minus, int i1_plus, int* arr1, int step1, # <<<<<<<<<<<<<< @@ -42917,7 +42899,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct int __pyx_t_1; __Pyx_RefNannySetupContext("compare_matchings_set", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":673 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":673 * cdef Matching* loc1 * * loc1 = &l1_stack # <<<<<<<<<<<<<< @@ -42926,7 +42908,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct */ __pyx_v_loc1 = (&__pyx_v_l1_stack); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":675 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":675 * loc1 = &l1_stack * * i1 = i1_minus # <<<<<<<<<<<<<< @@ -42935,7 +42917,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct */ __pyx_v_i1 = __pyx_v_i1_minus; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":676 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":676 * * i1 = i1_minus * while i1 < i1_plus: # <<<<<<<<<<<<<< @@ -42946,7 +42928,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct __pyx_t_1 = (__pyx_v_i1 < __pyx_v_i1_plus); if (!__pyx_t_1) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":677 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":677 * i1 = i1_minus * while i1 < i1_plus: * assign_matching(loc1, arr1, i1, step1, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -42955,7 +42937,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct */ __pyx_f_3_sa_assign_matching(__pyx_v_loc1, __pyx_v_arr1, __pyx_v_i1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":678 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -42964,7 +42946,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct */ __pyx_v_comparison = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, __pyx_v_loc1, __pyx_v_loc2, __pyx_v_offset_by_one, __pyx_v_len_last); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":679 + /* "/home/paulb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -42974,7 +42956,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct __pyx_t_1 = (__pyx_v_comparison == 0); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":680 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":680 * comparison = self.compare_matchings(loc1, loc2, offset_by_one, len_last) * if comparison == 0: * prev_comparison = 0 # <<<<<<<<<<<<<< @@ -42983,7 +42965,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct */ __pyx_v_prev_comparison = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":681 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":681 * if comparison == 0: * prev_comparison = 0 * break # <<<<<<<<<<<<<< @@ -42994,7 +42976,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct goto __pyx_L5; } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":682 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":682 * prev_comparison = 0 * break * elif i1 == i1_minus: # <<<<<<<<<<<<<< @@ -43004,7 +42986,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct __pyx_t_1 = (__pyx_v_i1 == __pyx_v_i1_minus); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":683 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":683 * break * elif i1 == i1_minus: * prev_comparison = comparison # <<<<<<<<<<<<<< @@ -43016,7 +42998,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":685 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":685 * prev_comparison = comparison * else: * if comparison != prev_comparison: # <<<<<<<<<<<<<< @@ -43026,7 +43008,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct __pyx_t_1 = (__pyx_v_comparison != __pyx_v_prev_comparison); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":686 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":686 * else: * if comparison != prev_comparison: * prev_comparison = 0 # <<<<<<<<<<<<<< @@ -43035,7 +43017,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct */ __pyx_v_prev_comparison = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":687 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":687 * if comparison != prev_comparison: * prev_comparison = 0 * break # <<<<<<<<<<<<<< @@ -43049,7 +43031,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct } __pyx_L5:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":688 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":688 * prev_comparison = 0 * break * i1 = i1 + step1 # <<<<<<<<<<<<<< @@ -43060,7 +43042,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct } __pyx_L4_break:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":689 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":689 * break * i1 = i1 + step1 * return prev_comparison # <<<<<<<<<<<<<< @@ -43076,7 +43058,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":692 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":692 * * * cdef long compare_matchings(self, Matching* loc1, Matching* loc2, int offset_by_one, int len_last): # <<<<<<<<<<<<<< @@ -43094,7 +43076,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py int __pyx_t_4; __Pyx_RefNannySetupContext("compare_matchings", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":695 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":695 * cdef int i * * if loc1.sent_id > loc2.sent_id: # <<<<<<<<<<<<<< @@ -43104,7 +43086,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py __pyx_t_1 = (__pyx_v_loc1->sent_id > __pyx_v_loc2->sent_id); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":696 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":696 * * if loc1.sent_id > loc2.sent_id: * return 1 # <<<<<<<<<<<<<< @@ -43117,7 +43099,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":697 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":697 * if loc1.sent_id > loc2.sent_id: * return 1 * if loc2.sent_id > loc1.sent_id: # <<<<<<<<<<<<<< @@ -43127,7 +43109,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py __pyx_t_1 = (__pyx_v_loc2->sent_id > __pyx_v_loc1->sent_id); if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":698 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":698 * return 1 * if loc2.sent_id > loc1.sent_id: * return -1 # <<<<<<<<<<<<<< @@ -43140,7 +43122,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py } __pyx_L4:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":700 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":700 * return -1 * * if loc1.size == 1 and loc2.size == 1: # <<<<<<<<<<<<<< @@ -43156,7 +43138,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py } if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":701 + /* "/home/paulb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -43166,7 +43148,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py __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); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":702 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -43181,7 +43163,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py goto __pyx_L5; } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":704 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":704 * return 1 * * elif offset_by_one: # <<<<<<<<<<<<<< @@ -43190,7 +43172,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py */ if (__pyx_v_offset_by_one) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":705 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":705 * * elif offset_by_one: * for i from 1 <= i < loc1.size: # <<<<<<<<<<<<<< @@ -43200,7 +43182,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py __pyx_t_4 = __pyx_v_loc1->size; for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":706 + /* "/home/paulb/workspace/cdec/python/src/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]: # <<<<<<<<<<<<<< @@ -43210,7 +43192,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py __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)])); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":707 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -43223,7 +43205,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py } __pyx_L9:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":708 + /* "/home/paulb/workspace/cdec/python/src/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]: # <<<<<<<<<<<<<< @@ -43233,7 +43215,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py __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)])); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":709 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":709 * return 1 * if loc1.arr[loc1.start+i] < loc2.arr[loc2.start+i-1]: * return -1 # <<<<<<<<<<<<<< @@ -43250,7 +43232,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":712 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":712 * * else: * if loc1.arr[loc1.start]+1 > loc2.arr[loc2.start]: # <<<<<<<<<<<<<< @@ -43260,7 +43242,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py __pyx_t_3 = (((__pyx_v_loc1->arr[__pyx_v_loc1->start]) + 1) > (__pyx_v_loc2->arr[__pyx_v_loc2->start])); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":713 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":713 * else: * if loc1.arr[loc1.start]+1 > loc2.arr[loc2.start]: * return 1 # <<<<<<<<<<<<<< @@ -43273,7 +43255,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py } __pyx_L11:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":714 + /* "/home/paulb/workspace/cdec/python/src/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]: # <<<<<<<<<<<<<< @@ -43283,7 +43265,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py __pyx_t_3 = (((__pyx_v_loc1->arr[__pyx_v_loc1->start]) + 1) < (__pyx_v_loc2->arr[__pyx_v_loc2->start])); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":715 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":715 * return 1 * if loc1.arr[loc1.start]+1 < loc2.arr[loc2.start]: * return -1 # <<<<<<<<<<<<<< @@ -43296,7 +43278,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py } __pyx_L12:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":717 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":717 * return -1 * * for i from 1 <= i < loc1.size: # <<<<<<<<<<<<<< @@ -43306,7 +43288,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py __pyx_t_4 = __pyx_v_loc1->size; for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":718 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":718 * * for i from 1 <= i < loc1.size: * if loc1.arr[loc1.start+i] > loc2.arr[loc2.start+i]: # <<<<<<<<<<<<<< @@ -43316,7 +43298,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py __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)])); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":719 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":719 * for i from 1 <= i < loc1.size: * if loc1.arr[loc1.start+i] > loc2.arr[loc2.start+i]: * return 1 # <<<<<<<<<<<<<< @@ -43329,7 +43311,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py } __pyx_L15:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":720 + /* "/home/paulb/workspace/cdec/python/src/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]: # <<<<<<<<<<<<<< @@ -43339,7 +43321,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py __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)])); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":721 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":721 * return 1 * if loc1.arr[loc1.start+i] < loc2.arr[loc2.start+i]: * return -1 # <<<<<<<<<<<<<< @@ -43355,7 +43337,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py } __pyx_L5:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":723 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":723 * return -1 * * if loc2.arr[loc2.end-1] + len_last - loc1.arr[loc1.start] > self.train_max_initial_size: # <<<<<<<<<<<<<< @@ -43365,7 +43347,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py __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); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":724 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":724 * * if loc2.arr[loc2.end-1] + len_last - loc1.arr[loc1.start] > self.train_max_initial_size: * return -1 # <<<<<<<<<<<<<< @@ -43378,7 +43360,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py } __pyx_L17:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":725 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -43394,7 +43376,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":728 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":728 * * * cdef int* merge_helper(self, int low1, int high1, int* arr1, int step1, # <<<<<<<<<<<<<< @@ -43418,7 +43400,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj int __pyx_t_3; __Pyx_RefNannySetupContext("merge_helper", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":736 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":736 * cdef Matching loc1, loc2 * * result_len[0] = 0 # <<<<<<<<<<<<<< @@ -43427,7 +43409,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj */ (__pyx_v_result_len[0]) = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":737 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":737 * * result_len[0] = 0 * result = malloc(0*sizeof(int)) # <<<<<<<<<<<<<< @@ -43436,7 +43418,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj */ __pyx_v_result = ((int *)malloc((0 * (sizeof(int))))); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":739 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":739 * result = malloc(0*sizeof(int)) * * i1 = low1 # <<<<<<<<<<<<<< @@ -43445,7 +43427,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj */ __pyx_v_i1 = __pyx_v_low1; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":740 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":740 * * i1 = low1 * i2 = low2 # <<<<<<<<<<<<<< @@ -43454,7 +43436,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj */ __pyx_v_i2 = __pyx_v_low2; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":741 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":741 * i1 = low1 * i2 = low2 * while i1 < high1 and i2 < high2: # <<<<<<<<<<<<<< @@ -43471,7 +43453,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj } if (!__pyx_t_3) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":744 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":744 * * # First, pop all unneeded loc2's off the stack * assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -43480,7 +43462,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj */ __pyx_f_3_sa_assign_matching((&__pyx_v_loc1), __pyx_v_arr1, __pyx_v_i1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":745 + /* "/home/paulb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -43491,7 +43473,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj __pyx_t_3 = (__pyx_v_i2 < __pyx_v_high2); if (!__pyx_t_3) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":746 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -43500,7 +43482,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj */ __pyx_f_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_i2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":747 + /* "/home/paulb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -43510,7 +43492,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj __pyx_t_3 = (((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last) == 1); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":748 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -43522,7 +43504,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":750 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":750 * i2 = i2 + step2 * else: * break # <<<<<<<<<<<<<< @@ -43535,7 +43517,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj } __pyx_L6_break:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":753 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":753 * * # Next: process all loc1's with the same starting val * j1 = i1 # <<<<<<<<<<<<<< @@ -43544,7 +43526,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj */ __pyx_v_j1 = __pyx_v_i1; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":754 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":754 * # Next: process all loc1's with the same starting val * j1 = i1 * while i1 < high1 and arr1[j1] == arr1[i1]: # <<<<<<<<<<<<<< @@ -43561,7 +43543,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj } if (!__pyx_t_2) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":755 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -43570,7 +43552,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj */ __pyx_f_3_sa_assign_matching((&__pyx_v_loc1), __pyx_v_arr1, __pyx_v_i1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":756 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -43579,7 +43561,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj */ __pyx_v_j2 = __pyx_v_i2; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":757 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":757 * assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr) * j2 = i2 * while j2 < high2: # <<<<<<<<<<<<<< @@ -43590,7 +43572,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj __pyx_t_2 = (__pyx_v_j2 < __pyx_v_high2); if (!__pyx_t_2) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":758 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":758 * j2 = i2 * while j2 < high2: * assign_matching(&loc2, arr2, j2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -43599,7 +43581,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj */ __pyx_f_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_j2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":759 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -43608,7 +43590,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj */ __pyx_v_comparison = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":760 + /* "/home/paulb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -43618,7 +43600,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj __pyx_t_2 = (__pyx_v_comparison == 0); if (__pyx_t_2) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":761 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -43630,7 +43612,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj } __pyx_L12:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":762 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":762 * if comparison == 0: * result = append_combined_matching(result, &loc1, &loc2, offset_by_one, num_subpatterns, result_len) * if comparison == 1: # <<<<<<<<<<<<<< @@ -43643,7 +43625,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj } __pyx_L13:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":764 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":764 * if comparison == 1: * pass * if comparison == -1: # <<<<<<<<<<<<<< @@ -43653,7 +43635,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj __pyx_t_2 = (__pyx_v_comparison == -1); if (__pyx_t_2) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":765 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":765 * pass * if comparison == -1: * break # <<<<<<<<<<<<<< @@ -43665,7 +43647,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":767 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":767 * break * else: * j2 = j2 + step2 # <<<<<<<<<<<<<< @@ -43678,7 +43660,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj } __pyx_L11_break:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":768 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":768 * else: * j2 = j2 + step2 * i1 = i1 + step1 # <<<<<<<<<<<<<< @@ -43689,7 +43671,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj } } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":769 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":769 * j2 = j2 + step2 * i1 = i1 + step1 * return result # <<<<<<<<<<<<<< @@ -43705,7 +43687,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":772 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":772 * * * cdef void sort_phrase_loc(self, IntList arr, PhraseLocation loc, Phrase phrase): # <<<<<<<<<<<<<< @@ -43727,17 +43709,17 @@ static void __pyx_f_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct __pyx_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sort_phrase_loc", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":777 + /* "/home/paulb/workspace/cdec/python/src/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 = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PySequence_Contains(__pyx_v_self->precomputed_index, ((PyObject *)__pyx_v_phrase)))); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":778 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":778 * * if phrase in self.precomputed_index: * loc.arr = self.precomputed_index[phrase] # <<<<<<<<<<<<<< @@ -43756,7 +43738,7 @@ static void __pyx_f_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct __pyx_ } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":780 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":780 * loc.arr = self.precomputed_index[phrase] * else: * loc.arr = IntList(initial_len=loc.sa_high-loc.sa_low) # <<<<<<<<<<<<<< @@ -43778,7 +43760,7 @@ static void __pyx_f_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct __pyx_ __pyx_v_loc->arr = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":781 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":781 * else: * loc.arr = IntList(initial_len=loc.sa_high-loc.sa_low) * veb = VEB(arr.len) # <<<<<<<<<<<<<< @@ -43798,7 +43780,7 @@ static void __pyx_f_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct __pyx_ __pyx_v_veb = ((struct __pyx_obj_3_sa_VEB *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":782 + /* "/home/paulb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -43808,7 +43790,7 @@ static void __pyx_f_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct __pyx_ __pyx_t_4 = __pyx_v_loc->sa_high; for (__pyx_v_i = __pyx_v_loc->sa_low; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":783 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":783 * veb = VEB(arr.len) * for i from loc.sa_low <= i < loc.sa_high: * veb._insert(arr.arr[i]) # <<<<<<<<<<<<<< @@ -43818,7 +43800,7 @@ static void __pyx_f_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct __pyx_ ((struct __pyx_vtabstruct_3_sa_VEB *)__pyx_v_veb->__pyx_vtab)->_insert(__pyx_v_veb, (__pyx_v_arr->arr[__pyx_v_i])); } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":784 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":784 * for i from loc.sa_low <= i < loc.sa_high: * veb._insert(arr.arr[i]) * i = veb.veb.min_val # <<<<<<<<<<<<<< @@ -43827,7 +43809,7 @@ static void __pyx_f_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct __pyx_ */ __pyx_v_i = __pyx_v_veb->veb->min_val; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":785 + /* "/home/paulb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -43837,7 +43819,7 @@ static void __pyx_f_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct __pyx_ __pyx_t_4 = (__pyx_v_loc->sa_high - __pyx_v_loc->sa_low); for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_4; __pyx_v_j++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":786 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -43846,7 +43828,7 @@ static void __pyx_f_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct __pyx_ */ (__pyx_v_loc->arr->arr[__pyx_v_j]) = __pyx_v_i; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":787 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":787 * for j from 0 <= j < loc.sa_high-loc.sa_low: * loc.arr.arr[j] = i * i = veb._findsucc(i) # <<<<<<<<<<<<<< @@ -43858,7 +43840,7 @@ static void __pyx_f_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct __pyx_ } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":788 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":788 * loc.arr.arr[j] = i * i = veb._findsucc(i) * loc.arr_low = 0 # <<<<<<<<<<<<<< @@ -43867,7 +43849,7 @@ static void __pyx_f_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct __pyx_ */ __pyx_v_loc->arr_low = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":789 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":789 * i = veb._findsucc(i) * loc.arr_low = 0 * loc.arr_high = loc.arr.len # <<<<<<<<<<<<<< @@ -43886,7 +43868,7 @@ static void __pyx_f_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct __pyx_ __Pyx_RefNannyFinishContext(); } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":792 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":792 * * * cdef intersect_helper(self, Phrase prefix, Phrase suffix, # <<<<<<<<<<<<<< @@ -43923,7 +43905,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("intersect_helper", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":799 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":799 * cdef int* result_ptr * * result_len = 0 # <<<<<<<<<<<<<< @@ -43932,7 +43914,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct */ __pyx_v_result_len = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":801 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":801 * result_len = 0 * * if sym_isvar(suffix[0]): # <<<<<<<<<<<<<< @@ -43946,7 +43928,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct __pyx_t_3 = __pyx_f_3_sa_sym_isvar(__pyx_t_2); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":802 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":802 * * if sym_isvar(suffix[0]): * offset_by_one = 1 # <<<<<<<<<<<<<< @@ -43958,7 +43940,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":804 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":804 * offset_by_one = 1 * else: * offset_by_one = 0 # <<<<<<<<<<<<<< @@ -43969,7 +43951,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":806 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":806 * offset_by_one = 0 * * len_last = len(suffix.getchunk(suffix.arity())) # <<<<<<<<<<<<<< @@ -43996,7 +43978,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_len_last = __pyx_t_6; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":808 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":808 * len_last = len(suffix.getchunk(suffix.arity())) * * if prefix_loc.arr is None: # <<<<<<<<<<<<<< @@ -44006,7 +43988,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct __pyx_t_7 = (((PyObject *)__pyx_v_prefix_loc->arr) == Py_None); if (__pyx_t_7) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":809 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":809 * * if prefix_loc.arr is None: * self.sort_phrase_loc(self.fsa.sa, prefix_loc, prefix) # <<<<<<<<<<<<<< @@ -44021,7 +44003,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct } __pyx_L4:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":810 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":810 * if prefix_loc.arr is None: * self.sort_phrase_loc(self.fsa.sa, prefix_loc, prefix) * arr1 = prefix_loc.arr # <<<<<<<<<<<<<< @@ -44031,7 +44013,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct __Pyx_INCREF(((PyObject *)__pyx_v_prefix_loc->arr)); __pyx_v_arr1 = __pyx_v_prefix_loc->arr; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":811 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":811 * self.sort_phrase_loc(self.fsa.sa, prefix_loc, prefix) * arr1 = prefix_loc.arr * low1 = prefix_loc.arr_low # <<<<<<<<<<<<<< @@ -44040,7 +44022,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct */ __pyx_v_low1 = __pyx_v_prefix_loc->arr_low; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":812 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":812 * arr1 = prefix_loc.arr * low1 = prefix_loc.arr_low * high1 = prefix_loc.arr_high # <<<<<<<<<<<<<< @@ -44049,7 +44031,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct */ __pyx_v_high1 = __pyx_v_prefix_loc->arr_high; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":813 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":813 * low1 = prefix_loc.arr_low * high1 = prefix_loc.arr_high * step1 = prefix_loc.num_subpatterns # <<<<<<<<<<<<<< @@ -44058,7 +44040,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct */ __pyx_v_step1 = __pyx_v_prefix_loc->num_subpatterns; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":815 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":815 * step1 = prefix_loc.num_subpatterns * * if suffix_loc.arr is None: # <<<<<<<<<<<<<< @@ -44068,7 +44050,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct __pyx_t_7 = (((PyObject *)__pyx_v_suffix_loc->arr) == Py_None); if (__pyx_t_7) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":816 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":816 * * if suffix_loc.arr is None: * self.sort_phrase_loc(self.fsa.sa, suffix_loc, suffix) # <<<<<<<<<<<<<< @@ -44083,7 +44065,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct } __pyx_L5:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":817 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":817 * if suffix_loc.arr is None: * self.sort_phrase_loc(self.fsa.sa, suffix_loc, suffix) * arr2 = suffix_loc.arr # <<<<<<<<<<<<<< @@ -44093,7 +44075,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct __Pyx_INCREF(((PyObject *)__pyx_v_suffix_loc->arr)); __pyx_v_arr2 = __pyx_v_suffix_loc->arr; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":818 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":818 * self.sort_phrase_loc(self.fsa.sa, suffix_loc, suffix) * arr2 = suffix_loc.arr * low2 = suffix_loc.arr_low # <<<<<<<<<<<<<< @@ -44102,7 +44084,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct */ __pyx_v_low2 = __pyx_v_suffix_loc->arr_low; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":819 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":819 * arr2 = suffix_loc.arr * low2 = suffix_loc.arr_low * high2 = suffix_loc.arr_high # <<<<<<<<<<<<<< @@ -44111,7 +44093,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct */ __pyx_v_high2 = __pyx_v_suffix_loc->arr_high; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":820 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":820 * low2 = suffix_loc.arr_low * high2 = suffix_loc.arr_high * step2 = suffix_loc.num_subpatterns # <<<<<<<<<<<<<< @@ -44120,7 +44102,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct */ __pyx_v_step2 = __pyx_v_suffix_loc->num_subpatterns; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":822 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":822 * step2 = suffix_loc.num_subpatterns * * num_subpatterns = prefix.arity()+1 # <<<<<<<<<<<<<< @@ -44139,7 +44121,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_num_subpatterns = __pyx_t_3; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":824 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":824 * num_subpatterns = prefix.arity()+1 * * if algorithm == MERGE: # <<<<<<<<<<<<<< @@ -44149,7 +44131,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct __pyx_t_7 = (__pyx_v_algorithm == __pyx_v_3_sa_MERGE); if (__pyx_t_7) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":827 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":827 * result_ptr = self.merge_helper(low1, high1, arr1.arr, step1, * low2, high2, arr2.arr, step2, * offset_by_one, len_last, num_subpatterns, &result_len) # <<<<<<<<<<<<<< @@ -44161,7 +44143,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":831 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":831 * 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) # <<<<<<<<<<<<<< @@ -44172,7 +44154,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct } __pyx_L6:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":833 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":833 * offset_by_one, len_last, num_subpatterns, &result_len) * * if result_len == 0: # <<<<<<<<<<<<<< @@ -44182,7 +44164,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct __pyx_t_7 = (__pyx_v_result_len == 0); if (__pyx_t_7) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":834 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":834 * * if result_len == 0: * free(result_ptr) # <<<<<<<<<<<<<< @@ -44191,7 +44173,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct */ free(__pyx_v_result_ptr); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":835 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":835 * if result_len == 0: * free(result_ptr) * return None # <<<<<<<<<<<<<< @@ -44206,7 +44188,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":837 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":837 * return None * else: * result = IntList() # <<<<<<<<<<<<<< @@ -44218,7 +44200,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct __pyx_v_result = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_5); __pyx_t_5 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":838 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":838 * else: * result = IntList() * free(result.arr) # <<<<<<<<<<<<<< @@ -44227,7 +44209,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct */ free(__pyx_v_result->arr); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":839 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":839 * result = IntList() * free(result.arr) * result.arr = result_ptr # <<<<<<<<<<<<<< @@ -44236,7 +44218,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct */ __pyx_v_result->arr = __pyx_v_result_ptr; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":840 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":840 * free(result.arr) * result.arr = result_ptr * result.len = result_len # <<<<<<<<<<<<<< @@ -44245,7 +44227,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct */ __pyx_v_result->len = __pyx_v_result_len; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":841 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":841 * result.arr = result_ptr * result.len = result_len * result.size = result_len # <<<<<<<<<<<<<< @@ -44254,7 +44236,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct */ __pyx_v_result->size = __pyx_v_result_len; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":842 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -44300,7 +44282,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":844 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":844 * return PhraseLocation(arr_low=0, arr_high=result_len, arr=result, num_subpatterns=num_subpatterns) * * cdef loc2str(self, PhraseLocation loc): # <<<<<<<<<<<<<< @@ -44323,7 +44305,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON_UNUSED st int __pyx_clineno = 0; __Pyx_RefNannySetupContext("loc2str", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":846 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":846 * cdef loc2str(self, PhraseLocation loc): * cdef int i, j * result = "{" # <<<<<<<<<<<<<< @@ -44333,7 +44315,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON_UNUSED st __Pyx_INCREF(((PyObject *)__pyx_kp_s_116)); __pyx_v_result = ((PyObject *)__pyx_kp_s_116); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":847 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":847 * cdef int i, j * result = "{" * i = 0 # <<<<<<<<<<<<<< @@ -44342,7 +44324,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON_UNUSED st */ __pyx_v_i = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":848 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":848 * result = "{" * i = 0 * while i < loc.arr_high: # <<<<<<<<<<<<<< @@ -44353,7 +44335,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON_UNUSED st __pyx_t_1 = (__pyx_v_i < __pyx_v_loc->arr_high); if (!__pyx_t_1) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":849 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":849 * i = 0 * while i < loc.arr_high: * result = result + "(" # <<<<<<<<<<<<<< @@ -44366,7 +44348,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON_UNUSED st __pyx_v_result = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":850 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":850 * while i < loc.arr_high: * result = result + "(" * for j from i <= j < i + loc.num_subpatterns: # <<<<<<<<<<<<<< @@ -44376,7 +44358,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON_UNUSED st __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/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":851 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":851 * result = result + "(" * for j from i <= j < i + loc.num_subpatterns: * result = result + ("%d " %loc.arr[j]) # <<<<<<<<<<<<<< @@ -44396,7 +44378,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON_UNUSED st __pyx_t_2 = 0; } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":852 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":852 * for j from i <= j < i + loc.num_subpatterns: * result = result + ("%d " %loc.arr[j]) * result = result + ")" # <<<<<<<<<<<<<< @@ -44409,7 +44391,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON_UNUSED st __pyx_v_result = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":853 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":853 * result = result + ("%d " %loc.arr[j]) * result = result + ")" * i = i + loc.num_subpatterns # <<<<<<<<<<<<<< @@ -44419,7 +44401,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON_UNUSED st __pyx_v_i = (__pyx_v_i + __pyx_v_loc->num_subpatterns); } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":854 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":854 * result = result + ")" * i = i + loc.num_subpatterns * result = result + "}" # <<<<<<<<<<<<<< @@ -44432,7 +44414,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON_UNUSED st __pyx_v_result = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":855 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":855 * i = i + loc.num_subpatterns * result = result + "}" * return result # <<<<<<<<<<<<<< @@ -44458,7 +44440,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON_UNUSED st return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":857 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":857 * return result * * cdef PhraseLocation intersect(self, prefix_node, suffix_node, Phrase phrase): # <<<<<<<<<<<<<< @@ -44484,7 +44466,7 @@ static struct __pyx_obj_3_sa_PhraseLocation *__pyx_f_3_sa_23HieroCachingRuleFact int __pyx_clineno = 0; __Pyx_RefNannySetupContext("intersect", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":861 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":861 * cdef PhraseLocation prefix_loc, suffix_loc, result * * prefix = prefix_node.phrase # <<<<<<<<<<<<<< @@ -44497,7 +44479,7 @@ static struct __pyx_obj_3_sa_PhraseLocation *__pyx_f_3_sa_23HieroCachingRuleFact __pyx_v_prefix = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":862 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":862 * * prefix = prefix_node.phrase * suffix = suffix_node.phrase # <<<<<<<<<<<<<< @@ -44510,7 +44492,7 @@ static struct __pyx_obj_3_sa_PhraseLocation *__pyx_f_3_sa_23HieroCachingRuleFact __pyx_v_suffix = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":863 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":863 * prefix = prefix_node.phrase * suffix = suffix_node.phrase * prefix_loc = prefix_node.phrase_location # <<<<<<<<<<<<<< @@ -44523,7 +44505,7 @@ static struct __pyx_obj_3_sa_PhraseLocation *__pyx_f_3_sa_23HieroCachingRuleFact __pyx_v_prefix_loc = ((struct __pyx_obj_3_sa_PhraseLocation *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":864 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":864 * suffix = suffix_node.phrase * prefix_loc = prefix_node.phrase_location * suffix_loc = suffix_node.phrase_location # <<<<<<<<<<<<<< @@ -44536,7 +44518,7 @@ static struct __pyx_obj_3_sa_PhraseLocation *__pyx_f_3_sa_23HieroCachingRuleFact __pyx_v_suffix_loc = ((struct __pyx_obj_3_sa_PhraseLocation *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":866 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":866 * suffix_loc = suffix_node.phrase_location * * result = self.get_precomputed_collocation(phrase) # <<<<<<<<<<<<<< @@ -44558,7 +44540,7 @@ static struct __pyx_obj_3_sa_PhraseLocation *__pyx_f_3_sa_23HieroCachingRuleFact __pyx_v_result = ((struct __pyx_obj_3_sa_PhraseLocation *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":867 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":867 * * result = self.get_precomputed_collocation(phrase) * if result is not None: # <<<<<<<<<<<<<< @@ -44568,7 +44550,7 @@ static struct __pyx_obj_3_sa_PhraseLocation *__pyx_f_3_sa_23HieroCachingRuleFact __pyx_t_4 = (((PyObject *)__pyx_v_result) != Py_None); if (__pyx_t_4) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":868 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":868 * result = self.get_precomputed_collocation(phrase) * if result is not None: * intersect_method = "precomputed" # <<<<<<<<<<<<<< @@ -44581,7 +44563,7 @@ static struct __pyx_obj_3_sa_PhraseLocation *__pyx_f_3_sa_23HieroCachingRuleFact } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":870 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":870 * intersect_method = "precomputed" * * if result is None: # <<<<<<<<<<<<<< @@ -44591,7 +44573,7 @@ static struct __pyx_obj_3_sa_PhraseLocation *__pyx_f_3_sa_23HieroCachingRuleFact __pyx_t_4 = (((PyObject *)__pyx_v_result) == Py_None); if (__pyx_t_4) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":871 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":871 * * if result is None: * if self.use_baeza_yates: # <<<<<<<<<<<<<< @@ -44600,7 +44582,7 @@ static struct __pyx_obj_3_sa_PhraseLocation *__pyx_f_3_sa_23HieroCachingRuleFact */ if (__pyx_v_self->use_baeza_yates) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":872 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -44614,7 +44596,7 @@ static struct __pyx_obj_3_sa_PhraseLocation *__pyx_f_3_sa_23HieroCachingRuleFact __pyx_v_result = ((struct __pyx_obj_3_sa_PhraseLocation *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":873 + /* "/home/paulb/workspace/cdec/python/src/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" # <<<<<<<<<<<<<< @@ -44628,7 +44610,7 @@ static struct __pyx_obj_3_sa_PhraseLocation *__pyx_f_3_sa_23HieroCachingRuleFact } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":875 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":875 * intersect_method="double binary" * else: * result = self.intersect_helper(prefix, suffix, prefix_loc, suffix_loc, MERGE) # <<<<<<<<<<<<<< @@ -44642,7 +44624,7 @@ static struct __pyx_obj_3_sa_PhraseLocation *__pyx_f_3_sa_23HieroCachingRuleFact __pyx_v_result = ((struct __pyx_obj_3_sa_PhraseLocation *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":876 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":876 * else: * result = self.intersect_helper(prefix, suffix, prefix_loc, suffix_loc, MERGE) * intersect_method="merge" # <<<<<<<<<<<<<< @@ -44658,7 +44640,7 @@ static struct __pyx_obj_3_sa_PhraseLocation *__pyx_f_3_sa_23HieroCachingRuleFact } __pyx_L4:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":877 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":877 * result = self.intersect_helper(prefix, suffix, prefix_loc, suffix_loc, MERGE) * intersect_method="merge" * return result # <<<<<<<<<<<<<< @@ -44696,11 +44678,11 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_13advance(PyObject *__p PyObject *__pyx_v_frontier = 0; PyObject *__pyx_v_res = 0; PyObject *__pyx_v_fwords = 0; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__frontier,&__pyx_n_s__res,&__pyx_n_s__fwords,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("advance (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__frontier,&__pyx_n_s__res,&__pyx_n_s__fwords,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -44715,15 +44697,18 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_13advance(PyObject *__p 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--; + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__frontier); + if (likely(values[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--; + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__res); + if (likely(values[1])) kw_args--; else { __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--; + values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fwords); + if (likely(values[2])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("advance", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -44755,7 +44740,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_13advance(PyObject *__p return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":879 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":879 * return result * * def advance(self, frontier, res, fwords): # <<<<<<<<<<<<<< @@ -44796,7 +44781,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("advance", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":881 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":881 * def advance(self, frontier, res, fwords): * cdef unsigned na * nf = [] # <<<<<<<<<<<<<< @@ -44808,7 +44793,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_ __pyx_v_nf = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":882 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":882 * cdef unsigned na * nf = [] * for (toskip, (i, alt, pathlen)) in frontier: # <<<<<<<<<<<<<< @@ -44826,18 +44811,10 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_ for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; 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 = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; } 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 = 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 = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { @@ -44851,33 +44828,27 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_ } if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { PyObject* sequence = __pyx_t_4; - #if CYTHON_COMPILING_IN_CPYTHON - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { + if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { + if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); + else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { + if (unlikely(PyList_GET_SIZE(sequence) != 2)) { + if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); + else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); - #else - __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __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;} - #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 = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); @@ -44888,13 +44859,12 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_ 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 = 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; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_8 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); + if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L6_unpacking_done:; } @@ -44903,22 +44873,21 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_ __pyx_t_5 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { PyObject* sequence = __pyx_t_6; - #if CYTHON_COMPILING_IN_CPYTHON - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 3)) { - if (size > 3) __Pyx_RaiseTooManyValuesError(3); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { + if (unlikely(PyTuple_GET_SIZE(sequence) != 3)) { + if (PyTuple_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3); + else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_10 = PyTuple_GET_ITEM(sequence, 2); } else { + if (unlikely(PyList_GET_SIZE(sequence) != 3)) { + if (PyList_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3); + else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } __pyx_t_7 = PyList_GET_ITEM(sequence, 0); __pyx_t_9 = PyList_GET_ITEM(sequence, 1); __pyx_t_10 = PyList_GET_ITEM(sequence, 2); @@ -44926,14 +44895,8 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_ __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_10); - #else - __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __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_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;} - #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 = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); @@ -44946,13 +44909,12 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_ 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 = 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; __pyx_L7_unpacking_failed:; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_8 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); + if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L8_unpacking_done:; } @@ -44966,7 +44928,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_ __pyx_v_pathlen = __pyx_t_10; __pyx_t_10 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":883 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":883 * nf = [] * for (toskip, (i, alt, pathlen)) in frontier: * spanlen = fwords[i][alt][2] # <<<<<<<<<<<<<< @@ -44985,19 +44947,20 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_ __pyx_v_spanlen = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":884 + /* "/home/paulb/workspace/cdec/python/src/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 = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_toskip, __pyx_int_0, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __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/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":885 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":885 * spanlen = fwords[i][alt][2] * if (toskip == 0): * res.append((i, alt, pathlen)) # <<<<<<<<<<<<<< @@ -45023,7 +44986,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_ } __pyx_L9:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":886 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":886 * if (toskip == 0): * res.append((i, alt, pathlen)) * ni = i + spanlen # <<<<<<<<<<<<<< @@ -45036,7 +44999,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_ __pyx_v_ni = __pyx_t_6; __pyx_t_6 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":887 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":887 * res.append((i, alt, pathlen)) * ni = i + spanlen * if (ni < len(fwords) and (pathlen + 1) < self.max_initial_size): # <<<<<<<<<<<<<< @@ -45046,7 +45009,8 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_ __pyx_t_13 = PyObject_Length(__pyx_v_fwords); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 887; __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 = 887; __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 = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_ni, __pyx_t_6, Py_LT); 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_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 = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -45055,7 +45019,8 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_ __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 = 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 = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_6, Py_LT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_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 = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -45066,7 +45031,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_ } if (__pyx_t_15) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":888 + /* "/home/paulb/workspace/cdec/python/src/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])): # <<<<<<<<<<<<<< @@ -45080,7 +45045,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_ for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_13; __pyx_t_16+=1) { __pyx_v_na = __pyx_t_16; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":889 + /* "/home/paulb/workspace/cdec/python/src/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))) # <<<<<<<<<<<<<< @@ -45121,18 +45086,18 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":890 + /* "/home/paulb/workspace/cdec/python/src/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 = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyList_GET_SIZE(((PyObject *)__pyx_v_nf)); __pyx_t_15 = (__pyx_t_2 > 0); if (__pyx_t_15) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":891 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":891 * nf.append((toskip - 1, (ni, na, pathlen + 1))) * if (len(nf) > 0): * return self.advance(nf, res, fwords) # <<<<<<<<<<<<<< @@ -45164,7 +45129,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_ } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":893 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":893 * return self.advance(nf, res, fwords) * else: * return res # <<<<<<<<<<<<<< @@ -45214,11 +45179,11 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_15get_all_nodes_isteps_ PyObject *__pyx_v_fwords = 0; PyObject *__pyx_v_next_states = 0; PyObject *__pyx_v_reachable_buffer = 0; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__skip,&__pyx_n_s__i,&__pyx_n_s__spanlen,&__pyx_n_s__pathlen,&__pyx_n_s__fwords,&__pyx_n_s__next_states,&__pyx_n_s__reachable_buffer,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_all_nodes_isteps_away (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__skip,&__pyx_n_s__i,&__pyx_n_s__spanlen,&__pyx_n_s__pathlen,&__pyx_n_s__fwords,&__pyx_n_s__next_states,&__pyx_n_s__reachable_buffer,0}; PyObject* values[7] = {0,0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -45237,35 +45202,42 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_15get_all_nodes_isteps_ 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--; + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__skip); + if (likely(values[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--; + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__i); + if (likely(values[1])) kw_args--; else { __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--; + values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__spanlen); + if (likely(values[2])) kw_args--; else { __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--; + values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pathlen); + if (likely(values[3])) kw_args--; else { __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--; + values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fwords); + if (likely(values[4])) kw_args--; else { __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--; + values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__next_states); + if (likely(values[5])) kw_args--; else { __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--; + values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__reachable_buffer); + if (likely(values[6])) kw_args--; else { __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;} } @@ -45305,7 +45277,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_15get_all_nodes_isteps_ return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":895 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":895 * return res * * def get_all_nodes_isteps_away(self, skip, i, spanlen, pathlen, fwords, next_states, reachable_buffer): # <<<<<<<<<<<<<< @@ -45343,7 +45315,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_all_nodes_isteps_away", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":897 + /* "/home/paulb/workspace/cdec/python/src/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 = [] # <<<<<<<<<<<<<< @@ -45355,7 +45327,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_ __pyx_v_frontier = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":898 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":898 * cdef unsigned alt_it * frontier = [] * if (i+spanlen+skip >= len(next_states)): # <<<<<<<<<<<<<< @@ -45370,14 +45342,15 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_ __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 = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 898; __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_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 = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":899 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":899 * frontier = [] * if (i+spanlen+skip >= len(next_states)): * return frontier # <<<<<<<<<<<<<< @@ -45392,7 +45365,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_ } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":900 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":900 * if (i+spanlen+skip >= len(next_states)): * return frontier * key = tuple([i,spanlen]) # <<<<<<<<<<<<<< @@ -45413,7 +45386,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_ __pyx_v_key = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":901 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":901 * return frontier * key = tuple([i,spanlen]) * reachable = [] # <<<<<<<<<<<<<< @@ -45425,17 +45398,17 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_ __pyx_v_reachable = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":902 + /* "/home/paulb/workspace/cdec/python/src/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 = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = ((PySequence_Contains(__pyx_v_reachable_buffer, ((PyObject *)__pyx_v_key)))); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_5) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":903 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":903 * reachable = [] * if (key in reachable_buffer): * reachable = reachable_buffer[key] # <<<<<<<<<<<<<< @@ -45451,7 +45424,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_ } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":905 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":905 * reachable = reachable_buffer[key] * else: * reachable = self.reachable(fwords, i, spanlen) # <<<<<<<<<<<<<< @@ -45479,7 +45452,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_ __pyx_v_reachable = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":906 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":906 * else: * reachable = self.reachable(fwords, i, spanlen) * reachable_buffer[key] = reachable # <<<<<<<<<<<<<< @@ -45490,7 +45463,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_ } __pyx_L4:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":907 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":907 * reachable = self.reachable(fwords, i, spanlen) * reachable_buffer[key] = reachable * for nextreachable in reachable: # <<<<<<<<<<<<<< @@ -45508,18 +45481,10 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_ for (;;) { if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_2)) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; 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 = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_2)) { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; 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 = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; } else { __pyx_t_4 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_4)) { @@ -45535,7 +45500,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_ __pyx_v_nextreachable = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":908 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":908 * reachable_buffer[key] = reachable * for nextreachable in reachable: * for next_id in next_states[nextreachable]: # <<<<<<<<<<<<<< @@ -45556,18 +45521,10 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_ for (;;) { if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; 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_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; 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_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; } else { __pyx_t_4 = __pyx_t_8(__pyx_t_1); if (unlikely(!__pyx_t_4)) { @@ -45583,7 +45540,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_ __pyx_v_next_id = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":909 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":909 * for nextreachable in reachable: * for next_id in next_states[nextreachable]: * jump = self.shortest(fwords,i,next_id) # <<<<<<<<<<<<<< @@ -45611,19 +45568,20 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_ __pyx_v_jump = __pyx_t_10; __pyx_t_10 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":910 + /* "/home/paulb/workspace/cdec/python/src/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_10 = PyObject_RichCompare(__pyx_v_jump, __pyx_v_skip, Py_LT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_RichCompare(__pyx_v_jump, __pyx_v_skip, Py_LT); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_5) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":911 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":911 * jump = self.shortest(fwords,i,next_id) * if jump < skip: * continue # <<<<<<<<<<<<<< @@ -45635,7 +45593,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_ } __pyx_L9:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":912 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":912 * if jump < skip: * continue * if pathlen+jump <= self.max_initial_size: # <<<<<<<<<<<<<< @@ -45646,14 +45604,15 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_ __Pyx_GOTREF(__pyx_t_10); __pyx_t_9 = PyInt_FromLong(__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_10, __pyx_t_9, 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_t_4 = PyObject_RichCompare(__pyx_t_10, __pyx_t_9, Py_LE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 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_5) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":913 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":913 * continue * if pathlen+jump <= self.max_initial_size: * for alt_id in range(len(fwords[next_id])): # <<<<<<<<<<<<<< @@ -45686,18 +45645,10 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_ for (;;) { if (!__pyx_t_12 && PyList_CheckExact(__pyx_t_9)) { if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_9)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_11); __Pyx_INCREF(__pyx_t_4); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_9, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_11); __Pyx_INCREF(__pyx_t_4); __pyx_t_11++; } else if (!__pyx_t_12 && PyTuple_CheckExact(__pyx_t_9)) { if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_9)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_11); __Pyx_INCREF(__pyx_t_4); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_9, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_11); __Pyx_INCREF(__pyx_t_4); __pyx_t_11++; } else { __pyx_t_4 = __pyx_t_12(__pyx_t_9); if (unlikely(!__pyx_t_4)) { @@ -45713,7 +45664,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_ __pyx_v_alt_id = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":914 + /* "/home/paulb/workspace/cdec/python/src/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): # <<<<<<<<<<<<<< @@ -45730,14 +45681,15 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = PyInt_FromLong(__pyx_v_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_13 = PyObject_RichCompare(__pyx_t_4, __pyx_t_10, Py_NE); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = PyObject_RichCompare(__pyx_t_4, __pyx_t_10, Py_NE); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_5) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":915 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -45761,17 +45713,17 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_ __pyx_v_newel = __pyx_t_10; __pyx_t_10 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":916 + /* "/home/paulb/workspace/cdec/python/src/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_5 = (__Pyx_PySequence_Contains(((PyObject *)__pyx_v_newel), ((PyObject *)__pyx_v_frontier), Py_NE)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = (__Pyx_NegateNonNeg(PySequence_Contains(((PyObject *)__pyx_v_frontier), ((PyObject *)__pyx_v_newel)))); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_5) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":917 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":917 * newel = (next_id,alt_id,pathlen+jump) * if newel not in frontier: * frontier.append((next_id,alt_id,pathlen+jump)) # <<<<<<<<<<<<<< @@ -45810,7 +45762,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":918 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":918 * if newel not in frontier: * frontier.append((next_id,alt_id,pathlen+jump)) * return frontier # <<<<<<<<<<<<<< @@ -45853,11 +45805,11 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_17reachable(PyObject *_ PyObject *__pyx_v_fwords = 0; PyObject *__pyx_v_ifrom = 0; PyObject *__pyx_v_dist = 0; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fwords,&__pyx_n_s__ifrom,&__pyx_n_s__dist,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reachable (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fwords,&__pyx_n_s__ifrom,&__pyx_n_s__dist,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -45872,15 +45824,18 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_17reachable(PyObject *_ 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--; + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fwords); + if (likely(values[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--; + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ifrom); + if (likely(values[1])) kw_args--; else { __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--; + values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dist); + if (likely(values[2])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("reachable", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -45912,7 +45867,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_17reachable(PyObject *_ return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":920 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":920 * return frontier * * def reachable(self, fwords, ifrom, dist): # <<<<<<<<<<<<<< @@ -45942,7 +45897,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("reachable", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":921 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":921 * * def reachable(self, fwords, ifrom, dist): * ret = [] # <<<<<<<<<<<<<< @@ -45954,7 +45909,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __py __pyx_v_ret = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":922 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":922 * def reachable(self, fwords, ifrom, dist): * ret = [] * if (ifrom >= len(fwords)): # <<<<<<<<<<<<<< @@ -45964,13 +45919,14 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __py __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 = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_ifrom, __pyx_t_1, Py_GE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 922; __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_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/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":923 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":923 * ret = [] * if (ifrom >= len(fwords)): * return ret # <<<<<<<<<<<<<< @@ -45985,7 +45941,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __py } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":924 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":924 * if (ifrom >= len(fwords)): * return ret * for alt_id in range(len(fwords[ifrom])): # <<<<<<<<<<<<<< @@ -46018,18 +45974,10 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __py 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 = 924; __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 = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; } 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 = 924; __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 = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; } else { __pyx_t_3 = __pyx_t_5(__pyx_t_1); if (unlikely(!__pyx_t_3)) { @@ -46045,7 +45993,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __py __pyx_v_alt_id = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":925 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":925 * return ret * for alt_id in range(len(fwords[ifrom])): * if (fwords[ifrom][alt_id][0] == EPSILON): # <<<<<<<<<<<<<< @@ -46062,14 +46010,15 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __py __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyInt_FromLong(__pyx_v_3_sa_EPSILON); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 925; __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 = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_t_6, Py_EQ); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 925; __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_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 = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_4) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":926 + /* "/home/paulb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -46120,29 +46069,30 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __py } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":928 + /* "/home/paulb/workspace/cdec/python/src/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 = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_RichCompare(__pyx_v_dist, __pyx_int_0, Py_EQ); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_8); 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_8); __pyx_t_8 = 0; if (__pyx_t_4) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":929 + /* "/home/paulb/workspace/cdec/python/src/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 = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = (__Pyx_NegateNonNeg(PySequence_Contains(((PyObject *)__pyx_v_ret), __pyx_v_ifrom))); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_4) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":930 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":930 * if (dist==0): * if (ifrom not in ret): * ret.append(ifrom) # <<<<<<<<<<<<<< @@ -46157,7 +46107,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __py } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":932 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":932 * ret.append(ifrom) * else: * for ifromchild in self.reachable(fwords,ifrom+fwords[ifrom][alt_id][2],dist-1): # <<<<<<<<<<<<<< @@ -46206,18 +46156,10 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __py for (;;) { if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_6)) { if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_6)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; 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_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_6)) { if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_6)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; 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_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; } else { __pyx_t_3 = __pyx_t_11(__pyx_t_6); if (unlikely(!__pyx_t_3)) { @@ -46233,17 +46175,17 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __py __pyx_v_ifromchild = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":933 + /* "/home/paulb/workspace/cdec/python/src/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_4 = (__Pyx_PySequence_Contains(__pyx_v_ifromchild, ((PyObject *)__pyx_v_ret), Py_NE)); 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_NegateNonNeg(PySequence_Contains(((PyObject *)__pyx_v_ret), __pyx_v_ifromchild))); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_4) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":934 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -46263,7 +46205,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __py } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":936 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":936 * ret.append(ifromchild) * * return ret # <<<<<<<<<<<<<< @@ -46300,11 +46242,11 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_19shortest(PyObject *__ PyObject *__pyx_v_fwords = 0; PyObject *__pyx_v_ifrom = 0; PyObject *__pyx_v_ito = 0; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fwords,&__pyx_n_s__ifrom,&__pyx_n_s__ito,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("shortest (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fwords,&__pyx_n_s__ifrom,&__pyx_n_s__ito,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -46319,15 +46261,18 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_19shortest(PyObject *__ 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--; + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fwords); + if (likely(values[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--; + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ifrom); + if (likely(values[1])) kw_args--; else { __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--; + values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ito); + if (likely(values[2])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("shortest", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -46359,7 +46304,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_19shortest(PyObject *__ return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":938 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":938 * return ret * * def shortest(self, fwords, ifrom, ito): # <<<<<<<<<<<<<< @@ -46384,7 +46329,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_18shortest(struct __pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("shortest", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":940 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":940 * def shortest(self, fwords, ifrom, ito): * cdef unsigned alt_id * min = 1000 # <<<<<<<<<<<<<< @@ -46394,19 +46339,20 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_18shortest(struct __pyx __Pyx_INCREF(__pyx_int_1000); __pyx_v_min = __pyx_int_1000; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":941 + /* "/home/paulb/workspace/cdec/python/src/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 = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_ifrom, __pyx_v_ito, Py_GT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 941; __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 = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":942 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":942 * min = 1000 * if (ifrom > ito): * return min # <<<<<<<<<<<<<< @@ -46421,19 +46367,20 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_18shortest(struct __pyx } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":943 + /* "/home/paulb/workspace/cdec/python/src/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 = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_ifrom, __pyx_v_ito, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 943; __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 = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":944 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":944 * return min * if (ifrom == ito): * return 0 # <<<<<<<<<<<<<< @@ -46448,7 +46395,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_18shortest(struct __pyx } __pyx_L4:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":945 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":945 * if (ifrom == ito): * return 0 * for alt_id in range(len(fwords[ifrom])): # <<<<<<<<<<<<<< @@ -46462,7 +46409,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_18shortest(struct __pyx for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_alt_id = __pyx_t_4; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":946 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -46501,7 +46448,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_18shortest(struct __pyx __pyx_v_currmin = __pyx_t_6; __pyx_t_6 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":947 + /* "/home/paulb/workspace/cdec/python/src/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): # <<<<<<<<<<<<<< @@ -46518,14 +46465,15 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_18shortest(struct __pyx __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyInt_FromLong(__pyx_v_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 = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __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 = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":948 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":948 * currmin = self.shortest(fwords,ifrom+fwords[ifrom][alt_id][2],ito) * if (fwords[ifrom][alt_id][0] != EPSILON): * currmin += 1 # <<<<<<<<<<<<<< @@ -46541,19 +46489,20 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_18shortest(struct __pyx } __pyx_L7:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":949 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":949 * if (fwords[ifrom][alt_id][0] != EPSILON): * currmin += 1 * if (currmin 0: # <<<<<<<<<<<<<< @@ -46740,11 +46691,11 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc * 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 = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyList_GET_SIZE(((PyObject *)__pyx_v_candidate)); __pyx_t_4 = (__pyx_t_3 > 0); if (!__pyx_t_4) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":958 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":958 * * while len(candidate) > 0: * curr = candidate.pop() # <<<<<<<<<<<<<< @@ -46757,7 +46708,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc __pyx_v_curr = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":959 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":959 * while len(candidate) > 0: * curr = candidate.pop() * if curr[0] >= len(_columns): # <<<<<<<<<<<<<< @@ -46769,14 +46720,15 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc __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 = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __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 = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_4) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":960 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":960 * curr = candidate.pop() * if curr[0] >= len(_columns): * continue # <<<<<<<<<<<<<< @@ -46788,7 +46740,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc } __pyx_L5:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":961 + /* "/home/paulb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -46797,17 +46749,19 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc */ __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_curr, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__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 = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = (__Pyx_NegateNonNeg(PySequence_Contains(((PyObject *)__pyx_v_result), __pyx_t_5))); 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); if (!__pyx_t_5) {__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 = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_min_dist, __pyx_t_5, Py_LE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_IsTrue(__pyx_t_1)) { __Pyx_DECREF(__pyx_t_1); __pyx_t_2 = PyInt_FromLong(__pyx_v_self->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 = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_t_2, Py_LE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 961; __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_5); __pyx_t_5 = 0; @@ -46819,7 +46773,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc } if (__pyx_t_7) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":962 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":962 * continue * if curr[0] not in result and min_dist <= curr[1] <= self.max_initial_size: * result.append(curr[0]); # <<<<<<<<<<<<<< @@ -46834,7 +46788,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc } __pyx_L6:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":963 + /* "/home/paulb/workspace/cdec/python/src/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]] # <<<<<<<<<<<<<< @@ -46850,7 +46804,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc __pyx_v_curr_col = __pyx_t_5; __pyx_t_5 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":964 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":964 * result.append(curr[0]); * curr_col = _columns[curr[0]] * for alt in curr_col: # <<<<<<<<<<<<<< @@ -46868,18 +46822,10 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc for (;;) { if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_5)) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_5)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; 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 = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; } 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 = 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 = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; } else { __pyx_t_1 = __pyx_t_9(__pyx_t_5); if (unlikely(!__pyx_t_1)) { @@ -46895,7 +46841,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc __pyx_v_alt = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":965 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":965 * curr_col = _columns[curr[0]] * for alt in curr_col: * next_id = curr[0]+alt[2] # <<<<<<<<<<<<<< @@ -46914,7 +46860,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc __pyx_v_next_id = __pyx_t_10; __pyx_t_10 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":966 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":966 * for alt in curr_col: * next_id = curr[0]+alt[2] * jump = 1 # <<<<<<<<<<<<<< @@ -46925,7 +46871,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc __Pyx_XDECREF(__pyx_v_jump); __pyx_v_jump = __pyx_int_1; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":967 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":967 * next_id = curr[0]+alt[2] * jump = 1 * if (alt[0] == EPSILON): # <<<<<<<<<<<<<< @@ -46936,14 +46882,15 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc __Pyx_GOTREF(__pyx_t_10); __pyx_t_2 = PyInt_FromLong(__pyx_v_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 = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_10, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_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/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":968 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":968 * jump = 1 * if (alt[0] == EPSILON): * jump = 0 # <<<<<<<<<<<<<< @@ -46957,26 +46904,28 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc } __pyx_L9:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":969 + /* "/home/paulb/workspace/cdec/python/src/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 = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = (__Pyx_NegateNonNeg(PySequence_Contains(((PyObject *)__pyx_v_result), __pyx_v_next_id))); 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); if (!__pyx_t_1) {__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 = 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 = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_min_dist, __pyx_t_2, Py_LE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_IsTrue(__pyx_t_1)) { __Pyx_DECREF(__pyx_t_1); __pyx_t_10 = PyInt_FromLong((__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 = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_10, Py_LE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -46988,7 +46937,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc } if (__pyx_t_6) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":970 + /* "/home/paulb/workspace/cdec/python/src/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]) # <<<<<<<<<<<<<< @@ -47018,7 +46967,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc __pyx_L3_continue:; } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":971 + /* "/home/paulb/workspace/cdec/python/src/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); # <<<<<<<<<<<<<< @@ -47067,11 +47016,11 @@ static char __pyx_doc_3_sa_23HieroCachingRuleFactory_22input[] = "When this func static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_23input(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_fwords = 0; PyObject *__pyx_v_meta = 0; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fwords,&__pyx_n_s__meta,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("input (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fwords,&__pyx_n_s__meta,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -47085,10 +47034,12 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_23input(PyObject *__pyx 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--; + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fwords); + if (likely(values[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--; + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__meta); + if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("input", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -47125,6 +47076,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_5input_lambda4(PyObject PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda4 (wrapper)", 0); + __pyx_self = __pyx_self; __pyx_r = __pyx_lambda_funcdef_lambda4(__pyx_self); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -47137,12 +47089,13 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_5input_7lambda4_lambda5 PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda5 (wrapper)", 0); + __pyx_self = __pyx_self; __pyx_r = __pyx_lambda_funcdef_lambda5(__pyx_self); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1142 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1142 * if len(extracts) > 0: * fcount = Counter() * fphrases = defaultdict(lambda: defaultdict(lambda: defaultdict(list))) # <<<<<<<<<<<<<< @@ -47239,12 +47192,13 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_5input_1lambda6(PyObjec PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda6 (wrapper)", 0); + __pyx_self = __pyx_self; __pyx_r = __pyx_lambda_funcdef_lambda6(__pyx_self, ((PyObject *)__pyx_v_x)); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1148 +/* "/home/paulb/workspace/cdec/python/src/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])) # <<<<<<<<<<<<<< @@ -47285,7 +47239,7 @@ static PyObject *__pyx_lambda_funcdef_lambda6(CYTHON_UNUSED PyObject *__pyx_self } static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_5input_4generator14(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1187 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1187 * # Online rule extraction and scoring * if self.online: * f_syms = tuple(word[0][0] for word in fwords) # <<<<<<<<<<<<<< @@ -47361,18 +47315,10 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_5input_4generator14(__p for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1187; __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 = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; } 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 = 1187; __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 = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { @@ -47424,12 +47370,11 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_5input_4generator14(__p __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_generator->resume_label = -1; - __Pyx_Generator_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return NULL; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":973 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":973 * return sorted(result); * * def input(self, fwords, meta): # <<<<<<<<<<<<<< @@ -47506,18 +47451,16 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene int __pyx_t_21; PyObject *(*__pyx_t_22)(PyObject *); Py_ssize_t __pyx_t_23; - Py_ssize_t __pyx_t_24; + PyObject *(*__pyx_t_24)(PyObject *); Py_ssize_t __pyx_t_25; - Py_ssize_t __pyx_t_26; + int __pyx_t_26; int __pyx_t_27; - int __pyx_t_28; - PyObject *(*__pyx_t_29)(PyObject *); __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("None", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; - case 1: goto __pyx_L61_resume_from_yield; - case 2: goto __pyx_L82_resume_from_yield; + case 1: goto __pyx_L65_resume_from_yield; + case 2: goto __pyx_L86_resume_from_yield; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; @@ -47525,7 +47468,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":984 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":984 * cdef Phrase hiero_phrase * * flen = len(fwords) # <<<<<<<<<<<<<< @@ -47538,7 +47481,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_cur_scope->__pyx_v_flen = __pyx_t_2; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":985 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":985 * * flen = len(fwords) * start_time = monitor_cpu() # <<<<<<<<<<<<<< @@ -47554,7 +47497,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_cur_scope->__pyx_v_start_time = __pyx_t_4; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":986 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":986 * flen = len(fwords) * start_time = monitor_cpu() * self.extract_time = 0.0 # <<<<<<<<<<<<<< @@ -47563,7 +47506,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene */ __pyx_cur_scope->__pyx_v_self->extract_time = 0.0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":987 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":987 * start_time = monitor_cpu() * self.extract_time = 0.0 * self.intersect_time = 0.0 # <<<<<<<<<<<<<< @@ -47572,7 +47515,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene */ __pyx_cur_scope->__pyx_v_self->intersect_time = 0.0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":988 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":988 * self.extract_time = 0.0 * self.intersect_time = 0.0 * nodes_isteps_away_buffer = {} # <<<<<<<<<<<<<< @@ -47585,7 +47528,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_nodes_isteps_away_buffer = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":989 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":989 * self.intersect_time = 0.0 * nodes_isteps_away_buffer = {} * hit = 0 # <<<<<<<<<<<<<< @@ -47594,7 +47537,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene */ __pyx_cur_scope->__pyx_v_hit = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":990 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":990 * nodes_isteps_away_buffer = {} * hit = 0 * reachable_buffer = {} # <<<<<<<<<<<<<< @@ -47607,7 +47550,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_reachable_buffer = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":995 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":995 * # during online extraction. This is probably the hackiest part of * # online grammar extraction. * seen_phrases = set() # <<<<<<<<<<<<<< @@ -47620,7 +47563,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_seen_phrases = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":998 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":998 * * # Do not cache between sentences * self.rules.root = ExtendedTrieNode(phrase_location=PhraseLocation()) # <<<<<<<<<<<<<< @@ -47642,7 +47585,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_self->rules->root = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1000 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1000 * self.rules.root = ExtendedTrieNode(phrase_location=PhraseLocation()) * * frontier = [] # <<<<<<<<<<<<<< @@ -47655,7 +47598,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_frontier = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1001 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1001 * * frontier = [] * for i in range(len(fwords)): # <<<<<<<<<<<<<< @@ -47669,7 +47612,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene 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/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1002 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1002 * frontier = [] * for i in range(len(fwords)): * for alt in range(0, len(fwords[i])): # <<<<<<<<<<<<<< @@ -47683,7 +47626,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene 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/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1003 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1003 * for i in range(len(fwords)): * for alt in range(0, len(fwords[i])): * if fwords[i][alt][0] != EPSILON: # <<<<<<<<<<<<<< @@ -47700,14 +47643,15 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyInt_FromLong(__pyx_v_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 = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_NE); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1003; __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_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 = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1004 + /* "/home/paulb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -47763,7 +47707,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene } } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1006 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1006 * frontier.append((i, i, (i,), alt, 0, self.rules.root, (), False)) * * xroot = None # <<<<<<<<<<<<<< @@ -47774,7 +47718,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __Pyx_GIVEREF(Py_None); __pyx_cur_scope->__pyx_v_xroot = Py_None; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1007 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1007 * * xroot = None * x1 = sym_setindex(self.category, 1) # <<<<<<<<<<<<<< @@ -47783,7 +47727,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene */ __pyx_cur_scope->__pyx_v_x1 = __pyx_f_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, 1); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1008 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1008 * xroot = None * x1 = sym_setindex(self.category, 1) * if x1 in self.rules.root.children: # <<<<<<<<<<<<<< @@ -47794,12 +47738,12 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __Pyx_GOTREF(__pyx_t_12); __pyx_t_11 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_self->rules->root, __pyx_n_s__children); 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 = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((PySequence_Contains(__pyx_t_11, __pyx_t_12))); 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_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1009 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1009 * x1 = sym_setindex(self.category, 1) * if x1 in self.rules.root.children: * xroot = self.rules.root.children[x1] # <<<<<<<<<<<<<< @@ -47820,7 +47764,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1011 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1011 * xroot = self.rules.root.children[x1] * else: * xroot = ExtendedTrieNode(suffix_link=self.rules.root, phrase_location=PhraseLocation()) # <<<<<<<<<<<<<< @@ -47843,7 +47787,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_xroot = __pyx_t_11; __pyx_t_11 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1012 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1012 * else: * xroot = ExtendedTrieNode(suffix_link=self.rules.root, phrase_location=PhraseLocation()) * self.rules.root.children[x1] = xroot # <<<<<<<<<<<<<< @@ -47857,7 +47801,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene } __pyx_L9:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1014 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1014 * self.rules.root.children[x1] = xroot * * for i in range(self.min_gap_size, len(fwords)): # <<<<<<<<<<<<<< @@ -47871,7 +47815,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene 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/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1015 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1015 * * for i in range(self.min_gap_size, len(fwords)): * for alt in range(0, len(fwords[i])): # <<<<<<<<<<<<<< @@ -47885,7 +47829,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene 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/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1016 + /* "/home/paulb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -47902,14 +47846,15 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = PyInt_FromLong(__pyx_v_3_sa_EPSILON); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1016; __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 = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_11, __pyx_t_12, Py_NE); if (unlikely(!__pyx_t_1)) {__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_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__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_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1017 + /* "/home/paulb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -47974,7 +47919,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene } } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1019 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1019 * frontier.append((i-self.min_gap_size, i, (i,), alt, self.min_gap_size, xroot, (x1,), True)) * * next_states = [] # <<<<<<<<<<<<<< @@ -47987,7 +47932,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_next_states = __pyx_t_15; __pyx_t_15 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1020 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1020 * * next_states = [] * for i in range(len(fwords)): # <<<<<<<<<<<<<< @@ -48001,7 +47946,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene 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/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1021 + /* "/home/paulb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -48033,7 +47978,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1023 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1023 * next_states.append(self.get_next_states(fwords,i,self.min_gap_size)) * * while len(frontier) > 0: # <<<<<<<<<<<<<< @@ -48041,11 +47986,11 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene * 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 = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyList_GET_SIZE(((PyObject *)__pyx_cur_scope->__pyx_v_frontier)); __pyx_t_9 = (__pyx_t_2 > 0); if (!__pyx_t_9) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1024 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1024 * * while len(frontier) > 0: * new_frontier = [] # <<<<<<<<<<<<<< @@ -48060,7 +48005,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_new_frontier = __pyx_t_14; __pyx_t_14 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1025 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1025 * while len(frontier) > 0: * new_frontier = [] * for k, i, input_match, alt, pathlen, node, prefix, is_shadow_path in frontier: # <<<<<<<<<<<<<< @@ -48070,25 +48015,15 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_t_14 = ((PyObject *)__pyx_cur_scope->__pyx_v_frontier); __Pyx_INCREF(__pyx_t_14); __pyx_t_2 = 0; for (;;) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_14)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __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_14, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; 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 != 8)) { - if (size > 8) __Pyx_RaiseTooManyValuesError(8); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__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))) { + if (unlikely(PyTuple_GET_SIZE(sequence) != 8)) { + if (PyTuple_GET_SIZE(sequence) > 8) __Pyx_RaiseTooManyValuesError(8); + else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } __pyx_t_15 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_11 = PyTuple_GET_ITEM(sequence, 2); @@ -48098,6 +48033,11 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_t_16 = PyTuple_GET_ITEM(sequence, 6); __pyx_t_17 = PyTuple_GET_ITEM(sequence, 7); } else { + if (unlikely(PyList_GET_SIZE(sequence) != 8)) { + if (PyList_GET_SIZE(sequence) > 8) __Pyx_RaiseTooManyValuesError(8); + else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } __pyx_t_15 = PyList_GET_ITEM(sequence, 0); __pyx_t_8 = PyList_GET_ITEM(sequence, 1); __pyx_t_11 = PyList_GET_ITEM(sequence, 2); @@ -48115,36 +48055,36 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(__pyx_t_17); - #else - Py_ssize_t i; - PyObject** temps[8] = {&__pyx_t_15,&__pyx_t_8,&__pyx_t_11,&__pyx_t_10,&__pyx_t_12,&__pyx_t_1,&__pyx_t_16,&__pyx_t_17}; - 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;} - *(temps[i]) = item; - } - #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else - { + } else { Py_ssize_t index = -1; - PyObject** temps[8] = {&__pyx_t_15,&__pyx_t_8,&__pyx_t_11,&__pyx_t_10,&__pyx_t_12,&__pyx_t_1,&__pyx_t_16,&__pyx_t_17}; __pyx_t_18 = PyObject_GetIter(__pyx_t_3); 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_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_19 = Py_TYPE(__pyx_t_18)->tp_iternext; - for (index=0; index < 8; index++) { - PyObject* item = __pyx_t_19(__pyx_t_18); if (unlikely(!item)) goto __pyx_L21_unpacking_failed; - __Pyx_GOTREF(item); - *(temps[index]) = item; - } + index = 0; __pyx_t_15 = __pyx_t_19(__pyx_t_18); if (unlikely(!__pyx_t_15)) goto __pyx_L21_unpacking_failed; + __Pyx_GOTREF(__pyx_t_15); + index = 1; __pyx_t_8 = __pyx_t_19(__pyx_t_18); if (unlikely(!__pyx_t_8)) goto __pyx_L21_unpacking_failed; + __Pyx_GOTREF(__pyx_t_8); + index = 2; __pyx_t_11 = __pyx_t_19(__pyx_t_18); if (unlikely(!__pyx_t_11)) goto __pyx_L21_unpacking_failed; + __Pyx_GOTREF(__pyx_t_11); + index = 3; __pyx_t_10 = __pyx_t_19(__pyx_t_18); if (unlikely(!__pyx_t_10)) goto __pyx_L21_unpacking_failed; + __Pyx_GOTREF(__pyx_t_10); + index = 4; __pyx_t_12 = __pyx_t_19(__pyx_t_18); if (unlikely(!__pyx_t_12)) goto __pyx_L21_unpacking_failed; + __Pyx_GOTREF(__pyx_t_12); + index = 5; __pyx_t_1 = __pyx_t_19(__pyx_t_18); if (unlikely(!__pyx_t_1)) goto __pyx_L21_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + index = 6; __pyx_t_16 = __pyx_t_19(__pyx_t_18); if (unlikely(!__pyx_t_16)) goto __pyx_L21_unpacking_failed; + __Pyx_GOTREF(__pyx_t_16); + index = 7; __pyx_t_17 = __pyx_t_19(__pyx_t_18); if (unlikely(!__pyx_t_17)) goto __pyx_L21_unpacking_failed; + __Pyx_GOTREF(__pyx_t_17); if (__Pyx_IternextUnpackEndCheck(__pyx_t_19(__pyx_t_18), 8) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_19 = NULL; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; goto __pyx_L22_unpacking_done; __pyx_L21_unpacking_failed:; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - __pyx_t_19 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); + if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L22_unpacking_done:; } @@ -48183,7 +48123,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_is_shadow_path = __pyx_t_17; __pyx_t_17 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1026 + /* "/home/paulb/workspace/cdec/python/src/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] # <<<<<<<<<<<<<< @@ -48204,7 +48144,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_word_id = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1027 + /* "/home/paulb/workspace/cdec/python/src/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] # <<<<<<<<<<<<<< @@ -48225,7 +48165,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_spanlen = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1029 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1029 * spanlen = fwords[i][alt][2] * # TODO get rid of k -- pathlen is replacing it * if word_id == EPSILON: # <<<<<<<<<<<<<< @@ -48234,13 +48174,14 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene */ __pyx_t_3 = PyInt_FromLong(__pyx_v_3_sa_EPSILON); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_17 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_word_id, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_17); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_word_id, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_17); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1031 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1031 * if word_id == EPSILON: * # skipping because word_id is epsilon * if i+spanlen >= len(fwords): # <<<<<<<<<<<<<< @@ -48258,14 +48199,15 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __pyx_t_17 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); - __pyx_t_16 = PyObject_RichCompare(__pyx_t_3, __pyx_t_17, Py_GE); __Pyx_XGOTREF(__pyx_t_16); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = PyObject_RichCompare(__pyx_t_3, __pyx_t_17, Py_GE); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_16); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1032 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1032 * # skipping because word_id is epsilon * if i+spanlen >= len(fwords): * continue # <<<<<<<<<<<<<< @@ -48277,7 +48219,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene } __pyx_L24:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1033 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1033 * if i+spanlen >= len(fwords): * continue * for nualt in range(0,len(fwords[i+spanlen])): # <<<<<<<<<<<<<< @@ -48297,7 +48239,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_6; __pyx_t_20+=1) { __pyx_cur_scope->__pyx_v_nualt = __pyx_t_20; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1034 + /* "/home/paulb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -48343,7 +48285,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1035 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -48355,7 +48297,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene } __pyx_L23:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1037 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1037 * continue * * phrase = prefix + (word_id,) # <<<<<<<<<<<<<< @@ -48376,7 +48318,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_phrase = __pyx_t_17; __pyx_t_17 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1038 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1038 * * phrase = prefix + (word_id,) * hiero_phrase = Phrase(phrase) # <<<<<<<<<<<<<< @@ -48397,7 +48339,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_hiero_phrase = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1039 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1039 * phrase = prefix + (word_id,) * hiero_phrase = Phrase(phrase) * arity = hiero_phrase.arity() # <<<<<<<<<<<<<< @@ -48413,7 +48355,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __pyx_cur_scope->__pyx_v_arity = __pyx_t_20; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1041 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1041 * arity = hiero_phrase.arity() * * lookup_required = False # <<<<<<<<<<<<<< @@ -48422,7 +48364,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene */ __pyx_cur_scope->__pyx_v_lookup_required = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1042 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1042 * * lookup_required = False * if word_id in node.children: # <<<<<<<<<<<<<< @@ -48431,11 +48373,11 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene */ __pyx_t_17 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); - __pyx_t_9 = (__Pyx_PySequence_Contains(__pyx_cur_scope->__pyx_v_word_id, __pyx_t_17, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((PySequence_Contains(__pyx_t_17, __pyx_cur_scope->__pyx_v_word_id))); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1043 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1043 * lookup_required = False * if word_id in node.children: * if node.children[word_id] is None: # <<<<<<<<<<<<<< @@ -48451,7 +48393,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1045 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1045 * if node.children[word_id] is None: * # Path dead-ends at this node * continue # <<<<<<<<<<<<<< @@ -48463,7 +48405,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1048 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1048 * else: * # Path continues at this node * node = node.children[word_id] # <<<<<<<<<<<<<< @@ -48486,7 +48428,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1050 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1050 * node = node.children[word_id] * else: * if node.suffix_link is None: # <<<<<<<<<<<<<< @@ -48499,7 +48441,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1052 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1052 * if node.suffix_link is None: * # Current node is root; lookup required * lookup_required = True # <<<<<<<<<<<<<< @@ -48511,7 +48453,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1054 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1054 * lookup_required = True * else: * if word_id in node.suffix_link.children: # <<<<<<<<<<<<<< @@ -48523,11 +48465,11 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_t_1 = PyObject_GetAttr(__pyx_t_17, __pyx_n_s__children); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 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 = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((PySequence_Contains(__pyx_t_1, __pyx_cur_scope->__pyx_v_word_id))); 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_1); __pyx_t_1 = 0; if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1055 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1055 * else: * if word_id in node.suffix_link.children: * if node.suffix_link.children[word_id] is None: # <<<<<<<<<<<<<< @@ -48546,7 +48488,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1057 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -48558,7 +48500,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene if (PyObject_SetItem(__pyx_t_1, __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_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1058 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1058 * # Suffix link reports path is dead end * node.children[word_id] = None * continue # <<<<<<<<<<<<<< @@ -48570,7 +48512,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1061 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1061 * else: * # Suffix link indicates lookup is reqired * lookup_required = True # <<<<<<<<<<<<<< @@ -48584,7 +48526,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1064 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1064 * else: * #ERROR: We never get here * raise Exception("Keyword trie error") # <<<<<<<<<<<<<< @@ -48603,7 +48545,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene } __pyx_L27:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1066 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1066 * raise Exception("Keyword trie error") * # checking whether lookup_required * if lookup_required: # <<<<<<<<<<<<<< @@ -48612,7 +48554,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene */ if (__pyx_cur_scope->__pyx_v_lookup_required) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1067 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1067 * # checking whether lookup_required * if lookup_required: * new_node = None # <<<<<<<<<<<<<< @@ -48625,7 +48567,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __Pyx_GIVEREF(Py_None); __pyx_cur_scope->__pyx_v_new_node = Py_None; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1068 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1068 * if lookup_required: * new_node = None * if is_shadow_path: # <<<<<<<<<<<<<< @@ -48635,7 +48577,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __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/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1071 + /* "/home/paulb/workspace/cdec/python/src/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, # <<<<<<<<<<<<<< @@ -48658,7 +48600,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1072 + /* "/home/paulb/workspace/cdec/python/src/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], # <<<<<<<<<<<<<< @@ -48676,7 +48618,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__suffix_link), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1073 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -48696,7 +48638,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1075 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1075 * phrase=hiero_phrase) * else: * if arity > 0: # <<<<<<<<<<<<<< @@ -48706,7 +48648,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_t_9 = (__pyx_cur_scope->__pyx_v_arity > 0); if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1077 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1077 * if arity > 0: * # Intersecting because of arity > 0 * intersect_start_time = monitor_cpu() # <<<<<<<<<<<<<< @@ -48724,7 +48666,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_intersect_start_time = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1078 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -48748,7 +48690,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_phrase_location = ((struct __pyx_obj_3_sa_PhraseLocation *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1079 + /* "/home/paulb/workspace/cdec/python/src/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() # <<<<<<<<<<<<<< @@ -48766,7 +48708,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_intersect_stop_time = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1080 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -48788,7 +48730,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1083 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1083 * else: * # Suffix array search * phrase_location = node.phrase_location # <<<<<<<<<<<<<< @@ -48804,7 +48746,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_phrase_location = ((struct __pyx_obj_3_sa_PhraseLocation *)__pyx_t_17); __pyx_t_17 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1084 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -48850,7 +48792,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_sa_range = __pyx_t_12; __pyx_t_12 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1085 + /* "/home/paulb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -48860,7 +48802,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_t_9 = (__pyx_cur_scope->__pyx_v_sa_range != Py_None); if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1086 + /* "/home/paulb/workspace/cdec/python/src/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]) # <<<<<<<<<<<<<< @@ -48889,7 +48831,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1088 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1088 * phrase_location = PhraseLocation(sa_low=sa_range[0], sa_high=sa_range[1]) * else: * phrase_location = None # <<<<<<<<<<<<<< @@ -48906,7 +48848,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene } __pyx_L34:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1090 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1090 * phrase_location = None * * if phrase_location is None: # <<<<<<<<<<<<<< @@ -48916,7 +48858,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_t_9 = (((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location) == Py_None); if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1091 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1091 * * if phrase_location is None: * node.children[word_id] = None # <<<<<<<<<<<<<< @@ -48928,7 +48870,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene if (PyObject_SetItem(__pyx_t_10, __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_10); __pyx_t_10 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1093 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1093 * node.children[word_id] = None * # Search failed * continue # <<<<<<<<<<<<<< @@ -48940,7 +48882,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene } __pyx_L36:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1095 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1095 * continue * # Search succeeded * suffix_link = self.rules.root # <<<<<<<<<<<<<< @@ -48953,7 +48895,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self->rules->root); __pyx_cur_scope->__pyx_v_suffix_link = __pyx_cur_scope->__pyx_v_self->rules->root; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1096 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1096 * # Search succeeded * suffix_link = self.rules.root * if node.suffix_link is not None: # <<<<<<<<<<<<<< @@ -48966,7 +48908,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1097 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1097 * suffix_link = self.rules.root * if node.suffix_link is not None: * suffix_link = node.suffix_link.children[word_id] # <<<<<<<<<<<<<< @@ -48990,7 +48932,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene } __pyx_L37:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1098 + /* "/home/paulb/workspace/cdec/python/src/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, # <<<<<<<<<<<<<< @@ -49001,7 +48943,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __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 = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1099 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1099 * suffix_link = node.suffix_link.children[word_id] * new_node = ExtendedTrieNode(phrase_location=phrase_location, * suffix_link=suffix_link, # <<<<<<<<<<<<<< @@ -49010,7 +48952,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene */ 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 = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1100 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1100 * new_node = ExtendedTrieNode(phrase_location=phrase_location, * suffix_link=suffix_link, * phrase=hiero_phrase) # <<<<<<<<<<<<<< @@ -49029,7 +48971,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene } __pyx_L33:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1101 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1101 * suffix_link=suffix_link, * phrase=hiero_phrase) * node.children[word_id] = new_node # <<<<<<<<<<<<<< @@ -49041,7 +48983,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene 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 = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1102 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1102 * phrase=hiero_phrase) * node.children[word_id] = new_node * node = new_node # <<<<<<<<<<<<<< @@ -49054,7 +48996,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_new_node); __pyx_cur_scope->__pyx_v_node = __pyx_cur_scope->__pyx_v_new_node; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1107 + /* "/home/paulb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -49064,7 +49006,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_t_9 = (__pyx_cur_scope->__pyx_v_arity < __pyx_cur_scope->__pyx_v_self->max_nonterminals); if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1108 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1108 * the node will exist if needed)''' * if arity < self.max_nonterminals: * xcat_index = arity+1 # <<<<<<<<<<<<<< @@ -49079,7 +49021,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_xcat_index = __pyx_t_12; __pyx_t_12 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1109 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1109 * if arity < self.max_nonterminals: * xcat_index = arity+1 * xcat = sym_setindex(self.category, xcat_index) # <<<<<<<<<<<<<< @@ -49089,7 +49031,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_t_20 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_xcat_index); if (unlikely((__pyx_t_20 == (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_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_20); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1110 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1110 * xcat_index = arity+1 * xcat = sym_setindex(self.category, xcat_index) * suffix_link_xcat_index = xcat_index # <<<<<<<<<<<<<< @@ -49102,7 +49044,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_xcat_index); __pyx_cur_scope->__pyx_v_suffix_link_xcat_index = __pyx_cur_scope->__pyx_v_xcat_index; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1111 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1111 * xcat = sym_setindex(self.category, xcat_index) * suffix_link_xcat_index = xcat_index * if is_shadow_path: # <<<<<<<<<<<<<< @@ -49112,7 +49054,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __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 = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1112 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1112 * suffix_link_xcat_index = xcat_index * if is_shadow_path: * suffix_link_xcat_index = xcat_index-1 # <<<<<<<<<<<<<< @@ -49130,7 +49072,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene } __pyx_L39:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1113 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -49140,7 +49082,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_t_20 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_suffix_link_xcat_index); if (unlikely((__pyx_t_20 == (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_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_20); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1114 + /* "/home/paulb/workspace/cdec/python/src/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, # <<<<<<<<<<<<<< @@ -49154,7 +49096,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_10) < 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; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1115 + /* "/home/paulb/workspace/cdec/python/src/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], # <<<<<<<<<<<<<< @@ -49172,7 +49114,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__suffix_link), __pyx_t_10) < 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; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1116 + /* "/home/paulb/workspace/cdec/python/src/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,))) # <<<<<<<<<<<<<< @@ -49203,7 +49145,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1114 + /* "/home/paulb/workspace/cdec/python/src/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, # <<<<<<<<<<<<<< @@ -49219,7 +49161,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene } __pyx_L38:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1119 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1119 * * # sample from range * if not is_shadow_path: # <<<<<<<<<<<<<< @@ -49230,7 +49172,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_t_21 = (!__pyx_t_9); if (__pyx_t_21) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1120 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1120 * # sample from range * if not is_shadow_path: * sample = self.sampler.sample(node.phrase_location) # <<<<<<<<<<<<<< @@ -49257,7 +49199,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_sample = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_12); __pyx_t_12 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1121 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1121 * if not is_shadow_path: * sample = self.sampler.sample(node.phrase_location) * num_subpatterns = ( node.phrase_location).num_subpatterns # <<<<<<<<<<<<<< @@ -49269,7 +49211,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_num_subpatterns = ((struct __pyx_obj_3_sa_PhraseLocation *)__pyx_t_12)->num_subpatterns; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1122 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1122 * sample = self.sampler.sample(node.phrase_location) * num_subpatterns = ( node.phrase_location).num_subpatterns * chunklen = IntList(initial_len=num_subpatterns) # <<<<<<<<<<<<<< @@ -49291,7 +49233,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_chunklen = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_17); __pyx_t_17 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1123 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1123 * num_subpatterns = ( node.phrase_location).num_subpatterns * chunklen = IntList(initial_len=num_subpatterns) * for j from 0 <= j < num_subpatterns: # <<<<<<<<<<<<<< @@ -49301,7 +49243,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_t_20 = __pyx_cur_scope->__pyx_v_num_subpatterns; for (__pyx_cur_scope->__pyx_v_j = 0; __pyx_cur_scope->__pyx_v_j < __pyx_t_20; __pyx_cur_scope->__pyx_v_j++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1124 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1124 * chunklen = IntList(initial_len=num_subpatterns) * for j from 0 <= j < num_subpatterns: * chunklen.arr[j] = hiero_phrase.chunklen(j) # <<<<<<<<<<<<<< @@ -49311,7 +49253,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene (__pyx_cur_scope->__pyx_v_chunklen->arr[__pyx_cur_scope->__pyx_v_j]) = ((struct __pyx_vtabstruct_3_sa_Phrase *)__pyx_cur_scope->__pyx_v_hiero_phrase->__pyx_vtab)->chunklen(__pyx_cur_scope->__pyx_v_hiero_phrase, __pyx_cur_scope->__pyx_v_j); } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1125 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1125 * for j from 0 <= j < num_subpatterns: * chunklen.arr[j] = hiero_phrase.chunklen(j) * extracts = [] # <<<<<<<<<<<<<< @@ -49326,7 +49268,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_extracts = __pyx_t_17; __pyx_t_17 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1126 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1126 * chunklen.arr[j] = hiero_phrase.chunklen(j) * extracts = [] * j = 0 # <<<<<<<<<<<<<< @@ -49335,7 +49277,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene */ __pyx_cur_scope->__pyx_v_j = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1127 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1127 * extracts = [] * j = 0 * extract_start = monitor_cpu() # <<<<<<<<<<<<<< @@ -49353,7 +49295,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_extract_start = __pyx_t_12; __pyx_t_12 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1128 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1128 * j = 0 * extract_start = monitor_cpu() * while j < sample.len: # <<<<<<<<<<<<<< @@ -49364,7 +49306,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_t_21 = (__pyx_cur_scope->__pyx_v_j < __pyx_cur_scope->__pyx_v_sample->len); if (!__pyx_t_21) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1129 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1129 * extract_start = monitor_cpu() * while j < sample.len: * extract = [] # <<<<<<<<<<<<<< @@ -49379,7 +49321,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_extract = ((PyObject *)__pyx_t_12); __pyx_t_12 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1131 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1131 * extract = [] * * assign_matching(&matching, sample.arr, j, num_subpatterns, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -49388,7 +49330,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene */ __pyx_f_3_sa_assign_matching((&__pyx_cur_scope->__pyx_v_matching), __pyx_cur_scope->__pyx_v_sample->arr, __pyx_cur_scope->__pyx_v_j, __pyx_cur_scope->__pyx_v_num_subpatterns, __pyx_cur_scope->__pyx_v_self->fda->sent_id->arr); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1132 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1132 * * assign_matching(&matching, sample.arr, j, num_subpatterns, self.fda.sent_id.arr) * loc = tuple(sample[j:j+num_subpatterns]) # <<<<<<<<<<<<<< @@ -49411,7 +49353,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_loc = __pyx_t_12; __pyx_t_12 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1133 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -49426,7 +49368,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_extract = __pyx_t_12; __pyx_t_12 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1134 + /* "/home/paulb/workspace/cdec/python/src/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]) # <<<<<<<<<<<<<< @@ -49448,18 +49390,10 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene for (;;) { 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_16 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_6); __Pyx_INCREF(__pyx_t_16); __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_16 = PySequence_ITEM(__pyx_t_10, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_16 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_6); __Pyx_INCREF(__pyx_t_16); __pyx_t_6++; } 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_16 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_6); __Pyx_INCREF(__pyx_t_16); __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_16 = PySequence_ITEM(__pyx_t_10, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_16 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_6); __Pyx_INCREF(__pyx_t_16); __pyx_t_6++; } else { __pyx_t_16 = __pyx_t_22(__pyx_t_10); if (unlikely(!__pyx_t_16)) { @@ -49484,7 +49418,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __Pyx_INCREF(__pyx_cur_scope->__pyx_v_loc); PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_cur_scope->__pyx_v_loc); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_loc); - if (unlikely(__Pyx_PyList_Append(__pyx_t_17, (PyObject*)__pyx_t_16))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(PyList_Append(__pyx_t_17, (PyObject*)__pyx_t_16))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_16)); __pyx_t_16 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -49500,7 +49434,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1135 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -49510,7 +49444,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_j = (__pyx_cur_scope->__pyx_v_j + __pyx_cur_scope->__pyx_v_num_subpatterns); } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1137 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1137 * j = j + num_subpatterns * * num_samples = sample.len/num_subpatterns # <<<<<<<<<<<<<< @@ -49527,7 +49461,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene } __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/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1138 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1138 * * num_samples = sample.len/num_subpatterns * extract_stop = monitor_cpu() # <<<<<<<<<<<<<< @@ -49545,7 +49479,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_extract_stop = __pyx_t_10; __pyx_t_10 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1139 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1139 * num_samples = sample.len/num_subpatterns * extract_stop = monitor_cpu() * self.extract_time = self.extract_time + extract_stop - extract_start # <<<<<<<<<<<<<< @@ -49564,18 +49498,18 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_cur_scope->__pyx_v_self->extract_time = __pyx_t_4; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1140 + /* "/home/paulb/workspace/cdec/python/src/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 = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyList_GET_SIZE(((PyObject *)__pyx_cur_scope->__pyx_v_extracts)); __pyx_t_21 = (__pyx_t_6 > 0); if (__pyx_t_21) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1141 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1141 * self.extract_time = self.extract_time + extract_stop - extract_start * if len(extracts) > 0: * fcount = Counter() # <<<<<<<<<<<<<< @@ -49593,7 +49527,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_fcount = __pyx_t_17; __pyx_t_17 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1142 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1142 * if len(extracts) > 0: * fcount = Counter() * fphrases = defaultdict(lambda: defaultdict(lambda: defaultdict(list))) # <<<<<<<<<<<<<< @@ -49619,7 +49553,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_fphrases = __pyx_t_10; __pyx_t_10 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1143 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1143 * fcount = Counter() * fphrases = defaultdict(lambda: defaultdict(lambda: defaultdict(list))) * for (f, e, count, als), loc in extracts: # <<<<<<<<<<<<<< @@ -49629,40 +49563,30 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_t_10 = ((PyObject *)__pyx_cur_scope->__pyx_v_extracts); __Pyx_INCREF(__pyx_t_10); __pyx_t_6 = 0; 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 = 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 = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_12 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_6); __Pyx_INCREF(__pyx_t_12); __pyx_t_6++; if ((likely(PyTuple_CheckExact(__pyx_t_12))) || (PyList_CheckExact(__pyx_t_12))) { PyObject* sequence = __pyx_t_12; - #if CYTHON_COMPILING_IN_CPYTHON - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { + if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { + if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); + else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } __pyx_t_17 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_16 = PyTuple_GET_ITEM(sequence, 1); } else { + if (unlikely(PyList_GET_SIZE(sequence) != 2)) { + if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); + else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } __pyx_t_17 = PyList_GET_ITEM(sequence, 0); __pyx_t_16 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_17); __Pyx_INCREF(__pyx_t_16); - #else - __pyx_t_17 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_16 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - } else - { + } 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 = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); @@ -49673,35 +49597,33 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene index = 1; __pyx_t_16 = __pyx_t_19(__pyx_t_1); if (unlikely(!__pyx_t_16)) goto __pyx_L50_unpacking_failed; __Pyx_GOTREF(__pyx_t_16); if (__Pyx_IternextUnpackEndCheck(__pyx_t_19(__pyx_t_1), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_19 = NULL; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L51_unpacking_done; __pyx_L50_unpacking_failed:; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_19 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); + if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); {__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_17))) || (PyList_CheckExact(__pyx_t_17))) { PyObject* sequence = __pyx_t_17; - #if CYTHON_COMPILING_IN_CPYTHON - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 4)) { - if (size > 4) __Pyx_RaiseTooManyValuesError(4); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { + if (unlikely(PyTuple_GET_SIZE(sequence) != 4)) { + if (PyTuple_GET_SIZE(sequence) > 4) __Pyx_RaiseTooManyValuesError(4); + else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } __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); } else { + if (unlikely(PyList_GET_SIZE(sequence) != 4)) { + if (PyList_GET_SIZE(sequence) > 4) __Pyx_RaiseTooManyValuesError(4); + else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); __pyx_t_11 = PyList_GET_ITEM(sequence, 2); @@ -49711,36 +49633,28 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx_t_8); - #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 = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - *(temps[i]) = item; - } - #endif __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - } else - { + } else { Py_ssize_t index = -1; - PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_3,&__pyx_t_11,&__pyx_t_8}; __pyx_t_15 = PyObject_GetIter(__pyx_t_17); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __pyx_t_19 = Py_TYPE(__pyx_t_15)->tp_iternext; - for (index=0; index < 4; index++) { - PyObject* item = __pyx_t_19(__pyx_t_15); if (unlikely(!item)) goto __pyx_L52_unpacking_failed; - __Pyx_GOTREF(item); - *(temps[index]) = item; - } + index = 0; __pyx_t_1 = __pyx_t_19(__pyx_t_15); if (unlikely(!__pyx_t_1)) goto __pyx_L52_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + index = 1; __pyx_t_3 = __pyx_t_19(__pyx_t_15); if (unlikely(!__pyx_t_3)) goto __pyx_L52_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 2; __pyx_t_11 = __pyx_t_19(__pyx_t_15); if (unlikely(!__pyx_t_11)) goto __pyx_L52_unpacking_failed; + __Pyx_GOTREF(__pyx_t_11); + index = 3; __pyx_t_8 = __pyx_t_19(__pyx_t_15); if (unlikely(!__pyx_t_8)) goto __pyx_L52_unpacking_failed; + __Pyx_GOTREF(__pyx_t_8); if (__Pyx_IternextUnpackEndCheck(__pyx_t_19(__pyx_t_15), 4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_19 = NULL; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; goto __pyx_L53_unpacking_done; __pyx_L52_unpacking_failed:; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_19 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); + if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L53_unpacking_done:; } @@ -49770,7 +49684,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_loc = __pyx_t_16; __pyx_t_16 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1144 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1144 * fphrases = defaultdict(lambda: defaultdict(lambda: defaultdict(list))) * for (f, e, count, als), loc in extracts: * fcount[f] += count # <<<<<<<<<<<<<< @@ -49788,7 +49702,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1145 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1145 * for (f, e, count, als), loc in extracts: * fcount[f] += count * fphrases[f][e][als].append(loc) # <<<<<<<<<<<<<< @@ -49810,75 +49724,191 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1146 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1146 * fcount[f] += count * fphrases[f][e][als].append(loc) * for f, elist in fphrases.iteritems(): # <<<<<<<<<<<<<< * for e, alslist in elist.iteritems(): * alignment, max_locs = max(alslist.iteritems(), key=lambda x: len(x[1])) */ - __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 = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_17 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_fphrases, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_23), (&__pyx_t_20)); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_fphrases, __pyx_n_s__iteritems); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_17 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); - __Pyx_XDECREF(__pyx_t_10); - __pyx_t_10 = __pyx_t_17; - __pyx_t_17 = 0; - while (1) { - __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_10, __pyx_t_23, &__pyx_t_6, &__pyx_t_17, &__pyx_t_12, NULL, __pyx_t_20); - if (unlikely(__pyx_t_7 == 0)) break; - 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_17); - __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyList_CheckExact(__pyx_t_17) || PyTuple_CheckExact(__pyx_t_17)) { + __pyx_t_10 = __pyx_t_17; __Pyx_INCREF(__pyx_t_10); __pyx_t_6 = 0; + __pyx_t_22 = NULL; + } else { + __pyx_t_6 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_17); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_22 = Py_TYPE(__pyx_t_10)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + for (;;) { + if (!__pyx_t_22 && PyList_CheckExact(__pyx_t_10)) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_10)) break; + __pyx_t_17 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_6); __Pyx_INCREF(__pyx_t_17); __pyx_t_6++; + } else if (!__pyx_t_22 && PyTuple_CheckExact(__pyx_t_10)) { + if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_10)) break; + __pyx_t_17 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_6); __Pyx_INCREF(__pyx_t_17); __pyx_t_6++; + } 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 = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_17); + } + if ((likely(PyTuple_CheckExact(__pyx_t_17))) || (PyList_CheckExact(__pyx_t_17))) { + PyObject* sequence = __pyx_t_17; + if (likely(PyTuple_CheckExact(sequence))) { + if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { + if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); + else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_12 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_16 = PyTuple_GET_ITEM(sequence, 1); + } else { + if (unlikely(PyList_GET_SIZE(sequence) != 2)) { + if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); + else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_12 = PyList_GET_ITEM(sequence, 0); + __pyx_t_16 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_12); + __Pyx_INCREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_8 = PyObject_GetIter(__pyx_t_17); 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_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_19 = Py_TYPE(__pyx_t_8)->tp_iternext; + index = 0; __pyx_t_12 = __pyx_t_19(__pyx_t_8); if (unlikely(!__pyx_t_12)) goto __pyx_L56_unpacking_failed; + __Pyx_GOTREF(__pyx_t_12); + index = 1; __pyx_t_16 = __pyx_t_19(__pyx_t_8); if (unlikely(!__pyx_t_16)) goto __pyx_L56_unpacking_failed; + __Pyx_GOTREF(__pyx_t_16); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_19(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L57_unpacking_done; + __pyx_L56_unpacking_failed:; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); + if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L57_unpacking_done:; + } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_f); __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_f); - __Pyx_GIVEREF(__pyx_t_17); - __pyx_cur_scope->__pyx_v_f = __pyx_t_17; - __pyx_t_17 = 0; - __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_elist); - __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_elist); __Pyx_GIVEREF(__pyx_t_12); - __pyx_cur_scope->__pyx_v_elist = __pyx_t_12; + __pyx_cur_scope->__pyx_v_f = __pyx_t_12; __pyx_t_12 = 0; + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_elist); + __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_elist); + __Pyx_GIVEREF(__pyx_t_16); + __pyx_cur_scope->__pyx_v_elist = __pyx_t_16; + __pyx_t_16 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1147 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1147 * fphrases[f][e][als].append(loc) * 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())) */ - __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 = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_17 = __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_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_elist, __pyx_n_s__iteritems); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); - __Pyx_XDECREF(__pyx_t_12); - __pyx_t_12 = __pyx_t_17; - __pyx_t_17 = 0; - while (1) { - __pyx_t_5 = __Pyx_dict_iter_next(__pyx_t_12, __pyx_t_25, &__pyx_t_24, &__pyx_t_17, &__pyx_t_16, NULL, __pyx_t_7); - if (unlikely(__pyx_t_5 == 0)) break; - if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = PyObject_Call(__pyx_t_17, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + if (PyList_CheckExact(__pyx_t_16) || PyTuple_CheckExact(__pyx_t_16)) { + __pyx_t_17 = __pyx_t_16; __Pyx_INCREF(__pyx_t_17); __pyx_t_23 = 0; + __pyx_t_24 = NULL; + } else { + __pyx_t_23 = -1; __pyx_t_17 = PyObject_GetIter(__pyx_t_16); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); - __Pyx_GOTREF(__pyx_t_16); + __pyx_t_24 = Py_TYPE(__pyx_t_17)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + for (;;) { + if (!__pyx_t_24 && PyList_CheckExact(__pyx_t_17)) { + if (__pyx_t_23 >= PyList_GET_SIZE(__pyx_t_17)) break; + __pyx_t_16 = PyList_GET_ITEM(__pyx_t_17, __pyx_t_23); __Pyx_INCREF(__pyx_t_16); __pyx_t_23++; + } else if (!__pyx_t_24 && PyTuple_CheckExact(__pyx_t_17)) { + if (__pyx_t_23 >= PyTuple_GET_SIZE(__pyx_t_17)) break; + __pyx_t_16 = PyTuple_GET_ITEM(__pyx_t_17, __pyx_t_23); __Pyx_INCREF(__pyx_t_16); __pyx_t_23++; + } else { + __pyx_t_16 = __pyx_t_24(__pyx_t_17); + if (unlikely(!__pyx_t_16)) { + if (PyErr_Occurred()) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_16); + } + if ((likely(PyTuple_CheckExact(__pyx_t_16))) || (PyList_CheckExact(__pyx_t_16))) { + PyObject* sequence = __pyx_t_16; + if (likely(PyTuple_CheckExact(sequence))) { + if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { + if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); + else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_12 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); + } else { + if (unlikely(PyList_GET_SIZE(sequence) != 2)) { + if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); + else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_12 = PyList_GET_ITEM(sequence, 0); + __pyx_t_8 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_12); + __Pyx_INCREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_11 = PyObject_GetIter(__pyx_t_16); 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_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_19 = Py_TYPE(__pyx_t_11)->tp_iternext; + index = 0; __pyx_t_12 = __pyx_t_19(__pyx_t_11); if (unlikely(!__pyx_t_12)) goto __pyx_L60_unpacking_failed; + __Pyx_GOTREF(__pyx_t_12); + index = 1; __pyx_t_8 = __pyx_t_19(__pyx_t_11); if (unlikely(!__pyx_t_8)) goto __pyx_L60_unpacking_failed; + __Pyx_GOTREF(__pyx_t_8); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_19(__pyx_t_11), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L61_unpacking_done; + __pyx_L60_unpacking_failed:; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); + if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L61_unpacking_done:; + } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_e); __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_e); - __Pyx_GIVEREF(__pyx_t_17); - __pyx_cur_scope->__pyx_v_e = __pyx_t_17; - __pyx_t_17 = 0; + __Pyx_GIVEREF(__pyx_t_12); + __pyx_cur_scope->__pyx_v_e = __pyx_t_12; + __pyx_t_12 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_alslist); __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_alslist); - __Pyx_GIVEREF(__pyx_t_16); - __pyx_cur_scope->__pyx_v_alslist = __pyx_t_16; - __pyx_t_16 = 0; + __Pyx_GIVEREF(__pyx_t_8); + __pyx_cur_scope->__pyx_v_alslist = __pyx_t_8; + __pyx_t_8 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1148 + /* "/home/paulb/workspace/cdec/python/src/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])) # <<<<<<<<<<<<<< @@ -49887,154 +49917,147 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene */ __pyx_t_16 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_alslist, __pyx_n_s__iteritems); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_16); - __pyx_t_17 = PyObject_Call(__pyx_t_16, ((PyObject *)__pyx_empty_tuple), NULL); 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_8 = PyObject_Call(__pyx_t_16, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __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); - __pyx_t_17 = 0; - __pyx_t_17 = PyDict_New(); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_17)); - __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_5input_1lambda6, 0, NULL, __pyx_n_s___sa, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_17, ((PyObject *)__pyx_n_s__key), __pyx_t_8) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __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_16), ((PyObject *)__pyx_t_17)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_8)); + __pyx_t_12 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_5input_1lambda6, 0, NULL, __pyx_n_s___sa, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_t_8, ((PyObject *)__pyx_n_s__key), __pyx_t_12) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_16), ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(((PyObject *)__pyx_t_16)); __pyx_t_16 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0; - if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) { - PyObject* sequence = __pyx_t_8; - #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 = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - #if CYTHON_COMPILING_IN_CPYTHON + __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; + if ((likely(PyTuple_CheckExact(__pyx_t_12))) || (PyList_CheckExact(__pyx_t_12))) { + PyObject* sequence = __pyx_t_12; if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_17 = PyTuple_GET_ITEM(sequence, 0); + if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { + if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); + else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_16 = PyTuple_GET_ITEM(sequence, 1); } else { - __pyx_t_17 = PyList_GET_ITEM(sequence, 0); + if (unlikely(PyList_GET_SIZE(sequence) != 2)) { + if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); + else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = PyList_GET_ITEM(sequence, 0); __pyx_t_16 = PyList_GET_ITEM(sequence, 1); } - __Pyx_INCREF(__pyx_t_17); + __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_16); - #else - __pyx_t_17 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_16 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } else - { + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 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 = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyObject_GetIter(__pyx_t_12); 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_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_19 = Py_TYPE(__pyx_t_11)->tp_iternext; - index = 0; __pyx_t_17 = __pyx_t_19(__pyx_t_11); if (unlikely(!__pyx_t_17)) goto __pyx_L58_unpacking_failed; - __Pyx_GOTREF(__pyx_t_17); - index = 1; __pyx_t_16 = __pyx_t_19(__pyx_t_11); if (unlikely(!__pyx_t_16)) goto __pyx_L58_unpacking_failed; + index = 0; __pyx_t_8 = __pyx_t_19(__pyx_t_11); if (unlikely(!__pyx_t_8)) goto __pyx_L62_unpacking_failed; + __Pyx_GOTREF(__pyx_t_8); + index = 1; __pyx_t_16 = __pyx_t_19(__pyx_t_11); if (unlikely(!__pyx_t_16)) goto __pyx_L62_unpacking_failed; __Pyx_GOTREF(__pyx_t_16); if (__Pyx_IternextUnpackEndCheck(__pyx_t_19(__pyx_t_11), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_19 = NULL; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - goto __pyx_L59_unpacking_done; - __pyx_L58_unpacking_failed:; + goto __pyx_L63_unpacking_done; + __pyx_L62_unpacking_failed:; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_19 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); + if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_L59_unpacking_done:; + __pyx_L63_unpacking_done:; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_alignment); __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_alignment); - __Pyx_GIVEREF(__pyx_t_17); - __pyx_cur_scope->__pyx_v_alignment = __pyx_t_17; - __pyx_t_17 = 0; + __Pyx_GIVEREF(__pyx_t_8); + __pyx_cur_scope->__pyx_v_alignment = __pyx_t_8; + __pyx_t_8 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_max_locs); __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_max_locs); __Pyx_GIVEREF(__pyx_t_16); __pyx_cur_scope->__pyx_v_max_locs = __pyx_t_16; __pyx_t_16 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1149 + /* "/home/paulb/workspace/cdec/python/src/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_GetName(__pyx_m, __pyx_n_s__itertools); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_16 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__chain); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __Pyx_GetName(__pyx_m, __pyx_n_s__itertools); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_16 = PyObject_GetAttr(__pyx_t_12, __pyx_n_s__chain); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_16); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyObject_GetAttr(__pyx_t_16, __pyx_n_s__from_iterable); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = PyObject_GetAttr(__pyx_t_16, __pyx_n_s__from_iterable); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_16 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_alslist, __pyx_n_s__itervalues); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_16); - __pyx_t_17 = PyObject_Call(__pyx_t_16, ((PyObject *)__pyx_empty_tuple), NULL); 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_8 = PyObject_Call(__pyx_t_16, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __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); - __pyx_t_17 = 0; - __pyx_t_17 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_16), NULL); 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; + PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_t_16), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_16)); __pyx_t_16 = 0; __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __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); - __pyx_t_17 = 0; - __pyx_t_17 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_16), NULL); 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_16, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_16), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(((PyObject *)__pyx_t_16)); __pyx_t_16 = 0; __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_locs)); __Pyx_XDECREF(((PyObject *)__pyx_cur_scope->__pyx_v_locs)); - __Pyx_GIVEREF(__pyx_t_17); - __pyx_cur_scope->__pyx_v_locs = ((PyObject*)__pyx_t_17); - __pyx_t_17 = 0; + __Pyx_GIVEREF(__pyx_t_8); + __pyx_cur_scope->__pyx_v_locs = ((PyObject*)__pyx_t_8); + __pyx_t_8 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1150 + /* "/home/paulb/workspace/cdec/python/src/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 = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_17 = PyInt_FromSsize_t(__pyx_t_26); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_17); + __pyx_t_25 = PyTuple_GET_SIZE(((PyObject *)__pyx_cur_scope->__pyx_v_locs)); + __pyx_t_8 = PyInt_FromSsize_t(__pyx_t_25); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_count); __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_count); - __Pyx_GIVEREF(__pyx_t_17); - __pyx_cur_scope->__pyx_v_count = __pyx_t_17; - __pyx_t_17 = 0; + __Pyx_GIVEREF(__pyx_t_8); + __pyx_cur_scope->__pyx_v_count = __pyx_t_8; + __pyx_t_8 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1151 + /* "/home/paulb/workspace/cdec/python/src/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_17 = __Pyx_GetName(__pyx_m, __pyx_n_s__FeatureContext); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_17); + __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__FeatureContext); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1152 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1152 * count = len(locs) * scores = self.scorer.score(FeatureContext( * f, e, count, fcount[f], num_samples, # <<<<<<<<<<<<<< @@ -50043,10 +50066,10 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene */ __pyx_t_16 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fcount, __pyx_cur_scope->__pyx_v_f); if (!__pyx_t_16) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_16); - __pyx_t_8 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_num_samples); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_12 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_num_samples); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1153 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1153 * scores = self.scorer.score(FeatureContext( * f, e, count, fcount[f], num_samples, * (k,i+spanlen), locs, input_match, # <<<<<<<<<<<<<< @@ -50069,7 +50092,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_t_11 = 0; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1157 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1157 * meta, * # Include online stats. None if none. * self.online_ctx_lookup(f, e))) # <<<<<<<<<<<<<< @@ -50103,8 +50126,8 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_count); PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_16); __Pyx_GIVEREF(__pyx_t_16); - PyTuple_SET_ITEM(__pyx_t_11, 4, __pyx_t_8); - __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_11, 4, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); 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)); @@ -50128,12 +50151,12 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene PyTuple_SET_ITEM(__pyx_t_11, 12, __pyx_t_15); __Pyx_GIVEREF(__pyx_t_15); __pyx_t_16 = 0; - __pyx_t_8 = 0; + __pyx_t_12 = 0; __pyx_t_3 = 0; __pyx_t_15 = 0; - __pyx_t_15 = PyObject_Call(__pyx_t_17, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __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_8); __pyx_t_8 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0; __pyx_t_11 = ((PyObject *)((struct __pyx_vtabstruct_3_sa_Scorer *)__pyx_cur_scope->__pyx_v_self->scorer->__pyx_vtab)->score(__pyx_cur_scope->__pyx_v_self->scorer, __pyx_t_15)); 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); @@ -50144,7 +50167,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_scores = ((struct __pyx_obj_3_sa_FeatureVector *)__pyx_t_11); __pyx_t_11 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1159 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1159 * self.online_ctx_lookup(f, e))) * # Phrase pair processed * if self.online: # <<<<<<<<<<<<<< @@ -50153,7 +50176,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene */ if (__pyx_cur_scope->__pyx_v_self->online) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1160 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1160 * # Phrase pair processed * if self.online: * seen_phrases.add((f, e)) # <<<<<<<<<<<<<< @@ -50170,11 +50193,11 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __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 = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0; - goto __pyx_L60; + goto __pyx_L64; } - __pyx_L60:; + __pyx_L64:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1161 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1161 * if self.online: * seen_phrases.add((f, e)) * yield Rule(self.category, f, e, scores, alignment) # <<<<<<<<<<<<<< @@ -50207,42 +50230,38 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_t_11 = 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_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_cur_scope->__pyx_t_2 = __pyx_t_10; __Pyx_XGIVEREF(__pyx_t_14); - __pyx_cur_scope->__pyx_t_5 = __pyx_t_14; - __pyx_cur_scope->__pyx_t_6 = __pyx_t_20; - __pyx_cur_scope->__pyx_t_7 = __pyx_t_23; - __pyx_cur_scope->__pyx_t_8 = __pyx_t_24; - __pyx_cur_scope->__pyx_t_9 = __pyx_t_25; + __pyx_cur_scope->__pyx_t_3 = __pyx_t_14; + __Pyx_XGIVEREF(__pyx_t_17); + __pyx_cur_scope->__pyx_t_4 = __pyx_t_17; + __pyx_cur_scope->__pyx_t_5 = __pyx_t_22; + __pyx_cur_scope->__pyx_t_6 = __pyx_t_23; + __pyx_cur_scope->__pyx_t_7 = __pyx_t_24; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); /* return from generator, yielding value */ __pyx_generator->resume_label = 1; return __pyx_r; - __pyx_L61_resume_from_yield:; + __pyx_L65_resume_from_yield:; __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_cur_scope->__pyx_t_3 = 0; + __pyx_t_10 = __pyx_cur_scope->__pyx_t_2; + __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_10); - __pyx_t_12 = __pyx_cur_scope->__pyx_t_4; - __pyx_cur_scope->__pyx_t_4 = 0; - __Pyx_XGOTREF(__pyx_t_12); - __pyx_t_14 = __pyx_cur_scope->__pyx_t_5; - __pyx_cur_scope->__pyx_t_5 = 0; + __pyx_t_14 = __pyx_cur_scope->__pyx_t_3; + __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_14); - __pyx_t_20 = __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; + __pyx_t_17 = __pyx_cur_scope->__pyx_t_4; + __pyx_cur_scope->__pyx_t_4 = 0; + __Pyx_XGOTREF(__pyx_t_17); + __pyx_t_22 = __pyx_cur_scope->__pyx_t_5; + __pyx_t_23 = __pyx_cur_scope->__pyx_t_6; + __pyx_t_24 = __pyx_cur_scope->__pyx_t_7; 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_17); __pyx_t_17 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L47; @@ -50255,29 +50274,30 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene } __pyx_L32:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1163 + /* "/home/paulb/workspace/cdec/python/src/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 = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_21 = (__pyx_t_23 < __pyx_cur_scope->__pyx_v_self->max_length); + __pyx_t_6 = PyObject_Length(__pyx_cur_scope->__pyx_v_phrase); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_21 = (__pyx_t_6 < __pyx_cur_scope->__pyx_v_self->max_length); if (__pyx_t_21) { __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); 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_12 = PyNumber_Add(__pyx_t_10, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); + __pyx_t_17 = PyNumber_Add(__pyx_t_10, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); __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 = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_Length(__pyx_t_10); if (unlikely(__pyx_t_6 == -1)) {__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_10 = PyInt_FromSsize_t(__pyx_t_23); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyInt_FromSsize_t(__pyx_t_6); 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 = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_11 = PyObject_RichCompare(__pyx_t_17, __pyx_t_10, Py_LT); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; @@ -50286,50 +50306,51 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __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 = 1163; __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 = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PyObject_RichCompare(__pyx_t_11, __pyx_t_10, Py_LE); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); __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 = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_28 = __pyx_t_27; + __pyx_t_26 = __Pyx_PyObject_IsTrue(__pyx_t_17); if (unlikely(__pyx_t_26 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_27 = __pyx_t_26; } else { - __pyx_t_28 = __pyx_t_9; + __pyx_t_27 = __pyx_t_9; } - __pyx_t_9 = __pyx_t_28; + __pyx_t_9 = __pyx_t_27; } else { __pyx_t_9 = __pyx_t_21; } if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1164 + /* "/home/paulb/workspace/cdec/python/src/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 = 1164; __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 = 1164; __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 = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_10 = PyNumber_Add(__pyx_t_17, __pyx_cur_scope->__pyx_v_spanlen); 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 = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_17 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fwords, __pyx_t_10); if (!__pyx_t_17) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); __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 = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_23; __pyx_t_20+=1) { + __pyx_t_6 = PyObject_Length(__pyx_t_17); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_6; __pyx_t_20+=1) { __pyx_cur_scope->__pyx_v_alt_id = __pyx_t_20; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1165 + /* "/home/paulb/workspace/cdec/python/src/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 = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); + __pyx_t_17 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); 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 = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -50339,37 +50360,37 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __Pyx_GOTREF(__pyx_t_10); __pyx_t_15 = PyNumber_Add(__pyx_cur_scope->__pyx_v_pathlen, __pyx_int_1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - __pyx_t_17 = PyTuple_New(8); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_17); - PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_12); - __Pyx_GIVEREF(__pyx_t_12); - PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_11); + __pyx_t_8 = PyTuple_New(8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_17); + __Pyx_GIVEREF(__pyx_t_17); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_input_match); - PyTuple_SET_ITEM(__pyx_t_17, 2, __pyx_cur_scope->__pyx_v_input_match); + PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_cur_scope->__pyx_v_input_match); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_input_match); - PyTuple_SET_ITEM(__pyx_t_17, 3, __pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_17, 4, __pyx_t_15); + PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_t_15); __Pyx_GIVEREF(__pyx_t_15); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_node); - PyTuple_SET_ITEM(__pyx_t_17, 5, __pyx_cur_scope->__pyx_v_node); + PyTuple_SET_ITEM(__pyx_t_8, 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_17, 6, __pyx_cur_scope->__pyx_v_phrase); + PyTuple_SET_ITEM(__pyx_t_8, 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_17, 7, __pyx_cur_scope->__pyx_v_is_shadow_path); + PyTuple_SET_ITEM(__pyx_t_8, 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_17 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_15 = 0; - __pyx_t_13 = PyList_Append(__pyx_cur_scope->__pyx_v_new_frontier, ((PyObject *)__pyx_t_17)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0; + __pyx_t_13 = 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 = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1166 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -50378,7 +50399,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene */ __pyx_cur_scope->__pyx_v_num_subpatterns = __pyx_cur_scope->__pyx_v_arity; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1167 + /* "/home/paulb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -50389,7 +50410,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_t_21 = (!__pyx_t_9); if (__pyx_t_21) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1168 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1168 * num_subpatterns = arity * if not is_shadow_path: * num_subpatterns = num_subpatterns + 1 # <<<<<<<<<<<<<< @@ -50397,34 +50418,34 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene * xcat = sym_setindex(self.category, arity+1) */ __pyx_cur_scope->__pyx_v_num_subpatterns = (__pyx_cur_scope->__pyx_v_num_subpatterns + 1); - goto __pyx_L65; + goto __pyx_L69; } - __pyx_L65:; + __pyx_L69:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1169 + /* "/home/paulb/workspace/cdec/python/src/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 = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_21 = ((__pyx_t_23 + 1) < __pyx_cur_scope->__pyx_v_self->max_length); + __pyx_t_6 = PyObject_Length(__pyx_cur_scope->__pyx_v_phrase); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_21 = ((__pyx_t_6 + 1) < __pyx_cur_scope->__pyx_v_self->max_length); if (__pyx_t_21) { __pyx_t_9 = (__pyx_cur_scope->__pyx_v_arity < __pyx_cur_scope->__pyx_v_self->max_nonterminals); if (__pyx_t_9) { - __pyx_t_28 = (__pyx_cur_scope->__pyx_v_num_subpatterns < __pyx_cur_scope->__pyx_v_self->max_chunks); - __pyx_t_27 = __pyx_t_28; + __pyx_t_27 = (__pyx_cur_scope->__pyx_v_num_subpatterns < __pyx_cur_scope->__pyx_v_self->max_chunks); + __pyx_t_26 = __pyx_t_27; } else { - __pyx_t_27 = __pyx_t_9; + __pyx_t_26 = __pyx_t_9; } - __pyx_t_9 = __pyx_t_27; + __pyx_t_9 = __pyx_t_26; } else { __pyx_t_9 = __pyx_t_21; } if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1170 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -50433,25 +50454,25 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene */ __pyx_cur_scope->__pyx_v_xcat = __pyx_f_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, (__pyx_cur_scope->__pyx_v_arity + 1)); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1171 + /* "/home/paulb/workspace/cdec/python/src/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_17 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_17); - __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_17, __pyx_cur_scope->__pyx_v_xcat, sizeof(int), PyInt_FromLong); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_8, __pyx_cur_scope->__pyx_v_xcat, sizeof(int), PyInt_FromLong); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1171; __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_8); __pyx_t_8 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_xnode); __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_xnode); __Pyx_GIVEREF(__pyx_t_15); __pyx_cur_scope->__pyx_v_xnode = __pyx_t_15; __pyx_t_15 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1173 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1173 * xnode = node.children[xcat] * # I put spanlen=1 below * key = tuple([self.min_gap_size, i, 1, pathlen]) # <<<<<<<<<<<<<< @@ -50460,14 +50481,14 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene */ __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 = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - __pyx_t_17 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_17); + __pyx_t_8 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); __pyx_t_10 = PyList_New(4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); PyList_SET_ITEM(__pyx_t_10, 0, __pyx_t_15); __Pyx_GIVEREF(__pyx_t_15); - PyList_SET_ITEM(__pyx_t_10, 1, __pyx_t_17); - __Pyx_GIVEREF(__pyx_t_17); + PyList_SET_ITEM(__pyx_t_10, 1, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); __Pyx_INCREF(__pyx_int_1); PyList_SET_ITEM(__pyx_t_10, 2, __pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); @@ -50475,68 +50496,68 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene PyList_SET_ITEM(__pyx_t_10, 3, __pyx_cur_scope->__pyx_v_pathlen); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_pathlen); __pyx_t_15 = 0; - __pyx_t_17 = 0; - __pyx_t_17 = ((PyObject *)PyList_AsTuple(__pyx_t_10)); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_17)); + __pyx_t_8 = 0; + __pyx_t_8 = ((PyObject *)PyList_AsTuple(__pyx_t_10)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_8)); __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_key)); __Pyx_XDECREF(((PyObject *)__pyx_cur_scope->__pyx_v_key)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_17)); - __pyx_cur_scope->__pyx_v_key = __pyx_t_17; - __pyx_t_17 = 0; + __Pyx_GIVEREF(((PyObject *)__pyx_t_8)); + __pyx_cur_scope->__pyx_v_key = __pyx_t_8; + __pyx_t_8 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1174 + /* "/home/paulb/workspace/cdec/python/src/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_17 = PyList_New(0); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_17); + __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_frontier_nodes); __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_frontier_nodes); - __Pyx_GIVEREF(((PyObject *)__pyx_t_17)); - __pyx_cur_scope->__pyx_v_frontier_nodes = ((PyObject *)__pyx_t_17); - __pyx_t_17 = 0; + __Pyx_GIVEREF(((PyObject *)__pyx_t_8)); + __pyx_cur_scope->__pyx_v_frontier_nodes = ((PyObject *)__pyx_t_8); + __pyx_t_8 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1175 + /* "/home/paulb/workspace/cdec/python/src/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_9 = (__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_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((PyDict_Contains(((PyObject *)__pyx_cur_scope->__pyx_v_nodes_isteps_away_buffer), ((PyObject *)__pyx_cur_scope->__pyx_v_key)))); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1176 + /* "/home/paulb/workspace/cdec/python/src/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_17 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_nodes_isteps_away_buffer), ((PyObject *)__pyx_cur_scope->__pyx_v_key)); if (!__pyx_t_17) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_17); + __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_nodes_isteps_away_buffer), ((PyObject *)__pyx_cur_scope->__pyx_v_key)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_frontier_nodes); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_frontier_nodes); - __Pyx_GIVEREF(__pyx_t_17); - __pyx_cur_scope->__pyx_v_frontier_nodes = __pyx_t_17; - __pyx_t_17 = 0; - goto __pyx_L67; + __Pyx_GIVEREF(__pyx_t_8); + __pyx_cur_scope->__pyx_v_frontier_nodes = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L71; } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1178 + /* "/home/paulb/workspace/cdec/python/src/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_17 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_123); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_17); + __pyx_t_8 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_123); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); __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 = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_15 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -50564,9 +50585,9 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_reachable_buffer)); __pyx_t_10 = 0; __pyx_t_15 = 0; - __pyx_t_15 = PyObject_Call(__pyx_t_17, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1178; __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_8); __pyx_t_8 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_frontier_nodes); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_frontier_nodes); @@ -50574,7 +50595,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_frontier_nodes = __pyx_t_15; __pyx_t_15 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1179 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -50583,9 +50604,9 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene */ 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 = 1179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_L67:; + __pyx_L71:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1181 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1181 * nodes_isteps_away_buffer[key] = frontier_nodes * * for (i, alt, pathlen) in frontier_nodes: # <<<<<<<<<<<<<< @@ -50593,28 +50614,20 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene * frontier = new_frontier */ if (PyList_CheckExact(__pyx_cur_scope->__pyx_v_frontier_nodes) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_frontier_nodes)) { - __pyx_t_15 = __pyx_cur_scope->__pyx_v_frontier_nodes; __Pyx_INCREF(__pyx_t_15); __pyx_t_23 = 0; + __pyx_t_15 = __pyx_cur_scope->__pyx_v_frontier_nodes; __Pyx_INCREF(__pyx_t_15); __pyx_t_6 = 0; __pyx_t_22 = NULL; } else { - __pyx_t_23 = -1; __pyx_t_15 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_frontier_nodes); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = -1; __pyx_t_15 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_frontier_nodes); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __pyx_t_22 = Py_TYPE(__pyx_t_15)->tp_iternext; } for (;;) { if (!__pyx_t_22 && PyList_CheckExact(__pyx_t_15)) { - if (__pyx_t_23 >= PyList_GET_SIZE(__pyx_t_15)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_11 = PyList_GET_ITEM(__pyx_t_15, __pyx_t_23); __Pyx_INCREF(__pyx_t_11); __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_15, __pyx_t_23); __pyx_t_23++; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_15)) break; + __pyx_t_11 = PyList_GET_ITEM(__pyx_t_15, __pyx_t_6); __Pyx_INCREF(__pyx_t_11); __pyx_t_6++; } else if (!__pyx_t_22 && PyTuple_CheckExact(__pyx_t_15)) { - if (__pyx_t_23 >= PyTuple_GET_SIZE(__pyx_t_15)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_15, __pyx_t_23); __Pyx_INCREF(__pyx_t_11); __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_15, __pyx_t_23); __pyx_t_23++; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_15)) break; + __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_15, __pyx_t_6); __Pyx_INCREF(__pyx_t_11); __pyx_t_6++; } else { __pyx_t_11 = __pyx_t_22(__pyx_t_15); if (unlikely(!__pyx_t_11)) { @@ -50628,72 +50641,64 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene } 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 - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 3)) { - if (size > 3) __Pyx_RaiseTooManyValuesError(3); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_17 = PyTuple_GET_ITEM(sequence, 0); + if (unlikely(PyTuple_GET_SIZE(sequence) != 3)) { + if (PyTuple_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3); + else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_12 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_17 = PyTuple_GET_ITEM(sequence, 2); } else { - __pyx_t_17 = PyList_GET_ITEM(sequence, 0); + if (unlikely(PyList_GET_SIZE(sequence) != 3)) { + if (PyList_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3); + else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = PyList_GET_ITEM(sequence, 0); __pyx_t_10 = PyList_GET_ITEM(sequence, 1); - __pyx_t_12 = PyList_GET_ITEM(sequence, 2); + __pyx_t_17 = PyList_GET_ITEM(sequence, 2); } - __Pyx_INCREF(__pyx_t_17); + __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(__pyx_t_12); - #else - __pyx_t_17 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __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 = 1181; __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 = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __Pyx_INCREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - } else - { + } 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 = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_19 = Py_TYPE(__pyx_t_3)->tp_iternext; - index = 0; __pyx_t_17 = __pyx_t_19(__pyx_t_3); if (unlikely(!__pyx_t_17)) goto __pyx_L70_unpacking_failed; - __Pyx_GOTREF(__pyx_t_17); - index = 1; __pyx_t_10 = __pyx_t_19(__pyx_t_3); if (unlikely(!__pyx_t_10)) goto __pyx_L70_unpacking_failed; + index = 0; __pyx_t_8 = __pyx_t_19(__pyx_t_3); if (unlikely(!__pyx_t_8)) goto __pyx_L74_unpacking_failed; + __Pyx_GOTREF(__pyx_t_8); + index = 1; __pyx_t_10 = __pyx_t_19(__pyx_t_3); if (unlikely(!__pyx_t_10)) goto __pyx_L74_unpacking_failed; __Pyx_GOTREF(__pyx_t_10); - index = 2; __pyx_t_12 = __pyx_t_19(__pyx_t_3); if (unlikely(!__pyx_t_12)) goto __pyx_L70_unpacking_failed; - __Pyx_GOTREF(__pyx_t_12); + index = 2; __pyx_t_17 = __pyx_t_19(__pyx_t_3); if (unlikely(!__pyx_t_17)) goto __pyx_L74_unpacking_failed; + __Pyx_GOTREF(__pyx_t_17); if (__Pyx_IternextUnpackEndCheck(__pyx_t_19(__pyx_t_3), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_19 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L71_unpacking_done; - __pyx_L70_unpacking_failed:; + goto __pyx_L75_unpacking_done; + __pyx_L74_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_19 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); + if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_L71_unpacking_done:; + __pyx_L75_unpacking_done:; } - __pyx_t_20 = __Pyx_PyInt_AsInt(__pyx_t_17); if (unlikely((__pyx_t_20 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_20 = __Pyx_PyInt_AsInt(__pyx_t_8); if (unlikely((__pyx_t_20 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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 = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_cur_scope->__pyx_v_i = __pyx_t_20; __pyx_cur_scope->__pyx_v_alt = __pyx_t_7; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_pathlen); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_pathlen); - __Pyx_GIVEREF(__pyx_t_12); - __pyx_cur_scope->__pyx_v_pathlen = __pyx_t_12; - __pyx_t_12 = 0; + __Pyx_GIVEREF(__pyx_t_17); + __pyx_cur_scope->__pyx_v_pathlen = __pyx_t_17; + __pyx_t_17 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1182 + /* "/home/paulb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -50702,71 +50707,71 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene */ __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); 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_12 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); + __pyx_t_17 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); __pyx_t_10 = PyInt_FromLong(__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_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_17); - PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_10); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 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_17)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyNumber_Add(__pyx_cur_scope->__pyx_v_input_match, ((PyObject *)__pyx_t_8)); 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_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0; - __pyx_t_17 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_alt); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; + __pyx_t_8 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_alt); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_xcat); 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_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_12, 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 = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Add(__pyx_cur_scope->__pyx_v_phrase, ((PyObject *)__pyx_t_12)); 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_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 = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_11); + __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; + __pyx_t_12 = PyTuple_New(8); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_12, 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); - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_17); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_17); __Pyx_GIVEREF(__pyx_t_17); + PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_12, 3, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); __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_12, 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_12, 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); + PyTuple_SET_ITEM(__pyx_t_12, 6, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __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_12, 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_10 = 0; __pyx_t_17 = 0; + __pyx_t_10 = 0; + __pyx_t_8 = 0; __pyx_t_3 = 0; - __pyx_t_13 = 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 = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; + __pyx_t_13 = PyList_Append(__pyx_cur_scope->__pyx_v_new_frontier, ((PyObject *)__pyx_t_12)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - goto __pyx_L66; + goto __pyx_L70; } - __pyx_L66:; - goto __pyx_L62; + __pyx_L70:; + goto __pyx_L66; } - __pyx_L62:; + __pyx_L66:; __pyx_L19_continue:; } __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1183 + /* "/home/paulb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -50780,7 +50785,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_frontier = __pyx_cur_scope->__pyx_v_new_frontier; } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1186 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1186 * * # Online rule extraction and scoring * if self.online: # <<<<<<<<<<<<<< @@ -50789,7 +50794,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene */ if (__pyx_cur_scope->__pyx_v_self->online) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1187 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1187 * # Online rule extraction and scoring * if self.online: * f_syms = tuple(word[0][0] for word in fwords) # <<<<<<<<<<<<<< @@ -50810,7 +50815,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_f_syms = ((PyObject*)__pyx_t_14); __pyx_t_14 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1188 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1188 * if self.online: * f_syms = tuple(word[0][0] for word in fwords) * for (f, lex_i, lex_j) in self.get_f_phrases(f_syms): # <<<<<<<<<<<<<< @@ -50824,99 +50829,83 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_f_syms)); PyTuple_SET_ITEM(__pyx_t_15, 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_14, ((PyObject *)__pyx_t_15), 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_t_12 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __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_15)); __pyx_t_15 = 0; - if (PyList_CheckExact(__pyx_t_8) || PyTuple_CheckExact(__pyx_t_8)) { - __pyx_t_15 = __pyx_t_8; __Pyx_INCREF(__pyx_t_15); __pyx_t_2 = 0; + if (PyList_CheckExact(__pyx_t_12) || PyTuple_CheckExact(__pyx_t_12)) { + __pyx_t_15 = __pyx_t_12; __Pyx_INCREF(__pyx_t_15); __pyx_t_2 = 0; __pyx_t_22 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_15 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = -1; __pyx_t_15 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __pyx_t_22 = Py_TYPE(__pyx_t_15)->tp_iternext; } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; for (;;) { if (!__pyx_t_22 && PyList_CheckExact(__pyx_t_15)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_15)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_8 = PyList_GET_ITEM(__pyx_t_15, __pyx_t_2); __Pyx_INCREF(__pyx_t_8); __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_8 = PySequence_ITEM(__pyx_t_15, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_12 = PyList_GET_ITEM(__pyx_t_15, __pyx_t_2); __Pyx_INCREF(__pyx_t_12); __pyx_t_2++; } else if (!__pyx_t_22 && PyTuple_CheckExact(__pyx_t_15)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_15)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_15, __pyx_t_2); __Pyx_INCREF(__pyx_t_8); __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_8 = PySequence_ITEM(__pyx_t_15, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_15, __pyx_t_2); __Pyx_INCREF(__pyx_t_12); __pyx_t_2++; } else { - __pyx_t_8 = __pyx_t_22(__pyx_t_15); - if (unlikely(!__pyx_t_8)) { + __pyx_t_12 = __pyx_t_22(__pyx_t_15); + if (unlikely(!__pyx_t_12)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } - __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_12); } - if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) { - PyObject* sequence = __pyx_t_8; - #if CYTHON_COMPILING_IN_CPYTHON - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 3)) { - if (size > 3) __Pyx_RaiseTooManyValuesError(3); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - #if CYTHON_COMPILING_IN_CPYTHON + if ((likely(PyTuple_CheckExact(__pyx_t_12))) || (PyList_CheckExact(__pyx_t_12))) { + PyObject* sequence = __pyx_t_12; if (likely(PyTuple_CheckExact(sequence))) { + if (unlikely(PyTuple_GET_SIZE(sequence) != 3)) { + if (PyTuple_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3); + else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } __pyx_t_14 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_17 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2); } else { + if (unlikely(PyList_GET_SIZE(sequence) != 3)) { + if (PyList_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3); + else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } __pyx_t_14 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); - __pyx_t_17 = PyList_GET_ITEM(sequence, 2); + __pyx_t_8 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(__pyx_t_17); - #else - __pyx_t_14 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __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 = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_17 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } else - { + __Pyx_INCREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 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 = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_19 = Py_TYPE(__pyx_t_10)->tp_iternext; - index = 0; __pyx_t_14 = __pyx_t_19(__pyx_t_10); if (unlikely(!__pyx_t_14)) goto __pyx_L75_unpacking_failed; + index = 0; __pyx_t_14 = __pyx_t_19(__pyx_t_10); if (unlikely(!__pyx_t_14)) goto __pyx_L79_unpacking_failed; __Pyx_GOTREF(__pyx_t_14); - index = 1; __pyx_t_3 = __pyx_t_19(__pyx_t_10); if (unlikely(!__pyx_t_3)) goto __pyx_L75_unpacking_failed; + index = 1; __pyx_t_3 = __pyx_t_19(__pyx_t_10); if (unlikely(!__pyx_t_3)) goto __pyx_L79_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); - index = 2; __pyx_t_17 = __pyx_t_19(__pyx_t_10); if (unlikely(!__pyx_t_17)) goto __pyx_L75_unpacking_failed; - __Pyx_GOTREF(__pyx_t_17); + index = 2; __pyx_t_8 = __pyx_t_19(__pyx_t_10); if (unlikely(!__pyx_t_8)) goto __pyx_L79_unpacking_failed; + __Pyx_GOTREF(__pyx_t_8); if (__Pyx_IternextUnpackEndCheck(__pyx_t_19(__pyx_t_10), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_19 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - goto __pyx_L76_unpacking_done; - __pyx_L75_unpacking_failed:; + goto __pyx_L80_unpacking_done; + __pyx_L79_unpacking_failed:; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_19 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); + if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_L76_unpacking_done:; + __pyx_L80_unpacking_done:; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_f); __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_f); @@ -50930,139 +50919,131 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_lex_j); __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_lex_j); - __Pyx_GIVEREF(__pyx_t_17); - __pyx_cur_scope->__pyx_v_lex_j = __pyx_t_17; - __pyx_t_17 = 0; + __Pyx_GIVEREF(__pyx_t_8); + __pyx_cur_scope->__pyx_v_lex_j = __pyx_t_8; + __pyx_t_8 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1189 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1189 * 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 = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_lex_j, __pyx_cur_scope->__pyx_v_lex_i); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_8 = PyNumber_Add(__pyx_t_12, __pyx_int_1); 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_17 = PyNumber_Add(__pyx_t_8, __pyx_int_1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_17); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_spanlen); __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_spanlen); - __Pyx_GIVEREF(__pyx_t_17); - __pyx_cur_scope->__pyx_v_spanlen = __pyx_t_17; - __pyx_t_17 = 0; + __Pyx_GIVEREF(__pyx_t_8); + __pyx_cur_scope->__pyx_v_spanlen = __pyx_t_8; + __pyx_t_8 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1190 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1190 * 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_17 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_f, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_17) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_17); - __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_17); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_8 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_f, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __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 = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_9 = (!__pyx_f_3_sa_sym_isvar(__pyx_t_7)); if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1191 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1191 * spanlen = (lex_j - lex_i) + 1 * if not sym_isvar(f[0]): * spanlen += 1 # <<<<<<<<<<<<<< * if not sym_isvar(f[1]): * spanlen += 1 */ - __pyx_t_17 = PyNumber_InPlaceAdd(__pyx_cur_scope->__pyx_v_spanlen, __pyx_int_1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_17); + __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_cur_scope->__pyx_v_spanlen, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_spanlen); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_spanlen); - __Pyx_GIVEREF(__pyx_t_17); - __pyx_cur_scope->__pyx_v_spanlen = __pyx_t_17; - __pyx_t_17 = 0; - goto __pyx_L77; + __Pyx_GIVEREF(__pyx_t_8); + __pyx_cur_scope->__pyx_v_spanlen = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L81; } - __pyx_L77:; + __pyx_L81:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1192 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1192 * if not sym_isvar(f[0]): * spanlen += 1 * if not sym_isvar(f[1]): # <<<<<<<<<<<<<< * spanlen += 1 * for e in self.phrases_fe.get(f, ()): */ - __pyx_t_17 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_f, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_17) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_17); - __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_17); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_8 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_f, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __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 = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_9 = (!__pyx_f_3_sa_sym_isvar(__pyx_t_7)); if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1193 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1193 * spanlen += 1 * if not sym_isvar(f[1]): * spanlen += 1 # <<<<<<<<<<<<<< * for e in self.phrases_fe.get(f, ()): * if (f, e) not in seen_phrases: */ - __pyx_t_17 = PyNumber_InPlaceAdd(__pyx_cur_scope->__pyx_v_spanlen, __pyx_int_1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_17); + __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_cur_scope->__pyx_v_spanlen, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_spanlen); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_spanlen); - __Pyx_GIVEREF(__pyx_t_17); - __pyx_cur_scope->__pyx_v_spanlen = __pyx_t_17; - __pyx_t_17 = 0; - goto __pyx_L78; + __Pyx_GIVEREF(__pyx_t_8); + __pyx_cur_scope->__pyx_v_spanlen = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L82; } - __pyx_L78:; + __pyx_L82:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1194 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1194 * if not sym_isvar(f[1]): * spanlen += 1 * for e in self.phrases_fe.get(f, ()): # <<<<<<<<<<<<<< * if (f, e) not in seen_phrases: * # Don't add multiple instances of the same phrase here */ - __pyx_t_17 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_self->phrases_fe, __pyx_n_s__get); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_17); - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_self->phrases_fe, __pyx_n_s__get); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); + __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_f); + PyTuple_SET_ITEM(__pyx_t_12, 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_8, 1, ((PyObject *)__pyx_empty_tuple)); + PyTuple_SET_ITEM(__pyx_t_12, 1, ((PyObject *)__pyx_empty_tuple)); __Pyx_GIVEREF(((PyObject *)__pyx_empty_tuple)); - __pyx_t_3 = PyObject_Call(__pyx_t_17, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) { - __pyx_t_8 = __pyx_t_3; __Pyx_INCREF(__pyx_t_8); __pyx_t_23 = 0; - __pyx_t_29 = NULL; + __pyx_t_12 = __pyx_t_3; __Pyx_INCREF(__pyx_t_12); __pyx_t_6 = 0; + __pyx_t_24 = NULL; } else { - __pyx_t_23 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_29 = Py_TYPE(__pyx_t_8)->tp_iternext; + __pyx_t_6 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_24 = Py_TYPE(__pyx_t_12)->tp_iternext; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { - if (!__pyx_t_29 && PyList_CheckExact(__pyx_t_8)) { - if (__pyx_t_23 >= PyList_GET_SIZE(__pyx_t_8)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_23); __Pyx_INCREF(__pyx_t_3); __pyx_t_23++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_8, __pyx_t_23); __pyx_t_23++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - } else if (!__pyx_t_29 && PyTuple_CheckExact(__pyx_t_8)) { - if (__pyx_t_23 >= PyTuple_GET_SIZE(__pyx_t_8)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_23); __Pyx_INCREF(__pyx_t_3); __pyx_t_23++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_8, __pyx_t_23); __pyx_t_23++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + if (!__pyx_t_24 && PyList_CheckExact(__pyx_t_12)) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_12)) break; + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; + } else if (!__pyx_t_24 && PyTuple_CheckExact(__pyx_t_12)) { + if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_12)) break; + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; } else { - __pyx_t_3 = __pyx_t_29(__pyx_t_8); + __pyx_t_3 = __pyx_t_24(__pyx_t_12); if (unlikely(!__pyx_t_3)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); @@ -51078,7 +51059,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_e = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1195 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1195 * spanlen += 1 * for e in self.phrases_fe.get(f, ()): * if (f, e) not in seen_phrases: # <<<<<<<<<<<<<< @@ -51093,11 +51074,11 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __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 = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = (__Pyx_NegateNonNeg(PySequence_Contains(((PyObject *)__pyx_cur_scope->__pyx_v_seen_phrases), ((PyObject *)__pyx_t_3)))); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1197 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1197 * if (f, e) not in seen_phrases: * # Don't add multiple instances of the same phrase here * seen_phrases.add((f, e)) # <<<<<<<<<<<<<< @@ -51115,7 +51096,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __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 = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1198 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1198 * # Don't add multiple instances of the same phrase here * seen_phrases.add((f, e)) * scores = self.scorer.score(FeatureContext( # <<<<<<<<<<<<<< @@ -51125,15 +51106,15 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FeatureContext); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1203 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1203 * fwords, self.fda, self.eda, * meta, * self.online_ctx_lookup(f, e))) # <<<<<<<<<<<<<< * alignment = self.phrases_al[f][e] * yield Rule(self.category, f, e, scores, alignment) */ - __pyx_t_17 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__online_ctx_lookup); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_17); + __pyx_t_8 = PyObject_GetAttr(((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 = 1203; __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 = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f); @@ -51142,9 +51123,9 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __Pyx_INCREF(__pyx_cur_scope->__pyx_v_e); PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_cur_scope->__pyx_v_e); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e); - __pyx_t_10 = PyObject_Call(__pyx_t_17, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0; __pyx_t_14 = PyTuple_New(13); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); @@ -51200,7 +51181,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_scores = ((struct __pyx_obj_3_sa_FeatureVector *)__pyx_t_14); __pyx_t_14 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1204 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1204 * meta, * self.online_ctx_lookup(f, e))) * alignment = self.phrases_al[f][e] # <<<<<<<<<<<<<< @@ -51218,7 +51199,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_alignment = __pyx_t_10; __pyx_t_10 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1205 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1205 * self.online_ctx_lookup(f, e))) * alignment = self.phrases_al[f][e] * yield Rule(self.category, f, e, scores, alignment) # <<<<<<<<<<<<<< @@ -51250,42 +51231,42 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_r = __pyx_t_10; __pyx_t_10 = 0; __pyx_cur_scope->__pyx_t_0 = __pyx_t_2; - __Pyx_XGIVEREF(__pyx_t_8); - __pyx_cur_scope->__pyx_t_3 = __pyx_t_8; + __pyx_cur_scope->__pyx_t_1 = __pyx_t_6; + __Pyx_XGIVEREF(__pyx_t_12); + __pyx_cur_scope->__pyx_t_2 = __pyx_t_12; __Pyx_XGIVEREF(__pyx_t_15); - __pyx_cur_scope->__pyx_t_4 = __pyx_t_15; - __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; + __pyx_cur_scope->__pyx_t_3 = __pyx_t_15; + __pyx_cur_scope->__pyx_t_5 = __pyx_t_22; + __pyx_cur_scope->__pyx_t_7 = __pyx_t_24; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); /* return from generator, yielding value */ __pyx_generator->resume_label = 2; return __pyx_r; - __pyx_L82_resume_from_yield:; + __pyx_L86_resume_from_yield:; __pyx_t_2 = __pyx_cur_scope->__pyx_t_0; - __pyx_t_8 = __pyx_cur_scope->__pyx_t_3; + __pyx_t_6 = __pyx_cur_scope->__pyx_t_1; + __pyx_t_12 = __pyx_cur_scope->__pyx_t_2; + __pyx_cur_scope->__pyx_t_2 = 0; + __Pyx_XGOTREF(__pyx_t_12); + __pyx_t_15 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; - __Pyx_XGOTREF(__pyx_t_8); - __pyx_t_15 = __pyx_cur_scope->__pyx_t_4; - __pyx_cur_scope->__pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_t_15); - __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; + __pyx_t_22 = __pyx_cur_scope->__pyx_t_5; + __pyx_t_24 = __pyx_cur_scope->__pyx_t_7; if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L81; + goto __pyx_L85; } - __pyx_L81:; + __pyx_L85:; } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - goto __pyx_L72; + goto __pyx_L76; } - __pyx_L72:; + __pyx_L76:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1207 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1207 * yield Rule(self.category, f, e, scores, alignment) * * stop_time = monitor_cpu() # <<<<<<<<<<<<<< @@ -51294,45 +51275,45 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene */ __pyx_t_15 = __Pyx_GetName(__pyx_m, __pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - __pyx_t_8 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_12 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __Pyx_GIVEREF(__pyx_t_8); - __pyx_cur_scope->__pyx_v_stop_time = __pyx_t_8; - __pyx_t_8 = 0; + __Pyx_GIVEREF(__pyx_t_12); + __pyx_cur_scope->__pyx_v_stop_time = __pyx_t_12; + __pyx_t_12 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1208 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1208 * * 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_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_15 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__info); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_15 = PyObject_GetAttr(__pyx_t_12, __pyx_n_s__info); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_start_time); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_10 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_stop_time, __pyx_t_8); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_start_time); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_10 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_stop_time, __pyx_t_12); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(((PyObject *)__pyx_kp_s_124)); - PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_kp_s_124)); + PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)__pyx_kp_s_124)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_124)); - PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1209 + /* "/home/paulb/workspace/cdec/python/src/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() # <<<<<<<<<<<<<< @@ -51341,15 +51322,15 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene */ __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__gc); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_8 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__collect); 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_t_12 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__collect); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1209; __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_Call(__pyx_t_8, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1210 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1210 * 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) # <<<<<<<<<<<<<< @@ -51358,8 +51339,8 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene */ __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_8 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__info); 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_12 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__info); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __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 = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); @@ -51371,13 +51352,13 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = 0; - __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 = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1211 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1211 * gc.collect() * logger.info(" Extract time = %f seconds", self.extract_time) * logger.info(" Intersect time = %f seconds", self.intersect_time) # <<<<<<<<<<<<<< @@ -51391,18 +51372,18 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->intersect_time); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_8 = PyTuple_New(2); 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_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(((PyObject *)__pyx_kp_s_126)); - PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_kp_s_126)); + PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)__pyx_kp_s_126)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_126)); - PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; @@ -51422,12 +51403,11 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_generator->resume_label = -1; - __Pyx_Generator_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return NULL; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1214 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1214 * * * cdef int find_fixpoint(self, # <<<<<<<<<<<<<< @@ -51457,7 +51437,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj int __pyx_clineno = 0; __Pyx_RefNannySetupContext("find_fixpoint", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1229 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1229 * 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 # <<<<<<<<<<<<<< @@ -51466,7 +51446,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj */ (__pyx_v_e_low[0]) = __pyx_v_e_in_low; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1230 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1230 * * e_low[0] = e_in_low * e_high[0] = e_in_high # <<<<<<<<<<<<<< @@ -51475,7 +51455,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj */ (__pyx_v_e_high[0]) = __pyx_v_e_in_high; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1231 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1231 * 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) # <<<<<<<<<<<<<< @@ -51487,7 +51467,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1232 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1232 * 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: # <<<<<<<<<<<<<< @@ -51497,7 +51477,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj __pyx_t_3 = ((__pyx_v_e_low[0]) == -1); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1238 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1238 * # rule X -> X_1 w X_2 / X_1 X_2. This is probably * # not worth the bother, though. * return 0 # <<<<<<<<<<<<<< @@ -51509,7 +51489,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj goto __pyx_L3; } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1239 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1239 * # not worth the bother, though. * return 0 * elif e_in_low != -1 and e_low[0] != e_in_low: # <<<<<<<<<<<<<< @@ -51525,7 +51505,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } if (__pyx_t_5) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1240 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1240 * return 0 * elif e_in_low != -1 and e_low[0] != e_in_low: * if e_in_low - e_low[0] < min_ex_size: # <<<<<<<<<<<<<< @@ -51535,7 +51515,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj __pyx_t_5 = ((__pyx_v_e_in_low - (__pyx_v_e_low[0])) < __pyx_v_min_ex_size); if (__pyx_t_5) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1241 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1241 * 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 # <<<<<<<<<<<<<< @@ -51544,7 +51524,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj */ (__pyx_v_e_low[0]) = (__pyx_v_e_in_low - __pyx_v_min_ex_size); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1242 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1242 * if e_in_low - e_low[0] < min_ex_size: * e_low[0] = e_in_low - min_ex_size * if e_low[0] < 0: # <<<<<<<<<<<<<< @@ -51554,7 +51534,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj __pyx_t_5 = ((__pyx_v_e_low[0]) < 0); if (__pyx_t_5) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1243 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1243 * e_low[0] = e_in_low - min_ex_size * if e_low[0] < 0: * return 0 # <<<<<<<<<<<<<< @@ -51573,7 +51553,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1245 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1245 * return 0 * * if e_high[0] - e_low[0] > max_e_len: # <<<<<<<<<<<<<< @@ -51583,7 +51563,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj __pyx_t_5 = (((__pyx_v_e_high[0]) - (__pyx_v_e_low[0])) > __pyx_v_max_e_len); if (__pyx_t_5) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1246 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1246 * * if e_high[0] - e_low[0] > max_e_len: * return 0 # <<<<<<<<<<<<<< @@ -51595,7 +51575,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj goto __pyx_L6; } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1247 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1247 * if e_high[0] - e_low[0] > max_e_len: * return 0 * elif e_in_high != -1 and e_high[0] != e_in_high: # <<<<<<<<<<<<<< @@ -51611,7 +51591,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } if (__pyx_t_4) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1248 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1248 * return 0 * elif e_in_high != -1 and e_high[0] != e_in_high: * if e_high[0] - e_in_high < min_ex_size: # <<<<<<<<<<<<<< @@ -51621,7 +51601,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj __pyx_t_4 = (((__pyx_v_e_high[0]) - __pyx_v_e_in_high) < __pyx_v_min_ex_size); if (__pyx_t_4) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1249 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1249 * 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 # <<<<<<<<<<<<<< @@ -51630,7 +51610,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj */ (__pyx_v_e_high[0]) = (__pyx_v_e_in_high + __pyx_v_min_ex_size); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1250 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1250 * 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: # <<<<<<<<<<<<<< @@ -51640,7 +51620,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj __pyx_t_4 = ((__pyx_v_e_high[0]) > __pyx_v_e_sent_len); if (__pyx_t_4) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1251 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1251 * e_high[0] = e_in_high + min_ex_size * if e_high[0] > e_sent_len: * return 0 # <<<<<<<<<<<<<< @@ -51659,7 +51639,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } __pyx_L6:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1253 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1253 * return 0 * * f_back_low[0] = -1 # <<<<<<<<<<<<<< @@ -51668,7 +51648,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj */ (__pyx_v_f_back_low[0]) = -1; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1254 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1254 * * f_back_low[0] = -1 * f_back_high[0] = -1 # <<<<<<<<<<<<<< @@ -51677,7 +51657,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj */ (__pyx_v_f_back_high[0]) = -1; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1255 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1255 * f_back_low[0] = -1 * f_back_high[0] = -1 * f_low_prev = f_low # <<<<<<<<<<<<<< @@ -51686,7 +51666,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj */ __pyx_v_f_low_prev = __pyx_v_f_low; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1256 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1256 * f_back_high[0] = -1 * f_low_prev = f_low * f_high_prev = f_high # <<<<<<<<<<<<<< @@ -51696,7 +51676,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj __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 = 1256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_f_high_prev = __pyx_t_1; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1257 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1257 * f_low_prev = f_low * f_high_prev = f_high * new_x = 0 # <<<<<<<<<<<<<< @@ -51705,7 +51685,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj */ __pyx_v_new_x = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1258 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1258 * f_high_prev = f_high * new_x = 0 * new_low_x = 0 # <<<<<<<<<<<<<< @@ -51714,7 +51694,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj */ __pyx_v_new_low_x = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1259 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1259 * new_x = 0 * new_low_x = 0 * new_high_x = 0 # <<<<<<<<<<<<<< @@ -51723,7 +51703,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj */ __pyx_v_new_high_x = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1261 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1261 * new_high_x = 0 * * while True: # <<<<<<<<<<<<<< @@ -51733,7 +51713,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj while (1) { if (!1) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1263 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1263 * while True: * * if f_back_low[0] == -1: # <<<<<<<<<<<<<< @@ -51743,7 +51723,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj __pyx_t_4 = ((__pyx_v_f_back_low[0]) == -1); if (__pyx_t_4) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1264 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1264 * * 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) # <<<<<<<<<<<<<< @@ -51757,7 +51737,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1266 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1266 * 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) # <<<<<<<<<<<<<< @@ -51768,7 +51748,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1267 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1267 * 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) # <<<<<<<<<<<<<< @@ -51781,7 +51761,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } __pyx_L11:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1269 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1269 * 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: # <<<<<<<<<<<<<< @@ -51791,7 +51771,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj __pyx_t_4 = ((__pyx_v_f_back_low[0]) > __pyx_v_f_low); if (__pyx_t_4) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1270 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1270 * * if f_back_low[0] > f_low: * f_back_low[0] = f_low # <<<<<<<<<<<<<< @@ -51803,7 +51783,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } __pyx_L12:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1272 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1272 * f_back_low[0] = f_low * * if f_back_high[0] < f_high: # <<<<<<<<<<<<<< @@ -51812,13 +51792,14 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj */ __pyx_t_2 = PyInt_FromLong((__pyx_v_f_back_high[0])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1272; __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 = 1272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_v_f_high, Py_LT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_4) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1273 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1273 * * if f_back_high[0] < f_high: * f_back_high[0] = f_high # <<<<<<<<<<<<<< @@ -51831,7 +51812,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } __pyx_L13:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1275 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1275 * f_back_high[0] = f_high * * if f_back_low[0] == f_low_prev and f_back_high[0] == f_high_prev: # <<<<<<<<<<<<<< @@ -51847,7 +51828,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1276 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1276 * * if f_back_low[0] == f_low_prev and f_back_high[0] == f_high_prev: * return 1 # <<<<<<<<<<<<<< @@ -51860,7 +51841,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } __pyx_L14:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1278 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1278 * return 1 * * if allow_low_x == 0 and f_back_low[0] < f_low: # <<<<<<<<<<<<<< @@ -51876,7 +51857,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } if (__pyx_t_5) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1280 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1280 * if allow_low_x == 0 and f_back_low[0] < f_low: * # FAIL: f phrase is not tight * return 0 # <<<<<<<<<<<<<< @@ -51889,7 +51870,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } __pyx_L15:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1282 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1282 * return 0 * * if f_back_high[0] - f_back_low[0] > max_f_len: # <<<<<<<<<<<<<< @@ -51899,7 +51880,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj __pyx_t_5 = (((__pyx_v_f_back_high[0]) - (__pyx_v_f_back_low[0])) > __pyx_v_max_f_len); if (__pyx_t_5) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1284 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1284 * if f_back_high[0] - f_back_low[0] > max_f_len: * # FAIL: f back projection is too wide * return 0 # <<<<<<<<<<<<<< @@ -51912,7 +51893,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } __pyx_L16:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1286 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1286 * return 0 * * if allow_high_x == 0 and f_back_high[0] > f_high: # <<<<<<<<<<<<<< @@ -51923,7 +51904,8 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj 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 = 1286; __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 = 1286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_v_f_high, Py_GT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -51933,7 +51915,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } if (__pyx_t_4) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1288 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1288 * if allow_high_x == 0 and f_back_high[0] > f_high: * # FAIL: extension on high side not allowed * return 0 # <<<<<<<<<<<<<< @@ -51946,7 +51928,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } __pyx_L17:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1290 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1290 * return 0 * * if f_low != f_back_low[0]: # <<<<<<<<<<<<<< @@ -51956,7 +51938,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj __pyx_t_4 = (__pyx_v_f_low != (__pyx_v_f_back_low[0])); if (__pyx_t_4) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1291 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1291 * * if f_low != f_back_low[0]: * if new_low_x == 0: # <<<<<<<<<<<<<< @@ -51966,7 +51948,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj __pyx_t_4 = (__pyx_v_new_low_x == 0); if (__pyx_t_4) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1292 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1292 * if f_low != f_back_low[0]: * if new_low_x == 0: * if new_x >= max_new_x: # <<<<<<<<<<<<<< @@ -51976,7 +51958,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj __pyx_t_4 = (__pyx_v_new_x >= __pyx_v_max_new_x); if (__pyx_t_4) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1294 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1294 * if new_x >= max_new_x: * # FAIL: extension required on low side violates max # of gaps * return 0 # <<<<<<<<<<<<<< @@ -51989,7 +51971,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1296 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1296 * return 0 * else: * new_x = new_x + 1 # <<<<<<<<<<<<<< @@ -51998,7 +51980,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj */ __pyx_v_new_x = (__pyx_v_new_x + 1); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1297 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1297 * else: * new_x = new_x + 1 * new_low_x = 1 # <<<<<<<<<<<<<< @@ -52012,7 +51994,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } __pyx_L19:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1298 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1298 * new_x = new_x + 1 * new_low_x = 1 * if f_low - f_back_low[0] < min_fx_size: # <<<<<<<<<<<<<< @@ -52022,7 +52004,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj __pyx_t_4 = ((__pyx_v_f_low - (__pyx_v_f_back_low[0])) < __pyx_v_min_fx_size); if (__pyx_t_4) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1299 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1299 * new_low_x = 1 * if f_low - f_back_low[0] < min_fx_size: * f_back_low[0] = f_low - min_fx_size # <<<<<<<<<<<<<< @@ -52031,7 +52013,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj */ (__pyx_v_f_back_low[0]) = (__pyx_v_f_low - __pyx_v_min_fx_size); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1300 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1300 * 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: # <<<<<<<<<<<<<< @@ -52041,7 +52023,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj __pyx_t_4 = (((__pyx_v_f_back_high[0]) - (__pyx_v_f_back_low[0])) > __pyx_v_max_f_len); if (__pyx_t_4) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1302 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1302 * if f_back_high[0] - f_back_low[0] > max_f_len: * # FAIL: extension required on low side violates max initial length * return 0 # <<<<<<<<<<<<<< @@ -52054,7 +52036,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } __pyx_L22:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1303 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1303 * # FAIL: extension required on low side violates max initial length * return 0 * if f_back_low[0] < 0: # <<<<<<<<<<<<<< @@ -52064,7 +52046,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj __pyx_t_4 = ((__pyx_v_f_back_low[0]) < 0); if (__pyx_t_4) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1305 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1305 * if f_back_low[0] < 0: * # FAIL: extension required on low side violates sentence boundary * return 0 # <<<<<<<<<<<<<< @@ -52083,7 +52065,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } __pyx_L18:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1307 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1307 * return 0 * * if f_high != f_back_high[0]: # <<<<<<<<<<<<<< @@ -52092,13 +52074,14 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj */ __pyx_t_2 = PyInt_FromLong((__pyx_v_f_back_high[0])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1307; __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 = 1307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_RichCompare(__pyx_v_f_high, __pyx_t_2, Py_NE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_4) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1308 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1308 * * if f_high != f_back_high[0]: * if new_high_x == 0: # <<<<<<<<<<<<<< @@ -52108,7 +52091,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj __pyx_t_4 = (__pyx_v_new_high_x == 0); if (__pyx_t_4) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1309 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1309 * if f_high != f_back_high[0]: * if new_high_x == 0: * if new_x >= max_new_x: # <<<<<<<<<<<<<< @@ -52118,7 +52101,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj __pyx_t_4 = (__pyx_v_new_x >= __pyx_v_max_new_x); if (__pyx_t_4) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1311 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1311 * if new_x >= max_new_x: * # FAIL: extension required on high side violates max # of gaps * return 0 # <<<<<<<<<<<<<< @@ -52131,7 +52114,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1313 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1313 * return 0 * else: * new_x = new_x + 1 # <<<<<<<<<<<<<< @@ -52140,7 +52123,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj */ __pyx_v_new_x = (__pyx_v_new_x + 1); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1314 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1314 * else: * new_x = new_x + 1 * new_high_x = 1 # <<<<<<<<<<<<<< @@ -52154,7 +52137,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } __pyx_L25:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1315 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1315 * new_x = new_x + 1 * new_high_x = 1 * if f_back_high[0] - f_high < min_fx_size: # <<<<<<<<<<<<<< @@ -52168,14 +52151,15 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj __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 = 1315; __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 = 1315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_RichCompare(__pyx_t_2, __pyx_t_6, Py_LT); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_4) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1316 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1316 * new_high_x = 1 * if f_back_high[0] - f_high < min_fx_size: * f_back_high[0] = f_high + min_fx_size # <<<<<<<<<<<<<< @@ -52191,7 +52175,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; (__pyx_v_f_back_high[0]) = __pyx_t_1; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1317 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1317 * 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: # <<<<<<<<<<<<<< @@ -52201,7 +52185,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj __pyx_t_4 = (((__pyx_v_f_back_high[0]) - (__pyx_v_f_back_low[0])) > __pyx_v_max_f_len); if (__pyx_t_4) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1319 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1319 * if f_back_high[0] - f_back_low[0] > max_f_len: * # FAIL: extension required on high side violates max initial length * return 0 # <<<<<<<<<<<<<< @@ -52214,7 +52198,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } __pyx_L28:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1320 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1320 * # FAIL: extension required on high side violates max initial length * return 0 * if f_back_high[0] > f_sent_len: # <<<<<<<<<<<<<< @@ -52224,7 +52208,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj __pyx_t_4 = ((__pyx_v_f_back_high[0]) > __pyx_v_f_sent_len); if (__pyx_t_4) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1322 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1322 * if f_back_high[0] > f_sent_len: * # FAIL: extension required on high side violates sentence boundary * return 0 # <<<<<<<<<<<<<< @@ -52243,7 +52227,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } __pyx_L24:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1324 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1324 * return 0 * * e_low_prev = e_low[0] # <<<<<<<<<<<<<< @@ -52252,7 +52236,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj */ __pyx_v_e_low_prev = (__pyx_v_e_low[0]); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1325 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1325 * * e_low_prev = e_low[0] * e_high_prev = e_high[0] # <<<<<<<<<<<<<< @@ -52261,7 +52245,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj */ __pyx_v_e_high_prev = (__pyx_v_e_high[0]); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1327 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1327 * 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) # <<<<<<<<<<<<<< @@ -52272,7 +52256,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1328 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1328 * * 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) # <<<<<<<<<<<<<< @@ -52283,7 +52267,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1329 + /* "/home/paulb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -52299,7 +52283,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1330 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1330 * 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 # <<<<<<<<<<<<<< @@ -52312,7 +52296,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } __pyx_L30:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1331 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1331 * if e_low[0] == e_low_prev and e_high[0] == e_high_prev: * return 1 * if allow_arbitrary_x == 0: # <<<<<<<<<<<<<< @@ -52322,7 +52306,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj __pyx_t_3 = (__pyx_v_allow_arbitrary_x == 0); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1333 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1333 * if allow_arbitrary_x == 0: * # FAIL: arbitrary expansion not permitted * return 0 # <<<<<<<<<<<<<< @@ -52335,7 +52319,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } __pyx_L31:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1334 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1334 * # FAIL: arbitrary expansion not permitted * return 0 * if e_high[0] - e_low[0] > max_e_len: # <<<<<<<<<<<<<< @@ -52345,7 +52329,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj __pyx_t_3 = (((__pyx_v_e_high[0]) - (__pyx_v_e_low[0])) > __pyx_v_max_e_len); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1336 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1336 * if e_high[0] - e_low[0] > max_e_len: * # FAIL: re-projection violates sentence max phrase length * return 0 # <<<<<<<<<<<<<< @@ -52358,7 +52342,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } __pyx_L32:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1337 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1337 * # FAIL: re-projection violates sentence max phrase length * return 0 * f_low_prev = f_back_low[0] # <<<<<<<<<<<<<< @@ -52367,7 +52351,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj */ __pyx_v_f_low_prev = (__pyx_v_f_back_low[0]); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1338 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1338 * return 0 * f_low_prev = f_back_low[0] * f_high_prev = f_back_high[0] # <<<<<<<<<<<<<< @@ -52390,7 +52374,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1341 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1341 * * * cdef find_projection(self, int in_low, int in_high, int* in_links_low, int* in_links_high, # <<<<<<<<<<<<<< @@ -52408,7 +52392,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_find_projection(CYTHON_U int __pyx_t_4; __Pyx_RefNannySetupContext("find_projection", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1344 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1344 * int* out_low, int* out_high): * cdef int i * for i from in_low <= i < in_high: # <<<<<<<<<<<<<< @@ -52418,7 +52402,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_find_projection(CYTHON_U __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/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1345 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1345 * cdef int i * for i from in_low <= i < in_high: * if in_links_low[i] != -1: # <<<<<<<<<<<<<< @@ -52428,7 +52412,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_find_projection(CYTHON_U __pyx_t_2 = ((__pyx_v_in_links_low[__pyx_v_i]) != -1); if (__pyx_t_2) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1346 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1346 * 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]: # <<<<<<<<<<<<<< @@ -52444,7 +52428,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_find_projection(CYTHON_U } if (__pyx_t_4) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1347 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1347 * 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] # <<<<<<<<<<<<<< @@ -52456,7 +52440,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_find_projection(CYTHON_U } __pyx_L6:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1348 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1348 * 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]: # <<<<<<<<<<<<<< @@ -52472,7 +52456,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_find_projection(CYTHON_U } if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1349 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1349 * 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] # <<<<<<<<<<<<<< @@ -52494,7 +52478,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_find_projection(CYTHON_U return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1352 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1352 * * * cdef int* int_arr_extend(self, int* arr, int* arr_len, int* data, int data_len): # <<<<<<<<<<<<<< @@ -52508,7 +52492,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTHON_UNUSED __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("int_arr_extend", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1354 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1354 * 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 # <<<<<<<<<<<<<< @@ -52517,7 +52501,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTHON_UNUSED */ __pyx_v_new_len = ((__pyx_v_arr_len[0]) + __pyx_v_data_len); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1355 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1355 * cdef int new_len * new_len = arr_len[0] + data_len * arr = realloc(arr, new_len*sizeof(int)) # <<<<<<<<<<<<<< @@ -52526,7 +52510,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTHON_UNUSED */ __pyx_v_arr = ((int *)realloc(__pyx_v_arr, (__pyx_v_new_len * (sizeof(int))))); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1356 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1356 * new_len = arr_len[0] + data_len * arr = realloc(arr, new_len*sizeof(int)) * memcpy(arr+arr_len[0], data, data_len*sizeof(int)) # <<<<<<<<<<<<<< @@ -52535,7 +52519,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTHON_UNUSED */ memcpy((__pyx_v_arr + (__pyx_v_arr_len[0])), __pyx_v_data, (__pyx_v_data_len * (sizeof(int)))); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1357 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1357 * arr = realloc(arr, new_len*sizeof(int)) * memcpy(arr+arr_len[0], data, data_len*sizeof(int)) * arr_len[0] = new_len # <<<<<<<<<<<<<< @@ -52544,7 +52528,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTHON_UNUSED */ (__pyx_v_arr_len[0]) = __pyx_v_new_len; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1358 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1358 * memcpy(arr+arr_len[0], data, data_len*sizeof(int)) * arr_len[0] = new_len * return arr # <<<<<<<<<<<<<< @@ -52560,7 +52544,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTHON_UNUSED return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1361 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1361 * * * 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, # <<<<<<<<<<<<<< @@ -52606,7 +52590,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("extract_phrases", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1369 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1369 * cdef result * * result = [] # <<<<<<<<<<<<<< @@ -52618,7 +52602,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_v_result = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1370 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1370 * * result = [] * len1 = 0 # <<<<<<<<<<<<<< @@ -52627,7 +52611,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_len1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1371 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1371 * result = [] * len1 = 0 * e_gaps1 = malloc(0) # <<<<<<<<<<<<<< @@ -52636,7 +52620,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_e_gaps1 = ((int *)malloc(0)); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1372 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1372 * len1 = 0 * e_gaps1 = malloc(0) * ephr_arr = IntList() # <<<<<<<<<<<<<< @@ -52648,7 +52632,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_v_ephr_arr = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1374 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1374 * ephr_arr = IntList() * * e_gap_order = malloc(num_gaps*sizeof(int)) # <<<<<<<<<<<<<< @@ -52657,7 +52641,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_e_gap_order = ((int *)malloc((__pyx_v_num_gaps * (sizeof(int))))); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1375 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1375 * * e_gap_order = malloc(num_gaps*sizeof(int)) * if num_gaps > 0: # <<<<<<<<<<<<<< @@ -52667,7 +52651,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_t_2 = (__pyx_v_num_gaps > 0); if (__pyx_t_2) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1376 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1376 * e_gap_order = malloc(num_gaps*sizeof(int)) * if num_gaps > 0: * e_gap_order[0] = 0 # <<<<<<<<<<<<<< @@ -52676,7 +52660,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ (__pyx_v_e_gap_order[0]) = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1377 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1377 * if num_gaps > 0: * e_gap_order[0] = 0 * for i from 1 <= i < num_gaps: # <<<<<<<<<<<<<< @@ -52686,7 +52670,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_t_3 = __pyx_v_num_gaps; for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1378 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1378 * e_gap_order[0] = 0 * for i from 1 <= i < num_gaps: * for j from 0 <= j < i: # <<<<<<<<<<<<<< @@ -52696,7 +52680,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_t_4 = __pyx_v_i; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_4; __pyx_v_j++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1379 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1379 * for i from 1 <= i < num_gaps: * for j from 0 <= j < i: * if e_gap_low[i] < e_gap_low[j]: # <<<<<<<<<<<<<< @@ -52706,7 +52690,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_t_2 = ((__pyx_v_e_gap_low[__pyx_v_i]) < (__pyx_v_e_gap_low[__pyx_v_j])); if (__pyx_t_2) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1380 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1380 * for j from 0 <= j < i: * if e_gap_low[i] < e_gap_low[j]: * for k from j <= k < i: # <<<<<<<<<<<<<< @@ -52716,7 +52700,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_t_5 = __pyx_v_i; for (__pyx_v_k = __pyx_v_j; __pyx_v_k < __pyx_t_5; __pyx_v_k++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1381 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1381 * if e_gap_low[i] < e_gap_low[j]: * for k from j <= k < i: * e_gap_order[k+1] = e_gap_order[k] # <<<<<<<<<<<<<< @@ -52726,7 +52710,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ (__pyx_v_e_gap_order[(__pyx_v_k + 1)]) = (__pyx_v_e_gap_order[__pyx_v_k]); } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1382 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1382 * for k from j <= k < i: * e_gap_order[k+1] = e_gap_order[k] * e_gap_order[j] = i # <<<<<<<<<<<<<< @@ -52735,7 +52719,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ (__pyx_v_e_gap_order[__pyx_v_j]) = __pyx_v_i; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1383 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1383 * e_gap_order[k+1] = e_gap_order[k] * e_gap_order[j] = i * break # <<<<<<<<<<<<<< @@ -52749,7 +52733,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1385 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1385 * break * else: * e_gap_order[i] = i # <<<<<<<<<<<<<< @@ -52764,7 +52748,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1387 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1387 * e_gap_order[i] = i * * e_x_low = e_low # <<<<<<<<<<<<<< @@ -52773,7 +52757,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_e_x_low = __pyx_v_e_low; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1388 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1388 * * e_x_low = e_low * e_x_high = e_high # <<<<<<<<<<<<<< @@ -52782,7 +52766,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_e_x_high = __pyx_v_e_high; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1389 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1389 * e_x_low = e_low * e_x_high = e_high * if not self.tight_phrases: # <<<<<<<<<<<<<< @@ -52792,7 +52776,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_t_2 = (!__pyx_v_self->tight_phrases); if (__pyx_t_2) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1390 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1390 * 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: # <<<<<<<<<<<<<< @@ -52815,7 +52799,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ } if (!__pyx_t_6) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1391 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1391 * 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 # <<<<<<<<<<<<<< @@ -52825,7 +52809,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_v_e_x_low = (__pyx_v_e_x_low - 1); } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1392 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1392 * 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: # <<<<<<<<<<<<<< @@ -52848,7 +52832,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ } if (!__pyx_t_2) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1393 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1393 * 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 # <<<<<<<<<<<<<< @@ -52861,7 +52845,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ } __pyx_L11:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1395 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1395 * e_x_high = e_x_high + 1 * * for i from e_x_low <= i <= e_low: # <<<<<<<<<<<<<< @@ -52871,7 +52855,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __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/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1396 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1396 * * for i from e_x_low <= i <= e_low: * e_gaps1 = self.int_arr_extend(e_gaps1, &len1, &i, 1) # <<<<<<<<<<<<<< @@ -52881,7 +52865,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_v_e_gaps1 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->int_arr_extend(__pyx_v_self, __pyx_v_e_gaps1, (&__pyx_v_len1), (&__pyx_v_i), 1); } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1398 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1398 * e_gaps1 = self.int_arr_extend(e_gaps1, &len1, &i, 1) * * for i from 0 <= i < num_gaps: # <<<<<<<<<<<<<< @@ -52891,7 +52875,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_t_3 = __pyx_v_num_gaps; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1399 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1399 * * for i from 0 <= i < num_gaps: * e_gaps2 = malloc(0) # <<<<<<<<<<<<<< @@ -52900,7 +52884,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_e_gaps2 = ((int *)malloc(0)); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1400 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1400 * for i from 0 <= i < num_gaps: * e_gaps2 = malloc(0) * len2 = 0 # <<<<<<<<<<<<<< @@ -52909,7 +52893,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_len2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1402 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1402 * len2 = 0 * * j = e_gap_order[i] # <<<<<<<<<<<<<< @@ -52918,7 +52902,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_j = (__pyx_v_e_gap_order[__pyx_v_i]); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1403 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1403 * * j = e_gap_order[i] * e_x_gap_low = e_gap_low[j] # <<<<<<<<<<<<<< @@ -52927,7 +52911,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_e_x_gap_low = (__pyx_v_e_gap_low[__pyx_v_j]); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1404 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1404 * j = e_gap_order[i] * e_x_gap_low = e_gap_low[j] * e_x_gap_high = e_gap_high[j] # <<<<<<<<<<<<<< @@ -52936,7 +52920,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_e_x_gap_high = (__pyx_v_e_gap_high[__pyx_v_j]); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1405 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1405 * e_x_gap_low = e_gap_low[j] * e_x_gap_high = e_gap_high[j] * if not self.tight_phrases: # <<<<<<<<<<<<<< @@ -52946,7 +52930,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_t_2 = (!__pyx_v_self->tight_phrases); if (__pyx_t_2) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1406 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1406 * 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: # <<<<<<<<<<<<<< @@ -52963,7 +52947,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ } if (!__pyx_t_7) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1407 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1407 * 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 # <<<<<<<<<<<<<< @@ -52973,7 +52957,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_v_e_x_gap_low = (__pyx_v_e_x_gap_low - 1); } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1408 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1408 * 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: # <<<<<<<<<<<<<< @@ -52990,7 +52974,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ } if (!__pyx_t_6) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1409 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1409 * 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 # <<<<<<<<<<<<<< @@ -53003,7 +52987,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ } __pyx_L20:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1411 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1411 * e_x_gap_high = e_x_gap_high + 1 * * k = 0 # <<<<<<<<<<<<<< @@ -53012,7 +52996,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_k = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1412 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1412 * * k = 0 * step = 1+(i*2) # <<<<<<<<<<<<<< @@ -53021,7 +53005,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_step = (1 + (__pyx_v_i * 2)); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1413 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1413 * k = 0 * step = 1+(i*2) * while k < len1: # <<<<<<<<<<<<<< @@ -53032,7 +53016,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_t_6 = (__pyx_v_k < __pyx_v_len1); if (!__pyx_t_6) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1414 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1414 * step = 1+(i*2) * while k < len1: * for m from e_x_gap_low <= m <= e_gap_low[j]: # <<<<<<<<<<<<<< @@ -53042,7 +53026,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __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/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1415 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1415 * while k < len1: * for m from e_x_gap_low <= m <= e_gap_low[j]: * if m >= e_gaps1[k+step-1]: # <<<<<<<<<<<<<< @@ -53052,7 +53036,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_t_6 = (__pyx_v_m >= (__pyx_v_e_gaps1[((__pyx_v_k + __pyx_v_step) - 1)])); if (__pyx_t_6) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1416 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1416 * 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: # <<<<<<<<<<<<<< @@ -53062,7 +53046,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __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/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1417 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1417 * 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 # <<<<<<<<<<<<<< @@ -53072,7 +53056,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_t_6 = ((__pyx_v_n - __pyx_v_m) >= 1); if (__pyx_t_6) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1418 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1418 * 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) # <<<<<<<<<<<<<< @@ -53081,7 +53065,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_e_gaps2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->int_arr_extend(__pyx_v_self, __pyx_v_e_gaps2, (&__pyx_v_len2), (__pyx_v_e_gaps1 + __pyx_v_k), __pyx_v_step); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1419 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1419 * 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) # <<<<<<<<<<<<<< @@ -53090,7 +53074,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_e_gaps2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->int_arr_extend(__pyx_v_self, __pyx_v_e_gaps2, (&__pyx_v_len2), (&__pyx_v_m), 1); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1420 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1420 * 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) # <<<<<<<<<<<<<< @@ -53107,7 +53091,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_L29:; } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1421 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1421 * 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 # <<<<<<<<<<<<<< @@ -53117,7 +53101,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_v_k = (__pyx_v_k + __pyx_v_step); } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1422 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1422 * e_gaps2 = self.int_arr_extend(e_gaps2, &len2, &n, 1) * k = k + step * free(e_gaps1) # <<<<<<<<<<<<<< @@ -53126,7 +53110,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ free(__pyx_v_e_gaps1); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1423 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1423 * k = k + step * free(e_gaps1) * e_gaps1 = e_gaps2 # <<<<<<<<<<<<<< @@ -53135,7 +53119,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_e_gaps1 = __pyx_v_e_gaps2; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1424 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1424 * free(e_gaps1) * e_gaps1 = e_gaps2 * len1 = len2 # <<<<<<<<<<<<<< @@ -53145,7 +53129,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_v_len1 = __pyx_v_len2; } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1426 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1426 * len1 = len2 * * step = 1+(num_gaps*2) # <<<<<<<<<<<<<< @@ -53154,7 +53138,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_step = (1 + (__pyx_v_num_gaps * 2)); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1427 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1427 * * step = 1+(num_gaps*2) * e_gaps2 = malloc(0) # <<<<<<<<<<<<<< @@ -53163,7 +53147,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_e_gaps2 = ((int *)malloc(0)); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1428 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1428 * step = 1+(num_gaps*2) * e_gaps2 = malloc(0) * len2 = 0 # <<<<<<<<<<<<<< @@ -53172,7 +53156,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_len2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1429 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1429 * e_gaps2 = malloc(0) * len2 = 0 * for i from e_high <= i <= e_x_high: # <<<<<<<<<<<<<< @@ -53182,7 +53166,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __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/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1430 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1430 * len2 = 0 * for i from e_high <= i <= e_x_high: * j = 0 # <<<<<<<<<<<<<< @@ -53191,7 +53175,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_j = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1431 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1431 * for i from e_high <= i <= e_x_high: * j = 0 * while j < len1: # <<<<<<<<<<<<<< @@ -53202,7 +53186,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_t_6 = (__pyx_v_j < __pyx_v_len1); if (!__pyx_t_6) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1432 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1432 * j = 0 * while j < len1: * if i - e_gaps1[j] <= self.train_max_initial_size and i >= e_gaps1[j+step-1]: # <<<<<<<<<<<<<< @@ -53218,7 +53202,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ } if (__pyx_t_2) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1433 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1433 * 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) # <<<<<<<<<<<<<< @@ -53227,7 +53211,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_e_gaps2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->int_arr_extend(__pyx_v_self, __pyx_v_e_gaps2, (&__pyx_v_len2), (__pyx_v_e_gaps1 + __pyx_v_j), __pyx_v_step); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1434 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1434 * 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) # <<<<<<<<<<<<<< @@ -53239,7 +53223,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ } __pyx_L37:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1435 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1435 * 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 # <<<<<<<<<<<<<< @@ -53250,7 +53234,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ } } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1436 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1436 * e_gaps2 = self.int_arr_extend(e_gaps2, &len2, &i, 1) * j = j + step * free(e_gaps1) # <<<<<<<<<<<<<< @@ -53259,7 +53243,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ free(__pyx_v_e_gaps1); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1437 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1437 * j = j + step * free(e_gaps1) * e_gaps1 = e_gaps2 # <<<<<<<<<<<<<< @@ -53268,7 +53252,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_e_gaps1 = __pyx_v_e_gaps2; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1438 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1438 * free(e_gaps1) * e_gaps1 = e_gaps2 * len1 = len2 # <<<<<<<<<<<<<< @@ -53277,7 +53261,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_len1 = __pyx_v_len2; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1440 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1440 * len1 = len2 * * step = (num_gaps+1)*2 # <<<<<<<<<<<<<< @@ -53286,7 +53270,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_step = ((__pyx_v_num_gaps + 1) * 2); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1441 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1441 * * step = (num_gaps+1)*2 * i = 0 # <<<<<<<<<<<<<< @@ -53295,7 +53279,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_i = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1443 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1443 * i = 0 * * while i < len1: # <<<<<<<<<<<<<< @@ -53306,7 +53290,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_t_2 = (__pyx_v_i < __pyx_v_len1); if (!__pyx_t_2) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1444 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1444 * * while i < len1: * ephr_arr._clear() # <<<<<<<<<<<<<< @@ -53315,7 +53299,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_ephr_arr->__pyx_vtab)->_clear(__pyx_v_ephr_arr); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1445 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1445 * while i < len1: * ephr_arr._clear() * num_chunks = 0 # <<<<<<<<<<<<<< @@ -53324,7 +53308,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_num_chunks = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1446 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1446 * ephr_arr._clear() * num_chunks = 0 * indexes = [] # <<<<<<<<<<<<<< @@ -53337,7 +53321,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_v_indexes = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1447 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1447 * num_chunks = 0 * indexes = [] * for j from 0 <= j < num_gaps+1: # <<<<<<<<<<<<<< @@ -53347,7 +53331,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_t_9 = (__pyx_v_num_gaps + 1); for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_9; __pyx_v_j++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1448 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1448 * indexes = [] * for j from 0 <= j < num_gaps+1: * if e_gaps1[i+2*j] < e_gaps1[i+(2*j)+1]: # <<<<<<<<<<<<<< @@ -53357,7 +53341,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_t_2 = ((__pyx_v_e_gaps1[(__pyx_v_i + (2 * __pyx_v_j))]) < (__pyx_v_e_gaps1[((__pyx_v_i + (2 * __pyx_v_j)) + 1)])); if (__pyx_t_2) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1449 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1449 * 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 # <<<<<<<<<<<<<< @@ -53369,7 +53353,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ } __pyx_L42:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1450 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1450 * 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]: # <<<<<<<<<<<<<< @@ -53379,7 +53363,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __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/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1451 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1451 * num_chunks = num_chunks + 1 * for k from e_gaps1[i+2*j] <= k < e_gaps1[i+(2*j)+1]: * indexes.append(k) # <<<<<<<<<<<<<< @@ -53391,7 +53375,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_t_10 = PyList_Append(__pyx_v_indexes, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1452 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1452 * 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]]) # <<<<<<<<<<<<<< @@ -53406,7 +53390,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_ephr_arr->__pyx_vtab)->_append(__pyx_v_ephr_arr, __pyx_t_4); } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1453 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1453 * indexes.append(k) * ephr_arr._append(self.eid2symid[self.eda.data.arr[e_sent_start+k]]) * if j < num_gaps: # <<<<<<<<<<<<<< @@ -53416,7 +53400,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_t_2 = (__pyx_v_j < __pyx_v_num_gaps); if (__pyx_t_2) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1454 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1454 * 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)) # <<<<<<<<<<<<<< @@ -53428,7 +53412,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_t_10 = PyList_Append(__pyx_v_indexes, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1455 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1455 * 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)) # <<<<<<<<<<<<<< @@ -53441,7 +53425,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_L45:; } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1456 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1456 * 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 # <<<<<<<<<<<<<< @@ -53450,7 +53434,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_i = (__pyx_v_i + __pyx_v_step); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1457 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1457 * 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: # <<<<<<<<<<<<<< @@ -53466,7 +53450,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ } if (__pyx_t_7) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1458 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1458 * i = i + step * if ephr_arr.len <= self.max_target_length and num_chunks <= self.max_target_chunks: * result.append((Phrase(ephr_arr),indexes)) # <<<<<<<<<<<<<< @@ -53498,7 +53482,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_L46:; } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1460 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1460 * result.append((Phrase(ephr_arr),indexes)) * * free(e_gaps1) # <<<<<<<<<<<<<< @@ -53507,7 +53491,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ free(__pyx_v_e_gaps1); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1461 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1461 * * free(e_gaps1) * free(e_gap_order) # <<<<<<<<<<<<<< @@ -53516,7 +53500,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ free(__pyx_v_e_gap_order); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1462 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1462 * free(e_gaps1) * free(e_gap_order) * return result # <<<<<<<<<<<<<< @@ -53544,7 +53528,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1464 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1464 * return result * * cdef IntList create_alignments(self, int* sent_links, int num_links, findexes, eindexes): # <<<<<<<<<<<<<< @@ -53572,7 +53556,7 @@ static struct __pyx_obj_3_sa_IntList *__pyx_f_3_sa_23HieroCachingRuleFactory_cre int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_alignments", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1466 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1466 * cdef IntList create_alignments(self, int* sent_links, int num_links, findexes, eindexes): * cdef unsigned i * cdef IntList ret = IntList() # <<<<<<<<<<<<<< @@ -53584,7 +53568,7 @@ static struct __pyx_obj_3_sa_IntList *__pyx_f_3_sa_23HieroCachingRuleFactory_cre __pyx_v_ret = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1467 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1467 * cdef unsigned i * cdef IntList ret = IntList() * for i in range(len(findexes)): # <<<<<<<<<<<<<< @@ -53595,7 +53579,7 @@ static struct __pyx_obj_3_sa_IntList *__pyx_f_3_sa_23HieroCachingRuleFactory_cre for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1468 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1468 * cdef IntList ret = IntList() * for i in range(len(findexes)): * s = findexes[i] # <<<<<<<<<<<<<< @@ -53608,19 +53592,20 @@ static struct __pyx_obj_3_sa_IntList *__pyx_f_3_sa_23HieroCachingRuleFactory_cre __pyx_v_s = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1469 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1469 * for i in range(len(findexes)): * s = findexes[i] * if (s<0): # <<<<<<<<<<<<<< * continue * idx = 0 */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_s, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_s, __pyx_int_0, Py_LT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_4) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1470 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1470 * s = findexes[i] * if (s<0): * continue # <<<<<<<<<<<<<< @@ -53632,7 +53617,7 @@ static struct __pyx_obj_3_sa_IntList *__pyx_f_3_sa_23HieroCachingRuleFactory_cre } __pyx_L5:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1471 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1471 * if (s<0): * continue * idx = 0 # <<<<<<<<<<<<<< @@ -53643,7 +53628,7 @@ static struct __pyx_obj_3_sa_IntList *__pyx_f_3_sa_23HieroCachingRuleFactory_cre __Pyx_XDECREF(__pyx_v_idx); __pyx_v_idx = __pyx_int_0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1472 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1472 * continue * idx = 0 * while (idx < num_links*2): # <<<<<<<<<<<<<< @@ -53653,13 +53638,14 @@ static struct __pyx_obj_3_sa_IntList *__pyx_f_3_sa_23HieroCachingRuleFactory_cre while (1) { __pyx_t_1 = PyInt_FromLong((__pyx_v_num_links * 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_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 = 1472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_idx, __pyx_t_1, Py_LT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (!__pyx_t_4) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1473 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1473 * idx = 0 * while (idx < num_links*2): * if (sent_links[idx] == s): # <<<<<<<<<<<<<< @@ -53669,13 +53655,14 @@ static struct __pyx_obj_3_sa_IntList *__pyx_f_3_sa_23HieroCachingRuleFactory_cre __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 = 1473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = PyInt_FromLong((__pyx_v_sent_links[__pyx_t_6])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_v_s, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_v_s, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_4) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1474 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1474 * while (idx < num_links*2): * if (sent_links[idx] == s): * j = eindexes.index(sent_links[idx+1]) # <<<<<<<<<<<<<< @@ -53703,7 +53690,7 @@ static struct __pyx_obj_3_sa_IntList *__pyx_f_3_sa_23HieroCachingRuleFactory_cre __pyx_v_j = __pyx_t_5; __pyx_t_5 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1475 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1475 * if (sent_links[idx] == s): * j = eindexes.index(sent_links[idx+1]) * ret.append(i*65536+j) # <<<<<<<<<<<<<< @@ -53723,7 +53710,7 @@ static struct __pyx_obj_3_sa_IntList *__pyx_f_3_sa_23HieroCachingRuleFactory_cre } __pyx_L8:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1476 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1476 * j = eindexes.index(sent_links[idx+1]) * ret.append(i*65536+j) * idx += 2 # <<<<<<<<<<<<<< @@ -53739,7 +53726,7 @@ static struct __pyx_obj_3_sa_IntList *__pyx_f_3_sa_23HieroCachingRuleFactory_cre __pyx_L3_continue:; } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1477 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1477 * ret.append(i*65536+j) * idx += 2 * return ret # <<<<<<<<<<<<<< @@ -53769,7 +53756,7 @@ static struct __pyx_obj_3_sa_IntList *__pyx_f_3_sa_23HieroCachingRuleFactory_cre return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1479 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1479 * return ret * * cdef extract(self, Phrase phrase, Matching* matching, int* chunklen, int num_chunks): # <<<<<<<<<<<<<< @@ -53863,7 +53850,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj int __pyx_clineno = 0; __Pyx_RefNannySetupContext("extract", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1492 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1492 * cdef reason_for_failure * * fphr_arr = IntList() # <<<<<<<<<<<<<< @@ -53875,7 +53862,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_v_fphr_arr = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1493 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1493 * * fphr_arr = IntList() * phrase_len = phrase.n # <<<<<<<<<<<<<< @@ -53884,7 +53871,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_phrase_len = __pyx_v_phrase->n; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1494 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1494 * fphr_arr = IntList() * phrase_len = phrase.n * extracts = [] # <<<<<<<<<<<<<< @@ -53896,7 +53883,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_v_extracts = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1495 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1495 * phrase_len = phrase.n * extracts = [] * sent_links = self.alignment._get_sent_links(matching.sent_id, &num_links) # <<<<<<<<<<<<<< @@ -53905,7 +53892,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_sent_links = ((struct __pyx_vtabstruct_3_sa_Alignment *)__pyx_v_self->alignment->__pyx_vtab)->_get_sent_links(__pyx_v_self->alignment, __pyx_v_matching->sent_id, (&__pyx_v_num_links)); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1497 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1497 * sent_links = self.alignment._get_sent_links(matching.sent_id, &num_links) * * e_sent_start = self.eda.sent_index.arr[matching.sent_id] # <<<<<<<<<<<<<< @@ -53914,7 +53901,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_e_sent_start = (__pyx_v_self->eda->sent_index->arr[__pyx_v_matching->sent_id]); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1498 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1498 * * e_sent_start = self.eda.sent_index.arr[matching.sent_id] * e_sent_end = self.eda.sent_index.arr[matching.sent_id+1] # <<<<<<<<<<<<<< @@ -53923,7 +53910,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_e_sent_end = (__pyx_v_self->eda->sent_index->arr[(__pyx_v_matching->sent_id + 1)]); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1499 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1499 * 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 # <<<<<<<<<<<<<< @@ -53932,7 +53919,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_e_sent_len = ((__pyx_v_e_sent_end - __pyx_v_e_sent_start) - 1); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1500 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1500 * 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] # <<<<<<<<<<<<<< @@ -53941,7 +53928,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_f_sent_start = (__pyx_v_self->fda->sent_index->arr[__pyx_v_matching->sent_id]); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1501 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1501 * 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] # <<<<<<<<<<<<<< @@ -53950,7 +53937,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_f_sent_end = (__pyx_v_self->fda->sent_index->arr[(__pyx_v_matching->sent_id + 1)]); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1502 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1502 * 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 # <<<<<<<<<<<<<< @@ -53959,7 +53946,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_f_sent_len = ((__pyx_v_f_sent_end - __pyx_v_f_sent_start) - 1); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1504 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1504 * f_sent_len = f_sent_end - f_sent_start - 1 * * self.findexes1.reset() # <<<<<<<<<<<<<< @@ -53973,7 +53960,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1505 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1505 * * self.findexes1.reset() * sofar = 0 # <<<<<<<<<<<<<< @@ -53983,7 +53970,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __Pyx_INCREF(__pyx_int_0); __pyx_v_sofar = __pyx_int_0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1506 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1506 * self.findexes1.reset() * sofar = 0 * for i in range(num_chunks): # <<<<<<<<<<<<<< @@ -53994,7 +53981,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1507 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1507 * sofar = 0 * for i in range(num_chunks): * for j in range(chunklen[i]): # <<<<<<<<<<<<<< @@ -54005,7 +53992,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_j = __pyx_t_6; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1508 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1508 * for i in range(num_chunks): * for j in range(chunklen[i]): * self.findexes1.append(matching.arr[matching.start+i]+j-f_sent_start); # <<<<<<<<<<<<<< @@ -54019,7 +54006,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1509 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1509 * for j in range(chunklen[i]): * self.findexes1.append(matching.arr[matching.start+i]+j-f_sent_start); * sofar += 1 # <<<<<<<<<<<<<< @@ -54033,7 +54020,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_1 = 0; } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1510 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1510 * self.findexes1.append(matching.arr[matching.start+i]+j-f_sent_start); * sofar += 1 * if (i+1 malloc(e_sent_len*sizeof(int)) # <<<<<<<<<<<<<< @@ -54083,7 +54070,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_e_links_low = ((int *)malloc((__pyx_v_e_sent_len * (sizeof(int))))); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1516 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1516 * * e_links_low = malloc(e_sent_len*sizeof(int)) * e_links_high = malloc(e_sent_len*sizeof(int)) # <<<<<<<<<<<<<< @@ -54092,7 +54079,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_e_links_high = ((int *)malloc((__pyx_v_e_sent_len * (sizeof(int))))); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1517 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1517 * 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)) # <<<<<<<<<<<<<< @@ -54101,7 +54088,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_f_links_low = ((int *)malloc((__pyx_v_f_sent_len * (sizeof(int))))); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1518 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1518 * 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)) # <<<<<<<<<<<<<< @@ -54110,7 +54097,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_f_links_high = ((int *)malloc((__pyx_v_f_sent_len * (sizeof(int))))); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1519 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1519 * 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)) # <<<<<<<<<<<<<< @@ -54119,7 +54106,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_f_gap_low = ((int *)malloc(((__pyx_v_num_chunks + 1) * (sizeof(int))))); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1520 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1520 * 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)) # <<<<<<<<<<<<<< @@ -54128,7 +54115,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_f_gap_high = ((int *)malloc(((__pyx_v_num_chunks + 1) * (sizeof(int))))); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1521 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1521 * 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)) # <<<<<<<<<<<<<< @@ -54137,7 +54124,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_e_gap_low = ((int *)malloc(((__pyx_v_num_chunks + 1) * (sizeof(int))))); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1522 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1522 * 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)) # <<<<<<<<<<<<<< @@ -54146,7 +54133,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_e_gap_high = ((int *)malloc(((__pyx_v_num_chunks + 1) * (sizeof(int))))); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1523 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1523 * 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)) # <<<<<<<<<<<<<< @@ -54155,7 +54142,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ memset(__pyx_v_f_gap_low, 0, ((__pyx_v_num_chunks + 1) * (sizeof(int)))); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1524 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1524 * 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)) # <<<<<<<<<<<<<< @@ -54164,7 +54151,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ memset(__pyx_v_f_gap_high, 0, ((__pyx_v_num_chunks + 1) * (sizeof(int)))); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1525 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1525 * 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)) # <<<<<<<<<<<<<< @@ -54173,7 +54160,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ memset(__pyx_v_e_gap_low, 0, ((__pyx_v_num_chunks + 1) * (sizeof(int)))); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1526 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1526 * 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)) # <<<<<<<<<<<<<< @@ -54182,7 +54169,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ memset(__pyx_v_e_gap_high, 0, ((__pyx_v_num_chunks + 1) * (sizeof(int)))); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1528 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1528 * memset(e_gap_high, 0, (num_chunks+1)*sizeof(int)) * * reason_for_failure = "" # <<<<<<<<<<<<<< @@ -54192,7 +54179,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __Pyx_INCREF(((PyObject *)__pyx_kp_s_45)); __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_45); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1530 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1530 * reason_for_failure = "" * * for i from 0 <= i < e_sent_len: # <<<<<<<<<<<<<< @@ -54202,7 +54189,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_3 = __pyx_v_e_sent_len; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1531 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1531 * * for i from 0 <= i < e_sent_len: * e_links_low[i] = -1 # <<<<<<<<<<<<<< @@ -54211,7 +54198,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ (__pyx_v_e_links_low[__pyx_v_i]) = -1; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1532 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1532 * for i from 0 <= i < e_sent_len: * e_links_low[i] = -1 * e_links_high[i] = -1 # <<<<<<<<<<<<<< @@ -54221,7 +54208,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj (__pyx_v_e_links_high[__pyx_v_i]) = -1; } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1533 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1533 * e_links_low[i] = -1 * e_links_high[i] = -1 * for i from 0 <= i < f_sent_len: # <<<<<<<<<<<<<< @@ -54231,7 +54218,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_3 = __pyx_v_f_sent_len; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1534 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1534 * e_links_high[i] = -1 * for i from 0 <= i < f_sent_len: * f_links_low[i] = -1 # <<<<<<<<<<<<<< @@ -54240,7 +54227,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ (__pyx_v_f_links_low[__pyx_v_i]) = -1; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1535 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1535 * for i from 0 <= i < f_sent_len: * f_links_low[i] = -1 * f_links_high[i] = -1 # <<<<<<<<<<<<<< @@ -54250,7 +54237,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj (__pyx_v_f_links_high[__pyx_v_i]) = -1; } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1541 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1541 * # links that we care about (but then how to look up * # when we want to check something on the e side?) * i = 0 # <<<<<<<<<<<<<< @@ -54259,7 +54246,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_i = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1542 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1542 * # when we want to check something on the e side?) * i = 0 * while i < num_links*2: # <<<<<<<<<<<<<< @@ -54270,7 +54257,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_7 = (__pyx_v_i < (__pyx_v_num_links * 2)); if (!__pyx_t_7) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1543 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1543 * i = 0 * while i < num_links*2: * f_i = sent_links[i] # <<<<<<<<<<<<<< @@ -54279,7 +54266,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_f_i = (__pyx_v_sent_links[__pyx_v_i]); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1544 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1544 * while i < num_links*2: * f_i = sent_links[i] * e_i = sent_links[i+1] # <<<<<<<<<<<<<< @@ -54288,7 +54275,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_e_i = (__pyx_v_sent_links[(__pyx_v_i + 1)]); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1545 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1545 * 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: # <<<<<<<<<<<<<< @@ -54304,7 +54291,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1546 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1546 * 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 # <<<<<<<<<<<<<< @@ -54316,7 +54303,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L14:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1547 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1547 * 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: # <<<<<<<<<<<<<< @@ -54332,7 +54319,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if (__pyx_t_8) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1548 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1548 * 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 # <<<<<<<<<<<<<< @@ -54344,7 +54331,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L15:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1549 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1549 * 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: # <<<<<<<<<<<<<< @@ -54360,7 +54347,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if (__pyx_t_7) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1550 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1550 * 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 # <<<<<<<<<<<<<< @@ -54372,7 +54359,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L16:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1551 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1551 * 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: # <<<<<<<<<<<<<< @@ -54388,7 +54375,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1552 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1552 * 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 # <<<<<<<<<<<<<< @@ -54400,7 +54387,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L17:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1553 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1553 * 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 # <<<<<<<<<<<<<< @@ -54410,7 +54397,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_v_i = (__pyx_v_i + 2); } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1555 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1555 * i = i + 2 * * als = [] # <<<<<<<<<<<<<< @@ -54422,7 +54409,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_v_als = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1556 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1556 * * als = [] * for x in range(matching.start,matching.end): # <<<<<<<<<<<<<< @@ -54433,7 +54420,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj for (__pyx_t_4 = __pyx_v_matching->start; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_x = __pyx_t_4; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1557 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1557 * 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]) # <<<<<<<<<<<<<< @@ -54456,7 +54443,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_v_al = __pyx_t_10; __pyx_t_10 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1558 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1558 * 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) # <<<<<<<<<<<<<< @@ -54466,7 +54453,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_11 = PyList_Append(__pyx_v_als, ((PyObject *)__pyx_v_al)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1560 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1560 * als.append(al) * # check all source-side alignment constraints * met_constraints = 1 # <<<<<<<<<<<<<< @@ -54475,7 +54462,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_met_constraints = 1; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1561 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1561 * # check all source-side alignment constraints * met_constraints = 1 * if self.require_aligned_terminal: # <<<<<<<<<<<<<< @@ -54484,7 +54471,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ if (__pyx_v_self->require_aligned_terminal) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1562 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1562 * met_constraints = 1 * if self.require_aligned_terminal: * num_aligned_chunks = 0 # <<<<<<<<<<<<<< @@ -54493,7 +54480,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_num_aligned_chunks = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1563 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1563 * if self.require_aligned_terminal: * num_aligned_chunks = 0 * for i from 0 <= i < num_chunks: # <<<<<<<<<<<<<< @@ -54503,7 +54490,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_3 = __pyx_v_num_chunks; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1564 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1564 * num_aligned_chunks = 0 * for i from 0 <= i < num_chunks: * for j from 0 <= j < chunklen[i]: # <<<<<<<<<<<<<< @@ -54513,7 +54500,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_4 = (__pyx_v_chunklen[__pyx_v_i]); for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_4; __pyx_v_j++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1565 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1565 * 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: # <<<<<<<<<<<<<< @@ -54523,7 +54510,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_9 = ((__pyx_v_f_links_low[(((__pyx_v_matching->arr[(__pyx_v_matching->start + __pyx_v_i)]) + __pyx_v_j) - __pyx_v_f_sent_start)]) > -1); if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1566 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1566 * 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 # <<<<<<<<<<<<<< @@ -54532,7 +54519,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_num_aligned_chunks = (__pyx_v_num_aligned_chunks + 1); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1567 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1567 * if f_links_low[matching.arr[matching.start+i]+j-f_sent_start] > -1: * num_aligned_chunks = num_aligned_chunks + 1 * break # <<<<<<<<<<<<<< @@ -54547,7 +54534,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_L24_break:; } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1568 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1568 * num_aligned_chunks = num_aligned_chunks + 1 * break * if num_aligned_chunks == 0: # <<<<<<<<<<<<<< @@ -54557,7 +54544,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_9 = (__pyx_v_num_aligned_chunks == 0); if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1569 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1569 * break * if num_aligned_chunks == 0: * reason_for_failure = "No aligned terminals" # <<<<<<<<<<<<<< @@ -54568,7 +54555,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __Pyx_DECREF(__pyx_v_reason_for_failure); __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_127); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1570 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1570 * if num_aligned_chunks == 0: * reason_for_failure = "No aligned terminals" * met_constraints = 0 # <<<<<<<<<<<<<< @@ -54580,7 +54567,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L26:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1571 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1571 * reason_for_failure = "No aligned terminals" * met_constraints = 0 * if self.require_aligned_chunks and num_aligned_chunks < num_chunks: # <<<<<<<<<<<<<< @@ -54595,7 +54582,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if (__pyx_t_7) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1572 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1572 * met_constraints = 0 * if self.require_aligned_chunks and num_aligned_chunks < num_chunks: * reason_for_failure = "Unaligned chunk" # <<<<<<<<<<<<<< @@ -54606,7 +54593,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __Pyx_DECREF(__pyx_v_reason_for_failure); __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_128); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1573 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1573 * if self.require_aligned_chunks and num_aligned_chunks < num_chunks: * reason_for_failure = "Unaligned chunk" * met_constraints = 0 # <<<<<<<<<<<<<< @@ -54621,7 +54608,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L20:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1575 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1575 * met_constraints = 0 * * if met_constraints and self.tight_phrases: # <<<<<<<<<<<<<< @@ -54636,7 +54623,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1577 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1577 * if met_constraints and self.tight_phrases: * # outside edge constraints are checked later * for i from 0 <= i < num_chunks-1: # <<<<<<<<<<<<<< @@ -54646,7 +54633,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_12 = (__pyx_v_num_chunks - 1); for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_12; __pyx_v_i++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1578 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1578 * # 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: # <<<<<<<<<<<<<< @@ -54656,7 +54643,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __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); if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1579 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1579 * 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" # <<<<<<<<<<<<<< @@ -54667,7 +54654,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __Pyx_DECREF(__pyx_v_reason_for_failure); __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_129); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1580 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1580 * 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 # <<<<<<<<<<<<<< @@ -54676,7 +54663,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_met_constraints = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1581 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1581 * reason_for_failure = "Gaps are not tight phrases" * met_constraints = 0 * break # <<<<<<<<<<<<<< @@ -54688,7 +54675,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L31:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1582 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1582 * met_constraints = 0 * break * if f_links_low[matching.arr[matching.start+i+1]-1-f_sent_start] == -1: # <<<<<<<<<<<<<< @@ -54698,7 +54685,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __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); if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1583 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1583 * break * if f_links_low[matching.arr[matching.start+i+1]-1-f_sent_start] == -1: * reason_for_failure = "Gaps are not tight phrases" # <<<<<<<<<<<<<< @@ -54709,7 +54696,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __Pyx_DECREF(__pyx_v_reason_for_failure); __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_129); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1584 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1584 * 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 # <<<<<<<<<<<<<< @@ -54718,7 +54705,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_met_constraints = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1585 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1585 * reason_for_failure = "Gaps are not tight phrases" * met_constraints = 0 * break # <<<<<<<<<<<<<< @@ -54735,7 +54722,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L28:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1587 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1587 * break * * f_low = matching.arr[matching.start] - f_sent_start # <<<<<<<<<<<<<< @@ -54744,7 +54731,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_f_low = ((__pyx_v_matching->arr[__pyx_v_matching->start]) - __pyx_v_f_sent_start); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1588 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1588 * * 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 # <<<<<<<<<<<<<< @@ -54753,7 +54740,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __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/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1589 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1589 * 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: # <<<<<<<<<<<<<< @@ -54762,7 +54749,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ if (__pyx_v_met_constraints) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1591 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1591 * if met_constraints: * * if self.find_fixpoint(f_low, f_high, f_links_low, f_links_high, e_links_low, e_links_high, # <<<<<<<<<<<<<< @@ -54772,7 +54759,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_10 = PyInt_FromLong(__pyx_v_f_high); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1595 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1595 * 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): # <<<<<<<<<<<<<< @@ -54783,7 +54770,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1596 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1596 * self.train_min_gap_size, 0, * self.max_nonterminals - num_chunks + 1, 1, 1, 0, 0): * gap_error = 0 # <<<<<<<<<<<<<< @@ -54792,7 +54779,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_gap_error = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1597 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1597 * self.max_nonterminals - num_chunks + 1, 1, 1, 0, 0): * gap_error = 0 * num_gaps = 0 # <<<<<<<<<<<<<< @@ -54801,7 +54788,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_num_gaps = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1599 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1599 * num_gaps = 0 * * if f_back_low < f_low: # <<<<<<<<<<<<<< @@ -54811,7 +54798,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_9 = (__pyx_v_f_back_low < __pyx_v_f_low); if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1600 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1600 * * if f_back_low < f_low: * f_gap_low[0] = f_back_low # <<<<<<<<<<<<<< @@ -54820,7 +54807,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ (__pyx_v_f_gap_low[0]) = __pyx_v_f_back_low; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1601 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1601 * if f_back_low < f_low: * f_gap_low[0] = f_back_low * f_gap_high[0] = f_low # <<<<<<<<<<<<<< @@ -54829,7 +54816,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ (__pyx_v_f_gap_high[0]) = __pyx_v_f_low; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1602 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1602 * f_gap_low[0] = f_back_low * f_gap_high[0] = f_low * num_gaps = 1 # <<<<<<<<<<<<<< @@ -54838,7 +54825,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_num_gaps = 1; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1603 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1603 * f_gap_high[0] = f_low * num_gaps = 1 * gap_start = 0 # <<<<<<<<<<<<<< @@ -54847,7 +54834,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_gap_start = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1604 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1604 * num_gaps = 1 * gap_start = 0 * phrase_len = phrase_len+1 # <<<<<<<<<<<<<< @@ -54856,7 +54843,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_phrase_len = (__pyx_v_phrase_len + 1); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1605 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1605 * gap_start = 0 * phrase_len = phrase_len+1 * if phrase_len > self.max_length: # <<<<<<<<<<<<<< @@ -54866,7 +54853,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_9 = (__pyx_v_phrase_len > __pyx_v_self->max_length); if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1606 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1606 * phrase_len = phrase_len+1 * if phrase_len > self.max_length: * gap_error = 1 # <<<<<<<<<<<<<< @@ -54878,7 +54865,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L36:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1607 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1607 * if phrase_len > self.max_length: * gap_error = 1 * if self.tight_phrases: # <<<<<<<<<<<<<< @@ -54887,7 +54874,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ if (__pyx_v_self->tight_phrases) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1608 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1608 * gap_error = 1 * if self.tight_phrases: * if f_links_low[f_back_low] == -1 or f_links_low[f_low-1] == -1: # <<<<<<<<<<<<<< @@ -54903,7 +54890,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if (__pyx_t_8) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1609 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1609 * if self.tight_phrases: * if f_links_low[f_back_low] == -1 or f_links_low[f_low-1] == -1: * gap_error = 1 # <<<<<<<<<<<<<< @@ -54912,7 +54899,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_gap_error = 1; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1610 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1610 * 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" # <<<<<<<<<<<<<< @@ -54932,7 +54919,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1612 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1612 * reason_for_failure = "Inside edges of preceding subphrase are not tight" * else: * gap_start = 1 # <<<<<<<<<<<<<< @@ -54941,7 +54928,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_gap_start = 1; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1613 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1613 * else: * gap_start = 1 * if self.tight_phrases and f_links_low[f_low] == -1: # <<<<<<<<<<<<<< @@ -54956,7 +54943,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1616 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1616 * # 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 # <<<<<<<<<<<<<< @@ -54970,7 +54957,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L35:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1618 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1618 * met_constraints = 0 * * for i from 0 <= i < matching.size - 1: # <<<<<<<<<<<<<< @@ -54980,7 +54967,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_12 = (__pyx_v_matching->size - 1); for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_12; __pyx_v_i++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1619 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1619 * * for i from 0 <= i < matching.size - 1: * f_gap_low[1+i] = matching.arr[matching.start+i] + chunklen[i] - f_sent_start # <<<<<<<<<<<<<< @@ -54989,7 +54976,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ (__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/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1620 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1620 * 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 # <<<<<<<<<<<<<< @@ -54998,7 +54985,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ (__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/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1621 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1621 * 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 # <<<<<<<<<<<<<< @@ -55008,7 +54995,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_v_num_gaps = (__pyx_v_num_gaps + 1); } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1623 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1623 * num_gaps = num_gaps + 1 * * if f_high < f_back_high: # <<<<<<<<<<<<<< @@ -55018,7 +55005,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_9 = (__pyx_v_f_high < __pyx_v_f_back_high); if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1624 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1624 * * if f_high < f_back_high: * f_gap_low[gap_start+num_gaps] = f_high # <<<<<<<<<<<<<< @@ -55027,7 +55014,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ (__pyx_v_f_gap_low[(__pyx_v_gap_start + __pyx_v_num_gaps)]) = __pyx_v_f_high; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1625 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1625 * 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 # <<<<<<<<<<<<<< @@ -55036,7 +55023,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ (__pyx_v_f_gap_high[(__pyx_v_gap_start + __pyx_v_num_gaps)]) = __pyx_v_f_back_high; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1626 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1626 * f_gap_low[gap_start+num_gaps] = f_high * f_gap_high[gap_start+num_gaps] = f_back_high * num_gaps = num_gaps + 1 # <<<<<<<<<<<<<< @@ -55045,7 +55032,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_num_gaps = (__pyx_v_num_gaps + 1); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1627 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1627 * f_gap_high[gap_start+num_gaps] = f_back_high * num_gaps = num_gaps + 1 * phrase_len = phrase_len+1 # <<<<<<<<<<<<<< @@ -55054,7 +55041,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_phrase_len = (__pyx_v_phrase_len + 1); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1628 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1628 * num_gaps = num_gaps + 1 * phrase_len = phrase_len+1 * if phrase_len > self.max_length: # <<<<<<<<<<<<<< @@ -55064,7 +55051,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_9 = (__pyx_v_phrase_len > __pyx_v_self->max_length); if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1629 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1629 * phrase_len = phrase_len+1 * if phrase_len > self.max_length: * gap_error = 1 # <<<<<<<<<<<<<< @@ -55076,7 +55063,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L43:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1630 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1630 * if phrase_len > self.max_length: * gap_error = 1 * if self.tight_phrases: # <<<<<<<<<<<<<< @@ -55085,7 +55072,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ if (__pyx_v_self->tight_phrases) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1631 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1631 * gap_error = 1 * if self.tight_phrases: * if f_links_low[f_back_high-1] == -1 or f_links_low[f_high] == -1: # <<<<<<<<<<<<<< @@ -55101,7 +55088,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if (__pyx_t_7) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1632 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1632 * if self.tight_phrases: * if f_links_low[f_back_high-1] == -1 or f_links_low[f_high] == -1: * gap_error = 1 # <<<<<<<<<<<<<< @@ -55110,7 +55097,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_gap_error = 1; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1633 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1633 * 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" # <<<<<<<<<<<<<< @@ -55130,7 +55117,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1635 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1635 * reason_for_failure = "Inside edges of following subphrase are not tight" * else: * if self.tight_phrases and f_links_low[f_high-1] == -1: # <<<<<<<<<<<<<< @@ -55145,7 +55132,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1636 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1636 * else: * if self.tight_phrases and f_links_low[f_high-1] == -1: * met_constraints = 0 # <<<<<<<<<<<<<< @@ -55159,7 +55146,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L42:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1638 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1638 * met_constraints = 0 * * if gap_error == 0: # <<<<<<<<<<<<<< @@ -55169,7 +55156,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_9 = (__pyx_v_gap_error == 0); if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1639 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1639 * * if gap_error == 0: * e_word_count = e_high - e_low # <<<<<<<<<<<<<< @@ -55178,7 +55165,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_e_word_count = (__pyx_v_e_high - __pyx_v_e_low); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1640 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1640 * if gap_error == 0: * e_word_count = e_high - e_low * for i from 0 <= i < num_gaps: # check integrity of subphrases # <<<<<<<<<<<<<< @@ -55188,7 +55175,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_3 = __pyx_v_num_gaps; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1641 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1641 * 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], # <<<<<<<<<<<<<< @@ -55198,7 +55185,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __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 = 1641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1646 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1646 * 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, # <<<<<<<<<<<<<< @@ -55209,7 +55196,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1648 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1648 * self.train_max_initial_size, self.train_max_initial_size, * 0, 0, 0, 0, 0, 0, 0) == 0: * gap_error = 1 # <<<<<<<<<<<<<< @@ -55218,7 +55205,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_gap_error = 1; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1649 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1649 * 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]) # <<<<<<<<<<<<<< @@ -55244,7 +55231,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_v_reason_for_failure = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1650 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1650 * 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 # <<<<<<<<<<<<<< @@ -55261,7 +55248,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L47:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1652 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1652 * break * * if gap_error == 0: # <<<<<<<<<<<<<< @@ -55271,7 +55258,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_9 = (__pyx_v_gap_error == 0); if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1653 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1653 * * if gap_error == 0: * i = 1 # <<<<<<<<<<<<<< @@ -55280,7 +55267,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_i = 1; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1654 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1654 * if gap_error == 0: * i = 1 * self.findexes.reset() # <<<<<<<<<<<<<< @@ -55294,7 +55281,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1655 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1655 * i = 1 * self.findexes.reset() * if f_back_low < f_low: # <<<<<<<<<<<<<< @@ -55304,7 +55291,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_9 = (__pyx_v_f_back_low < __pyx_v_f_low); if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1656 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1656 * self.findexes.reset() * if f_back_low < f_low: * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -55313,7 +55300,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1657 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1657 * if f_back_low < f_low: * fphr_arr._append(sym_setindex(self.category, i)) * i = i+1 # <<<<<<<<<<<<<< @@ -55322,7 +55309,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_i = (__pyx_v_i + 1); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1658 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1658 * fphr_arr._append(sym_setindex(self.category, i)) * i = i+1 * self.findexes.append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -55339,7 +55326,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L52:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1659 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1659 * i = i+1 * self.findexes.append(sym_setindex(self.category, i)) * self.findexes.extend(self.findexes1) # <<<<<<<<<<<<<< @@ -55359,7 +55346,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1660 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1660 * self.findexes.append(sym_setindex(self.category, i)) * self.findexes.extend(self.findexes1) * for j from 0 <= j < phrase.n: # <<<<<<<<<<<<<< @@ -55369,7 +55356,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_3 = __pyx_v_phrase->n; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_3; __pyx_v_j++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1661 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1661 * self.findexes.extend(self.findexes1) * for j from 0 <= j < phrase.n: * if sym_isvar(phrase.syms[j]): # <<<<<<<<<<<<<< @@ -55379,7 +55366,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_4 = __pyx_f_3_sa_sym_isvar((__pyx_v_phrase->syms[__pyx_v_j])); if (__pyx_t_4) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1662 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1662 * for j from 0 <= j < phrase.n: * if sym_isvar(phrase.syms[j]): * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -55388,7 +55375,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1663 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1663 * if sym_isvar(phrase.syms[j]): * fphr_arr._append(sym_setindex(self.category, i)) * i = i + 1 # <<<<<<<<<<<<<< @@ -55400,7 +55387,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1665 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1665 * i = i + 1 * else: * fphr_arr._append(phrase.syms[j]) # <<<<<<<<<<<<<< @@ -55412,7 +55399,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_L55:; } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1666 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1666 * else: * fphr_arr._append(phrase.syms[j]) * if f_back_high > f_high: # <<<<<<<<<<<<<< @@ -55422,7 +55409,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_9 = (__pyx_v_f_back_high > __pyx_v_f_high); if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1667 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1667 * fphr_arr._append(phrase.syms[j]) * if f_back_high > f_high: * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -55431,7 +55418,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1668 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1668 * if f_back_high > f_high: * fphr_arr._append(sym_setindex(self.category, i)) * self.findexes.append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -55448,7 +55435,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L56:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1670 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1670 * self.findexes.append(sym_setindex(self.category, i)) * * fphr = Phrase(fphr_arr) # <<<<<<<<<<<<<< @@ -55466,7 +55453,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_v_fphr = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_10); __pyx_t_10 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1671 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1671 * * fphr = Phrase(fphr_arr) * if met_constraints: # <<<<<<<<<<<<<< @@ -55475,7 +55462,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ if (__pyx_v_met_constraints) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1674 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1674 * 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) # <<<<<<<<<<<<<< @@ -55487,7 +55474,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_v_phrase_list = __pyx_t_10; __pyx_t_10 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1675 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1675 * 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: # <<<<<<<<<<<<<< @@ -55498,7 +55485,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_9 = (__pyx_t_13 > 0); if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1676 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1676 * matching.sent_id, e_sent_len, e_sent_start) * if len(phrase_list) > 0: * pair_count = 1.0 / len(phrase_list) # <<<<<<<<<<<<<< @@ -55515,7 +55502,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1678 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1678 * pair_count = 1.0 / len(phrase_list) * else: * pair_count = 0 # <<<<<<<<<<<<<< @@ -55524,7 +55511,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_pair_count = 0.0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1679 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1679 * 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) # <<<<<<<<<<<<<< @@ -55562,7 +55549,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L58:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1680 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1680 * 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: # <<<<<<<<<<<<<< @@ -55580,18 +55567,10 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj for (;;) { if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_14)) { if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_14)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_15 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_15); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1680; __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 = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_15 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_15); __pyx_t_13++; } 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 = 1680; __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 = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_15 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_15); __pyx_t_13++; } else { __pyx_t_15 = __pyx_t_16(__pyx_t_14); if (unlikely(!__pyx_t_15)) { @@ -55605,33 +55584,27 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if ((likely(PyTuple_CheckExact(__pyx_t_15))) || (PyList_CheckExact(__pyx_t_15))) { PyObject* sequence = __pyx_t_15; - #if CYTHON_COMPILING_IN_CPYTHON - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { + if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { + if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); + else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { + if (unlikely(PyList_GET_SIZE(sequence) != 2)) { + if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); + else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); - #else - __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - } else - { + } else { Py_ssize_t index = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_15); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); @@ -55642,13 +55615,12 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj index = 1; __pyx_t_2 = __pyx_t_17(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L61_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_17 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L62_unpacking_done; __pyx_L61_unpacking_failed:; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_17 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); + if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L62_unpacking_done:; } @@ -55659,7 +55631,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_v_eindexes = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1681 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1681 * 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) # <<<<<<<<<<<<<< @@ -55675,7 +55647,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_v_als1 = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1682 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1682 * 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))) # <<<<<<<<<<<<<< @@ -55716,7 +55688,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L57:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1683 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1683 * 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 # <<<<<<<<<<<<<< @@ -55726,7 +55698,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_9 = (__pyx_v_num_gaps < __pyx_v_self->max_nonterminals); if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1684 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1684 * extracts.append((fphr, phrase2, pair_count, tuple(als1))) * if (num_gaps < self.max_nonterminals and * phrase_len < self.max_length and # <<<<<<<<<<<<<< @@ -55736,7 +55708,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_7 = (__pyx_v_phrase_len < __pyx_v_self->max_length); if (__pyx_t_7) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1685 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1685 * 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): # <<<<<<<<<<<<<< @@ -55754,7 +55726,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if (__pyx_t_7) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1686 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1686 * 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 # <<<<<<<<<<<<<< @@ -55764,7 +55736,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_7 = (__pyx_v_f_back_low == __pyx_v_f_low); if (__pyx_t_7) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1687 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1687 * 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 # <<<<<<<<<<<<<< @@ -55774,7 +55746,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_9 = (__pyx_v_f_low >= __pyx_v_self->train_min_gap_size); if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1688 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1688 * 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))): # <<<<<<<<<<<<<< @@ -55804,7 +55776,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1689 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1689 * 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 # <<<<<<<<<<<<<< @@ -55813,7 +55785,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_f_x_low = (__pyx_v_f_low - __pyx_v_self->train_min_gap_size); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1690 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1690 * ((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 # <<<<<<<<<<<<<< @@ -55822,7 +55794,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_met_constraints = 1; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1691 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1691 * f_x_low = f_low-self.train_min_gap_size * met_constraints = 1 * if self.tight_phrases: # <<<<<<<<<<<<<< @@ -55831,7 +55803,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ if (__pyx_v_self->tight_phrases) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1692 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1692 * met_constraints = 1 * if self.tight_phrases: * while f_x_low >= 0 and f_links_low[f_x_low] == -1: # <<<<<<<<<<<<<< @@ -55848,7 +55820,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if (!__pyx_t_18) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1693 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1693 * if self.tight_phrases: * while f_x_low >= 0 and f_links_low[f_x_low] == -1: * f_x_low = f_x_low - 1 # <<<<<<<<<<<<<< @@ -55861,7 +55833,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L65:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1694 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1694 * 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: # <<<<<<<<<<<<<< @@ -55877,7 +55849,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if (__pyx_t_7) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1695 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1695 * 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 # <<<<<<<<<<<<<< @@ -55889,7 +55861,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L68:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1697 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1697 * met_constraints = 0 * * if (met_constraints and # <<<<<<<<<<<<<< @@ -55898,7 +55870,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ if (__pyx_v_met_constraints) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1698 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1698 * * if (met_constraints and * self.find_fixpoint(f_x_low, f_back_high, # <<<<<<<<<<<<<< @@ -55908,7 +55880,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_14 = PyInt_FromLong(__pyx_v_f_back_high); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1702 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1702 * 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, # <<<<<<<<<<<<<< @@ -55918,7 +55890,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj if (((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_x_low, __pyx_t_14, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_e_low, __pyx_v_e_high, (&__pyx_v_e_x_low), (&__pyx_v_e_x_high), (&__pyx_v_f_x_low), (&__pyx_v_f_x_high), __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, 1, 1, 1, 1, 0, 1, 0)) { __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1704 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1704 * self.train_max_initial_size, self.train_max_initial_size, * 1, 1, 1, 1, 0, 1, 0) and * ((not self.tight_phrases) or f_links_low[f_x_low] != -1) and # <<<<<<<<<<<<<< @@ -55934,7 +55906,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1705 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1705 * 1, 1, 1, 1, 0, 1, 0) and * ((not self.tight_phrases) or f_links_low[f_x_low] != -1) and * self.find_fixpoint(f_x_low, f_low, # check integrity of new subphrase # <<<<<<<<<<<<<< @@ -55944,7 +55916,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_1 = PyInt_FromLong(__pyx_v_f_low); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1709 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1709 * -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, # <<<<<<<<<<<<<< @@ -55967,7 +55939,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if (__pyx_t_7) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1711 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1711 * self.train_max_initial_size, self.train_max_initial_size, * 0, 0, 0, 0, 0, 0, 0)): * fphr_arr._clear() # <<<<<<<<<<<<<< @@ -55976,7 +55948,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_clear(__pyx_v_fphr_arr); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1712 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1712 * 0, 0, 0, 0, 0, 0, 0)): * fphr_arr._clear() * i = 1 # <<<<<<<<<<<<<< @@ -55985,7 +55957,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_i = 1; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1713 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1713 * fphr_arr._clear() * i = 1 * self.findexes.reset() # <<<<<<<<<<<<<< @@ -55999,7 +55971,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1714 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1714 * i = 1 * self.findexes.reset() * self.findexes.append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -56013,7 +55985,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1715 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1715 * self.findexes.reset() * self.findexes.append(sym_setindex(self.category, i)) * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -56022,7 +55994,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1716 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1716 * self.findexes.append(sym_setindex(self.category, i)) * fphr_arr._append(sym_setindex(self.category, i)) * i = i+1 # <<<<<<<<<<<<<< @@ -56031,7 +56003,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_i = (__pyx_v_i + 1); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1717 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1717 * fphr_arr._append(sym_setindex(self.category, i)) * i = i+1 * self.findexes.extend(self.findexes1) # <<<<<<<<<<<<<< @@ -56051,7 +56023,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1718 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1718 * i = i+1 * self.findexes.extend(self.findexes1) * for j from 0 <= j < phrase.n: # <<<<<<<<<<<<<< @@ -56061,7 +56033,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_3 = __pyx_v_phrase->n; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_3; __pyx_v_j++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1719 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1719 * self.findexes.extend(self.findexes1) * for j from 0 <= j < phrase.n: * if sym_isvar(phrase.syms[j]): # <<<<<<<<<<<<<< @@ -56071,7 +56043,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_4 = __pyx_f_3_sa_sym_isvar((__pyx_v_phrase->syms[__pyx_v_j])); if (__pyx_t_4) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1720 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1720 * for j from 0 <= j < phrase.n: * if sym_isvar(phrase.syms[j]): * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -56080,7 +56052,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1721 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1721 * if sym_isvar(phrase.syms[j]): * fphr_arr._append(sym_setindex(self.category, i)) * i = i + 1 # <<<<<<<<<<<<<< @@ -56092,7 +56064,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1723 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1723 * i = i + 1 * else: * fphr_arr._append(phrase.syms[j]) # <<<<<<<<<<<<<< @@ -56104,7 +56076,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_L72:; } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1724 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1724 * else: * fphr_arr._append(phrase.syms[j]) * if f_back_high > f_high: # <<<<<<<<<<<<<< @@ -56114,7 +56086,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_7 = (__pyx_v_f_back_high > __pyx_v_f_high); if (__pyx_t_7) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1725 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1725 * fphr_arr._append(phrase.syms[j]) * if f_back_high > f_high: * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -56123,7 +56095,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1726 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1726 * if f_back_high > f_high: * fphr_arr._append(sym_setindex(self.category, i)) * self.findexes.append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -56140,7 +56112,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L73:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1727 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1727 * fphr_arr._append(sym_setindex(self.category, i)) * self.findexes.append(sym_setindex(self.category, i)) * fphr = Phrase(fphr_arr) # <<<<<<<<<<<<<< @@ -56159,7 +56131,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_v_fphr = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_15); __pyx_t_15 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1730 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1730 * 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) # <<<<<<<<<<<<<< @@ -56172,7 +56144,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_v_phrase_list = __pyx_t_15; __pyx_t_15 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1731 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1731 * 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: # <<<<<<<<<<<<<< @@ -56183,7 +56155,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_7 = (__pyx_t_13 > 0); if (__pyx_t_7) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1732 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1732 * e_sent_len, e_sent_start) * if len(phrase_list) > 0: * pair_count = 1.0 / len(phrase_list) # <<<<<<<<<<<<<< @@ -56200,7 +56172,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1734 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1734 * pair_count = 1.0 / len(phrase_list) * else: * pair_count = 0 # <<<<<<<<<<<<<< @@ -56211,7 +56183,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L74:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1735 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1735 * else: * pair_count = 0 * for phrase2,eindexes in phrase_list: # <<<<<<<<<<<<<< @@ -56229,18 +56201,10 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj for (;;) { 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 = 1735; __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 = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_15, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; } 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 = 1735; __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 = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_15, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; } else { __pyx_t_1 = __pyx_t_16(__pyx_t_15); if (unlikely(!__pyx_t_1)) { @@ -56254,33 +56218,27 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; - #if CYTHON_COMPILING_IN_CPYTHON - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { + if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { + if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); + else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } __pyx_t_14 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { + if (unlikely(PyList_GET_SIZE(sequence) != 2)) { + if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); + else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } __pyx_t_14 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(__pyx_t_2); - #else - __pyx_t_14 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } else - { + } 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 = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); @@ -56291,13 +56249,12 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj index = 1; __pyx_t_2 = __pyx_t_17(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L77_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_17 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L78_unpacking_done; __pyx_L77_unpacking_failed:; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_17 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); + if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L78_unpacking_done:; } @@ -56308,7 +56265,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_v_eindexes = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1736 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1736 * pair_count = 0 * for phrase2,eindexes in phrase_list: * als2 = self.create_alignments(sent_links,num_links,self.findexes,eindexes) # <<<<<<<<<<<<<< @@ -56324,7 +56281,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_v_als2 = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1737 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1737 * 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))) # <<<<<<<<<<<<<< @@ -56368,7 +56325,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L64:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1739 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1739 * extracts.append((fphr, phrase2, pair_count, tuple(als2))) * * if (f_back_high == f_high and # <<<<<<<<<<<<<< @@ -56378,7 +56335,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_7 = (__pyx_v_f_back_high == __pyx_v_f_high); if (__pyx_t_7) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1740 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1740 * * if (f_back_high == f_high and * f_sent_len - f_high >= self.train_min_gap_size and # <<<<<<<<<<<<<< @@ -56388,7 +56345,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_9 = ((__pyx_v_f_sent_len - __pyx_v_f_high) >= __pyx_v_self->train_min_gap_size); if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1741 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1741 * 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))): # <<<<<<<<<<<<<< @@ -56418,7 +56375,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1742 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1742 * 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 # <<<<<<<<<<<<<< @@ -56427,7 +56384,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_f_x_high = (__pyx_v_f_high + __pyx_v_self->train_min_gap_size); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1743 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1743 * ((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 # <<<<<<<<<<<<<< @@ -56436,7 +56393,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_met_constraints = 1; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1744 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1744 * f_x_high = f_high+self.train_min_gap_size * met_constraints = 1 * if self.tight_phrases: # <<<<<<<<<<<<<< @@ -56445,7 +56402,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ if (__pyx_v_self->tight_phrases) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1745 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1745 * met_constraints = 1 * if self.tight_phrases: * while f_x_high <= f_sent_len and f_links_low[f_x_high-1] == -1: # <<<<<<<<<<<<<< @@ -56462,7 +56419,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if (!__pyx_t_18) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1746 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1746 * 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 # <<<<<<<<<<<<<< @@ -56475,7 +56432,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L80:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1747 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1747 * 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: # <<<<<<<<<<<<<< @@ -56491,7 +56448,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if (__pyx_t_7) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1748 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1748 * 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 # <<<<<<<<<<<<<< @@ -56503,7 +56460,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L83:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1750 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1750 * met_constraints = 0 * * if (met_constraints and # <<<<<<<<<<<<<< @@ -56512,7 +56469,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ if (__pyx_v_met_constraints) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1751 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1751 * * if (met_constraints and * self.find_fixpoint(f_back_low, f_x_high, # <<<<<<<<<<<<<< @@ -56522,7 +56479,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_15 = PyInt_FromLong(__pyx_v_f_x_high); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1751; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1755 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1755 * 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, # <<<<<<<<<<<<<< @@ -56532,7 +56489,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj if (((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_back_low, __pyx_t_15, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_e_low, __pyx_v_e_high, (&__pyx_v_e_x_low), (&__pyx_v_e_x_high), (&__pyx_v_f_x_low), (&__pyx_v_f_x_high), __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, 1, 1, 1, 0, 1, 1, 0)) { __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1757 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1757 * 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 # <<<<<<<<<<<<<< @@ -56548,7 +56505,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1758 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1758 * 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, # <<<<<<<<<<<<<< @@ -56558,7 +56515,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_14 = PyInt_FromLong(__pyx_v_f_x_high); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1763 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1763 * 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, # <<<<<<<<<<<<<< @@ -56581,7 +56538,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if (__pyx_t_7) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1765 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1765 * self.train_max_initial_size, self.train_max_initial_size, * 0, 0, 0, 0, 0, 0, 0)): * fphr_arr._clear() # <<<<<<<<<<<<<< @@ -56590,7 +56547,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_clear(__pyx_v_fphr_arr); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1766 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1766 * 0, 0, 0, 0, 0, 0, 0)): * fphr_arr._clear() * i = 1 # <<<<<<<<<<<<<< @@ -56599,7 +56556,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_i = 1; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1767 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1767 * fphr_arr._clear() * i = 1 * self.findexes.reset() # <<<<<<<<<<<<<< @@ -56613,7 +56570,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1768 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1768 * i = 1 * self.findexes.reset() * if f_back_low < f_low: # <<<<<<<<<<<<<< @@ -56623,7 +56580,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_7 = (__pyx_v_f_back_low < __pyx_v_f_low); if (__pyx_t_7) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1769 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1769 * self.findexes.reset() * if f_back_low < f_low: * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -56632,7 +56589,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1770 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1770 * if f_back_low < f_low: * fphr_arr._append(sym_setindex(self.category, i)) * i = i+1 # <<<<<<<<<<<<<< @@ -56641,7 +56598,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_i = (__pyx_v_i + 1); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1771 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1771 * fphr_arr._append(sym_setindex(self.category, i)) * i = i+1 * self.findexes.append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -56658,7 +56615,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L85:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1772 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1772 * i = i+1 * self.findexes.append(sym_setindex(self.category, i)) * self.findexes.extend(self.findexes1) # <<<<<<<<<<<<<< @@ -56678,7 +56635,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1773 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1773 * self.findexes.append(sym_setindex(self.category, i)) * self.findexes.extend(self.findexes1) * for j from 0 <= j < phrase.n: # <<<<<<<<<<<<<< @@ -56688,7 +56645,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_3 = __pyx_v_phrase->n; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_3; __pyx_v_j++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1774 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1774 * self.findexes.extend(self.findexes1) * for j from 0 <= j < phrase.n: * if sym_isvar(phrase.syms[j]): # <<<<<<<<<<<<<< @@ -56698,7 +56655,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_4 = __pyx_f_3_sa_sym_isvar((__pyx_v_phrase->syms[__pyx_v_j])); if (__pyx_t_4) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1775 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1775 * for j from 0 <= j < phrase.n: * if sym_isvar(phrase.syms[j]): * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -56707,7 +56664,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1776 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1776 * if sym_isvar(phrase.syms[j]): * fphr_arr._append(sym_setindex(self.category, i)) * i = i + 1 # <<<<<<<<<<<<<< @@ -56719,7 +56676,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1778 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1778 * i = i + 1 * else: * fphr_arr._append(phrase.syms[j]) # <<<<<<<<<<<<<< @@ -56731,7 +56688,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_L88:; } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1779 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1779 * else: * fphr_arr._append(phrase.syms[j]) * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -56740,7 +56697,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1780 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1780 * fphr_arr._append(phrase.syms[j]) * fphr_arr._append(sym_setindex(self.category, i)) * self.findexes.append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -56754,7 +56711,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1781 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1781 * fphr_arr._append(sym_setindex(self.category, i)) * self.findexes.append(sym_setindex(self.category, i)) * fphr = Phrase(fphr_arr) # <<<<<<<<<<<<<< @@ -56773,7 +56730,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_v_fphr = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1784 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1784 * 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) # <<<<<<<<<<<<<< @@ -56786,7 +56743,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_v_phrase_list = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1785 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1785 * 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: # <<<<<<<<<<<<<< @@ -56797,7 +56754,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_7 = (__pyx_t_13 > 0); if (__pyx_t_7) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1786 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1786 * matching.sent_id, e_sent_len, e_sent_start) * if len(phrase_list) > 0: * pair_count = 1.0 / len(phrase_list) # <<<<<<<<<<<<<< @@ -56814,7 +56771,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1788 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1788 * pair_count = 1.0 / len(phrase_list) * else: * pair_count = 0 # <<<<<<<<<<<<<< @@ -56825,7 +56782,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L89:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1789 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1789 * else: * pair_count = 0 * for phrase2, eindexes in phrase_list: # <<<<<<<<<<<<<< @@ -56843,18 +56800,10 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj for (;;) { 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 = 1789; __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 = 1789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_14 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_13); __Pyx_INCREF(__pyx_t_14); __pyx_t_13++; } 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 = 1789; __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 = 1789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_14 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_13); __Pyx_INCREF(__pyx_t_14); __pyx_t_13++; } else { __pyx_t_14 = __pyx_t_16(__pyx_t_1); if (unlikely(!__pyx_t_14)) { @@ -56868,33 +56817,27 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if ((likely(PyTuple_CheckExact(__pyx_t_14))) || (PyList_CheckExact(__pyx_t_14))) { PyObject* sequence = __pyx_t_14; - #if CYTHON_COMPILING_IN_CPYTHON - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { + if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { + if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); + else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } __pyx_t_15 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { + if (unlikely(PyList_GET_SIZE(sequence) != 2)) { + if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); + else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } __pyx_t_15 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_15); __Pyx_INCREF(__pyx_t_2); - #else - __pyx_t_15 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - } else - { + } 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 = 1789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); @@ -56905,13 +56848,12 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj index = 1; __pyx_t_2 = __pyx_t_17(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L92_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1789; __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; __pyx_L92_unpacking_failed:; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_17 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); + if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L93_unpacking_done:; } @@ -56922,7 +56864,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_v_eindexes = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1790 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1790 * pair_count = 0 * for phrase2, eindexes in phrase_list: * als3 = self.create_alignments(sent_links,num_links,self.findexes,eindexes) # <<<<<<<<<<<<<< @@ -56938,7 +56880,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_v_als3 = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1791 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1791 * 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))) # <<<<<<<<<<<<<< @@ -56982,7 +56924,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L79:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1792 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1792 * 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 # <<<<<<<<<<<<<< @@ -56992,7 +56934,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_7 = (__pyx_v_num_gaps < (__pyx_v_self->max_nonterminals - 1)); if (__pyx_t_7) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1793 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1793 * extracts.append((fphr, phrase2, pair_count, tuple(als3))) * if (num_gaps < self.max_nonterminals - 1 and * phrase_len+1 < self.max_length and # <<<<<<<<<<<<<< @@ -57002,7 +56944,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_9 = ((__pyx_v_phrase_len + 1) < __pyx_v_self->max_length); if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1794 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1794 * if (num_gaps < self.max_nonterminals - 1 and * phrase_len+1 < self.max_length and * f_back_high == f_high and # <<<<<<<<<<<<<< @@ -57012,7 +56954,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_18 = (__pyx_v_f_back_high == __pyx_v_f_high); if (__pyx_t_18) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1795 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1795 * phrase_len+1 < self.max_length and * f_back_high == f_high and * f_back_low == f_low and # <<<<<<<<<<<<<< @@ -57022,7 +56964,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_8 = (__pyx_v_f_back_low == __pyx_v_f_low); if (__pyx_t_8) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1796 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1796 * 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 # <<<<<<<<<<<<<< @@ -57032,7 +56974,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_19 = (((__pyx_v_f_back_high - __pyx_v_f_back_low) + (2 * __pyx_v_self->train_min_gap_size)) <= __pyx_v_self->train_max_initial_size); if (__pyx_t_19) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1797 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1797 * 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 # <<<<<<<<<<<<<< @@ -57042,7 +56984,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_20 = (__pyx_v_f_low >= __pyx_v_self->train_min_gap_size); if (__pyx_t_20) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1798 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1798 * 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 # <<<<<<<<<<<<<< @@ -57052,7 +56994,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_21 = (__pyx_v_f_high <= (__pyx_v_f_sent_len - __pyx_v_self->train_min_gap_size)); if (__pyx_t_21) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1799 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1799 * 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))): # <<<<<<<<<<<<<< @@ -57102,7 +57044,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1801 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1801 * ((not self.tight_phrases) or (f_links_low[f_low-1] != -1 and f_links_low[f_high] != -1))): * * met_constraints = 1 # <<<<<<<<<<<<<< @@ -57111,7 +57053,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_met_constraints = 1; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1802 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1802 * * met_constraints = 1 * f_x_low = f_low-self.train_min_gap_size # <<<<<<<<<<<<<< @@ -57120,7 +57062,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_f_x_low = (__pyx_v_f_low - __pyx_v_self->train_min_gap_size); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1803 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1803 * met_constraints = 1 * f_x_low = f_low-self.train_min_gap_size * if self.tight_phrases: # <<<<<<<<<<<<<< @@ -57129,7 +57071,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ if (__pyx_v_self->tight_phrases) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1804 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1804 * 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: # <<<<<<<<<<<<<< @@ -57146,7 +57088,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if (!__pyx_t_18) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1805 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1805 * if self.tight_phrases: * while f_x_low >= 0 and f_links_low[f_x_low] == -1: * f_x_low = f_x_low - 1 # <<<<<<<<<<<<<< @@ -57159,7 +57101,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L95:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1806 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1806 * 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: # <<<<<<<<<<<<<< @@ -57169,7 +57111,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_18 = (__pyx_v_f_x_low < 0); if (__pyx_t_18) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1807 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1807 * f_x_low = f_x_low - 1 * if f_x_low < 0: * met_constraints = 0 # <<<<<<<<<<<<<< @@ -57181,7 +57123,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L98:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1809 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1809 * met_constraints = 0 * * f_x_high = f_high+self.train_min_gap_size # <<<<<<<<<<<<<< @@ -57190,7 +57132,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_f_x_high = (__pyx_v_f_high + __pyx_v_self->train_min_gap_size); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1810 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1810 * * f_x_high = f_high+self.train_min_gap_size * if self.tight_phrases: # <<<<<<<<<<<<<< @@ -57199,7 +57141,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ if (__pyx_v_self->tight_phrases) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1811 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1811 * 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: # <<<<<<<<<<<<<< @@ -57216,7 +57158,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if (!__pyx_t_7) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1812 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1812 * 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 # <<<<<<<<<<<<<< @@ -57229,7 +57171,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L99:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1813 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1813 * 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: # <<<<<<<<<<<<<< @@ -57245,7 +57187,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1814 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1814 * 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 # <<<<<<<<<<<<<< @@ -57257,7 +57199,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L102:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1816 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1816 * met_constraints = 0 * * if (met_constraints and # <<<<<<<<<<<<<< @@ -57266,7 +57208,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ if (__pyx_v_met_constraints) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1817 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1817 * * if (met_constraints and * (self.find_fixpoint(f_x_low, f_x_high, # <<<<<<<<<<<<<< @@ -57276,7 +57218,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_1 = PyInt_FromLong(__pyx_v_f_x_high); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1821 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1821 * 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, # <<<<<<<<<<<<<< @@ -57287,7 +57229,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1823 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1823 * 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 # <<<<<<<<<<<<<< @@ -57309,7 +57251,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if (__pyx_t_18) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1824 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1824 * 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, # <<<<<<<<<<<<<< @@ -57319,7 +57261,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_1 = PyInt_FromLong(__pyx_v_f_low); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1828 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1828 * -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, # <<<<<<<<<<<<<< @@ -57330,7 +57272,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1830 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1830 * 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, # <<<<<<<<<<<<<< @@ -57340,7 +57282,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_1 = PyInt_FromLong(__pyx_v_f_x_high); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1835 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1835 * 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, # <<<<<<<<<<<<<< @@ -57367,7 +57309,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1837 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1837 * self.train_max_initial_size, self.train_max_initial_size, * 0, 0, 0, 0, 0, 0, 0)): * fphr_arr._clear() # <<<<<<<<<<<<<< @@ -57376,7 +57318,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_clear(__pyx_v_fphr_arr); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1838 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1838 * 0, 0, 0, 0, 0, 0, 0)): * fphr_arr._clear() * i = 1 # <<<<<<<<<<<<<< @@ -57385,7 +57327,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_i = 1; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1839 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1839 * fphr_arr._clear() * i = 1 * self.findexes.reset() # <<<<<<<<<<<<<< @@ -57399,7 +57341,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1840 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1840 * i = 1 * self.findexes.reset() * self.findexes.append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -57413,7 +57355,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1841 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1841 * self.findexes.reset() * self.findexes.append(sym_setindex(self.category, i)) * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -57422,7 +57364,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1842 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1842 * self.findexes.append(sym_setindex(self.category, i)) * fphr_arr._append(sym_setindex(self.category, i)) * i = i+1 # <<<<<<<<<<<<<< @@ -57431,7 +57373,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_i = (__pyx_v_i + 1); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1843 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1843 * fphr_arr._append(sym_setindex(self.category, i)) * i = i+1 * self.findexes.extend(self.findexes1) # <<<<<<<<<<<<<< @@ -57451,7 +57393,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1844 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1844 * i = i+1 * self.findexes.extend(self.findexes1) * for j from 0 <= j < phrase.n: # <<<<<<<<<<<<<< @@ -57461,7 +57403,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_3 = __pyx_v_phrase->n; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_3; __pyx_v_j++) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1845 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1845 * self.findexes.extend(self.findexes1) * for j from 0 <= j < phrase.n: * if sym_isvar(phrase.syms[j]): # <<<<<<<<<<<<<< @@ -57471,7 +57413,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_4 = __pyx_f_3_sa_sym_isvar((__pyx_v_phrase->syms[__pyx_v_j])); if (__pyx_t_4) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1846 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1846 * for j from 0 <= j < phrase.n: * if sym_isvar(phrase.syms[j]): * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -57480,7 +57422,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1847 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1847 * if sym_isvar(phrase.syms[j]): * fphr_arr._append(sym_setindex(self.category, i)) * i = i + 1 # <<<<<<<<<<<<<< @@ -57492,7 +57434,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1849 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1849 * i = i + 1 * else: * fphr_arr._append(phrase.syms[j]) # <<<<<<<<<<<<<< @@ -57504,7 +57446,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_L106:; } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1850 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1850 * else: * fphr_arr._append(phrase.syms[j]) * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -57513,7 +57455,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1851 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1851 * fphr_arr._append(phrase.syms[j]) * fphr_arr._append(sym_setindex(self.category, i)) * self.findexes.append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -57527,7 +57469,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1852 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1852 * fphr_arr._append(sym_setindex(self.category, i)) * self.findexes.append(sym_setindex(self.category, i)) * fphr = Phrase(fphr_arr) # <<<<<<<<<<<<<< @@ -57546,7 +57488,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_v_fphr = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_14); __pyx_t_14 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1855 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1855 * 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) # <<<<<<<<<<<<<< @@ -57559,7 +57501,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_v_phrase_list = __pyx_t_14; __pyx_t_14 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1856 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1856 * 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: # <<<<<<<<<<<<<< @@ -57570,7 +57512,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_9 = (__pyx_t_13 > 0); if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1857 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1857 * matching.sent_id, e_sent_len, e_sent_start) * if len(phrase_list) > 0: * pair_count = 1.0 / len(phrase_list) # <<<<<<<<<<<<<< @@ -57587,7 +57529,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1859 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1859 * pair_count = 1.0 / len(phrase_list) * else: * pair_count = 0 # <<<<<<<<<<<<<< @@ -57598,7 +57540,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L107:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1860 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1860 * else: * pair_count = 0 * for phrase2, eindexes in phrase_list: # <<<<<<<<<<<<<< @@ -57616,18 +57558,10 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj for (;;) { if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_14)) { if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_14)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_15 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_15); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1860; __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 = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_15 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_15); __pyx_t_13++; } 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 = 1860; __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 = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_15 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_15); __pyx_t_13++; } else { __pyx_t_15 = __pyx_t_16(__pyx_t_14); if (unlikely(!__pyx_t_15)) { @@ -57641,33 +57575,27 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if ((likely(PyTuple_CheckExact(__pyx_t_15))) || (PyList_CheckExact(__pyx_t_15))) { PyObject* sequence = __pyx_t_15; - #if CYTHON_COMPILING_IN_CPYTHON - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { + if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { + if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); + else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { + if (unlikely(PyList_GET_SIZE(sequence) != 2)) { + if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); + else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); - #else - __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - } else - { + } else { Py_ssize_t index = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_15); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); @@ -57678,13 +57606,12 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj index = 1; __pyx_t_2 = __pyx_t_17(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L110_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_17 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L111_unpacking_done; __pyx_L110_unpacking_failed:; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_17 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); + if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L111_unpacking_done:; } @@ -57695,7 +57622,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_v_eindexes = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1861 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1861 * pair_count = 0 * for phrase2, eindexes in phrase_list: * als4 = self.create_alignments(sent_links,num_links,self.findexes,eindexes) # <<<<<<<<<<<<<< @@ -57711,7 +57638,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_v_als4 = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1862 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1862 * 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))) # <<<<<<<<<<<<<< @@ -57764,7 +57691,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1864 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1864 * extracts.append((fphr, phrase2, pair_count, tuple(als4))) * else: * reason_for_failure = "Unable to extract basic phrase" # <<<<<<<<<<<<<< @@ -57780,7 +57707,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L33:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1866 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1866 * reason_for_failure = "Unable to extract basic phrase" * * free(sent_links) # <<<<<<<<<<<<<< @@ -57789,7 +57716,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ free(__pyx_v_sent_links); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1867 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1867 * * free(sent_links) * free(f_links_low) # <<<<<<<<<<<<<< @@ -57798,7 +57725,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ free(__pyx_v_f_links_low); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1868 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1868 * free(sent_links) * free(f_links_low) * free(f_links_high) # <<<<<<<<<<<<<< @@ -57807,7 +57734,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ free(__pyx_v_f_links_high); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1869 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1869 * free(f_links_low) * free(f_links_high) * free(e_links_low) # <<<<<<<<<<<<<< @@ -57816,7 +57743,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ free(__pyx_v_e_links_low); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1870 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1870 * free(f_links_high) * free(e_links_low) * free(e_links_high) # <<<<<<<<<<<<<< @@ -57825,7 +57752,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ free(__pyx_v_e_links_high); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1871 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1871 * free(e_links_low) * free(e_links_high) * free(f_gap_low) # <<<<<<<<<<<<<< @@ -57834,7 +57761,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ free(__pyx_v_f_gap_low); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1872 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1872 * free(e_links_high) * free(f_gap_low) * free(f_gap_high) # <<<<<<<<<<<<<< @@ -57843,7 +57770,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ free(__pyx_v_f_gap_high); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1873 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1873 * free(f_gap_low) * free(f_gap_high) * free(e_gap_low) # <<<<<<<<<<<<<< @@ -57852,7 +57779,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ free(__pyx_v_e_gap_low); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1874 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1874 * free(f_gap_high) * free(e_gap_low) * free(e_gap_high) # <<<<<<<<<<<<<< @@ -57861,7 +57788,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ free(__pyx_v_e_gap_high); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1876 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1876 * free(e_gap_high) * * return extracts # <<<<<<<<<<<<<< @@ -57909,11 +57836,11 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_26add_instance(PyObject PyObject *__pyx_v_f_words = 0; PyObject *__pyx_v_e_words = 0; PyObject *__pyx_v_alignment = 0; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__f_words,&__pyx_n_s__e_words,&__pyx_n_s__alignment,0}; PyObject *__pyx_r = 0; __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,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -57928,15 +57855,18 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_26add_instance(PyObject 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--; + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f_words); + if (likely(values[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--; + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e_words); + if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("add_instance", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1884; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__alignment)) != 0)) kw_args--; + values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__alignment); + if (likely(values[2])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("add_instance", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1884; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -57981,11 +57911,12 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_12add_instance_1extract PyObject *__pyx_v_links = 0; PyObject *__pyx_v_nt = 0; PyObject *__pyx_v_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 *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("extract (wrapper)", 0); + __pyx_self = __pyx_self; { - 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; @@ -58006,45 +57937,54 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_12add_instance_1extract 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--; + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f_i); + if (likely(values[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--; + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f_j); + if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1918; __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--; + values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e_i); + if (likely(values[2])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1918; __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--; + values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e_j); + if (likely(values[3])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1918; __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--; + values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__min_bound); + if (likely(values[4])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 4); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: - if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__wc)) != 0)) kw_args--; + values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__wc); + if (likely(values[5])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 5); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 6: - if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__links)) != 0)) kw_args--; + values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__links); + if (likely(values[6])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 6); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 7: - if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nt)) != 0)) kw_args--; + values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nt); + if (likely(values[7])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 7); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1918; __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--; + values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nt_open); + if (likely(values[8])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 8); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -58088,7 +58028,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_12add_instance_1extract return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1918 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1918 * # 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): # <<<<<<<<<<<<<< @@ -58134,7 +58074,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __pyx_outer_scope = (struct __pyx_obj_3_sa___pyx_scope_struct_21_add_instance *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1920 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1920 * 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: # <<<<<<<<<<<<<< @@ -58144,7 +58084,8 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( if (unlikely(!__pyx_cur_scope->__pyx_v_f_len)) { __Pyx_RaiseClosureNameError("f_len"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __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 = 1920; __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 = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_v_f_j, __pyx_t_1, Py_GT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -58157,7 +58098,8 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __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 = 1920; __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 = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __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_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -58168,7 +58110,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } if (__pyx_t_6) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1921 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1921 * # Phrase extraction limits * if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size: * return # <<<<<<<<<<<<<< @@ -58182,7 +58124,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1923 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1923 * return * # Unaligned word * if not al[f_j]: # <<<<<<<<<<<<<< @@ -58197,7 +58139,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __pyx_t_3 = (!__pyx_t_6); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1925 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1925 * if not al[f_j]: * # Adjacent to non-terminal: extend (non-terminal now open) * if nt and nt[-1][2] == f_j - 1: # <<<<<<<<<<<<<< @@ -58213,7 +58155,8 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __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 = 1925; __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 = 1925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1925; __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -58224,7 +58167,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } if (__pyx_t_5) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1926 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1926 * # Adjacent to non-terminal: extend (non-terminal now open) * if nt and nt[-1][2] == f_j - 1: * nt[-1][2] += 1 # <<<<<<<<<<<<<< @@ -58243,7 +58186,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1927 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1927 * 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) # <<<<<<<<<<<<<< @@ -58289,7 +58232,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1928 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1928 * nt[-1][2] += 1 * extract(f_i, f_j + 1, e_i, e_j, min_bound, wc, links, nt, True) * nt[-1][2] -= 1 # <<<<<<<<<<<<<< @@ -58311,7 +58254,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } __pyx_L5:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1931 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1931 * # 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: # <<<<<<<<<<<<<< @@ -58323,7 +58266,8 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( 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 = 1931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __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 = 1931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_wc, __pyx_t_2, Py_LT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -58333,7 +58277,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } if (__pyx_t_6) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1932 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1932 * # 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) # <<<<<<<<<<<<<< @@ -58384,7 +58328,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } __pyx_L6:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1933 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1933 * 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 # <<<<<<<<<<<<<< @@ -58398,7 +58342,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } __pyx_L4:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1935 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1935 * return * # Aligned word * link_i = fe_span[f_j][0] # <<<<<<<<<<<<<< @@ -58414,7 +58358,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __pyx_v_link_i = __pyx_t_8; __pyx_t_8 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1936 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1936 * # Aligned word * link_i = fe_span[f_j][0] * link_j = fe_span[f_j][1] # <<<<<<<<<<<<<< @@ -58429,7 +58373,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __pyx_v_link_j = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1937 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1937 * link_i = fe_span[f_j][0] * link_j = fe_span[f_j][1] * new_e_i = min(link_i, e_i) # <<<<<<<<<<<<<< @@ -58440,7 +58384,8 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __pyx_t_4 = __pyx_v_e_i; __Pyx_INCREF(__pyx_v_link_i); __pyx_t_8 = __pyx_v_link_i; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_8, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_8, Py_LT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { @@ -58456,7 +58401,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __pyx_v_new_e_i = __pyx_t_2; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1938 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1938 * link_j = fe_span[f_j][1] * new_e_i = min(link_i, e_i) * new_e_j = max(link_j, e_j) # <<<<<<<<<<<<<< @@ -58467,7 +58412,8 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __pyx_t_2 = __pyx_v_e_j; __Pyx_INCREF(__pyx_v_link_j); __pyx_t_4 = __pyx_v_link_j; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_GT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { @@ -58483,7 +58429,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __pyx_v_new_e_j = __pyx_t_8; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1941 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1941 * # 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 # <<<<<<<<<<<<<< @@ -58493,19 +58439,20 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __Pyx_INCREF(__pyx_v_min_bound); __pyx_v_new_min_bound = __pyx_v_min_bound; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1943 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1943 * 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 = 1943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_RichCompare(__pyx_v_e_j, __pyx_int_neg_1, Py_EQ); if (unlikely(!__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_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); 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_8); __pyx_t_8 = 0; if (__pyx_t_6) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1944 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1944 * # First aligned word creates span * if e_j == -1: * for i from new_e_i <= i <= new_e_j: # <<<<<<<<<<<<<< @@ -58521,7 +58468,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __pyx_v_i = __pyx_t_8; __pyx_t_8 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1945 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1945 * if e_j == -1: * for i from new_e_i <= i <= new_e_j: * if ef_span[i][0] < f_i: # <<<<<<<<<<<<<< @@ -58534,13 +58481,14 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1945; __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 = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_RichCompare(__pyx_t_2, __pyx_v_f_i, Py_LT); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); __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 = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_6) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1946 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1946 * for i from new_e_i <= i <= new_e_j: * if ef_span[i][0] < f_i: * return # <<<<<<<<<<<<<< @@ -58554,7 +58502,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } __pyx_L10:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1947 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1947 * if ef_span[i][0] < f_i: * return * new_min_bound = max(new_min_bound, ef_span[i][1]) # <<<<<<<<<<<<<< @@ -58568,7 +58516,8 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __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 = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_8, Py_GT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __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) { @@ -58587,7 +58536,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __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 = 1944; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1944 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1944 * # First aligned word creates span * if e_j == -1: * for i from new_e_i <= i <= new_e_j: # <<<<<<<<<<<<<< @@ -58603,7 +58552,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } /*else*/ { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1950 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1950 * # Other aligned words extend span * else: * for i from new_e_i <= i < e_i: # <<<<<<<<<<<<<< @@ -58619,7 +58568,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __pyx_v_i = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1951 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1951 * else: * for i from new_e_i <= i < e_i: * if ef_span[i][0] < f_i: # <<<<<<<<<<<<<< @@ -58632,13 +58581,14 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __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_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_v_f_i, Py_LT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1952 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1952 * for i from new_e_i <= i < e_i: * if ef_span[i][0] < f_i: * return # <<<<<<<<<<<<<< @@ -58652,7 +58602,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } __pyx_L13:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1953 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1953 * if ef_span[i][0] < f_i: * return * new_min_bound = max(new_min_bound, ef_span[i][1]) # <<<<<<<<<<<<<< @@ -58666,7 +58616,8 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __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_2, __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_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_GT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __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) { @@ -58685,7 +58636,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __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 = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1950 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1950 * # Other aligned words extend span * else: * for i from new_e_i <= i < e_i: # <<<<<<<<<<<<<< @@ -58698,7 +58649,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __pyx_v_i = __pyx_t_8; __pyx_t_8 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1954 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1954 * return * new_min_bound = max(new_min_bound, ef_span[i][1]) * for i from e_j < i <= new_e_j: # <<<<<<<<<<<<<< @@ -58714,7 +58665,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __pyx_v_i = __pyx_t_8; __pyx_t_8 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1955 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1955 * 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: # <<<<<<<<<<<<<< @@ -58727,13 +58678,14 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1955; __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); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); __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_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_6) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1956 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1956 * for i from e_j < i <= new_e_j: * if ef_span[i][0] < f_i: * return # <<<<<<<<<<<<<< @@ -58747,7 +58699,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } __pyx_L16:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1957 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1957 * if ef_span[i][0] < f_i: * return * new_min_bound = max(new_min_bound, ef_span[i][1]) # <<<<<<<<<<<<<< @@ -58761,7 +58713,8 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __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_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_8, Py_GT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { @@ -58780,7 +58733,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __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;} } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1954 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1954 * return * new_min_bound = max(new_min_bound, ef_span[i][1]) * for i from e_j < i <= new_e_j: # <<<<<<<<<<<<<< @@ -58795,7 +58748,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } __pyx_L7:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1959 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1959 * new_min_bound = max(new_min_bound, ef_span[i][1]) * # Extract, extend with word (unless non-terminal open) * if not nt_open: # <<<<<<<<<<<<<< @@ -58806,7 +58759,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __pyx_t_3 = (!__pyx_t_6); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1960 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1960 * # Extract, extend with word (unless non-terminal open) * if not nt_open: * nt_collision = False # <<<<<<<<<<<<<< @@ -58815,7 +58768,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( */ __pyx_v_nt_collision = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1961 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1961 * if not nt_open: * nt_collision = False * for link in al[f_j]: # <<<<<<<<<<<<<< @@ -58836,18 +58789,10 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( 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_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; } 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_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; } else { __pyx_t_4 = __pyx_t_12(__pyx_t_2); if (unlikely(!__pyx_t_4)) { @@ -58863,7 +58808,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __pyx_v_link = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1962 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1962 * nt_collision = False * for link in al[f_j]: * if e_nt_cover[link]: # <<<<<<<<<<<<<< @@ -58877,7 +58822,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1963 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1963 * for link in al[f_j]: * if e_nt_cover[link]: * nt_collision = True # <<<<<<<<<<<<<< @@ -58891,7 +58836,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1966 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1966 * # 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: # <<<<<<<<<<<<<< @@ -58902,7 +58847,8 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( 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 = 1966; __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 = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_wc, __pyx_t_2, Py_LT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -58912,7 +58858,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } if (__pyx_t_5) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1967 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1967 * # may be okay for continuing non-terminals * if not nt_collision and wc < self.max_length: * plus_links = [] # <<<<<<<<<<<<<< @@ -58924,7 +58870,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __pyx_v_plus_links = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1968 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1968 * if not nt_collision and wc < self.max_length: * plus_links = [] * for link in al[f_j]: # <<<<<<<<<<<<<< @@ -58945,18 +58891,10 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( 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_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; } 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_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; } else { __pyx_t_4 = __pyx_t_12(__pyx_t_2); if (unlikely(!__pyx_t_4)) { @@ -58972,7 +58910,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __pyx_v_link = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1969 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1969 * plus_links = [] * for link in al[f_j]: * plus_links.append((f_j, link)) # <<<<<<<<<<<<<< @@ -58990,7 +58928,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __pyx_t_13 = PyList_Append(__pyx_v_plus_links, ((PyObject *)__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(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1970 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1970 * for link in al[f_j]: * plus_links.append((f_j, link)) * cover[link] += 1 # <<<<<<<<<<<<<< @@ -59012,7 +58950,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1971 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1971 * plus_links.append((f_j, link)) * cover[link] += 1 * links.append(plus_links) # <<<<<<<<<<<<<< @@ -59023,7 +58961,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1972 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1972 * cover[link] += 1 * links.append(plus_links) * if links and f_j >= new_min_bound: # <<<<<<<<<<<<<< @@ -59032,7 +58970,8 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( */ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_links); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __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 = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_v_f_j, __pyx_v_new_min_bound, Py_GE); 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_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_6 = __pyx_t_3; @@ -59041,7 +58980,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } if (__pyx_t_6) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1973 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1973 * 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)) # <<<<<<<<<<<<<< @@ -59107,7 +59046,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } __pyx_L24:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1974 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1974 * 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) # <<<<<<<<<<<<<< @@ -59155,7 +59094,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1975 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1975 * 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() # <<<<<<<<<<<<<< @@ -59166,7 +59105,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1976 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1976 * 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]: # <<<<<<<<<<<<<< @@ -59187,18 +59126,10 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( for (;;) { if (!__pyx_t_12 && PyList_CheckExact(__pyx_t_4)) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_4)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; } else if (!__pyx_t_12 && PyTuple_CheckExact(__pyx_t_4)) { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_4)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; } else { __pyx_t_2 = __pyx_t_12(__pyx_t_4); if (unlikely(!__pyx_t_2)) { @@ -59214,7 +59145,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __pyx_v_link = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1977 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1977 * links.pop() * for link in al[f_j]: * cover[link] -= 1 # <<<<<<<<<<<<<< @@ -59242,7 +59173,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } __pyx_L17:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1979 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1979 * 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: # <<<<<<<<<<<<<< @@ -59258,7 +59189,8 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __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 = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_EQ); 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_2); __pyx_t_2 = 0; __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 = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -59269,7 +59201,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1981 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1981 * if nt and nt[-1][2] == f_j - 1: * # Add to non-terminal, checking for collisions * old_last_nt = nt[-1][:] # <<<<<<<<<<<<<< @@ -59284,7 +59216,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __pyx_v_old_last_nt = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1982 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1982 * # Add to non-terminal, checking for collisions * old_last_nt = nt[-1][:] * nt[-1][2] = f_j # <<<<<<<<<<<<<< @@ -59296,7 +59228,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( if (__Pyx_SetItemInt(__pyx_t_4, 2, __pyx_v_f_j, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1983 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1983 * old_last_nt = nt[-1][:] * nt[-1][2] = f_j * if link_i < nt[-1][3]: # <<<<<<<<<<<<<< @@ -59308,13 +59240,14 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __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_v_link_i, __pyx_t_8, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_link_i, __pyx_t_8, Py_LT); 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_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 = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1984 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1984 * nt[-1][2] = f_j * if link_i < nt[-1][3]: * if not span_check(cover, link_i, nt[-1][3] - 1): # <<<<<<<<<<<<<< @@ -59352,7 +59285,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __pyx_t_6 = (!__pyx_t_3); if (__pyx_t_6) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1985 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1985 * if link_i < nt[-1][3]: * if not span_check(cover, link_i, nt[-1][3] - 1): * nt[-1] = old_last_nt # <<<<<<<<<<<<<< @@ -59361,7 +59294,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( */ if (__Pyx_SetItemInt(__pyx_v_nt, -1, __pyx_v_old_last_nt, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1985; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1986 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1986 * if not span_check(cover, link_i, nt[-1][3] - 1): * nt[-1] = old_last_nt * return # <<<<<<<<<<<<<< @@ -59375,7 +59308,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } __pyx_L29:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1987 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1987 * nt[-1] = old_last_nt * return * span_inc(cover, link_i, nt[-1][3] - 1) # <<<<<<<<<<<<<< @@ -59409,7 +59342,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1988 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1988 * return * span_inc(cover, link_i, nt[-1][3] - 1) * span_inc(e_nt_cover, link_i, nt[-1][3] - 1) # <<<<<<<<<<<<<< @@ -59444,7 +59377,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1989 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1989 * 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 # <<<<<<<<<<<<<< @@ -59459,7 +59392,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } __pyx_L28:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1990 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1990 * span_inc(e_nt_cover, link_i, nt[-1][3] - 1) * nt[-1][3] = link_i * if link_j > nt[-1][4]: # <<<<<<<<<<<<<< @@ -59471,13 +59404,14 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1990; __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_v_link_j, __pyx_t_8, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_link_j, __pyx_t_8, Py_GT); 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_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 = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1991 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1991 * nt[-1][3] = link_i * if link_j > nt[-1][4]: * if not span_check(cover, nt[-1][4] + 1, link_j): # <<<<<<<<<<<<<< @@ -59515,7 +59449,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __pyx_t_3 = (!__pyx_t_6); if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1992 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1992 * if link_j > nt[-1][4]: * if not span_check(cover, nt[-1][4] + 1, link_j): * nt[-1] = old_last_nt # <<<<<<<<<<<<<< @@ -59524,7 +59458,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( */ if (__Pyx_SetItemInt(__pyx_v_nt, -1, __pyx_v_old_last_nt, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1993 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1993 * if not span_check(cover, nt[-1][4] + 1, link_j): * nt[-1] = old_last_nt * return # <<<<<<<<<<<<<< @@ -59538,7 +59472,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } __pyx_L31:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1994 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1994 * nt[-1] = old_last_nt * return * span_inc(cover, nt[-1][4] + 1, link_j) # <<<<<<<<<<<<<< @@ -59572,7 +59506,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1995 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1995 * return * span_inc(cover, nt[-1][4] + 1, link_j) * span_inc(e_nt_cover, nt[-1][4] + 1, link_j) # <<<<<<<<<<<<<< @@ -59607,7 +59541,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1996 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1996 * 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 # <<<<<<<<<<<<<< @@ -59622,7 +59556,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } __pyx_L30:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1997 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1997 * span_inc(e_nt_cover, nt[-1][4] + 1, link_j) * nt[-1][4] = link_j * if links and f_j >= new_min_bound: # <<<<<<<<<<<<<< @@ -59631,7 +59565,8 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( */ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_links); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_3) { - __pyx_t_4 = PyObject_RichCompare(__pyx_v_f_j, __pyx_v_new_min_bound, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_f_j, __pyx_v_new_min_bound, Py_GE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __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 = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = __pyx_t_6; @@ -59640,7 +59575,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } if (__pyx_t_5) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1998 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1998 * 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)) # <<<<<<<<<<<<<< @@ -59706,7 +59641,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } __pyx_L32:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1999 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1999 * 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) # <<<<<<<<<<<<<< @@ -59752,7 +59687,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2000 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2000 * 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 # <<<<<<<<<<<<<< @@ -59761,7 +59696,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( */ if (__Pyx_SetItemInt(__pyx_v_nt, -1, __pyx_v_old_last_nt, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2001 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2001 * 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]: # <<<<<<<<<<<<<< @@ -59773,13 +59708,14 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 3, sizeof(long), PyInt_FromLong); 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_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_v_link_i, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_link_i, __pyx_t_4, Py_LT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __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 = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2002 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2002 * nt[-1] = old_last_nt * if link_i < nt[-1][3]: * span_dec(cover, link_i, nt[-1][3] - 1) # <<<<<<<<<<<<<< @@ -59814,7 +59750,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2003 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2003 * 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) # <<<<<<<<<<<<<< @@ -59852,7 +59788,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } __pyx_L33:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2004 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2004 * 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]: # <<<<<<<<<<<<<< @@ -59864,13 +59800,14 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_15, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = PyObject_RichCompare(__pyx_v_link_j, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_15); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyObject_RichCompare(__pyx_v_link_j, __pyx_t_1, Py_GT); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_15); 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_15); __pyx_t_15 = 0; if (__pyx_t_5) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2005 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2005 * 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) # <<<<<<<<<<<<<< @@ -59905,7 +59842,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2006 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2006 * 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) # <<<<<<<<<<<<<< @@ -59946,7 +59883,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } __pyx_L27:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2008 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2008 * 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: # <<<<<<<<<<<<<< @@ -59964,7 +59901,8 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __pyx_t_4 = PyNumber_Subtract(__pyx_v_f_j, __pyx_t_15); 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_15); __pyx_t_15 = 0; - __pyx_t_15 = PyObject_RichCompare(__pyx_t_4, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_15); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyObject_RichCompare(__pyx_t_4, __pyx_int_1, Py_GT); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; @@ -59975,7 +59913,8 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( if (__pyx_t_6) { __pyx_t_15 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_wc, __pyx_t_15, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_wc, __pyx_t_15, Py_LT); 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_15); __pyx_t_15 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -59992,7 +59931,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2010 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2010 * 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): # <<<<<<<<<<<<<< @@ -60022,7 +59961,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __pyx_t_6 = (!__pyx_t_3); if (__pyx_t_6) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2011 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2011 * # Check for collisions * if not span_check(cover, link_i, link_j): * return # <<<<<<<<<<<<<< @@ -60036,7 +59975,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } __pyx_L36:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2012 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2012 * if not span_check(cover, link_i, link_j): * return * span_inc(cover, link_i, link_j) # <<<<<<<<<<<<<< @@ -60062,7 +60001,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2013 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2013 * return * span_inc(cover, link_i, link_j) * span_inc(e_nt_cover, link_i, link_j) # <<<<<<<<<<<<<< @@ -60089,7 +60028,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2014 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2014 * 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]) # <<<<<<<<<<<<<< @@ -60134,7 +60073,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2016 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2016 * 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: # <<<<<<<<<<<<<< @@ -60143,7 +60082,8 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( */ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_links); 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_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 = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_f_j, __pyx_v_new_min_bound, Py_GE); 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_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_16 = __pyx_t_3; @@ -60152,7 +60092,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } if (__pyx_t_16) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2017 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2017 * # 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)) # <<<<<<<<<<<<<< @@ -60218,7 +60158,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } __pyx_L37:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2018 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2018 * 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) # <<<<<<<<<<<<<< @@ -60266,7 +60206,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2019 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2019 * 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() # <<<<<<<<<<<<<< @@ -60277,7 +60217,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2020 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2020 * 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) # <<<<<<<<<<<<<< @@ -60303,7 +60243,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2021 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2021 * nt.pop() * span_dec(cover, link_i, link_j) * span_dec(e_nt_cover, link_i, link_j) # <<<<<<<<<<<<<< @@ -60357,7 +60297,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1884 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1884 * # Aggregate stats from a training instance * # (Extract rules, update counts) * def add_instance(self, f_words, e_words, alignment): # <<<<<<<<<<<<<< @@ -60418,7 +60358,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_e_words); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e_words); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1886 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1886 * def add_instance(self, f_words, e_words, alignment): * * self.online = True # <<<<<<<<<<<<<< @@ -60427,7 +60367,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ */ __pyx_cur_scope->__pyx_v_self->online = 1; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1893 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1893 * # span more than once. * # (f, e, al, lex_f_i, lex_f_j) * rules = set() # <<<<<<<<<<<<<< @@ -60440,7 +60380,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __pyx_cur_scope->__pyx_v_rules = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1895 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1895 * rules = set() * * f_len = len(f_words) # <<<<<<<<<<<<<< @@ -60457,7 +60397,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __pyx_cur_scope->__pyx_v_f_len = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1896 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1896 * * f_len = len(f_words) * e_len = len(e_words) # <<<<<<<<<<<<<< @@ -60473,7 +60413,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __pyx_v_e_len = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1899 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1899 * * # Pre-compute alignment info * al = [[] for i in range(f_len)] # <<<<<<<<<<<<<< @@ -60502,18 +60442,10 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ 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 = 1899; __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 = 1899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; } 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 = 1899; __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 = 1899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; } else { __pyx_t_4 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_4)) { @@ -60530,7 +60462,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __pyx_t_4 = 0; __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - if (unlikely(__Pyx_PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1899; __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; @@ -60539,7 +60471,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __pyx_cur_scope->__pyx_v_al = ((PyObject *)__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1900 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1900 * # Pre-compute alignment info * al = [[] for i in range(f_len)] * fe_span = [[e_len + 1, -1] for i in range(f_len)] # <<<<<<<<<<<<<< @@ -60568,18 +60500,10 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ 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 = 1900; __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 = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; } 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 = 1900; __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 = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; } else { __pyx_t_4 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_4)) { @@ -60604,7 +60528,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ PyList_SET_ITEM(__pyx_t_6, 1, __pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); __pyx_t_4 = 0; - if (unlikely(__Pyx_PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1900; __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; @@ -60613,7 +60537,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __pyx_cur_scope->__pyx_v_fe_span = ((PyObject *)__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1901 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1901 * 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)] # <<<<<<<<<<<<<< @@ -60642,18 +60566,10 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ 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 = 1901; __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 = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; } 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 = 1901; __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 = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; } else { __pyx_t_6 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_6)) { @@ -60678,7 +60594,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ PyList_SET_ITEM(__pyx_t_4, 1, __pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); __pyx_t_6 = 0; - if (unlikely(__Pyx_PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(PyList_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(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -60687,7 +60603,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __pyx_cur_scope->__pyx_v_ef_span = ((PyObject *)__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1902 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1902 * 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: # <<<<<<<<<<<<<< @@ -60705,18 +60621,10 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ for (;;) { if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __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 = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; } 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 = 1902; __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 = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; } else { __pyx_t_3 = __pyx_t_5(__pyx_t_1); if (unlikely(!__pyx_t_3)) { @@ -60730,33 +60638,27 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ } 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 = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { + if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { + if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); + else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { + if (unlikely(PyList_GET_SIZE(sequence) != 2)) { + if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); + else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } __pyx_t_4 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __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 = 1902; __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 = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #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 = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); @@ -60767,13 +60669,12 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ 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 = 1902; __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; __pyx_L11_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_8 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); + if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L12_unpacking_done:; } @@ -60784,7 +60685,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __pyx_v_e = __pyx_t_6; __pyx_t_6 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1903 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1903 * ef_span = [[f_len + 1, -1] for i in range(e_len)] * for (f, e) in alignment: * al[f].append(e) # <<<<<<<<<<<<<< @@ -60798,7 +60699,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1904 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1904 * for (f, e) in alignment: * al[f].append(e) * fe_span[f][0] = min(fe_span[f][0], e) # <<<<<<<<<<<<<< @@ -60812,7 +60713,8 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1904; __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 = 1904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_4, Py_LT); 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_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_9) { @@ -60830,7 +60732,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1905 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1905 * al[f].append(e) * fe_span[f][0] = min(fe_span[f][0], e) * fe_span[f][1] = max(fe_span[f][1], e) # <<<<<<<<<<<<<< @@ -60844,7 +60746,8 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __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 = 1905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_GT); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_9) { @@ -60862,7 +60765,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1906 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1906 * 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) # <<<<<<<<<<<<<< @@ -60876,7 +60779,8 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__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 = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_4, Py_LT); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 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) { @@ -60894,7 +60798,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1907 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1907 * 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) # <<<<<<<<<<<<<< @@ -60908,7 +60812,8 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __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_7 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_GT); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 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) { @@ -60928,7 +60833,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1910 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1910 * * # Target side word coverage * cover = [0] * e_len # <<<<<<<<<<<<<< @@ -60949,7 +60854,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __pyx_cur_scope->__pyx_v_cover = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1912 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1912 * cover = [0] * e_len * # Non-terminal coverage * f_nt_cover = [0] * f_len # <<<<<<<<<<<<<< @@ -60969,7 +60874,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __pyx_v_f_nt_cover = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1913 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1913 * # Non-terminal coverage * f_nt_cover = [0] * f_len * e_nt_cover = [0] * e_len # <<<<<<<<<<<<<< @@ -60990,7 +60895,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __pyx_cur_scope->__pyx_v_e_nt_cover = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1918 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1918 * # 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): # <<<<<<<<<<<<<< @@ -61003,7 +60908,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __pyx_cur_scope->__pyx_v_extract = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2024 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2024 * * # Try to extract phrases from every f index * for f_i from 0 <= f_i < f_len: # <<<<<<<<<<<<<< @@ -61013,7 +60918,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __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 = 2024; __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/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2026 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2026 * for f_i from 0 <= f_i < f_len: * # Skip if phrases won't be tight on left side * if not al[f_i]: # <<<<<<<<<<<<<< @@ -61027,7 +60932,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __pyx_t_11 = (!__pyx_t_9); if (__pyx_t_11) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2027 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2027 * # Skip if phrases won't be tight on left side * if not al[f_i]: * continue # <<<<<<<<<<<<<< @@ -61039,7 +60944,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ } __pyx_L15:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2028 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2028 * if not al[f_i]: * continue * extract(f_i, f_i, f_len + 1, -1, f_i, 0, [], [], False) # <<<<<<<<<<<<<< @@ -61096,7 +61001,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __pyx_L13_continue:; } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2033 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2033 * # 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): # <<<<<<<<<<<<<< @@ -61126,18 +61031,10 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ for (;;) { if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_14)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_14)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_12 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_12); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_12 = PySequence_ITEM(__pyx_t_14, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_12 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_12); __pyx_t_2++; } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_14)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_14)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_12); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_12 = PySequence_ITEM(__pyx_t_14, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_12); __pyx_t_2++; } else { __pyx_t_12 = __pyx_t_5(__pyx_t_14); if (unlikely(!__pyx_t_12)) { @@ -61151,22 +61048,21 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ } if ((likely(PyTuple_CheckExact(__pyx_t_12))) || (PyList_CheckExact(__pyx_t_12))) { PyObject* sequence = __pyx_t_12; - #if CYTHON_COMPILING_IN_CPYTHON - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 3)) { - if (size > 3) __Pyx_RaiseTooManyValuesError(3); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { + if (unlikely(PyTuple_GET_SIZE(sequence) != 3)) { + if (PyTuple_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3); + else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } __pyx_t_13 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); } else { + if (unlikely(PyList_GET_SIZE(sequence) != 3)) { + if (PyList_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3); + else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } __pyx_t_13 = PyList_GET_ITEM(sequence, 0); __pyx_t_7 = PyList_GET_ITEM(sequence, 1); __pyx_t_4 = PyList_GET_ITEM(sequence, 2); @@ -61174,14 +61070,8 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_4); - #else - __pyx_t_13 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - } else - { + } 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 = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); @@ -61194,13 +61084,12 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ 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 = 2033; __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; __pyx_L18_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_8 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); + if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L19_unpacking_done:; } @@ -61214,7 +61103,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __pyx_v_lex_j = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2034 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2034 * # at the cost of readability * for (f, lex_i, lex_j) in self.get_f_phrases(f_words): * self.samples_f[f] += 1 # <<<<<<<<<<<<<< @@ -61237,7 +61126,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ } __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2037 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2037 * * # Update phrase counts * for rule in rules: # <<<<<<<<<<<<<< @@ -61255,18 +61144,10 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ for (;;) { if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_14)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_14)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_12 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_12); __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_14, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_12 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_12); __pyx_t_2++; } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_14)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_14)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_12); __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_14, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_12); __pyx_t_2++; } else { __pyx_t_12 = __pyx_t_5(__pyx_t_14); if (unlikely(!__pyx_t_12)) { @@ -61282,7 +61163,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __pyx_v_rule = __pyx_t_12; __pyx_t_12 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2038 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2038 * # Update phrase counts * for rule in rules: * (f_ph, e_ph, al) = rule[:3] # <<<<<<<<<<<<<< @@ -61293,22 +61174,21 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __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 - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 3)) { - if (size > 3) __Pyx_RaiseTooManyValuesError(3); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { + if (unlikely(PyTuple_GET_SIZE(sequence) != 3)) { + if (PyTuple_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3); + else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_13 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); } else { + if (unlikely(PyList_GET_SIZE(sequence) != 3)) { + if (PyList_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3); + else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } __pyx_t_4 = PyList_GET_ITEM(sequence, 0); __pyx_t_13 = PyList_GET_ITEM(sequence, 1); __pyx_t_7 = PyList_GET_ITEM(sequence, 2); @@ -61316,14 +61196,8 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(__pyx_t_7); - #else - __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_13 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - } else - { + } 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 = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); @@ -61336,13 +61210,12 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ 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 = 2038; __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; __pyx_L22_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_8 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); + if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L23_unpacking_done:; } @@ -61358,7 +61231,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __pyx_cur_scope->__pyx_v_al = __pyx_t_7; __pyx_t_7 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2039 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2039 * for rule in rules: * (f_ph, e_ph, al) = rule[:3] * self.phrases_f[f_ph] += 1 # <<<<<<<<<<<<<< @@ -61379,7 +61252,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2040 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2040 * (f_ph, e_ph, al) = rule[:3] * self.phrases_f[f_ph] += 1 * self.phrases_e[e_ph] += 1 # <<<<<<<<<<<<<< @@ -61400,7 +61273,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2041 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2041 * self.phrases_f[f_ph] += 1 * self.phrases_e[e_ph] += 1 * self.phrases_fe[f_ph][e_ph] += 1 # <<<<<<<<<<<<<< @@ -61421,7 +61294,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2042 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2042 * self.phrases_e[e_ph] += 1 * self.phrases_fe[f_ph][e_ph] += 1 * if not self.phrases_al[f_ph][e_ph]: # <<<<<<<<<<<<<< @@ -61438,7 +61311,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __pyx_t_9 = (!__pyx_t_11); if (__pyx_t_9) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2043 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2043 * self.phrases_fe[f_ph][e_ph] += 1 * if not self.phrases_al[f_ph][e_ph]: * self.phrases_al[f_ph][e_ph] = al # <<<<<<<<<<<<<< @@ -61455,7 +61328,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ } __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2046 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2046 * * # Update Bilexical counts * for e_w in e_words: # <<<<<<<<<<<<<< @@ -61473,18 +61346,10 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ for (;;) { if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_14)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_14)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_14, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_14)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_14)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_14, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; } else { __pyx_t_7 = __pyx_t_5(__pyx_t_14); if (unlikely(!__pyx_t_7)) { @@ -61500,7 +61365,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __pyx_v_e_w = __pyx_t_7; __pyx_t_7 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2047 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2047 * # Update Bilexical counts * for e_w in e_words: * self.bilex_e[e_w] += 1 # <<<<<<<<<<<<<< @@ -61523,7 +61388,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ } __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2048 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2048 * for e_w in e_words: * self.bilex_e[e_w] += 1 * for f_w in f_words: # <<<<<<<<<<<<<< @@ -61541,18 +61406,10 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ for (;;) { if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_14)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_14)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_14, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_14)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_14)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_14, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; } else { __pyx_t_7 = __pyx_t_5(__pyx_t_14); if (unlikely(!__pyx_t_7)) { @@ -61568,7 +61425,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __pyx_v_f_w = __pyx_t_7; __pyx_t_7 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2049 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2049 * self.bilex_e[e_w] += 1 * for f_w in f_words: * self.bilex_f[f_w] += 1 # <<<<<<<<<<<<<< @@ -61589,7 +61446,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2050 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2050 * for f_w in f_words: * self.bilex_f[f_w] += 1 * for e_w in e_words: # <<<<<<<<<<<<<< @@ -61607,18 +61464,10 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ for (;;) { if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_7)) { if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_7)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_12 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_15); __Pyx_INCREF(__pyx_t_12); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_12 = PySequence_ITEM(__pyx_t_7, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_12 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_15); __Pyx_INCREF(__pyx_t_12); __pyx_t_15++; } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_7)) { if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_7)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_15); __Pyx_INCREF(__pyx_t_12); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_12 = PySequence_ITEM(__pyx_t_7, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_15); __Pyx_INCREF(__pyx_t_12); __pyx_t_15++; } else { __pyx_t_12 = __pyx_t_16(__pyx_t_7); if (unlikely(!__pyx_t_12)) { @@ -61634,7 +61483,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __pyx_v_e_w = __pyx_t_12; __pyx_t_12 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2051 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2051 * self.bilex_f[f_w] += 1 * for e_w in e_words: * self.bilex_fe[f_w][e_w] += 1 # <<<<<<<<<<<<<< @@ -61700,11 +61549,11 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_28form_rule(PyObject *_ PyObject *__pyx_v_e_span = 0; PyObject *__pyx_v_nt = 0; PyObject *__pyx_v_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 *__pyx_r = 0; __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}; PyObject* values[6] = {0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -61722,30 +61571,36 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_28form_rule(PyObject *_ 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--; + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f_i); + if (likely(values[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--; + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e_i); + if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2054; __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--; + values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f_span); + if (likely(values[2])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2054; __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--; + values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e_span); + if (likely(values[3])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: - if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nt)) != 0)) kw_args--; + values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nt); + if (likely(values[4])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 4); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: - if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__al)) != 0)) kw_args--; + values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__al); + if (likely(values[5])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 5); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -61789,11 +61644,12 @@ static PyMethodDef __pyx_mdef_3_sa_23HieroCachingRuleFactory_9form_rule_lambda7 static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_9form_rule_lambda7(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__x,&__pyx_n_s__y,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda7 (wrapper)", 0); + __pyx_self = __pyx_self; { - 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; @@ -61807,10 +61663,12 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_9form_rule_lambda7(PyOb 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--; + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__x); + if (likely(values[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--; + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__y); + if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("lambda7", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -61840,7 +61698,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_9form_rule_lambda7(PyOb return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2057 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2057 * * # Substitute in non-terminals * nt_inv = sorted(nt, cmp=lambda x, y: cmp(x[3], y[3])) # <<<<<<<<<<<<<< @@ -61898,11 +61756,12 @@ static PyMethodDef __pyx_mdef_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda8 static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__x,&__pyx_n_s__y,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda8 (wrapper)", 0); + __pyx_self = __pyx_self; { - 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; @@ -61916,10 +61775,12 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda8(PyO 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--; + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__x); + if (likely(values[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--; + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__y); + if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("lambda8", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -61949,7 +61810,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda8(PyO return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2081 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2081 * # 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])) # <<<<<<<<<<<<<< @@ -62002,7 +61863,7 @@ static PyObject *__pyx_lambda_funcdef_lambda8(CYTHON_UNUSED PyObject *__pyx_self } static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_9form_rule_4generator15(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2115 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2115 * f = Phrase(f_sym) * e = Phrase(e_sym) * a = tuple(self.alignment.link(i, j) for (i, j) in links) # <<<<<<<<<<<<<< @@ -62083,18 +61944,10 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_9form_rule_4generator15 for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __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 = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; } 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 = 2115; __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 = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { @@ -62108,33 +61961,27 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_9form_rule_4generator15 } if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { PyObject* sequence = __pyx_t_4; - #if CYTHON_COMPILING_IN_CPYTHON - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { + if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { + if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); + else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { + if (unlikely(PyList_GET_SIZE(sequence) != 2)) { + if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); + else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); - #else - __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __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 = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } else - { + } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); @@ -62145,13 +61992,12 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_9form_rule_4generator15 index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_8 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); + if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L7_unpacking_done:; } @@ -62202,12 +62048,11 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_9form_rule_4generator15 __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_generator->resume_label = -1; - __Pyx_Generator_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return NULL; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2054 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2054 * * # Create a rule from source, target, non-terminals, and alignments * def form_rule(self, f_i, e_i, f_span, e_span, nt, al): # <<<<<<<<<<<<<< @@ -62264,7 +62109,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2057 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2057 * * # Substitute in non-terminals * nt_inv = sorted(nt, cmp=lambda x, y: cmp(x[3], y[3])) # <<<<<<<<<<<<<< @@ -62289,7 +62134,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __pyx_v_nt_inv = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2058 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2058 * # Substitute in non-terminals * nt_inv = sorted(nt, cmp=lambda x, y: cmp(x[3], y[3])) * f_sym = list(f_span[:]) # <<<<<<<<<<<<<< @@ -62309,7 +62154,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __pyx_v_f_sym = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2059 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2059 * nt_inv = sorted(nt, cmp=lambda x, y: cmp(x[3], y[3])) * f_sym = list(f_span[:]) * off = f_i # <<<<<<<<<<<<<< @@ -62319,7 +62164,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __Pyx_INCREF(__pyx_v_f_i); __pyx_v_off = __pyx_v_f_i; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2060 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2060 * f_sym = list(f_span[:]) * off = f_i * for next_nt in nt: # <<<<<<<<<<<<<< @@ -62337,18 +62182,10 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py for (;;) { 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;} - #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;} - #endif + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; } 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;} - #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;} - #endif + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; } else { __pyx_t_2 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_2)) { @@ -62364,7 +62201,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __pyx_v_next_nt = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2061 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2061 * off = f_i * for next_nt in nt: * nt_len = (next_nt[2] - next_nt[1]) + 1 # <<<<<<<<<<<<<< @@ -62386,7 +62223,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __pyx_v_nt_len = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2062 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2062 * for next_nt in nt: * nt_len = (next_nt[2] - next_nt[1]) + 1 * i = 0 # <<<<<<<<<<<<<< @@ -62397,7 +62234,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __Pyx_XDECREF(__pyx_v_i); __pyx_v_i = __pyx_int_0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2063 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2063 * nt_len = (next_nt[2] - next_nt[1]) + 1 * i = 0 * while i < nt_len: # <<<<<<<<<<<<<< @@ -62405,12 +62242,13 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py * 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 = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_i, __pyx_v_nt_len, Py_LT); 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_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); 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_1); __pyx_t_1 = 0; if (!__pyx_t_7) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2064 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2064 * i = 0 * while i < nt_len: * f_sym.pop(next_nt[1] - off) # <<<<<<<<<<<<<< @@ -62435,7 +62273,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2065 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2065 * while i < nt_len: * f_sym.pop(next_nt[1] - off) * i += 1 # <<<<<<<<<<<<<< @@ -62449,7 +62287,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __pyx_t_2 = 0; } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2066 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2066 * f_sym.pop(next_nt[1] - off) * i += 1 * f_sym.insert(next_nt[1] - off, sym_setindex(self.category, next_nt[0])) # <<<<<<<<<<<<<< @@ -62472,7 +62310,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __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 = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2067 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2067 * i += 1 * f_sym.insert(next_nt[1] - off, sym_setindex(self.category, next_nt[0])) * off += (nt_len - 1) # <<<<<<<<<<<<<< @@ -62490,7 +62328,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2068 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2068 * f_sym.insert(next_nt[1] - off, sym_setindex(self.category, next_nt[0])) * off += (nt_len - 1) * e_sym = list(e_span[:]) # <<<<<<<<<<<<<< @@ -62510,7 +62348,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __pyx_v_e_sym = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2069 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2069 * off += (nt_len - 1) * e_sym = list(e_span[:]) * off = e_i # <<<<<<<<<<<<<< @@ -62521,7 +62359,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __Pyx_DECREF(__pyx_v_off); __pyx_v_off = __pyx_v_e_i; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2070 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2070 * e_sym = list(e_span[:]) * off = e_i * for next_nt in nt_inv: # <<<<<<<<<<<<<< @@ -62539,18 +62377,10 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py for (;;) { 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 = 2070; __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 = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; } 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 = 2070; __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 = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; } else { __pyx_t_2 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_2)) { @@ -62566,7 +62396,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __pyx_v_next_nt = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2071 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2071 * off = e_i * for next_nt in nt_inv: * nt_len = (next_nt[4] - next_nt[3]) + 1 # <<<<<<<<<<<<<< @@ -62588,7 +62418,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __pyx_v_nt_len = __pyx_t_6; __pyx_t_6 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2072 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2072 * for next_nt in nt_inv: * nt_len = (next_nt[4] - next_nt[3]) + 1 * i = 0 # <<<<<<<<<<<<<< @@ -62599,7 +62429,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __Pyx_XDECREF(__pyx_v_i); __pyx_v_i = __pyx_int_0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2073 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2073 * nt_len = (next_nt[4] - next_nt[3]) + 1 * i = 0 * while i < nt_len: # <<<<<<<<<<<<<< @@ -62607,12 +62437,13 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py * 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 = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_RichCompare(__pyx_v_i, __pyx_v_nt_len, Py_LT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (!__pyx_t_7) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2074 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2074 * i = 0 * while i < nt_len: * e_sym.pop(next_nt[3] - off) # <<<<<<<<<<<<<< @@ -62637,7 +62468,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2075 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2075 * while i < nt_len: * e_sym.pop(next_nt[3] - off) * i += 1 # <<<<<<<<<<<<<< @@ -62651,7 +62482,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __pyx_t_2 = 0; } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2076 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2076 * e_sym.pop(next_nt[3] - off) * i += 1 * e_sym.insert(next_nt[3] - off, sym_setindex(self.category, next_nt[0])) # <<<<<<<<<<<<<< @@ -62674,7 +62505,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __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 = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2077 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2077 * i += 1 * e_sym.insert(next_nt[3] - off, sym_setindex(self.category, next_nt[0])) * off += (nt_len - 1) # <<<<<<<<<<<<<< @@ -62692,7 +62523,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2080 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2080 * * # Adjusting alignment links takes some doing * links = [list(link) for sub in al for link in sub] # <<<<<<<<<<<<<< @@ -62712,18 +62543,10 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py for (;;) { 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 = 2080; __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 = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; } 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 = 2080; __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 = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; } else { __pyx_t_1 = __pyx_t_5(__pyx_t_2); if (unlikely(!__pyx_t_1)) { @@ -62749,18 +62572,10 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py for (;;) { 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 = 2080; __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 = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; } 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 = 2080; __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 = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; } else { __pyx_t_6 = __pyx_t_11(__pyx_t_1); if (unlikely(!__pyx_t_6)) { @@ -62783,7 +62598,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __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 = 2080; __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_PyList_Append(__pyx_t_3, (PyObject*)__pyx_t_12))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(PyList_Append(__pyx_t_3, (PyObject*)__pyx_t_12))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2080; __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; @@ -62794,7 +62609,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __pyx_cur_scope->__pyx_v_links = ((PyObject *)__pyx_t_3); __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2081 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2081 * # 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])) # <<<<<<<<<<<<<< @@ -62819,7 +62634,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __pyx_v_links_inv = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2082 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2082 * 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) # <<<<<<<<<<<<<< @@ -62835,7 +62650,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __pyx_v_links_len = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2083 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2083 * links_inv = sorted(links, cmp=lambda x, y: cmp(x[1], y[1])) * links_len = len(links) * nt_len = len(nt) # <<<<<<<<<<<<<< @@ -62849,7 +62664,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __pyx_v_nt_len = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2084 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2084 * links_len = len(links) * nt_len = len(nt) * nt_i = 0 # <<<<<<<<<<<<<< @@ -62859,7 +62674,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __Pyx_INCREF(__pyx_int_0); __pyx_v_nt_i = __pyx_int_0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2085 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2085 * nt_len = len(nt) * nt_i = 0 * off = f_i # <<<<<<<<<<<<<< @@ -62870,7 +62685,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __Pyx_DECREF(__pyx_v_off); __pyx_v_off = __pyx_v_f_i; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2086 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2086 * nt_i = 0 * off = f_i * i = 0 # <<<<<<<<<<<<<< @@ -62881,7 +62696,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __Pyx_XDECREF(__pyx_v_i); __pyx_v_i = __pyx_int_0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2087 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2087 * off = f_i * i = 0 * while i < links_len: # <<<<<<<<<<<<<< @@ -62889,12 +62704,13 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py * 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 = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_i, __pyx_v_links_len, Py_LT); 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_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); 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_1); __pyx_t_1 = 0; if (!__pyx_t_7) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2088 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2088 * i = 0 * while i < links_len: * while nt_i < nt_len and links[i][0] > nt[nt_i][1]: # <<<<<<<<<<<<<< @@ -62902,7 +62718,8 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py * 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 = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_nt_i, __pyx_v_nt_len, Py_LT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_7) { @@ -62916,7 +62733,8 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); 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_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 = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_GT); if (unlikely(!__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_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 = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -62927,7 +62745,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py } if (!__pyx_t_14) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2089 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2089 * 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]) # <<<<<<<<<<<<<< @@ -62955,7 +62773,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __pyx_v_off = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2090 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2090 * 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 # <<<<<<<<<<<<<< @@ -62969,7 +62787,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __pyx_t_2 = 0; } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2091 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2091 * off += (nt[nt_i][2] - nt[nt_i][1]) * nt_i += 1 * links[i][0] -= off # <<<<<<<<<<<<<< @@ -62988,7 +62806,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2092 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2092 * nt_i += 1 * links[i][0] -= off * i += 1 # <<<<<<<<<<<<<< @@ -63002,7 +62820,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __pyx_t_2 = 0; } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2093 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2093 * links[i][0] -= off * i += 1 * nt_i = 0 # <<<<<<<<<<<<<< @@ -63013,7 +62831,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __Pyx_DECREF(__pyx_v_nt_i); __pyx_v_nt_i = __pyx_int_0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2094 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2094 * i += 1 * nt_i = 0 * off = e_i # <<<<<<<<<<<<<< @@ -63024,7 +62842,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __Pyx_DECREF(__pyx_v_off); __pyx_v_off = __pyx_v_e_i; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2095 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2095 * nt_i = 0 * off = e_i * i = 0 # <<<<<<<<<<<<<< @@ -63035,7 +62853,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __Pyx_DECREF(__pyx_v_i); __pyx_v_i = __pyx_int_0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2096 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2096 * off = e_i * i = 0 * while i < links_len: # <<<<<<<<<<<<<< @@ -63043,12 +62861,13 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py * 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 = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_v_i, __pyx_v_links_len, Py_LT); if (unlikely(!__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_14 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_14) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2097 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2097 * i = 0 * while i < links_len: * while nt_i < nt_len and links_inv[i][1] > nt_inv[nt_i][3]: # <<<<<<<<<<<<<< @@ -63056,7 +62875,8 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py * 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 = 2097; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_v_nt_i, __pyx_v_nt_len, Py_LT); 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_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_14 < 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; if (__pyx_t_14) { @@ -63070,7 +62890,8 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 3, sizeof(long), PyInt_FromLong); 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_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 = 2097; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_GT); 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_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 = 2097; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -63081,7 +62902,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py } if (!__pyx_t_13) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2098 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2098 * 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]) # <<<<<<<<<<<<<< @@ -63109,7 +62930,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __pyx_v_off = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2099 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2099 * 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 # <<<<<<<<<<<<<< @@ -63123,7 +62944,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __pyx_t_3 = 0; } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2100 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2100 * off += (nt_inv[nt_i][4] - nt_inv[nt_i][3]) * nt_i += 1 * links_inv[i][1] -= off # <<<<<<<<<<<<<< @@ -63142,7 +62963,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2101 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2101 * nt_i += 1 * links_inv[i][1] -= off * i += 1 # <<<<<<<<<<<<<< @@ -63156,7 +62977,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __pyx_t_3 = 0; } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2104 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2104 * * # Find lexical span * lex_f_i = f_i # <<<<<<<<<<<<<< @@ -63166,7 +62987,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __Pyx_INCREF(__pyx_v_f_i); __pyx_v_lex_f_i = __pyx_v_f_i; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2105 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2105 * # Find lexical span * lex_f_i = f_i * lex_f_j = f_i + (len(f_span) - 1) # <<<<<<<<<<<<<< @@ -63182,7 +63003,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __pyx_v_lex_f_j = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2106 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2106 * lex_f_i = f_i * lex_f_j = f_i + (len(f_span) - 1) * if nt: # <<<<<<<<<<<<<< @@ -63192,7 +63013,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_nt); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_13) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2107 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2107 * lex_f_j = f_i + (len(f_span) - 1) * if nt: * if nt[0][1] == lex_f_i: # <<<<<<<<<<<<<< @@ -63204,13 +63025,14 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2107; __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 = 2107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_v_lex_f_i, Py_EQ); 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_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_13) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2108 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2108 * if nt: * if nt[0][1] == lex_f_i: * lex_f_i += (nt[0][2] - nt[0][1]) + 1 # <<<<<<<<<<<<<< @@ -63244,7 +63066,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py } __pyx_L24:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2109 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2109 * if nt[0][1] == lex_f_i: * lex_f_i += (nt[0][2] - nt[0][1]) + 1 * if nt[-1][2] == lex_f_j: # <<<<<<<<<<<<<< @@ -63256,13 +63078,14 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2109; __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 = 2109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_v_lex_f_j, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __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 = 2109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_13) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2110 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2110 * 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 # <<<<<<<<<<<<<< @@ -63299,7 +63122,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py } __pyx_L23:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2113 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2113 * * # Create rule (f_phrase, e_phrase, links, f_link_min, f_link_max) * f = Phrase(f_sym) # <<<<<<<<<<<<<< @@ -63317,7 +63140,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __pyx_v_f = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2114 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2114 * # Create rule (f_phrase, e_phrase, links, f_link_min, f_link_max) * f = Phrase(f_sym) * e = Phrase(e_sym) # <<<<<<<<<<<<<< @@ -63335,7 +63158,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __pyx_v_e = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2115 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2115 * f = Phrase(f_sym) * e = Phrase(e_sym) * a = tuple(self.alignment.link(i, j) for (i, j) in links) # <<<<<<<<<<<<<< @@ -63355,7 +63178,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __pyx_v_a = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2116 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2116 * 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) # <<<<<<<<<<<<<< @@ -63424,11 +63247,11 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_30fmt_rule(PyObject *__ PyObject *__pyx_v_f = 0; PyObject *__pyx_v_e = 0; PyObject *__pyx_v_a = 0; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__f,&__pyx_n_s__e,&__pyx_n_s__a,0}; PyObject *__pyx_r = 0; __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}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -63443,15 +63266,18 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_30fmt_rule(PyObject *__ 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--; + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f); + if (likely(values[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--; + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e); + if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("fmt_rule", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2119; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__a)) != 0)) kw_args--; + values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__a); + if (likely(values[2])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("fmt_rule", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2119; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -63484,7 +63310,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_30fmt_rule(PyObject *__ } static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_8fmt_rule_2generator16(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2120 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2120 * # 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) # <<<<<<<<<<<<<< @@ -63562,18 +63388,10 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_8fmt_rule_2generator16( for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __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 = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; } 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 = 2120; __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 = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { @@ -63643,12 +63461,11 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_8fmt_rule_2generator16( __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_generator->resume_label = -1; - __Pyx_Generator_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return NULL; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2119 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2119 * * # Rule string from rule * def fmt_rule(self, f, e, a): # <<<<<<<<<<<<<< @@ -63681,7 +63498,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_29fmt_rule(struct __pyx __Pyx_INCREF(__pyx_cur_scope->__pyx_v_a); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_a); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2120 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2120 * # 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) # <<<<<<<<<<<<<< @@ -63704,7 +63521,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_29fmt_rule(struct __pyx __pyx_v_a_str = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2121 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2121 * 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) # <<<<<<<<<<<<<< @@ -63760,7 +63577,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_32dump_online_stats(PyO return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2124 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2124 * * # Debugging * def dump_online_stats(self): # <<<<<<<<<<<<<< @@ -63790,7 +63607,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str int __pyx_clineno = 0; __Pyx_RefNannySetupContext("dump_online_stats", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2125 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2125 * # Debugging * def dump_online_stats(self): * logger.info('------------------------------') # <<<<<<<<<<<<<< @@ -63807,7 +63624,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2126 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2126 * def dump_online_stats(self): * logger.info('------------------------------') * logger.info(' Online Stats ') # <<<<<<<<<<<<<< @@ -63824,7 +63641,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2127 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2127 * logger.info('------------------------------') * logger.info(' Online Stats ') * logger.info('------------------------------') # <<<<<<<<<<<<<< @@ -63841,7 +63658,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2128 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2128 * logger.info(' Online Stats ') * logger.info('------------------------------') * logger.info('f') # <<<<<<<<<<<<<< @@ -63858,7 +63675,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2129 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2129 * logger.info('------------------------------') * logger.info('f') * for w in self.bilex_f: # <<<<<<<<<<<<<< @@ -63876,18 +63693,10 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str for (;;) { if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; } else { __pyx_t_2 = __pyx_t_4(__pyx_t_1); if (unlikely(!__pyx_t_2)) { @@ -63903,7 +63712,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str __pyx_v_w = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2130 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2130 * logger.info('f') * for w in self.bilex_f: * logger.info(sym_tostring(w) + ' : ' + str(self.bilex_f[w])) # <<<<<<<<<<<<<< @@ -63948,7 +63757,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2131 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2131 * for w in self.bilex_f: * logger.info(sym_tostring(w) + ' : ' + str(self.bilex_f[w])) * logger.info('e') # <<<<<<<<<<<<<< @@ -63965,7 +63774,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2132 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2132 * logger.info(sym_tostring(w) + ' : ' + str(self.bilex_f[w])) * logger.info('e') * for w in self.bilex_e: # <<<<<<<<<<<<<< @@ -63983,18 +63792,10 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str for (;;) { if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; } else { __pyx_t_8 = __pyx_t_4(__pyx_t_1); if (unlikely(!__pyx_t_8)) { @@ -64010,7 +63811,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str __pyx_v_w = __pyx_t_8; __pyx_t_8 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2133 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2133 * logger.info('e') * for w in self.bilex_e: * logger.info(sym_tostring(w) + ' : ' + str(self.bilex_e[w])) # <<<<<<<<<<<<<< @@ -64055,7 +63856,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2134 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2134 * for w in self.bilex_e: * logger.info(sym_tostring(w) + ' : ' + str(self.bilex_e[w])) * logger.info('fe') # <<<<<<<<<<<<<< @@ -64072,7 +63873,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2135 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2135 * logger.info(sym_tostring(w) + ' : ' + str(self.bilex_e[w])) * logger.info('fe') * for w in self.bilex_fe: # <<<<<<<<<<<<<< @@ -64090,18 +63891,10 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str for (;;) { if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_7); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_7); __pyx_t_3++; } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_7); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_7); __pyx_t_3++; } else { __pyx_t_7 = __pyx_t_4(__pyx_t_1); if (unlikely(!__pyx_t_7)) { @@ -64117,7 +63910,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str __pyx_v_w = __pyx_t_7; __pyx_t_7 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2136 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2136 * logger.info('fe') * for w in self.bilex_fe: * for w2 in self.bilex_fe[w]: # <<<<<<<<<<<<<< @@ -64138,18 +63931,10 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str for (;;) { if (!__pyx_t_10 && PyList_CheckExact(__pyx_t_8)) { if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_8)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_7); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_7); __pyx_t_9++; } else if (!__pyx_t_10 && PyTuple_CheckExact(__pyx_t_8)) { if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_8)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_7); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_7); __pyx_t_9++; } else { __pyx_t_7 = __pyx_t_10(__pyx_t_8); if (unlikely(!__pyx_t_7)) { @@ -64165,7 +63950,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str __pyx_v_w2 = __pyx_t_7; __pyx_t_7 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2137 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2137 * for w in self.bilex_fe: * for w2 in self.bilex_fe[w]: * logger.info(sym_tostring(w) + ' : ' + sym_tostring(w2) + ' : ' + str(self.bilex_fe[w][w2])) # <<<<<<<<<<<<<< @@ -64225,7 +64010,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2138 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2138 * for w2 in self.bilex_fe[w]: * logger.info(sym_tostring(w) + ' : ' + sym_tostring(w2) + ' : ' + str(self.bilex_fe[w][w2])) * logger.info('F') # <<<<<<<<<<<<<< @@ -64242,7 +64027,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2139 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2139 * logger.info(sym_tostring(w) + ' : ' + sym_tostring(w2) + ' : ' + str(self.bilex_fe[w][w2])) * logger.info('F') * for ph in self.phrases_f: # <<<<<<<<<<<<<< @@ -64260,18 +64045,10 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str for (;;) { if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; } else { __pyx_t_8 = __pyx_t_4(__pyx_t_1); if (unlikely(!__pyx_t_8)) { @@ -64287,7 +64064,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str __pyx_v_ph = __pyx_t_8; __pyx_t_8 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2140 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2140 * logger.info('F') * for ph in self.phrases_f: * logger.info(str(ph) + ' ||| ' + str(self.phrases_f[ph])) # <<<<<<<<<<<<<< @@ -64337,7 +64114,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2141 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2141 * for ph in self.phrases_f: * logger.info(str(ph) + ' ||| ' + str(self.phrases_f[ph])) * logger.info('E') # <<<<<<<<<<<<<< @@ -64354,7 +64131,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2142 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2142 * logger.info(str(ph) + ' ||| ' + str(self.phrases_f[ph])) * logger.info('E') * for ph in self.phrases_e: # <<<<<<<<<<<<<< @@ -64372,18 +64149,10 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str for (;;) { if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; } else { __pyx_t_2 = __pyx_t_4(__pyx_t_1); if (unlikely(!__pyx_t_2)) { @@ -64399,7 +64168,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str __pyx_v_ph = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2143 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2143 * logger.info('E') * for ph in self.phrases_e: * logger.info(str(ph) + ' ||| ' + str(self.phrases_e[ph])) # <<<<<<<<<<<<<< @@ -64449,7 +64218,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2144 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2144 * for ph in self.phrases_e: * logger.info(str(ph) + ' ||| ' + str(self.phrases_e[ph])) * logger.info('FE') # <<<<<<<<<<<<<< @@ -64466,7 +64235,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2145 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2145 * logger.info(str(ph) + ' ||| ' + str(self.phrases_e[ph])) * logger.info('FE') * self.dump_online_rules() # <<<<<<<<<<<<<< @@ -64511,7 +64280,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_34dump_online_rules(PyO return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2147 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2147 * self.dump_online_rules() * * def dump_online_rules(self): # <<<<<<<<<<<<<< @@ -64541,7 +64310,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_33dump_online_rules(str int __pyx_clineno = 0; __Pyx_RefNannySetupContext("dump_online_rules", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2148 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2148 * * def dump_online_rules(self): * for ph in self.phrases_fe: # <<<<<<<<<<<<<< @@ -64559,18 +64328,10 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_33dump_online_rules(str for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2148; __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 = 2148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; } 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 = 2148; __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 = 2148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { @@ -64586,7 +64347,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_33dump_online_rules(str __pyx_v_ph = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2149 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2149 * def dump_online_rules(self): * for ph in self.phrases_fe: * for ph2 in self.phrases_fe[ph]: # <<<<<<<<<<<<<< @@ -64607,18 +64368,10 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_33dump_online_rules(str for (;;) { if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_5)) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_5)) { if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; } else { __pyx_t_4 = __pyx_t_7(__pyx_t_5); if (unlikely(!__pyx_t_4)) { @@ -64634,7 +64387,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_33dump_online_rules(str __pyx_v_ph2 = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2150 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2150 * for ph in self.phrases_fe: * for ph2 in self.phrases_fe[ph]: * logger.info(self.fmt_rule(str(ph), str(ph2), self.phrases_al[ph][ph2]) + ' ||| ' + str(self.phrases_fe[ph][ph2])) # <<<<<<<<<<<<<< @@ -64745,11 +64498,11 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_36online_ctx_lookup(PyO static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_36online_ctx_lookup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_f = 0; PyObject *__pyx_v_e = 0; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__f,&__pyx_n_s__e,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("online_ctx_lookup (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__f,&__pyx_n_s__e,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -64763,10 +64516,12 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_36online_ctx_lookup(PyO 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--; + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f); + if (likely(values[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--; + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e); + if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("online_ctx_lookup", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -64796,7 +64551,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_36online_ctx_lookup(PyO return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2154 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2154 * # 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): # <<<<<<<<<<<<<< @@ -64821,7 +64576,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_35online_ctx_lookup(str int __pyx_clineno = 0; __Pyx_RefNannySetupContext("online_ctx_lookup", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2155 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2155 * # IMPORTANT: use get() to avoid adding items to defaultdict * def online_ctx_lookup(self, f, e): * if self.online: # <<<<<<<<<<<<<< @@ -64830,7 +64585,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_35online_ctx_lookup(str */ if (__pyx_v_self->online) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2156 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2156 * def online_ctx_lookup(self, f, e): * if self.online: * fcount = self.phrases_f.get(f, 0) # <<<<<<<<<<<<<< @@ -64854,7 +64609,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_35online_ctx_lookup(str __pyx_v_fcount = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2157 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2157 * if self.online: * fcount = self.phrases_f.get(f, 0) * fsample_count = self.samples_f.get(f, 0) # <<<<<<<<<<<<<< @@ -64878,7 +64633,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_35online_ctx_lookup(str __pyx_v_fsample_count = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2158 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2158 * fcount = self.phrases_f.get(f, 0) * fsample_count = self.samples_f.get(f, 0) * d = self.phrases_fe.get(f, None) # <<<<<<<<<<<<<< @@ -64902,7 +64657,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_35online_ctx_lookup(str __pyx_v_d = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2159 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2159 * fsample_count = self.samples_f.get(f, 0) * d = self.phrases_fe.get(f, None) * paircount = d.get(e, 0) if d else 0 # <<<<<<<<<<<<<< @@ -64934,7 +64689,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_35online_ctx_lookup(str __pyx_v_paircount = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2160 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2160 * d = self.phrases_fe.get(f, None) * paircount = d.get(e, 0) if d else 0 * return OnlineFeatureContext(fcount, fsample_count, paircount, self.bilex_f, self.bilex_e, self.bilex_fe) # <<<<<<<<<<<<<< @@ -64975,7 +64730,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_35online_ctx_lookup(str } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2161 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2161 * paircount = d.get(e, 0) if d else 0 * return OnlineFeatureContext(fcount, fsample_count, paircount, self.bilex_f, self.bilex_e, self.bilex_fe) * return None # <<<<<<<<<<<<<< @@ -65028,11 +64783,12 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_13get_f_phrases_1extrac PyObject *__pyx_v_wc = 0; PyObject *__pyx_v_ntc = 0; PyObject *__pyx_v_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 *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("extract (wrapper)", 0); + __pyx_self = __pyx_self; { - 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; @@ -65051,35 +64807,42 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_13get_f_phrases_1extrac 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--; + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f_i); + if (likely(values[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--; + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f_j); + if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 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__lex_i)) != 0)) kw_args--; + values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lex_i); + if (likely(values[2])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2171; __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--; + values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lex_j); + if (likely(values[3])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: - if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__wc)) != 0)) kw_args--; + values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__wc); + if (likely(values[4])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 4); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: - if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ntc)) != 0)) kw_args--; + values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ntc); + if (likely(values[5])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 5); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 6: - if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__syms)) != 0)) kw_args--; + values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__syms); + if (likely(values[6])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 6); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -65119,7 +64882,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_13get_f_phrases_1extrac return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2171 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2171 * phrases = set() # (fphrase, lex_i, lex_j) * * def extract(f_i, f_j, lex_i, lex_j, wc, ntc, syms): # <<<<<<<<<<<<<< @@ -65151,7 +64914,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract __pyx_outer_scope = (struct __pyx_obj_3_sa___pyx_scope_struct_26_get_f_phrases *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2173 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2173 * 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: # <<<<<<<<<<<<<< @@ -65161,7 +64924,8 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract if (unlikely(!__pyx_cur_scope->__pyx_v_f_len)) { __Pyx_RaiseClosureNameError("f_len"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __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 = 2173; __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 = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_v_f_j, __pyx_t_1, Py_GT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -65174,7 +64938,8 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__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_initial_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __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 = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __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_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -65185,7 +64950,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract } if (__pyx_t_6) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2174 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2174 * # Phrase extraction limits * if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size: * return # <<<<<<<<<<<<<< @@ -65199,7 +64964,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract } __pyx_L3:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2176 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2176 * return * # Extend with word * if wc + ntc < self.max_length: # <<<<<<<<<<<<<< @@ -65210,14 +64975,15 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract __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 = 2176; __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 = 2176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_LT); 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(__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 = 2176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2177 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2177 * # Extend with word * if wc + ntc < self.max_length: * syms.append(f_words[f_j]) # <<<<<<<<<<<<<< @@ -65232,7 +64998,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2178 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2178 * if wc + ntc < self.max_length: * syms.append(f_words[f_j]) * f = Phrase(syms) # <<<<<<<<<<<<<< @@ -65250,7 +65016,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract __pyx_v_f = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2179 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2179 * syms.append(f_words[f_j]) * f = Phrase(syms) * new_lex_i = min(lex_i, f_j) # <<<<<<<<<<<<<< @@ -65261,7 +65027,8 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract __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 = 2179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_6) { @@ -65277,7 +65044,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract __pyx_v_new_lex_i = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2180 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2180 * f = Phrase(syms) * new_lex_i = min(lex_i, f_j) * new_lex_j = max(lex_j, f_j) # <<<<<<<<<<<<<< @@ -65288,7 +65055,8 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract __pyx_t_4 = __pyx_v_f_j; __Pyx_INCREF(__pyx_v_lex_j); __pyx_t_1 = __pyx_v_lex_j; - __pyx_t_7 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_GT); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_6) { @@ -65304,7 +65072,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract __pyx_v_new_lex_j = __pyx_t_2; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2181 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2181 * 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)) # <<<<<<<<<<<<<< @@ -65336,7 +65104,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2182 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2182 * 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) # <<<<<<<<<<<<<< @@ -65376,7 +65144,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2183 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2183 * 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() # <<<<<<<<<<<<<< @@ -65390,7 +65158,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract } __pyx_L4:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2185 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2185 * syms.pop() * # Extend with existing non-terminal * if syms and sym_isvar(syms[-1]): # <<<<<<<<<<<<<< @@ -65409,7 +65177,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract } if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2187 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2187 * 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) # <<<<<<<<<<<<<< @@ -65450,7 +65218,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract } __pyx_L5:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2189 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2189 * extract(f_i, f_j + 1, lex_i, lex_j, wc, ntc, syms) * # Extend with new non-terminal * if wc + ntc < self.max_length: # <<<<<<<<<<<<<< @@ -65461,14 +65229,15 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract __Pyx_GOTREF(__pyx_t_1); __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 = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); 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); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __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 = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2190 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2190 * # 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])): # <<<<<<<<<<<<<< @@ -65480,7 +65249,8 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract if (!__pyx_t_6) { __pyx_t_4 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_nonterminals); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyObject_RichCompare(__pyx_v_ntc, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_v_ntc, __pyx_t_4, Py_LT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __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 = 2190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -65500,7 +65270,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract } if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2191 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2191 * 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)) # <<<<<<<<<<<<<< @@ -65518,7 +65288,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2192 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2192 * 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) # <<<<<<<<<<<<<< @@ -65537,19 +65307,20 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract __pyx_v_f = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2193 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2193 * 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_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 = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_v_wc, __pyx_int_0, Py_GT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2193; __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[8]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2194 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2194 * f = Phrase(syms) * if wc > 0: * phrases.add((f, lex_i, lex_j)) # <<<<<<<<<<<<<< @@ -65584,7 +65355,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract } __pyx_L8:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2195 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2195 * if wc > 0: * phrases.add((f, lex_i, lex_j)) * extract(f_i, f_j + 1, lex_i, lex_j, wc, ntc + 1, syms) # <<<<<<<<<<<<<< @@ -65624,7 +65395,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2196 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2196 * phrases.add((f, lex_i, lex_j)) * extract(f_i, f_j + 1, lex_i, lex_j, wc, ntc + 1, syms) * syms.pop() # <<<<<<<<<<<<<< @@ -65659,7 +65430,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2166 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2166 * # (Used for EGivenFCoherent) * # Return set of (fphrase, lex_i, lex_j) * def get_f_phrases(self, f_words): # <<<<<<<<<<<<<< @@ -65695,7 +65466,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_37get_f_phrases(struct __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f_words); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f_words); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2168 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2168 * def get_f_phrases(self, f_words): * * f_len = len(f_words) # <<<<<<<<<<<<<< @@ -65712,7 +65483,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_37get_f_phrases(struct __pyx_cur_scope->__pyx_v_f_len = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2169 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2169 * * f_len = len(f_words) * phrases = set() # (fphrase, lex_i, lex_j) # <<<<<<<<<<<<<< @@ -65725,7 +65496,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_37get_f_phrases(struct __pyx_cur_scope->__pyx_v_phrases = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2171 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2171 * phrases = set() # (fphrase, lex_i, lex_j) * * def extract(f_i, f_j, lex_i, lex_j, wc, ntc, syms): # <<<<<<<<<<<<<< @@ -65738,7 +65509,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_37get_f_phrases(struct __pyx_cur_scope->__pyx_v_extract = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2199 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2199 * * # Try to extract phrases from every f index * for f_i from 0 <= f_i < f_len: # <<<<<<<<<<<<<< @@ -65748,7 +65519,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_37get_f_phrases(struct __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 = 2199; __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/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2200 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2200 * # 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, []) # <<<<<<<<<<<<<< @@ -65790,7 +65561,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_37get_f_phrases(struct __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2202 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2202 * extract(f_i, f_i, f_len, -1, 0, 0, []) * * return phrases # <<<<<<<<<<<<<< @@ -65825,11 +65596,12 @@ static PyObject *__pyx_pw_3_sa_17span_check(PyObject *__pyx_self, PyObject *__py PyObject *__pyx_v_vec = 0; PyObject *__pyx_v_i = 0; PyObject *__pyx_v_j = 0; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__vec,&__pyx_n_s__i,&__pyx_n_s__j,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("span_check (wrapper)", 0); + __pyx_self = __pyx_self; { - 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; @@ -65844,15 +65616,18 @@ static PyObject *__pyx_pw_3_sa_17span_check(PyObject *__pyx_self, PyObject *__py 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--; + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__vec); + if (likely(values[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--; + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__i); + if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("span_check", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2205; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__j)) != 0)) kw_args--; + values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__j); + if (likely(values[2])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("span_check", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2205; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -65884,7 +65659,7 @@ static PyObject *__pyx_pw_3_sa_17span_check(PyObject *__pyx_self, PyObject *__py return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2205 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2205 * * # Spans are _inclusive_ on both ends [i, j] * def span_check(vec, i, j): # <<<<<<<<<<<<<< @@ -65903,7 +65678,7 @@ static PyObject *__pyx_pf_3_sa_16span_check(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_clineno = 0; __Pyx_RefNannySetupContext("span_check", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2206 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2206 * # Spans are _inclusive_ on both ends [i, j] * def span_check(vec, i, j): * k = i # <<<<<<<<<<<<<< @@ -65913,7 +65688,7 @@ static PyObject *__pyx_pf_3_sa_16span_check(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_INCREF(__pyx_v_i); __pyx_v_k = __pyx_v_i; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2207 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2207 * def span_check(vec, i, j): * k = i * while k <= j: # <<<<<<<<<<<<<< @@ -65921,12 +65696,13 @@ static PyObject *__pyx_pf_3_sa_16span_check(CYTHON_UNUSED PyObject *__pyx_self, * 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 = 2207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_k, __pyx_v_j, Py_LE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2207; __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 = 2207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_2) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2208 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2208 * k = i * while k <= j: * if vec[k]: # <<<<<<<<<<<<<< @@ -65939,7 +65715,7 @@ static PyObject *__pyx_pf_3_sa_16span_check(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2209 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2209 * while k <= j: * if vec[k]: * return False # <<<<<<<<<<<<<< @@ -65956,7 +65732,7 @@ static PyObject *__pyx_pf_3_sa_16span_check(CYTHON_UNUSED PyObject *__pyx_self, } __pyx_L5:; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2210 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2210 * if vec[k]: * return False * k += 1 # <<<<<<<<<<<<<< @@ -65970,7 +65746,7 @@ static PyObject *__pyx_pf_3_sa_16span_check(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_1 = 0; } - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2211 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2211 * return False * k += 1 * return True # <<<<<<<<<<<<<< @@ -66004,11 +65780,12 @@ static PyObject *__pyx_pw_3_sa_19span_inc(PyObject *__pyx_self, PyObject *__pyx_ PyObject *__pyx_v_vec = 0; PyObject *__pyx_v_i = 0; PyObject *__pyx_v_j = 0; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__vec,&__pyx_n_s__i,&__pyx_n_s__j,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("span_inc (wrapper)", 0); + __pyx_self = __pyx_self; { - 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; @@ -66023,15 +65800,18 @@ static PyObject *__pyx_pw_3_sa_19span_inc(PyObject *__pyx_self, PyObject *__pyx_ 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--; + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__vec); + if (likely(values[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--; + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__i); + if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("span_inc", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2213; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__j)) != 0)) kw_args--; + values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__j); + if (likely(values[2])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("span_inc", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2213; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -66063,7 +65843,7 @@ static PyObject *__pyx_pw_3_sa_19span_inc(PyObject *__pyx_self, PyObject *__pyx_ return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2213 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2213 * return True * * def span_inc(vec, i, j): # <<<<<<<<<<<<<< @@ -66084,7 +65864,7 @@ static PyObject *__pyx_pf_3_sa_18span_inc(CYTHON_UNUSED PyObject *__pyx_self, Py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("span_inc", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2214 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2214 * * def span_inc(vec, i, j): * k = i # <<<<<<<<<<<<<< @@ -66094,7 +65874,7 @@ static PyObject *__pyx_pf_3_sa_18span_inc(CYTHON_UNUSED PyObject *__pyx_self, Py __Pyx_INCREF(__pyx_v_i); __pyx_v_k = __pyx_v_i; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2215 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2215 * def span_inc(vec, i, j): * k = i * while k <= j: # <<<<<<<<<<<<<< @@ -66102,12 +65882,13 @@ static PyObject *__pyx_pf_3_sa_18span_inc(CYTHON_UNUSED PyObject *__pyx_self, 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 = 2215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_k, __pyx_v_j, Py_LE); 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_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_2) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2216 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2216 * k = i * while k <= j: * vec[k] += 1 # <<<<<<<<<<<<<< @@ -66125,7 +65906,7 @@ static PyObject *__pyx_pf_3_sa_18span_inc(CYTHON_UNUSED PyObject *__pyx_self, Py __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2217 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2217 * while k <= j: * vec[k] += 1 * k += 1 # <<<<<<<<<<<<<< @@ -66161,11 +65942,12 @@ static PyObject *__pyx_pw_3_sa_21span_dec(PyObject *__pyx_self, PyObject *__pyx_ PyObject *__pyx_v_vec = 0; PyObject *__pyx_v_i = 0; PyObject *__pyx_v_j = 0; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__vec,&__pyx_n_s__i,&__pyx_n_s__j,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("span_dec (wrapper)", 0); + __pyx_self = __pyx_self; { - 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; @@ -66180,15 +65962,18 @@ static PyObject *__pyx_pw_3_sa_21span_dec(PyObject *__pyx_self, PyObject *__pyx_ 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--; + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__vec); + if (likely(values[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--; + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__i); + if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("span_dec", 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--; + values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__j); + if (likely(values[2])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("span_dec", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -66220,7 +66005,7 @@ static PyObject *__pyx_pw_3_sa_21span_dec(PyObject *__pyx_self, PyObject *__pyx_ return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2219 +/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2219 * k += 1 * * def span_dec(vec, i, j): # <<<<<<<<<<<<<< @@ -66241,7 +66026,7 @@ static PyObject *__pyx_pf_3_sa_20span_dec(CYTHON_UNUSED PyObject *__pyx_self, Py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("span_dec", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2220 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2220 * * def span_dec(vec, i, j): * k = i # <<<<<<<<<<<<<< @@ -66251,7 +66036,7 @@ static PyObject *__pyx_pf_3_sa_20span_dec(CYTHON_UNUSED PyObject *__pyx_self, Py __Pyx_INCREF(__pyx_v_i); __pyx_v_k = __pyx_v_i; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2221 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2221 * def span_dec(vec, i, j): * k = i * while k <= j: # <<<<<<<<<<<<<< @@ -66259,12 +66044,13 @@ static PyObject *__pyx_pf_3_sa_20span_dec(CYTHON_UNUSED PyObject *__pyx_self, 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_1 = PyObject_RichCompare(__pyx_v_k, __pyx_v_j, Py_LE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2221; __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 = 2221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_2) break; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2222 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2222 * k = i * while k <= j: * vec[k] -= 1 # <<<<<<<<<<<<<< @@ -66281,7 +66067,7 @@ static PyObject *__pyx_pf_3_sa_20span_dec(CYTHON_UNUSED PyObject *__pyx_self, Py __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2223 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2223 * while k <= j: * vec[k] -= 1 * k += 1 # <<<<<<<<<<<<<< @@ -66322,7 +66108,7 @@ static int __pyx_pw_3_sa_13FeatureVector_1__cinit__(PyObject *__pyx_v_self, PyOb return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":7 +/* "/home/paulb/workspace/cdec/python/src/sa/features.pxi":7 * * cdef class FeatureVector: * def __cinit__(self): # <<<<<<<<<<<<<< @@ -66341,7 +66127,7 @@ static int __pyx_pf_3_sa_13FeatureVector___cinit__(struct __pyx_obj_3_sa_Feature int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":8 + /* "/home/paulb/workspace/cdec/python/src/sa/features.pxi":8 * cdef class FeatureVector: * def __cinit__(self): * self.names = IntList(INITIAL_CAPACITY, INCREMENT) # <<<<<<<<<<<<<< @@ -66369,7 +66155,7 @@ static int __pyx_pf_3_sa_13FeatureVector___cinit__(struct __pyx_obj_3_sa_Feature __pyx_v_self->names = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":9 + /* "/home/paulb/workspace/cdec/python/src/sa/features.pxi":9 * def __cinit__(self): * self.names = IntList(INITIAL_CAPACITY, INCREMENT) * self.values = FloatList(INITIAL_CAPACITY, INCREMENT) # <<<<<<<<<<<<<< @@ -66415,11 +66201,11 @@ static PyObject *__pyx_pw_3_sa_13FeatureVector_3set(PyObject *__pyx_v_self, PyOb static PyObject *__pyx_pw_3_sa_13FeatureVector_3set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { unsigned int __pyx_v_name; float __pyx_v_value; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__name,&__pyx_n_s__value,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set (wrapper)", 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; @@ -66433,10 +66219,12 @@ static PyObject *__pyx_pw_3_sa_13FeatureVector_3set(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__name)) != 0)) kw_args--; + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__name); + if (likely(values[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--; + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value); + if (likely(values[1])) 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;} } @@ -66466,7 +66254,7 @@ static PyObject *__pyx_pw_3_sa_13FeatureVector_3set(PyObject *__pyx_v_self, PyOb return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":11 +/* "/home/paulb/workspace/cdec/python/src/sa/features.pxi":11 * self.values = FloatList(INITIAL_CAPACITY, INCREMENT) * * def set(self, unsigned name, float value): # <<<<<<<<<<<<<< @@ -66484,7 +66272,7 @@ static PyObject *__pyx_pf_3_sa_13FeatureVector_2set(struct __pyx_obj_3_sa_Featur int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":12 + /* "/home/paulb/workspace/cdec/python/src/sa/features.pxi":12 * * def set(self, unsigned name, float value): * self.names.append(name) # <<<<<<<<<<<<<< @@ -66498,7 +66286,7 @@ static PyObject *__pyx_pf_3_sa_13FeatureVector_2set(struct __pyx_obj_3_sa_Featur __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":13 + /* "/home/paulb/workspace/cdec/python/src/sa/features.pxi":13 * def set(self, unsigned name, float value): * self.names.append(name) * self.values.append(value) # <<<<<<<<<<<<<< @@ -66537,7 +66325,7 @@ static PyObject *__pyx_pw_3_sa_13FeatureVector_5__iter__(PyObject *__pyx_v_self) return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":15 +/* "/home/paulb/workspace/cdec/python/src/sa/features.pxi":15 * self.values.append(value) * * def __iter__(self): # <<<<<<<<<<<<<< @@ -66603,7 +66391,7 @@ static PyObject *__pyx_gb_3_sa_13FeatureVector_6generator5(__pyx_GeneratorObject __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/pauldb/workspace/cdec/python/src/sa/features.pxi":17 + /* "/home/paulb/workspace/cdec/python/src/sa/features.pxi":17 * def __iter__(self): * cdef unsigned i * for i in range(self.names.len): # <<<<<<<<<<<<<< @@ -66614,7 +66402,7 @@ static PyObject *__pyx_gb_3_sa_13FeatureVector_6generator5(__pyx_GeneratorObject 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/pauldb/workspace/cdec/python/src/sa/features.pxi":18 + /* "/home/paulb/workspace/cdec/python/src/sa/features.pxi":18 * cdef unsigned i * for i in range(self.names.len): * yield (FD.word(self.names[i]), self.values[i]) # <<<<<<<<<<<<<< @@ -66661,7 +66449,6 @@ static PyObject *__pyx_gb_3_sa_13FeatureVector_6generator5(__pyx_GeneratorObject __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_generator->resume_label = -1; - __Pyx_Generator_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return NULL; } @@ -66678,7 +66465,7 @@ static PyObject *__pyx_pw_3_sa_13FeatureVector_8__str__(PyObject *__pyx_v_self) } static PyObject *__pyx_gb_3_sa_13FeatureVector_7__str___2generator17(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":21 +/* "/home/paulb/workspace/cdec/python/src/sa/features.pxi":21 * * def __str__(self): * return ' '.join('%s=%s' % feat for feat in self) # <<<<<<<<<<<<<< @@ -66753,18 +66540,10 @@ static PyObject *__pyx_gb_3_sa_13FeatureVector_7__str___2generator17(__pyx_Gener for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 21; __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[13]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; } 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[13]; __pyx_lineno = 21; __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[13]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { @@ -66812,12 +66591,11 @@ static PyObject *__pyx_gb_3_sa_13FeatureVector_7__str___2generator17(__pyx_Gener __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_generator->resume_label = -1; - __Pyx_Generator_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return NULL; } -/* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":20 +/* "/home/paulb/workspace/cdec/python/src/sa/features.pxi":20 * yield (FD.word(self.names[i]), self.values[i]) * * def __str__(self): # <<<<<<<<<<<<<< @@ -66846,7 +66624,7 @@ static PyObject *__pyx_pf_3_sa_13FeatureVector_7__str__(struct __pyx_obj_3_sa_Fe __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self); - /* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":21 + /* "/home/paulb/workspace/cdec/python/src/sa/features.pxi":21 * * def __str__(self): * return ' '.join('%s=%s' % feat for feat in self) # <<<<<<<<<<<<<< @@ -66902,7 +66680,7 @@ static int __pyx_pw_3_sa_6Scorer_1__init__(PyObject *__pyx_v_self, PyObject *__p return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":25 +/* "/home/paulb/workspace/cdec/python/src/sa/features.pxi":25 * cdef class Scorer: * cdef models * def __init__(self, *models): # <<<<<<<<<<<<<< @@ -66925,7 +66703,7 @@ static int __pyx_pf_3_sa_6Scorer___init__(struct __pyx_obj_3_sa_Scorer *__pyx_v_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":26 + /* "/home/paulb/workspace/cdec/python/src/sa/features.pxi":26 * cdef models * def __init__(self, *models): * names = [FD.index(model.__name__) for model in models] # <<<<<<<<<<<<<< @@ -66937,11 +66715,7 @@ static int __pyx_pf_3_sa_6Scorer___init__(struct __pyx_obj_3_sa_Scorer *__pyx_v_ __pyx_t_2 = ((PyObject *)__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 - __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[13]; __pyx_lineno = 26; __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[13]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; __Pyx_XDECREF(__pyx_v_model); __pyx_v_model = __pyx_t_4; __pyx_t_4 = 0; @@ -66951,7 +66725,7 @@ static int __pyx_pf_3_sa_6Scorer___init__(struct __pyx_obj_3_sa_Scorer *__pyx_v_ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyInt_FromLong(((struct __pyx_vtabstruct_3_sa_StringMap *)__pyx_v_3_sa_FD->__pyx_vtab)->index(__pyx_v_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_PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(PyList_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; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -66959,7 +66733,7 @@ static int __pyx_pf_3_sa_6Scorer___init__(struct __pyx_obj_3_sa_Scorer *__pyx_v_ __pyx_v_names = __pyx_t_1; __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":27 + /* "/home/paulb/workspace/cdec/python/src/sa/features.pxi":27 * def __init__(self, *models): * names = [FD.index(model.__name__) for model in models] * self.models = zip(names, models) # <<<<<<<<<<<<<< @@ -66998,7 +66772,7 @@ static int __pyx_pf_3_sa_6Scorer___init__(struct __pyx_obj_3_sa_Scorer *__pyx_v_ return __pyx_r; } -/* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":29 +/* "/home/paulb/workspace/cdec/python/src/sa/features.pxi":29 * self.models = zip(names, models) * * cdef FeatureVector score(self, ctx): # <<<<<<<<<<<<<< @@ -67025,7 +66799,7 @@ static struct __pyx_obj_3_sa_FeatureVector *__pyx_f_3_sa_6Scorer_score(struct __ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("score", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":30 + /* "/home/paulb/workspace/cdec/python/src/sa/features.pxi":30 * * cdef FeatureVector score(self, ctx): * cdef FeatureVector scores = FeatureVector() # <<<<<<<<<<<<<< @@ -67037,7 +66811,7 @@ static struct __pyx_obj_3_sa_FeatureVector *__pyx_f_3_sa_6Scorer_score(struct __ __pyx_v_scores = ((struct __pyx_obj_3_sa_FeatureVector *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":31 + /* "/home/paulb/workspace/cdec/python/src/sa/features.pxi":31 * cdef FeatureVector score(self, ctx): * cdef FeatureVector scores = FeatureVector() * for name, model in self.models: # <<<<<<<<<<<<<< @@ -67055,18 +66829,10 @@ static struct __pyx_obj_3_sa_FeatureVector *__pyx_f_3_sa_6Scorer_score(struct __ for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 31; __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[13]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; } 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[13]; __pyx_lineno = 31; __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[13]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { @@ -67080,33 +66846,27 @@ static struct __pyx_obj_3_sa_FeatureVector *__pyx_f_3_sa_6Scorer_score(struct __ } if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { PyObject* sequence = __pyx_t_4; - #if CYTHON_COMPILING_IN_CPYTHON - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[13]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { + if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { + if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); + else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[13]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { + if (unlikely(PyList_GET_SIZE(sequence) != 2)) { + if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); + else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); + {__pyx_filename = __pyx_f[13]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); - #else - __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } else - { + } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); @@ -67117,13 +66877,12 @@ static struct __pyx_obj_3_sa_FeatureVector *__pyx_f_3_sa_6Scorer_score(struct __ index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_8 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); + if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[13]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L6_unpacking_done:; } @@ -67134,7 +66893,7 @@ static struct __pyx_obj_3_sa_FeatureVector *__pyx_f_3_sa_6Scorer_score(struct __ __pyx_v_model = __pyx_t_6; __pyx_t_6 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":32 + /* "/home/paulb/workspace/cdec/python/src/sa/features.pxi":32 * cdef FeatureVector scores = FeatureVector() * for name, model in self.models: * scores.set(name, model(ctx)) # <<<<<<<<<<<<<< @@ -67166,7 +66925,7 @@ static struct __pyx_obj_3_sa_FeatureVector *__pyx_f_3_sa_6Scorer_score(struct __ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":33 + /* "/home/paulb/workspace/cdec/python/src/sa/features.pxi":33 * for name, model in self.models: * scores.set(name, model(ctx)) * return scores # <<<<<<<<<<<<<< @@ -67612,7 +67371,7 @@ static PyTypeObject __pyx_type_3_sa_IntList = { #endif }; -static PyObject *__pyx_tp_new_3_sa_FeatureVector(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_3_sa_FeatureVector(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_3_sa_FeatureVector *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -67627,8 +67386,8 @@ static PyObject *__pyx_tp_new_3_sa_FeatureVector(PyTypeObject *t, CYTHON_UNUSED static void __pyx_tp_dealloc_3_sa_FeatureVector(PyObject *o) { struct __pyx_obj_3_sa_FeatureVector *p = (struct __pyx_obj_3_sa_FeatureVector *)o; - Py_CLEAR(p->names); - Py_CLEAR(p->values); + Py_XDECREF(((PyObject *)p->names)); + Py_XDECREF(((PyObject *)p->values)); (*Py_TYPE(o)->tp_free)(o); } @@ -67848,7 +67607,7 @@ static PyObject *__pyx_sq_item_3_sa_Phrase(PyObject *o, Py_ssize_t i) { return r; } -static PyObject *__pyx_getprop_3_sa_6Phrase_words(PyObject *o, CYTHON_UNUSED void *x) { +static PyObject *__pyx_getprop_3_sa_6Phrase_words(PyObject *o, void *x) { return __pyx_pw_3_sa_6Phrase_5words_1__get__(o); } @@ -68040,10 +67799,10 @@ static PyObject *__pyx_tp_new_3_sa_Rule(PyTypeObject *t, PyObject *a, PyObject * static void __pyx_tp_dealloc_3_sa_Rule(PyObject *o) { struct __pyx_obj_3_sa_Rule *p = (struct __pyx_obj_3_sa_Rule *)o; - Py_CLEAR(p->f); - Py_CLEAR(p->e); - Py_CLEAR(p->scores); - Py_CLEAR(p->word_alignments); + Py_XDECREF(((PyObject *)p->f)); + Py_XDECREF(((PyObject *)p->e)); + Py_XDECREF(((PyObject *)p->scores)); + Py_XDECREF(p->word_alignments); (*Py_TYPE(o)->tp_free)(o); } @@ -68083,11 +67842,11 @@ static int __pyx_tp_clear_3_sa_Rule(PyObject *o) { return 0; } -static PyObject *__pyx_getprop_3_sa_4Rule_f(PyObject *o, CYTHON_UNUSED void *x) { +static PyObject *__pyx_getprop_3_sa_4Rule_f(PyObject *o, void *x) { return __pyx_pw_3_sa_4Rule_1f_1__get__(o); } -static PyObject *__pyx_getprop_3_sa_4Rule_e(PyObject *o, CYTHON_UNUSED void *x) { +static PyObject *__pyx_getprop_3_sa_4Rule_e(PyObject *o, void *x) { return __pyx_pw_3_sa_4Rule_1e_1__get__(o); } @@ -68259,7 +68018,7 @@ static PyTypeObject __pyx_type_3_sa_Rule = { }; static struct __pyx_vtabstruct_3_sa_StringMap __pyx_vtable_3_sa_StringMap; -static PyObject *__pyx_tp_new_3_sa_StringMap(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_3_sa_StringMap(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_3_sa_StringMap *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -68462,11 +68221,11 @@ static PyObject *__pyx_tp_new_3_sa_DataArray(PyTypeObject *t, PyObject *a, PyObj static void __pyx_tp_dealloc_3_sa_DataArray(PyObject *o) { struct __pyx_obj_3_sa_DataArray *p = (struct __pyx_obj_3_sa_DataArray *)o; - Py_CLEAR(p->word2id); - Py_CLEAR(p->id2word); - Py_CLEAR(p->data); - Py_CLEAR(p->sent_id); - Py_CLEAR(p->sent_index); + Py_XDECREF(p->word2id); + Py_XDECREF(p->id2word); + Py_XDECREF(((PyObject *)p->data)); + Py_XDECREF(((PyObject *)p->sent_id)); + Py_XDECREF(((PyObject *)p->sent_index)); (*Py_TYPE(o)->tp_free)(o); } @@ -68519,11 +68278,11 @@ static PyObject *__pyx_sq_item_3_sa_DataArray(PyObject *o, Py_ssize_t i) { return r; } -static PyObject *__pyx_getprop_3_sa_9DataArray_word2id(PyObject *o, CYTHON_UNUSED void *x) { +static PyObject *__pyx_getprop_3_sa_9DataArray_word2id(PyObject *o, void *x) { return __pyx_pw_3_sa_9DataArray_7word2id_1__get__(o); } -static int __pyx_setprop_3_sa_9DataArray_word2id(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { +static int __pyx_setprop_3_sa_9DataArray_word2id(PyObject *o, PyObject *v, void *x) { if (v) { return __pyx_pw_3_sa_9DataArray_7word2id_3__set__(o, v); } @@ -68532,11 +68291,11 @@ static int __pyx_setprop_3_sa_9DataArray_word2id(PyObject *o, PyObject *v, CYTHO } } -static PyObject *__pyx_getprop_3_sa_9DataArray_id2word(PyObject *o, CYTHON_UNUSED void *x) { +static PyObject *__pyx_getprop_3_sa_9DataArray_id2word(PyObject *o, void *x) { return __pyx_pw_3_sa_9DataArray_7id2word_1__get__(o); } -static int __pyx_setprop_3_sa_9DataArray_id2word(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { +static int __pyx_setprop_3_sa_9DataArray_id2word(PyObject *o, PyObject *v, void *x) { if (v) { return __pyx_pw_3_sa_9DataArray_7id2word_3__set__(o, v); } @@ -68545,11 +68304,11 @@ static int __pyx_setprop_3_sa_9DataArray_id2word(PyObject *o, PyObject *v, CYTHO } } -static PyObject *__pyx_getprop_3_sa_9DataArray_data(PyObject *o, CYTHON_UNUSED void *x) { +static PyObject *__pyx_getprop_3_sa_9DataArray_data(PyObject *o, void *x) { return __pyx_pw_3_sa_9DataArray_4data_1__get__(o); } -static int __pyx_setprop_3_sa_9DataArray_data(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { +static int __pyx_setprop_3_sa_9DataArray_data(PyObject *o, PyObject *v, void *x) { if (v) { return __pyx_pw_3_sa_9DataArray_4data_3__set__(o, v); } @@ -68558,11 +68317,11 @@ static int __pyx_setprop_3_sa_9DataArray_data(PyObject *o, PyObject *v, CYTHON_U } } -static PyObject *__pyx_getprop_3_sa_9DataArray_sent_id(PyObject *o, CYTHON_UNUSED void *x) { +static PyObject *__pyx_getprop_3_sa_9DataArray_sent_id(PyObject *o, void *x) { return __pyx_pw_3_sa_9DataArray_7sent_id_1__get__(o); } -static int __pyx_setprop_3_sa_9DataArray_sent_id(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { +static int __pyx_setprop_3_sa_9DataArray_sent_id(PyObject *o, PyObject *v, void *x) { if (v) { return __pyx_pw_3_sa_9DataArray_7sent_id_3__set__(o, v); } @@ -68571,11 +68330,11 @@ static int __pyx_setprop_3_sa_9DataArray_sent_id(PyObject *o, PyObject *v, CYTHO } } -static PyObject *__pyx_getprop_3_sa_9DataArray_sent_index(PyObject *o, CYTHON_UNUSED void *x) { +static PyObject *__pyx_getprop_3_sa_9DataArray_sent_index(PyObject *o, void *x) { return __pyx_pw_3_sa_9DataArray_10sent_index_1__get__(o); } -static int __pyx_setprop_3_sa_9DataArray_sent_index(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { +static int __pyx_setprop_3_sa_9DataArray_sent_index(PyObject *o, PyObject *v, void *x) { if (v) { return __pyx_pw_3_sa_9DataArray_10sent_index_3__set__(o, v); } @@ -68780,8 +68539,8 @@ static PyObject *__pyx_tp_new_3_sa_Alignment(PyTypeObject *t, PyObject *a, PyObj static void __pyx_tp_dealloc_3_sa_Alignment(PyObject *o) { struct __pyx_obj_3_sa_Alignment *p = (struct __pyx_obj_3_sa_Alignment *)o; - Py_CLEAR(p->links); - Py_CLEAR(p->sent_index); + Py_XDECREF(((PyObject *)p->links)); + Py_XDECREF(((PyObject *)p->sent_index)); (*Py_TYPE(o)->tp_free)(o); } @@ -68998,14 +68757,14 @@ static PyObject *__pyx_tp_new_3_sa_BiLex(PyTypeObject *t, PyObject *a, PyObject static void __pyx_tp_dealloc_3_sa_BiLex(PyObject *o) { struct __pyx_obj_3_sa_BiLex *p = (struct __pyx_obj_3_sa_BiLex *)o; - Py_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_XDECREF(((PyObject *)p->col1)); + Py_XDECREF(((PyObject *)p->col2)); + Py_XDECREF(((PyObject *)p->f_index)); + Py_XDECREF(((PyObject *)p->e_index)); + Py_XDECREF(p->id2eword); + Py_XDECREF(p->id2fword); + Py_XDECREF(p->eword2id); + Py_XDECREF(p->fword2id); (*Py_TYPE(o)->tp_free)(o); } @@ -69235,7 +68994,7 @@ static PyTypeObject __pyx_type_3_sa_BiLex = { #endif }; -static PyObject *__pyx_tp_new_3_sa_BitSetIterator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_3_sa_BitSetIterator(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; return o; @@ -69404,7 +69163,7 @@ static PyTypeObject __pyx_type_3_sa_BitSetIterator = { #endif }; -static PyObject *__pyx_tp_new_3_sa_BitSet(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_3_sa_BitSet(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; if (__pyx_pw_3_sa_6BitSet_1__cinit__(o, __pyx_empty_tuple, NULL) < 0) { @@ -69588,7 +69347,7 @@ static PyTypeObject __pyx_type_3_sa_BitSet = { #endif }; -static PyObject *__pyx_tp_new_3_sa_VEBIterator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_3_sa_VEBIterator(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; return o; @@ -69958,8 +69717,8 @@ static PyObject *__pyx_tp_new_3_sa_LCP(PyTypeObject *t, PyObject *a, PyObject *k static void __pyx_tp_dealloc_3_sa_LCP(PyObject *o) { struct __pyx_obj_3_sa_LCP *p = (struct __pyx_obj_3_sa_LCP *)o; - Py_CLEAR(p->sa); - Py_CLEAR(p->lcp); + Py_XDECREF(((PyObject *)p->sa)); + Py_XDECREF(((PyObject *)p->lcp)); (*Py_TYPE(o)->tp_free)(o); } @@ -70147,7 +69906,7 @@ static PyTypeObject __pyx_type_3_sa_LCP = { }; static struct __pyx_vtabstruct_3_sa_Alphabet __pyx_vtable_3_sa_Alphabet; -static PyObject *__pyx_tp_new_3_sa_Alphabet(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_3_sa_Alphabet(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_3_sa_Alphabet *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -70173,9 +69932,9 @@ static void __pyx_tp_dealloc_3_sa_Alphabet(PyObject *o) { --Py_REFCNT(o); PyErr_Restore(etype, eval, etb); } - Py_CLEAR(p->terminals); - Py_CLEAR(p->nonterminals); - Py_CLEAR(p->id2sym); + Py_XDECREF(((PyObject *)p->terminals)); + Py_XDECREF(((PyObject *)p->nonterminals)); + Py_XDECREF(((PyObject *)p->id2sym)); (*Py_TYPE(o)->tp_free)(o); } @@ -70209,11 +69968,11 @@ static int __pyx_tp_clear_3_sa_Alphabet(PyObject *o) { return 0; } -static PyObject *__pyx_getprop_3_sa_8Alphabet_terminals(PyObject *o, CYTHON_UNUSED void *x) { +static PyObject *__pyx_getprop_3_sa_8Alphabet_terminals(PyObject *o, void *x) { return __pyx_pw_3_sa_8Alphabet_9terminals_1__get__(o); } -static PyObject *__pyx_getprop_3_sa_8Alphabet_nonterminals(PyObject *o, CYTHON_UNUSED void *x) { +static PyObject *__pyx_getprop_3_sa_8Alphabet_nonterminals(PyObject *o, void *x) { return __pyx_pw_3_sa_8Alphabet_12nonterminals_1__get__(o); } @@ -70585,8 +70344,8 @@ static PyObject *__pyx_tp_new_3_sa_Precomputation(PyTypeObject *t, PyObject *a, static void __pyx_tp_dealloc_3_sa_Precomputation(PyObject *o) { struct __pyx_obj_3_sa_Precomputation *p = (struct __pyx_obj_3_sa_Precomputation *)o; - Py_CLEAR(p->precomputed_index); - Py_CLEAR(p->precomputed_collocations); + Py_XDECREF(p->precomputed_index); + Py_XDECREF(p->precomputed_collocations); (*Py_TYPE(o)->tp_free)(o); } @@ -70793,9 +70552,9 @@ static PyObject *__pyx_tp_new_3_sa_SuffixArray(PyTypeObject *t, PyObject *a, PyO static void __pyx_tp_dealloc_3_sa_SuffixArray(PyObject *o) { struct __pyx_obj_3_sa_SuffixArray *p = (struct __pyx_obj_3_sa_SuffixArray *)o; - Py_CLEAR(p->darray); - Py_CLEAR(p->sa); - Py_CLEAR(p->ha); + Py_XDECREF(((PyObject *)p->darray)); + Py_XDECREF(((PyObject *)p->sa)); + Py_XDECREF(((PyObject *)p->ha)); (*Py_TYPE(o)->tp_free)(o); } @@ -71001,7 +70760,7 @@ static PyTypeObject __pyx_type_3_sa_SuffixArray = { #endif }; -static PyObject *__pyx_tp_new_3_sa_TrieNode(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_3_sa_TrieNode(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_3_sa_TrieNode *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -71015,7 +70774,7 @@ static PyObject *__pyx_tp_new_3_sa_TrieNode(PyTypeObject *t, CYTHON_UNUSED PyObj static void __pyx_tp_dealloc_3_sa_TrieNode(PyObject *o) { struct __pyx_obj_3_sa_TrieNode *p = (struct __pyx_obj_3_sa_TrieNode *)o; - Py_CLEAR(p->children); + Py_XDECREF(p->children); (*Py_TYPE(o)->tp_free)(o); } @@ -71037,11 +70796,11 @@ static int __pyx_tp_clear_3_sa_TrieNode(PyObject *o) { return 0; } -static PyObject *__pyx_getprop_3_sa_8TrieNode_children(PyObject *o, CYTHON_UNUSED void *x) { +static PyObject *__pyx_getprop_3_sa_8TrieNode_children(PyObject *o, void *x) { return __pyx_pw_3_sa_8TrieNode_8children_1__get__(o); } -static int __pyx_setprop_3_sa_8TrieNode_children(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { +static int __pyx_setprop_3_sa_8TrieNode_children(PyObject *o, PyObject *v, void *x) { if (v) { return __pyx_pw_3_sa_8TrieNode_8children_3__set__(o, v); } @@ -71229,9 +70988,9 @@ static PyObject *__pyx_tp_new_3_sa_ExtendedTrieNode(PyTypeObject *t, PyObject *a static void __pyx_tp_dealloc_3_sa_ExtendedTrieNode(PyObject *o) { struct __pyx_obj_3_sa_ExtendedTrieNode *p = (struct __pyx_obj_3_sa_ExtendedTrieNode *)o; - Py_CLEAR(p->phrase); - Py_CLEAR(p->phrase_location); - Py_CLEAR(p->suffix_link); + Py_XDECREF(p->phrase); + Py_XDECREF(p->phrase_location); + Py_XDECREF(p->suffix_link); __pyx_tp_dealloc_3_sa_TrieNode(o); } @@ -71267,11 +71026,11 @@ static int __pyx_tp_clear_3_sa_ExtendedTrieNode(PyObject *o) { return 0; } -static PyObject *__pyx_getprop_3_sa_16ExtendedTrieNode_phrase(PyObject *o, CYTHON_UNUSED void *x) { +static PyObject *__pyx_getprop_3_sa_16ExtendedTrieNode_phrase(PyObject *o, void *x) { return __pyx_pw_3_sa_16ExtendedTrieNode_6phrase_1__get__(o); } -static int __pyx_setprop_3_sa_16ExtendedTrieNode_phrase(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { +static int __pyx_setprop_3_sa_16ExtendedTrieNode_phrase(PyObject *o, PyObject *v, void *x) { if (v) { return __pyx_pw_3_sa_16ExtendedTrieNode_6phrase_3__set__(o, v); } @@ -71280,11 +71039,11 @@ static int __pyx_setprop_3_sa_16ExtendedTrieNode_phrase(PyObject *o, PyObject *v } } -static PyObject *__pyx_getprop_3_sa_16ExtendedTrieNode_phrase_location(PyObject *o, CYTHON_UNUSED void *x) { +static PyObject *__pyx_getprop_3_sa_16ExtendedTrieNode_phrase_location(PyObject *o, void *x) { return __pyx_pw_3_sa_16ExtendedTrieNode_15phrase_location_1__get__(o); } -static int __pyx_setprop_3_sa_16ExtendedTrieNode_phrase_location(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { +static int __pyx_setprop_3_sa_16ExtendedTrieNode_phrase_location(PyObject *o, PyObject *v, void *x) { if (v) { return __pyx_pw_3_sa_16ExtendedTrieNode_15phrase_location_3__set__(o, v); } @@ -71293,11 +71052,11 @@ static int __pyx_setprop_3_sa_16ExtendedTrieNode_phrase_location(PyObject *o, Py } } -static PyObject *__pyx_getprop_3_sa_16ExtendedTrieNode_suffix_link(PyObject *o, CYTHON_UNUSED void *x) { +static PyObject *__pyx_getprop_3_sa_16ExtendedTrieNode_suffix_link(PyObject *o, void *x) { return __pyx_pw_3_sa_16ExtendedTrieNode_11suffix_link_1__get__(o); } -static int __pyx_setprop_3_sa_16ExtendedTrieNode_suffix_link(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { +static int __pyx_setprop_3_sa_16ExtendedTrieNode_suffix_link(PyObject *o, PyObject *v, void *x) { if (v) { return __pyx_pw_3_sa_16ExtendedTrieNode_11suffix_link_3__set__(o, v); } @@ -71485,7 +71244,7 @@ static PyObject *__pyx_tp_new_3_sa_TrieTable(PyTypeObject *t, PyObject *a, PyObj static void __pyx_tp_dealloc_3_sa_TrieTable(PyObject *o) { struct __pyx_obj_3_sa_TrieTable *p = (struct __pyx_obj_3_sa_TrieTable *)o; - Py_CLEAR(p->root); + Py_XDECREF(p->root); (*Py_TYPE(o)->tp_free)(o); } @@ -71507,11 +71266,11 @@ static int __pyx_tp_clear_3_sa_TrieTable(PyObject *o) { return 0; } -static PyObject *__pyx_getprop_3_sa_9TrieTable_extended(PyObject *o, CYTHON_UNUSED void *x) { +static PyObject *__pyx_getprop_3_sa_9TrieTable_extended(PyObject *o, void *x) { return __pyx_pw_3_sa_9TrieTable_8extended_1__get__(o); } -static int __pyx_setprop_3_sa_9TrieTable_extended(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { +static int __pyx_setprop_3_sa_9TrieTable_extended(PyObject *o, PyObject *v, void *x) { if (v) { return __pyx_pw_3_sa_9TrieTable_8extended_3__set__(o, v); } @@ -71521,11 +71280,11 @@ static int __pyx_setprop_3_sa_9TrieTable_extended(PyObject *o, PyObject *v, CYTH } } -static PyObject *__pyx_getprop_3_sa_9TrieTable_count(PyObject *o, CYTHON_UNUSED void *x) { +static PyObject *__pyx_getprop_3_sa_9TrieTable_count(PyObject *o, void *x) { return __pyx_pw_3_sa_9TrieTable_5count_1__get__(o); } -static int __pyx_setprop_3_sa_9TrieTable_count(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { +static int __pyx_setprop_3_sa_9TrieTable_count(PyObject *o, PyObject *v, void *x) { if (v) { return __pyx_pw_3_sa_9TrieTable_5count_3__set__(o, v); } @@ -71535,11 +71294,11 @@ static int __pyx_setprop_3_sa_9TrieTable_count(PyObject *o, PyObject *v, CYTHON_ } } -static PyObject *__pyx_getprop_3_sa_9TrieTable_root(PyObject *o, CYTHON_UNUSED void *x) { +static PyObject *__pyx_getprop_3_sa_9TrieTable_root(PyObject *o, void *x) { return __pyx_pw_3_sa_9TrieTable_4root_1__get__(o); } -static int __pyx_setprop_3_sa_9TrieTable_root(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { +static int __pyx_setprop_3_sa_9TrieTable_root(PyObject *o, PyObject *v, void *x) { if (v) { return __pyx_pw_3_sa_9TrieTable_4root_3__set__(o, v); } @@ -71729,7 +71488,7 @@ static PyObject *__pyx_tp_new_3_sa_PhraseLocation(PyTypeObject *t, PyObject *a, static void __pyx_tp_dealloc_3_sa_PhraseLocation(PyObject *o) { struct __pyx_obj_3_sa_PhraseLocation *p = (struct __pyx_obj_3_sa_PhraseLocation *)o; - Py_CLEAR(p->arr); + Py_XDECREF(((PyObject *)p->arr)); (*Py_TYPE(o)->tp_free)(o); } @@ -71923,7 +71682,7 @@ static PyObject *__pyx_tp_new_3_sa_Sampler(PyTypeObject *t, PyObject *a, PyObjec static void __pyx_tp_dealloc_3_sa_Sampler(PyObject *o) { struct __pyx_obj_3_sa_Sampler *p = (struct __pyx_obj_3_sa_Sampler *)o; - Py_CLEAR(p->sa); + Py_XDECREF(((PyObject *)p->sa)); (*Py_TYPE(o)->tp_free)(o); } @@ -72143,30 +71902,30 @@ static PyObject *__pyx_tp_new_3_sa_HieroCachingRuleFactory(PyTypeObject *t, PyOb static void __pyx_tp_dealloc_3_sa_HieroCachingRuleFactory(PyObject *o) { struct __pyx_obj_3_sa_HieroCachingRuleFactory *p = (struct __pyx_obj_3_sa_HieroCachingRuleFactory *)o; - Py_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->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->bilex_f); - Py_CLEAR(p->bilex_e); - Py_CLEAR(p->bilex_fe); + Py_XDECREF(((PyObject *)p->rules)); + Py_XDECREF(((PyObject *)p->sampler)); + Py_XDECREF(((PyObject *)p->scorer)); + Py_XDECREF(p->precomputed_index); + Py_XDECREF(p->precomputed_collocations); + Py_XDECREF(p->precompute_file); + Py_XDECREF(p->max_rank); + Py_XDECREF(p->prev_norm_prefix); + Py_XDECREF(((PyObject *)p->fsa)); + Py_XDECREF(((PyObject *)p->fda)); + Py_XDECREF(((PyObject *)p->eda)); + Py_XDECREF(((PyObject *)p->alignment)); + Py_XDECREF(((PyObject *)p->eid2symid)); + Py_XDECREF(((PyObject *)p->fid2symid)); + Py_XDECREF(((PyObject *)p->findexes)); + Py_XDECREF(((PyObject *)p->findexes1)); + Py_XDECREF(p->samples_f); + Py_XDECREF(p->phrases_f); + Py_XDECREF(p->phrases_e); + Py_XDECREF(p->phrases_fe); + Py_XDECREF(p->phrases_al); + Py_XDECREF(p->bilex_f); + Py_XDECREF(p->bilex_e); + Py_XDECREF(p->bilex_fe); (*Py_TYPE(o)->tp_free)(o); } @@ -72503,7 +72262,7 @@ static PyTypeObject __pyx_type_3_sa_HieroCachingRuleFactory = { }; static struct __pyx_vtabstruct_3_sa_Scorer __pyx_vtable_3_sa_Scorer; -static PyObject *__pyx_tp_new_3_sa_Scorer(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_3_sa_Scorer(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_3_sa_Scorer *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -72515,7 +72274,7 @@ static PyObject *__pyx_tp_new_3_sa_Scorer(PyTypeObject *t, CYTHON_UNUSED PyObjec static void __pyx_tp_dealloc_3_sa_Scorer(PyObject *o) { struct __pyx_obj_3_sa_Scorer *p = (struct __pyx_obj_3_sa_Scorer *)o; - Py_CLEAR(p->models); + Py_XDECREF(p->models); (*Py_TYPE(o)->tp_free)(o); } @@ -72695,7 +72454,7 @@ static PyTypeObject __pyx_type_3_sa_Scorer = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct____iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct____iter__(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct____iter__ *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -72706,7 +72465,7 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct____iter__(PyTypeObject *t, static void __pyx_tp_dealloc_3_sa___pyx_scope_struct____iter__(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct____iter__ *p = (struct __pyx_obj_3_sa___pyx_scope_struct____iter__ *)o; - Py_CLEAR(p->__pyx_v_self); + Py_XDECREF(((PyObject *)p->__pyx_v_self)); (*Py_TYPE(o)->tp_free)(o); } @@ -72886,7 +72645,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct____iter__ = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_1_read_bitext(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_1_read_bitext(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_1_read_bitext *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -72897,7 +72656,7 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_1_read_bitext(PyTypeObject static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_1_read_bitext(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_1_read_bitext *p = (struct __pyx_obj_3_sa___pyx_scope_struct_1_read_bitext *)o; - Py_CLEAR(p->__pyx_v_fp); + Py_XDECREF(p->__pyx_v_fp); (*Py_TYPE(o)->tp_free)(o); } @@ -73077,7 +72836,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_1_read_bitext = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_2_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_2_genexpr(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_2_genexpr *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -73090,9 +72849,9 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_2_genexpr(PyTypeObject *t, static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_2_genexpr(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_3_sa___pyx_scope_struct_2_genexpr *)o; - Py_CLEAR(p->__pyx_outer_scope); - Py_CLEAR(p->__pyx_v_line); - Py_CLEAR(p->__pyx_t_0); + Py_XDECREF(((PyObject *)p->__pyx_outer_scope)); + Py_XDECREF(p->__pyx_v_line); + Py_XDECREF(p->__pyx_t_0); (*Py_TYPE(o)->tp_free)(o); } @@ -73284,7 +73043,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_2_genexpr = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_3_compute_stats(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_3_compute_stats(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_3_compute_stats *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -73300,12 +73059,12 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_3_compute_stats(PyTypeObje static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_3_compute_stats(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_3_compute_stats *p = (struct __pyx_obj_3_sa___pyx_scope_struct_3_compute_stats *)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); + Py_XDECREF(((PyObject *)p->__pyx_v_ngram)); + Py_XDECREF(((PyObject *)p->__pyx_v_ngram_start)); + Py_XDECREF(((PyObject *)p->__pyx_v_ngram_starts)); + Py_XDECREF(((PyObject *)p->__pyx_v_run_start)); + Py_XDECREF(((PyObject *)p->__pyx_v_self)); + Py_XDECREF(((PyObject *)p->__pyx_v_veb)); (*Py_TYPE(o)->tp_free)(o); } @@ -73515,7 +73274,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_3_compute_stats = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_4_make_lattice(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_4_make_lattice(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_4_make_lattice *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -73527,8 +73286,8 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_4_make_lattice(PyTypeObjec static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_4_make_lattice(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_4_make_lattice *p = (struct __pyx_obj_3_sa___pyx_scope_struct_4_make_lattice *)o; - Py_CLEAR(p->__pyx_v_word_ids); - Py_CLEAR(p->__pyx_v_words); + Py_XDECREF(p->__pyx_v_word_ids); + Py_XDECREF(p->__pyx_v_words); (*Py_TYPE(o)->tp_free)(o); } @@ -73714,7 +73473,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_4_make_lattice = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_5_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_5_genexpr(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_5_genexpr *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -73727,9 +73486,9 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_5_genexpr(PyTypeObject *t, static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_5_genexpr(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_3_sa___pyx_scope_struct_5_genexpr *)o; - Py_CLEAR(p->__pyx_outer_scope); - Py_CLEAR(p->__pyx_v_word); - Py_CLEAR(p->__pyx_t_0); + Py_XDECREF(((PyObject *)p->__pyx_outer_scope)); + Py_XDECREF(p->__pyx_v_word); + Py_XDECREF(p->__pyx_t_0); (*Py_TYPE(o)->tp_free)(o); } @@ -73921,7 +73680,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_5_genexpr = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_6_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_6_genexpr(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_6_genexpr *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -73934,9 +73693,9 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_6_genexpr(PyTypeObject *t, static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_6_genexpr(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_3_sa___pyx_scope_struct_6_genexpr *)o; - Py_CLEAR(p->__pyx_outer_scope); - Py_CLEAR(p->__pyx_v_word); - Py_CLEAR(p->__pyx_t_0); + Py_XDECREF(((PyObject *)p->__pyx_outer_scope)); + Py_XDECREF(p->__pyx_v_word); + Py_XDECREF(p->__pyx_t_0); (*Py_TYPE(o)->tp_free)(o); } @@ -74128,7 +73887,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_6_genexpr = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_7_decode_lattice(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_7_decode_lattice(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_7_decode_lattice *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -74139,7 +73898,7 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_7_decode_lattice(PyTypeObj static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_7_decode_lattice(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_7_decode_lattice *p = (struct __pyx_obj_3_sa___pyx_scope_struct_7_decode_lattice *)o; - Py_CLEAR(p->__pyx_v_lattice); + Py_XDECREF(p->__pyx_v_lattice); (*Py_TYPE(o)->tp_free)(o); } @@ -74319,7 +74078,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_7_decode_lattice = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_8_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_8_genexpr(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_8_genexpr *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -74338,15 +74097,15 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_8_genexpr(PyTypeObject *t, static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_8_genexpr(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_8_genexpr *p = (struct __pyx_obj_3_sa___pyx_scope_struct_8_genexpr *)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); + Py_XDECREF(((PyObject *)p->__pyx_outer_scope)); + Py_XDECREF(p->__pyx_v_arc); + Py_XDECREF(p->__pyx_v_dist); + Py_XDECREF(p->__pyx_v_node); + Py_XDECREF(p->__pyx_v_sym); + Py_XDECREF(p->__pyx_v_weight); + Py_XDECREF(p->__pyx_t_0); + Py_XDECREF(p->__pyx_t_3); + Py_XDECREF(p->__pyx_t_4); (*Py_TYPE(o)->tp_free)(o); } @@ -74574,7 +74333,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_8_genexpr = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_9_decode_sentence(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_9_decode_sentence(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_9_decode_sentence *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -74585,7 +74344,7 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_9_decode_sentence(PyTypeOb static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_9_decode_sentence(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_9_decode_sentence *p = (struct __pyx_obj_3_sa___pyx_scope_struct_9_decode_sentence *)o; - Py_CLEAR(p->__pyx_v_lattice); + Py_XDECREF(p->__pyx_v_lattice); (*Py_TYPE(o)->tp_free)(o); } @@ -74765,7 +74524,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_9_decode_sentence = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_10_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_10_genexpr(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_10_genexpr *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -74779,10 +74538,10 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_10_genexpr(PyTypeObject *t static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_10_genexpr(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_10_genexpr *p = (struct __pyx_obj_3_sa___pyx_scope_struct_10_genexpr *)o; - Py_CLEAR(p->__pyx_outer_scope); - Py_CLEAR(p->__pyx_v__); - Py_CLEAR(p->__pyx_v_sym); - Py_CLEAR(p->__pyx_t_0); + Py_XDECREF(((PyObject *)p->__pyx_outer_scope)); + Py_XDECREF(p->__pyx_v__); + Py_XDECREF(p->__pyx_v_sym); + Py_XDECREF(p->__pyx_t_0); (*Py_TYPE(o)->tp_free)(o); } @@ -74980,7 +74739,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_10_genexpr = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_11_encode_words(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_11_encode_words(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_11_encode_words *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -74991,7 +74750,7 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_11_encode_words(PyTypeObje static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_11_encode_words(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_11_encode_words *p = (struct __pyx_obj_3_sa___pyx_scope_struct_11_encode_words *)o; - Py_CLEAR(p->__pyx_v_words); + Py_XDECREF(p->__pyx_v_words); (*Py_TYPE(o)->tp_free)(o); } @@ -75171,7 +74930,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_11_encode_words = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_12_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_12_genexpr(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_12_genexpr *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -75184,9 +74943,9 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_12_genexpr(PyTypeObject *t static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_12_genexpr(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_12_genexpr *p = (struct __pyx_obj_3_sa___pyx_scope_struct_12_genexpr *)o; - Py_CLEAR(p->__pyx_outer_scope); - Py_CLEAR(p->__pyx_v_word); - Py_CLEAR(p->__pyx_t_0); + Py_XDECREF(((PyObject *)p->__pyx_outer_scope)); + Py_XDECREF(p->__pyx_v_word); + Py_XDECREF(p->__pyx_t_0); (*Py_TYPE(o)->tp_free)(o); } @@ -75378,7 +75137,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_12_genexpr = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_13_decode_words(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_13_decode_words(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_13_decode_words *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -75389,7 +75148,7 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_13_decode_words(PyTypeObje static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_13_decode_words(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_13_decode_words *p = (struct __pyx_obj_3_sa___pyx_scope_struct_13_decode_words *)o; - Py_CLEAR(p->__pyx_v_syms); + Py_XDECREF(p->__pyx_v_syms); (*Py_TYPE(o)->tp_free)(o); } @@ -75569,7 +75328,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_13_decode_words = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_14_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_14_genexpr(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_14_genexpr *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -75582,9 +75341,9 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_14_genexpr(PyTypeObject *t static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_14_genexpr(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_14_genexpr *p = (struct __pyx_obj_3_sa___pyx_scope_struct_14_genexpr *)o; - Py_CLEAR(p->__pyx_outer_scope); - Py_CLEAR(p->__pyx_v_sym); - Py_CLEAR(p->__pyx_t_0); + Py_XDECREF(((PyObject *)p->__pyx_outer_scope)); + Py_XDECREF(p->__pyx_v_sym); + Py_XDECREF(p->__pyx_t_0); (*Py_TYPE(o)->tp_free)(o); } @@ -75776,7 +75535,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_14_genexpr = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_15___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_15___iter__(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_15___iter__ *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -75787,7 +75546,7 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_15___iter__(PyTypeObject * static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_15___iter__(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_15___iter__ *p = (struct __pyx_obj_3_sa___pyx_scope_struct_15___iter__ *)o; - Py_CLEAR(p->__pyx_v_self); + Py_XDECREF(((PyObject *)p->__pyx_v_self)); (*Py_TYPE(o)->tp_free)(o); } @@ -75967,7 +75726,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_15___iter__ = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_16___str__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_16___str__(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_16___str__ *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -75978,7 +75737,7 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_16___str__(PyTypeObject *t static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_16___str__(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_16___str__ *p = (struct __pyx_obj_3_sa___pyx_scope_struct_16___str__ *)o; - Py_CLEAR(p->__pyx_v_self); + Py_XDECREF(((PyObject *)p->__pyx_v_self)); (*Py_TYPE(o)->tp_free)(o); } @@ -76158,7 +75917,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_16___str__ = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_17_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_17_genexpr(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_17_genexpr *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -76171,9 +75930,9 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_17_genexpr(PyTypeObject *t static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_17_genexpr(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_17_genexpr *p = (struct __pyx_obj_3_sa___pyx_scope_struct_17_genexpr *)o; - Py_CLEAR(p->__pyx_outer_scope); - Py_CLEAR(p->__pyx_v_a); - Py_CLEAR(p->__pyx_t_0); + Py_XDECREF(((PyObject *)p->__pyx_outer_scope)); + Py_XDECREF(p->__pyx_v_a); + Py_XDECREF(p->__pyx_t_0); (*Py_TYPE(o)->tp_free)(o); } @@ -76365,7 +76124,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_17_genexpr = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_18_alignments(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_18_alignments(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_18_alignments *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -76378,9 +76137,9 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_18_alignments(PyTypeObject static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_18_alignments(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_18_alignments *p = (struct __pyx_obj_3_sa___pyx_scope_struct_18_alignments *)o; - Py_CLEAR(p->__pyx_v_point); - Py_CLEAR(p->__pyx_v_self); - Py_CLEAR(p->__pyx_t_0); + Py_XDECREF(p->__pyx_v_point); + Py_XDECREF(((PyObject *)p->__pyx_v_self)); + Py_XDECREF(p->__pyx_t_0); (*Py_TYPE(o)->tp_free)(o); } @@ -76572,7 +76331,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_18_alignments = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_19_input(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_19_input(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_19_input *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -76631,71 +76390,71 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_19_input(PyTypeObject *t, p->__pyx_v_xcat_index = 0; p->__pyx_v_xnode = 0; p->__pyx_v_xroot = 0; + p->__pyx_t_2 = 0; p->__pyx_t_3 = 0; p->__pyx_t_4 = 0; - p->__pyx_t_5 = 0; return o; } static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_19_input(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_19_input *p = (struct __pyx_obj_3_sa___pyx_scope_struct_19_input *)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_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_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); + Py_XDECREF(p->__pyx_v_alignment); + Py_XDECREF(p->__pyx_v_als); + Py_XDECREF(p->__pyx_v_alslist); + Py_XDECREF(((PyObject *)p->__pyx_v_chunklen)); + Py_XDECREF(p->__pyx_v_count); + Py_XDECREF(p->__pyx_v_e); + Py_XDECREF(p->__pyx_v_elist); + Py_XDECREF(p->__pyx_v_extract); + Py_XDECREF(p->__pyx_v_extract_start); + Py_XDECREF(p->__pyx_v_extract_stop); + Py_XDECREF(((PyObject *)p->__pyx_v_extracts)); + Py_XDECREF(p->__pyx_v_f); + Py_XDECREF(((PyObject *)p->__pyx_v_f_syms)); + Py_XDECREF(p->__pyx_v_fcount); + Py_XDECREF(p->__pyx_v_fphrases); + Py_XDECREF(((PyObject *)p->__pyx_v_frontier)); + Py_XDECREF(p->__pyx_v_frontier_nodes); + Py_XDECREF(p->__pyx_v_fwords); + Py_XDECREF(p->__pyx_v_genexpr); + Py_XDECREF(((PyObject *)p->__pyx_v_hiero_phrase)); + Py_XDECREF(p->__pyx_v_input_match); + Py_XDECREF(p->__pyx_v_intersect_start_time); + Py_XDECREF(p->__pyx_v_intersect_stop_time); + Py_XDECREF(p->__pyx_v_is_shadow_path); + Py_XDECREF(((PyObject *)p->__pyx_v_key)); + Py_XDECREF(p->__pyx_v_lex_i); + Py_XDECREF(p->__pyx_v_lex_j); + Py_XDECREF(p->__pyx_v_loc); + Py_XDECREF(((PyObject *)p->__pyx_v_locs)); + Py_XDECREF(p->__pyx_v_max_locs); + Py_XDECREF(p->__pyx_v_meta); + Py_XDECREF(((PyObject *)p->__pyx_v_new_frontier)); + Py_XDECREF(p->__pyx_v_new_node); + Py_XDECREF(((PyObject *)p->__pyx_v_next_states)); + Py_XDECREF(p->__pyx_v_node); + Py_XDECREF(((PyObject *)p->__pyx_v_nodes_isteps_away_buffer)); + Py_XDECREF(p->__pyx_v_pathlen); + Py_XDECREF(p->__pyx_v_phrase); + Py_XDECREF(((PyObject *)p->__pyx_v_phrase_location)); + Py_XDECREF(p->__pyx_v_prefix); + Py_XDECREF(((PyObject *)p->__pyx_v_reachable_buffer)); + Py_XDECREF(p->__pyx_v_sa_range); + Py_XDECREF(((PyObject *)p->__pyx_v_sample)); + Py_XDECREF(((PyObject *)p->__pyx_v_scores)); + Py_XDECREF(((PyObject *)p->__pyx_v_seen_phrases)); + Py_XDECREF(((PyObject *)p->__pyx_v_self)); + Py_XDECREF(p->__pyx_v_spanlen); + Py_XDECREF(p->__pyx_v_stop_time); + Py_XDECREF(p->__pyx_v_suffix_link); + Py_XDECREF(p->__pyx_v_suffix_link_xcat_index); + Py_XDECREF(p->__pyx_v_word_id); + Py_XDECREF(p->__pyx_v_xcat_index); + Py_XDECREF(p->__pyx_v_xnode); + Py_XDECREF(p->__pyx_v_xroot); + Py_XDECREF(p->__pyx_t_2); + Py_XDECREF(p->__pyx_t_3); + Py_XDECREF(p->__pyx_t_4); (*Py_TYPE(o)->tp_free)(o); } @@ -76864,15 +76623,15 @@ static int __pyx_tp_traverse_3_sa___pyx_scope_struct_19_input(PyObject *o, visit if (p->__pyx_v_xroot) { e = (*v)(p->__pyx_v_xroot, a); if (e) return e; } + if (p->__pyx_t_2) { + e = (*v)(p->__pyx_t_2, a); if (e) return e; + } if (p->__pyx_t_3) { e = (*v)(p->__pyx_t_3, a); if (e) return e; } if (p->__pyx_t_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; } @@ -77041,15 +76800,15 @@ static int __pyx_tp_clear_3_sa___pyx_scope_struct_19_input(PyObject *o) { tmp = ((PyObject*)p->__pyx_v_xroot); p->__pyx_v_xroot = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_t_2); + p->__pyx_t_2 = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_t_3); p->__pyx_t_3 = Py_None; Py_INCREF(Py_None); 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; } @@ -77211,7 +76970,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_19_input = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_20_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_20_genexpr(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_20_genexpr *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -77224,9 +76983,9 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_20_genexpr(PyTypeObject *t static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_20_genexpr(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_20_genexpr *p = (struct __pyx_obj_3_sa___pyx_scope_struct_20_genexpr *)o; - Py_CLEAR(p->__pyx_outer_scope); - Py_CLEAR(p->__pyx_v_word); - Py_CLEAR(p->__pyx_t_0); + Py_XDECREF(((PyObject *)p->__pyx_outer_scope)); + Py_XDECREF(p->__pyx_v_word); + Py_XDECREF(p->__pyx_t_0); (*Py_TYPE(o)->tp_free)(o); } @@ -77418,7 +77177,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_20_genexpr = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_21_add_instance(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_21_add_instance(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_21_add_instance *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -77439,17 +77198,17 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_21_add_instance(PyTypeObje static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_21_add_instance(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_21_add_instance *p = (struct __pyx_obj_3_sa___pyx_scope_struct_21_add_instance *)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); + Py_XDECREF(p->__pyx_v_al); + Py_XDECREF(p->__pyx_v_cover); + Py_XDECREF(p->__pyx_v_e_nt_cover); + Py_XDECREF(p->__pyx_v_e_words); + Py_XDECREF(p->__pyx_v_ef_span); + Py_XDECREF(p->__pyx_v_extract); + Py_XDECREF(p->__pyx_v_f_len); + Py_XDECREF(p->__pyx_v_f_words); + Py_XDECREF(p->__pyx_v_fe_span); + Py_XDECREF(p->__pyx_v_rules); + Py_XDECREF(((PyObject *)p->__pyx_v_self)); (*Py_TYPE(o)->tp_free)(o); } @@ -77689,7 +77448,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_21_add_instance = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_22_form_rule(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_22_form_rule(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_22_form_rule *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -77701,8 +77460,8 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_22_form_rule(PyTypeObject static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_22_form_rule(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_22_form_rule *p = (struct __pyx_obj_3_sa___pyx_scope_struct_22_form_rule *)o; - Py_CLEAR(p->__pyx_v_links); - Py_CLEAR(p->__pyx_v_self); + Py_XDECREF(p->__pyx_v_links); + Py_XDECREF(((PyObject *)p->__pyx_v_self)); (*Py_TYPE(o)->tp_free)(o); } @@ -77888,7 +77647,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_22_form_rule = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_23_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_23_genexpr(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_23_genexpr *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -77902,10 +77661,10 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_23_genexpr(PyTypeObject *t static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_23_genexpr(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_23_genexpr *p = (struct __pyx_obj_3_sa___pyx_scope_struct_23_genexpr *)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); + Py_XDECREF(((PyObject *)p->__pyx_outer_scope)); + Py_XDECREF(p->__pyx_v_i); + Py_XDECREF(p->__pyx_v_j); + Py_XDECREF(p->__pyx_t_0); (*Py_TYPE(o)->tp_free)(o); } @@ -78103,7 +77862,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_23_genexpr = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_24_fmt_rule(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_24_fmt_rule(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_24_fmt_rule *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -78115,8 +77874,8 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_24_fmt_rule(PyTypeObject * static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_24_fmt_rule(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_24_fmt_rule *p = (struct __pyx_obj_3_sa___pyx_scope_struct_24_fmt_rule *)o; - Py_CLEAR(p->__pyx_v_a); - Py_CLEAR(p->__pyx_v_self); + Py_XDECREF(p->__pyx_v_a); + Py_XDECREF(((PyObject *)p->__pyx_v_self)); (*Py_TYPE(o)->tp_free)(o); } @@ -78302,7 +78061,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_24_fmt_rule = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_25_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_25_genexpr(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_25_genexpr *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -78315,9 +78074,9 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_25_genexpr(PyTypeObject *t static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_25_genexpr(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_25_genexpr *p = (struct __pyx_obj_3_sa___pyx_scope_struct_25_genexpr *)o; - Py_CLEAR(p->__pyx_outer_scope); - Py_CLEAR(p->__pyx_v_packed); - Py_CLEAR(p->__pyx_t_0); + Py_XDECREF(((PyObject *)p->__pyx_outer_scope)); + Py_XDECREF(p->__pyx_v_packed); + Py_XDECREF(p->__pyx_t_0); (*Py_TYPE(o)->tp_free)(o); } @@ -78509,7 +78268,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_25_genexpr = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_26_get_f_phrases(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_26_get_f_phrases(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_26_get_f_phrases *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -78524,11 +78283,11 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_26_get_f_phrases(PyTypeObj static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_26_get_f_phrases(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_26_get_f_phrases *p = (struct __pyx_obj_3_sa___pyx_scope_struct_26_get_f_phrases *)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); + Py_XDECREF(p->__pyx_v_extract); + Py_XDECREF(p->__pyx_v_f_len); + Py_XDECREF(p->__pyx_v_f_words); + Py_XDECREF(p->__pyx_v_phrases); + Py_XDECREF(((PyObject *)p->__pyx_v_self)); (*Py_TYPE(o)->tp_free)(o); } @@ -78732,7 +78491,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_26_get_f_phrases = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_27___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_27___iter__(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_27___iter__ *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -78743,7 +78502,7 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_27___iter__(PyTypeObject * static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_27___iter__(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_27___iter__ *p = (struct __pyx_obj_3_sa___pyx_scope_struct_27___iter__ *)o; - Py_CLEAR(p->__pyx_v_self); + Py_XDECREF(((PyObject *)p->__pyx_v_self)); (*Py_TYPE(o)->tp_free)(o); } @@ -78923,7 +78682,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_27___iter__ = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_28___str__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_28___str__(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_28___str__ *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -78934,7 +78693,7 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_28___str__(PyTypeObject *t static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_28___str__(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_28___str__ *p = (struct __pyx_obj_3_sa___pyx_scope_struct_28___str__ *)o; - Py_CLEAR(p->__pyx_v_self); + Py_XDECREF(((PyObject *)p->__pyx_v_self)); (*Py_TYPE(o)->tp_free)(o); } @@ -79114,7 +78873,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_28___str__ = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_29_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_29_genexpr(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_29_genexpr *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -79127,9 +78886,9 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_29_genexpr(PyTypeObject *t static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_29_genexpr(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_29_genexpr *p = (struct __pyx_obj_3_sa___pyx_scope_struct_29_genexpr *)o; - Py_CLEAR(p->__pyx_outer_scope); - Py_CLEAR(p->__pyx_v_feat); - Py_CLEAR(p->__pyx_t_0); + Py_XDECREF(((PyObject *)p->__pyx_outer_scope)); + Py_XDECREF(p->__pyx_v_feat); + Py_XDECREF(p->__pyx_t_0); (*Py_TYPE(o)->tp_free)(o); } @@ -79712,7 +79471,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":20 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -79729,7 +79488,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_int_1000); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_10)); - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":21 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":21 * self.id2word = ["END_OF_FILE", "END_OF_LINE"] * self.data = IntList(1000,1000) * self.sent_id = IntList(1000,1000) # <<<<<<<<<<<<<< @@ -79746,7 +79505,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_int_1000); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_11)); - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":22 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":22 * self.data = IntList(1000,1000) * self.sent_id = IntList(1000,1000) * self.sent_index = IntList(1000,1000) # <<<<<<<<<<<<<< @@ -79763,7 +79522,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_int_1000); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_12)); - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":66 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":66 * f.write("%s " % self.get_word(w_id)) * if w_id == 1: * f.write("\n") # <<<<<<<<<<<<<< @@ -79777,7 +79536,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_15)); - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":61 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":61 * * def write_text(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -79797,7 +79556,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(Py_None); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_16)); - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":69 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":69 * * def read_text(self, char* filename): * with gzip_or_text(filename) as fp: # <<<<<<<<<<<<<< @@ -79817,7 +79576,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(Py_None); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_17)); - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":74 + /* "/home/paulb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -79831,7 +79590,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_18)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_19)); - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":73 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":73 * * def read_bitext(self, char* filename, int side): * with gzip_or_text(filename) as fp: # <<<<<<<<<<<<<< @@ -79851,7 +79610,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(Py_None); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_20)); - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":144 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":144 * for i in self.data: * f.write("%d " %i) * f.write("\n") # <<<<<<<<<<<<<< @@ -79865,7 +79624,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_22)); - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":147 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":147 * for i in self.sent_index: * f.write("%d " %i) * f.write("\n") # <<<<<<<<<<<<<< @@ -79879,7 +79638,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_23)); - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":150 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":150 * for i in self.sent_id: * f.write("%d " %i) * f.write("\n") # <<<<<<<<<<<<<< @@ -79893,7 +79652,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_24)); - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":153 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":153 * for word in self.id2word: * f.write("%s %d " % (word, self.word2id[word])) * f.write("\n") # <<<<<<<<<<<<<< @@ -79907,7 +79666,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_26)); - /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":156 + /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":156 * * def write_enhanced(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -79926,7 +79685,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(Py_None); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_28)); - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":46 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":46 * * def __cinit__(self, from_binary=None, from_text=None): * self.links = IntList(1000,1000) # <<<<<<<<<<<<<< @@ -79943,7 +79702,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_int_1000); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_29)); - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":47 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":47 * def __cinit__(self, from_binary=None, from_text=None): * self.links = IntList(1000,1000) * self.sent_index = IntList(1000,1000) # <<<<<<<<<<<<<< @@ -79960,7 +79719,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_int_1000); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_30)); - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":59 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":59 * pairs = line.split() * for pair in pairs: * (i, j) = map(int, pair.split('-')) # <<<<<<<<<<<<<< @@ -79974,7 +79733,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_31)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_32)); - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":54 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":54 * * def read_text(self, char* filename): * with gzip_or_text(filename) as f: # <<<<<<<<<<<<<< @@ -79994,7 +79753,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(Py_None); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_33)); - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":75 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":75 * for i, link in enumerate(self.links): * while i >= self.sent_index[sent_num]: * f.write("\n") # <<<<<<<<<<<<<< @@ -80008,7 +79767,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_34)); - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":78 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":78 * sent_num = sent_num + 1 * f.write("%d-%d " % self.unlink(link)) * f.write("\n") # <<<<<<<<<<<<<< @@ -80022,7 +79781,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_36)); - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":71 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":71 * * def write_text(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -80042,7 +79801,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(Py_None); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_37)); - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":92 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":92 * for link in self.links: * f.write("%d " % link) * f.write("\n") # <<<<<<<<<<<<<< @@ -80056,7 +79815,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_38)); - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":95 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":95 * for i in self.sent_index: * f.write("%d " % i) * f.write("\n") # <<<<<<<<<<<<<< @@ -80070,7 +79829,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_39)); - /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":88 + /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":88 * * def write_enhanced(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -80090,7 +79849,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(Py_None); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_40)); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":297 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":297 * * # Re-read file, placing words into buckets * f.seek(0) # <<<<<<<<<<<<<< @@ -80104,7 +79863,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_int_0); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_43)); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":273 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":273 * * fcount = IntList() * with gzip_or_text(filename) as f: # <<<<<<<<<<<<<< @@ -80124,7 +79883,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(Py_None); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_44)); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":339 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":339 * * if i > j: * raise Exception("Sort error in CLex") # <<<<<<<<<<<<<< @@ -80138,7 +79897,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_46)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_47)); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":362 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":362 * for i in self.f_index: * f.write("%d " % i) * f.write("\n") # <<<<<<<<<<<<<< @@ -80152,7 +79911,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_49)); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":365 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":365 * for i, s1, s2 in zip(self.e_index, self.col1, self.col2): * f.write("%d %f %f " % (i, s1, s2)) * f.write("\n") # <<<<<<<<<<<<<< @@ -80166,7 +79925,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_51)); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":368 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":368 * for i, w in enumerate(self.id2fword): * f.write("%d %s " % (i, w)) * f.write("\n") # <<<<<<<<<<<<<< @@ -80180,7 +79939,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_53)); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":371 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":371 * for i, w in enumerate(self.id2eword): * f.write("%d %s " % (i, w)) * f.write("\n") # <<<<<<<<<<<<<< @@ -80194,7 +79953,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_54)); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":359 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":359 * * def write_enhanced(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -80214,7 +79973,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(Py_None); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_55)); - /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":404 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":404 * cdef i, N, e_id, f_id * * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -80234,7 +79993,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(Py_None); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_57)); - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":13 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":13 * cdef IntList rank * * logger.info("Constructing LCP array") # <<<<<<<<<<<<<< @@ -80248,7 +80007,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_60)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_61)); - /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":34 + /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":34 * if h > 0: * h = h-1 * logger.info("LCP array completed") # <<<<<<<<<<<<<< @@ -80262,7 +80021,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_62)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_63)); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":297 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":297 * pattern_rank = {} * * logger.info("Precomputing frequent intersections") # <<<<<<<<<<<<<< @@ -80276,7 +80035,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_72)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_73)); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":314 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":314 * queue = IntList(increment=1000) * * logger.info(" Computing inverted indexes...") # <<<<<<<<<<<<<< @@ -80290,7 +80049,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_74)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_75)); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":329 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":329 * trie_node_data_append(node, i) * * logger.info(" Computing collocations...") # <<<<<<<<<<<<<< @@ -80304,7 +80063,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_76)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_77)); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":393 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":393 * for pattern2 in J_set: * if len(pattern1) + len(pattern2) + 1 < self.max_length: * combined_pattern = pattern1 + (-1,) + pattern2 # <<<<<<<<<<<<<< @@ -80318,7 +80077,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_int_neg_1); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_79)); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":400 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":400 * x = x+1 * if len(pattern1) + len(pattern2) + 1 <= self.max_length: * combined_pattern = pattern1 + (-1,) + pattern2 # <<<<<<<<<<<<<< @@ -80332,7 +80091,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_int_neg_1); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_80)); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":407 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":407 * x = x+2 * if len(pattern1) + len(pattern2) + 1<= self.max_length: * combined_pattern = pattern1 + (-1,) + pattern2 # <<<<<<<<<<<<<< @@ -80346,7 +80105,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_int_neg_1); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_81)); - /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":409 + /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":409 * combined_pattern = pattern1 + (-1,) + pattern2 * IJ_set.add(combined_pattern) * combined_pattern = pattern2 + (-1,) + pattern1 # <<<<<<<<<<<<<< @@ -80360,7 +80119,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_int_neg_1); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_82)); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":94 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":94 * * '''Step 3: read off suffix array from inverse suffix array''' * logger.info(" Finalizing sort...") # <<<<<<<<<<<<<< @@ -80374,7 +80133,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_92)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_93)); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":193 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":193 * for a_i in self.sa: * f.write("%d " % a_i) * f.write("\n") # <<<<<<<<<<<<<< @@ -80388,7 +80147,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_96)); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":196 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":196 * for w_i in self.ha: * f.write("%d " % w_i) * f.write("\n") # <<<<<<<<<<<<<< @@ -80402,7 +80161,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_97)); - /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":189 + /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":189 * * def write_enhanced(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -80422,7 +80181,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(Py_None); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_98)); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":119 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":119 * logger.info("Sampling strategy: uniform, max sample size = %d", sample_size) * else: * logger.info("Sampling strategy: no sampling") # <<<<<<<<<<<<<< @@ -80436,7 +80195,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_101)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_102)); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":339 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":339 * self.rules.root = ExtendedTrieNode(phrase_location=PhraseLocation()) * if alignment is None: * raise Exception("Must specify an alignment object") # <<<<<<<<<<<<<< @@ -80450,7 +80209,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_106)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_107)); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1064 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1064 * else: * #ERROR: We never get here * raise Exception("Keyword trie error") # <<<<<<<<<<<<<< @@ -80464,7 +80223,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_121)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_122)); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1918 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1918 * # 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): # <<<<<<<<<<<<<< @@ -80533,7 +80292,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_135)); __pyx_k_codeobj_136 = (PyObject*)__Pyx_PyCode_New(9, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_135, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_137, __pyx_n_s__extract, 1918, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_136)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2125 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2125 * # Debugging * def dump_online_stats(self): * logger.info('------------------------------') # <<<<<<<<<<<<<< @@ -80547,7 +80306,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_140)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_141)); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2126 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2126 * def dump_online_stats(self): * logger.info('------------------------------') * logger.info(' Online Stats ') # <<<<<<<<<<<<<< @@ -80561,7 +80320,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_142)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_143)); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2127 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2127 * logger.info('------------------------------') * logger.info(' Online Stats ') * logger.info('------------------------------') # <<<<<<<<<<<<<< @@ -80575,7 +80334,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_140)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_144)); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2128 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2128 * logger.info(' Online Stats ') * logger.info('------------------------------') * logger.info('f') # <<<<<<<<<<<<<< @@ -80589,7 +80348,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_n_s__f)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_145)); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2131 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2131 * for w in self.bilex_f: * logger.info(sym_tostring(w) + ' : ' + str(self.bilex_f[w])) * logger.info('e') # <<<<<<<<<<<<<< @@ -80603,7 +80362,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_n_s__e)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_147)); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2134 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2134 * for w in self.bilex_e: * logger.info(sym_tostring(w) + ' : ' + str(self.bilex_e[w])) * logger.info('fe') # <<<<<<<<<<<<<< @@ -80617,7 +80376,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_n_s__fe)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_148)); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2138 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2138 * for w2 in self.bilex_fe[w]: * logger.info(sym_tostring(w) + ' : ' + sym_tostring(w2) + ' : ' + str(self.bilex_fe[w][w2])) * logger.info('F') # <<<<<<<<<<<<<< @@ -80631,7 +80390,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_n_s__F)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_149)); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2141 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2141 * for ph in self.phrases_f: * logger.info(str(ph) + ' ||| ' + str(self.phrases_f[ph])) * logger.info('E') # <<<<<<<<<<<<<< @@ -80645,7 +80404,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_n_s__E)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_150)); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2144 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2144 * for ph in self.phrases_e: * logger.info(str(ph) + ' ||| ' + str(self.phrases_e[ph])) * logger.info('FE') # <<<<<<<<<<<<<< @@ -80659,7 +80418,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_n_s__FE)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_151)); - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2171 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2171 * phrases = set() # (fphrase, lex_i, lex_j) * * def extract(f_i, f_j, lex_i, lex_j, wc, ntc, syms): # <<<<<<<<<<<<<< @@ -80742,7 +80501,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_160)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_161)); - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":107 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":107 * return ALPHABET.fromstring(string, terminal) * * def isvar(sym): # <<<<<<<<<<<<<< @@ -80757,7 +80516,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_162)); __pyx_k_codeobj_163 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_162, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_164, __pyx_n_s__isvar, 107, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_163)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":110 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":110 * return sym_isvar(sym) * * def make_lattice(words): # <<<<<<<<<<<<<< @@ -80784,7 +80543,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_165)); __pyx_k_codeobj_166 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_165, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_164, __pyx_n_s__make_lattice, 110, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_166)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":114 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":114 * return tuple(((word, None, 1), ) for word in word_ids) * * def decode_lattice(lattice): # <<<<<<<<<<<<<< @@ -80805,7 +80564,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_167)); __pyx_k_codeobj_168 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_167, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_164, __pyx_n_s__decode_lattice, 114, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_168)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":118 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":118 * for arc in node for node in lattice) * * def decode_sentence(lattice): # <<<<<<<<<<<<<< @@ -80826,7 +80585,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_169)); __pyx_k_codeobj_170 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_169, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_164, __pyx_n_s__decode_sentence, 118, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_170)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":121 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":121 * return tuple(sym_tostring(sym) for ((sym, _, _),) in lattice) * * def encode_words(words): # <<<<<<<<<<<<<< @@ -80847,7 +80606,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_171)); __pyx_k_codeobj_172 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_171, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_164, __pyx_n_s__encode_words, 121, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_172)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":124 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":124 * return tuple(sym_fromstring(word, True) for word in words) * * def decode_words(syms): # <<<<<<<<<<<<<< @@ -80867,7 +80626,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_173)); __pyx_k_codeobj_174 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_173, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_164, __pyx_n_s__decode_words, 124, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_174)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2205 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2205 * * # Spans are _inclusive_ on both ends [i, j] * def span_check(vec, i, j): # <<<<<<<<<<<<<< @@ -80891,7 +80650,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_176)); __pyx_k_codeobj_177 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_176, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_137, __pyx_n_s__span_check, 2205, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_177)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2213 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2213 * return True * * def span_inc(vec, i, j): # <<<<<<<<<<<<<< @@ -80915,7 +80674,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_178)); __pyx_k_codeobj_179 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_178, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_137, __pyx_n_s__span_inc, 2213, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_179)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2219 + /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2219 * k += 1 * * def span_dec(vec, i, j): # <<<<<<<<<<<<<< @@ -81005,15 +80764,16 @@ PyMODINIT_FUNC PyInit__sa(void) #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4(__Pyx_NAMESTR("_sa"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("_sa"), __pyx_methods, 0, 0, PYTHON_API_VERSION); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif - if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __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); + if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #if PY_MAJOR_VERSION < 3 + Py_INCREF(__pyx_m); #endif + __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); + if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -81343,7 +81103,7 @@ PyMODINIT_FUNC PyInit__sa(void) if (PyObject_SetAttr(__pyx_m, __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/pauldb/workspace/cdec/python/src/sa/bilex.pxi":54 + /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":54 * cdef id2eword, id2fword, eword2id, fword2id * * def __cinit__(self, from_text=None, from_data=False, from_binary=None, # <<<<<<<<<<<<<< @@ -81356,7 +81116,7 @@ PyMODINIT_FUNC PyInit__sa(void) __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":17 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":17 * from libc.string cimport memset * * cdef int MIN_BOTTOM_SIZE = 32 # <<<<<<<<<<<<<< @@ -81365,7 +81125,7 @@ PyMODINIT_FUNC PyInit__sa(void) */ __pyx_v_3_sa_MIN_BOTTOM_SIZE = 32; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":18 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":18 * * cdef int MIN_BOTTOM_SIZE = 32 * cdef int MIN_BOTTOM_BITS = 5 # <<<<<<<<<<<<<< @@ -81374,7 +81134,7 @@ PyMODINIT_FUNC PyInit__sa(void) */ __pyx_v_3_sa_MIN_BOTTOM_BITS = 5; - /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":28 + /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":28 * LOWER_MASK[i] = mask * * _init_lower_mask() # <<<<<<<<<<<<<< @@ -81383,7 +81143,7 @@ PyMODINIT_FUNC PyInit__sa(void) */ __pyx_f_3_sa__init_lower_mask(); - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":4 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":4 * from libc.stdlib cimport malloc, realloc, strtol * * cdef int INDEX_SHIFT = 3 # <<<<<<<<<<<<<< @@ -81392,7 +81152,7 @@ PyMODINIT_FUNC PyInit__sa(void) */ __pyx_v_3_sa_INDEX_SHIFT = 3; - /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":5 + /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":5 * * cdef int INDEX_SHIFT = 3 * cdef int INDEX_MASK = (1<= 3 + if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) && + PyUnicode_Compare(**name, key) == 0) break; + #else + if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) && + _PyString_Eq(**name, key)) break; + #endif } - } - } else - #endif - if (likely(PyUnicode_Check(key))) { - while (*name) { - int cmp = (**name == key) ? 0 : - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : - #endif - PyUnicode_Compare(**name, key); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) { + if (*name) { values[name-argnames] = value; - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - int cmp = (**argname == key) ? 0 : - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : - #endif - PyUnicode_Compare(**argname, key); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) goto arg_passed_twice; - argname++; + } else { + for (name=argnames; name != first_kw_arg; name++) { + if (**name == key) goto arg_passed_twice; + #if PY_MAJOR_VERSION >= 3 + if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) && + PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice; + #else + if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) && + _PyString_Eq(**name, key)) goto arg_passed_twice; + #endif + } + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } } } - } else - goto invalid_keyword_type; - if (kwds2) { - if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; - } else { - goto invalid_keyword; } } return 0; arg_passed_twice: - __Pyx_RaiseDoubleKeywordsError(function_name, key); + __Pyx_RaiseDoubleKeywordsError(function_name, **name); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, @@ -81997,7 +81733,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)", + "%s() takes %s %"PY_FORMAT_SIZE_T"d positional argument%s (%"PY_FORMAT_SIZE_T"d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } @@ -82037,38 +81773,33 @@ static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyOb static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { Py_XINCREF(type); - if (!value || value == Py_None) - value = NULL; - else + Py_XINCREF(value); + Py_XINCREF(tb); + if (tb == Py_None) { + Py_DECREF(tb); + tb = 0; + } + else if (tb != NULL && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + if (value == NULL) { + value = Py_None; Py_INCREF(value); - if (!tb || tb == Py_None) - tb = NULL; - else { - Py_INCREF(tb); - if (!PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } } #if PY_VERSION_HEX < 0x02050000 - if (PyClass_Check(type)) { + if (!PyClass_Check(type)) #else - if (PyType_Check(type)) { + if (!PyType_Check(type)) #endif -#if CYTHON_COMPILING_IN_PYPY - if (!value) { - Py_INCREF(Py_None); - value = Py_None; - } -#endif - PyErr_NormalizeException(&type, &value, &tb); - } else { - if (value) { + { + if (value != Py_None) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } + Py_DECREF(value); value = type; #if PY_VERSION_HEX < 0x02050000 if (PyInstance_Check(type)) { @@ -82101,7 +81832,6 @@ raise_error: } #else /* Python 3+ */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { - PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { @@ -82119,36 +81849,12 @@ 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; - } - } else { + } else if (!PyExceptionClass_Check(type)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } - if (cause && cause != Py_None) { + if (cause) { PyObject *fixed_cause; if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); @@ -82165,6 +81871,9 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject "BaseException"); goto bad; } + if (!value) { + value = PyObject_CallObject(type, NULL); + } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); @@ -82178,7 +81887,6 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject } } bad: - Py_XDECREF(owned_instance); return; } #endif @@ -82202,17 +81910,13 @@ static CYTHON_INLINE int __Pyx_CheckKeywordStrings( { PyObject* key = 0; Py_ssize_t pos = 0; -#if CPYTHON_COMPILING_IN_PYPY - if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) - goto invalid_keyword; - return 1; -#else while (PyDict_Next(kwdict, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) + #else + if (unlikely(!PyUnicode_Check(key))) #endif - if (unlikely(!PyUnicode_Check(key))) - goto invalid_keyword_type; + goto invalid_keyword_type; } if ((!kw_allowed) && unlikely(key)) goto invalid_keyword; @@ -82221,7 +81925,6 @@ invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%s() keywords must be strings", function_name); return 0; -#endif invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 @@ -82234,9 +81937,10 @@ invalid_keyword: return 0; } + + static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { PyObject *local_type, *local_value, *local_tb; -#if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); local_type = tstate->curexc_type; @@ -82245,27 +81949,19 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; -#else - PyErr_Fetch(&local_type, &local_value, &local_tb); -#endif PyErr_NormalizeException(&local_type, &local_value, &local_tb); -#if CYTHON_COMPILING_IN_CPYTHON if (unlikely(tstate->curexc_type)) -#else - if (unlikely(PyErr_Occurred())) -#endif goto bad; #if PY_MAJOR_VERSION >= 3 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; #endif - Py_INCREF(local_type); - Py_INCREF(local_value); - Py_INCREF(local_tb); *type = local_type; *value = local_value; *tb = local_tb; -#if CYTHON_COMPILING_IN_CPYTHON + Py_INCREF(local_type); + Py_INCREF(local_value); + Py_INCREF(local_tb); tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; @@ -82273,13 +81969,10 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) tstate->exc_value = local_value; tstate->exc_traceback = local_tb; /* Make sure tstate is in a consistent state when we XDECREF - these objects (DECREF may run arbitrary code). */ + these objects (XDECREF may run arbitrary code). */ Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); -#else - PyErr_SetExcInfo(local_type, local_value, local_tb); -#endif return 0; bad: *type = 0; @@ -82308,40 +82001,23 @@ static CYTHON_INLINE long __Pyx_mod_long(long a, long b) { return r; } -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, - "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); + "need more than %"PY_FORMAT_SIZE_T"d value%s to unpack", + index, (index == 1) ? "" : "s"); } -static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, - "need more than %" CYTHON_FORMAT_SSIZE_T "d value%s to unpack", - index, (index == 1) ? "" : "s"); + "too many values to unpack (expected %"PY_FORMAT_SIZE_T"d)", expected); } -static CYTHON_INLINE int __Pyx_IterFinish(void) { -#if CYTHON_COMPILING_IN_CPYTHON - PyThreadState *tstate = PyThreadState_GET(); - PyObject* exc_type = tstate->curexc_type; - if (unlikely(exc_type)) { - if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { - PyObject *exc_value, *exc_tb; - exc_value = tstate->curexc_value; - exc_tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; - Py_DECREF(exc_type); - Py_XDECREF(exc_value); - Py_XDECREF(exc_tb); - return 0; - } else { - return -1; - } - } - return 0; -#else - if (unlikely(PyErr_Occurred())) { +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + if (unlikely(retval)) { + Py_DECREF(retval); + __Pyx_RaiseTooManyValuesError(expected); + return -1; + } else if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { PyErr_Clear(); return 0; @@ -82350,25 +82026,12 @@ static CYTHON_INLINE int __Pyx_IterFinish(void) { } } return 0; -#endif } -static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { - if (unlikely(retval)) { - Py_DECREF(retval); - __Pyx_RaiseTooManyValuesError(expected); - return -1; - } else { - return __Pyx_IterFinish(); - } - return 0; -} + static double __Pyx__PyObject_AsDouble(PyObject* obj) { PyObject* float_value; -#if CYTHON_COMPILING_IN_PYPY - float_value = PyNumber_Float(obj); -#else if (Py_TYPE(obj)->tp_as_number && Py_TYPE(obj)->tp_as_number->nb_float) { return PyFloat_AsDouble(obj); } else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) { @@ -82385,7 +82048,6 @@ static double __Pyx__PyObject_AsDouble(PyObject* obj) { PyTuple_SET_ITEM(args, 0, 0); Py_DECREF(args); } -#endif if (likely(float_value)) { double value = PyFloat_AS_DOUBLE(float_value); Py_DECREF(float_value); @@ -82419,158 +82081,8 @@ static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed return 0; } -static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); -} - -static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { - if (t == Py_None) { - __Pyx_RaiseNoneNotIterableError(); - } else if (PyTuple_GET_SIZE(t) < index) { - __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); - } else { - __Pyx_RaiseTooManyValuesError(index); - } -} - -static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, - int is_tuple, int has_known_size, int decref_tuple) { - Py_ssize_t index; - PyObject *value1 = NULL, *value2 = NULL, *iter = NULL; - if (!is_tuple && unlikely(!PyTuple_Check(tuple))) { - iternextfunc iternext; - iter = PyObject_GetIter(tuple); - if (unlikely(!iter)) goto bad; - if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; } - iternext = Py_TYPE(iter)->tp_iternext; - value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; } - value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; } - if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad; - Py_DECREF(iter); - } else { - if (!has_known_size && unlikely(PyTuple_GET_SIZE(tuple) != 2)) { - __Pyx_UnpackTupleError(tuple, 2); - goto bad; - } -#if CYTHON_COMPILING_IN_PYPY - value1 = PySequence_ITEM(tuple, 0); - if (unlikely(!value1)) goto bad; - value2 = PySequence_ITEM(tuple, 1); - if (unlikely(!value2)) goto bad; -#else - value1 = PyTuple_GET_ITEM(tuple, 0); - value2 = PyTuple_GET_ITEM(tuple, 1); - Py_INCREF(value1); - Py_INCREF(value2); -#endif - if (decref_tuple) { Py_DECREF(tuple); } - } - *pvalue1 = value1; - *pvalue2 = value2; - return 0; -unpacking_failed: - if (!has_known_size && __Pyx_IterFinish() == 0) - __Pyx_RaiseNeedMoreValuesError(index); -bad: - Py_XDECREF(iter); - Py_XDECREF(value1); - Py_XDECREF(value2); - if (decref_tuple) { Py_XDECREF(tuple); } - return -1; -} - -static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, - Py_ssize_t* p_orig_length, int* p_source_is_dict) { - is_dict = is_dict || likely(PyDict_CheckExact(iterable)); - *p_source_is_dict = is_dict; -#if !CYTHON_COMPILING_IN_PYPY - if (is_dict) { - *p_orig_length = PyDict_Size(iterable); - Py_INCREF(iterable); - return iterable; - } -#endif - *p_orig_length = 0; - if (method_name) { - PyObject* iter; - iterable = PyObject_CallMethodObjArgs(iterable, method_name, NULL); - if (!iterable) - return NULL; -#if !CYTHON_COMPILING_IN_PYPY - if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable)) - return iterable; -#endif - iter = PyObject_GetIter(iterable); - Py_DECREF(iterable); - return iter; - } - return PyObject_GetIter(iterable); -} -static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* iter_obj, Py_ssize_t orig_length, Py_ssize_t* ppos, - PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) { - PyObject* next_item; -#if !CYTHON_COMPILING_IN_PYPY - if (source_is_dict) { - PyObject *key, *value; - if (unlikely(orig_length != PyDict_Size(iter_obj))) { - PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration"); - return -1; - } - if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) { - return 0; - } - if (pitem) { - PyObject* tuple = PyTuple_New(2); - if (unlikely(!tuple)) { - return -1; - } - Py_INCREF(key); - Py_INCREF(value); - PyTuple_SET_ITEM(tuple, 0, key); - PyTuple_SET_ITEM(tuple, 1, value); - *pitem = tuple; - } else { - if (pkey) { - Py_INCREF(key); - *pkey = key; - } - if (pvalue) { - Py_INCREF(value); - *pvalue = value; - } - } - return 1; - } else if (PyTuple_CheckExact(iter_obj)) { - Py_ssize_t pos = *ppos; - if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0; - *ppos = pos + 1; - next_item = PyTuple_GET_ITEM(iter_obj, pos); - Py_INCREF(next_item); - } else if (PyList_CheckExact(iter_obj)) { - Py_ssize_t pos = *ppos; - if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0; - *ppos = pos + 1; - next_item = PyList_GET_ITEM(iter_obj, pos); - Py_INCREF(next_item); - } else -#endif - { - next_item = PyIter_Next(iter_obj); - if (unlikely(!next_item)) { - return __Pyx_IterFinish(); - } - } - if (pitem) { - *pitem = next_item; - } else if (pkey && pvalue) { - if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1)) - return -1; - } else if (pkey) { - *pkey = next_item; - } else { - *pvalue = next_item; - } - return 1; +static CYTHON_INLINE void __Pyx_RaiseNoneIndexingError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is unsubscriptable"); } static CYTHON_INLINE int __Pyx_div_int(int a, int b) { @@ -82581,7 +82093,6 @@ static CYTHON_INLINE int __Pyx_div_int(int a, int b) { } static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { -#if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); *type = tstate->exc_type; *value = tstate->exc_value; @@ -82589,12 +82100,8 @@ static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); -#else - PyErr_GetExcInfo(type, value, tb); -#endif } static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { -#if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->exc_type; @@ -82606,9 +82113,6 @@ static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); -#else - PyErr_SetExcInfo(type, value, tb); -#endif } static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level) { @@ -82689,6 +82193,78 @@ static CYTHON_INLINE void __Pyx_RaiseImportError(PyObject *name) { #endif } +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + if (PyBytes_GET_SIZE(s1) != PyBytes_GET_SIZE(s2)) { + return (equals == Py_NE); + } else if (PyBytes_GET_SIZE(s1) == 1) { + if (equals == Py_EQ) + return (PyBytes_AS_STRING(s1)[0] == PyBytes_AS_STRING(s2)[0]); + else + return (PyBytes_AS_STRING(s1)[0] != PyBytes_AS_STRING(s2)[0]); + } else { + int result = memcmp(PyBytes_AS_STRING(s1), PyBytes_AS_STRING(s2), (size_t)PyBytes_GET_SIZE(s1)); + 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; + } +} + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyUnicode_CheckExact(s1) & PyUnicode_CheckExact(s2)) { + #if CYTHON_PEP393_ENABLED + if ((PyUnicode_READY(s1) < 0) || (PyUnicode_READY(s2) < 0)) + return -1; + if (PyUnicode_GET_LENGTH(s1) != PyUnicode_GET_LENGTH(s2)) { + return (equals == Py_NE); + } else if (PyUnicode_GET_LENGTH(s1) == 1) { + Py_UCS4 ch1 = PyUnicode_READ_CHAR(s1, 0); + Py_UCS4 ch2 = PyUnicode_READ_CHAR(s2, 0); + return (equals == Py_EQ) ? (ch1 == ch2) : (ch1 != ch2); + #else + if (PyUnicode_GET_SIZE(s1) != PyUnicode_GET_SIZE(s2)) { + return (equals == Py_NE); + } else if (PyUnicode_GET_SIZE(s1) == 1) { + Py_UNICODE ch1 = PyUnicode_AS_UNICODE(s1)[0]; + Py_UNICODE ch2 = PyUnicode_AS_UNICODE(s2)[0]; + return (equals == Py_EQ) ? (ch1 == ch2) : (ch1 != ch2); + #endif + } else { + int result = PyUnicode_Compare(s1, s2); + if ((result == -1) && unlikely(PyErr_Occurred())) + return -1; + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyUnicode_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyUnicode_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; + } +} + static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) { @@ -82969,56 +82545,6 @@ __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) PyString_AsString(func_name), (void *)op); #endif } -#if CYTHON_COMPILING_IN_PYPY -static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { - PyCFunctionObject* f = (PyCFunctionObject*)func; - PyCFunction meth = PyCFunction_GET_FUNCTION(func); - PyObject *self = PyCFunction_GET_SELF(func); - Py_ssize_t size; - switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) { - case METH_VARARGS: - if (likely(kw == NULL) || PyDict_Size(kw) == 0) - return (*meth)(self, arg); - break; - case METH_VARARGS | METH_KEYWORDS: - return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); - case METH_NOARGS: - if (likely(kw == NULL) || PyDict_Size(kw) == 0) { - size = PyTuple_GET_SIZE(arg); - if (size == 0) - return (*meth)(self, NULL); - PyErr_Format(PyExc_TypeError, - "%.200s() takes no arguments (%zd given)", - f->m_ml->ml_name, size); - return NULL; - } - break; - case METH_O: - if (likely(kw == NULL) || PyDict_Size(kw) == 0) { - size = PyTuple_GET_SIZE(arg); - if (size == 1) - return (*meth)(self, PyTuple_GET_ITEM(arg, 0)); - PyErr_Format(PyExc_TypeError, - "%.200s() takes exactly one argument (%zd given)", - f->m_ml->ml_name, size); - return NULL; - } - break; - default: - PyErr_SetString(PyExc_SystemError, "Bad call flags in " - "__Pyx_CyFunction_Call. METH_OLDARGS is no " - "longer supported!"); - return NULL; - } - PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", - f->m_ml->ml_name); - return NULL; -} -#else -static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { - return PyCFunction_Call(func, arg, kw); -} -#endif static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __Pyx_NAMESTR("cython_function_or_method"), /*tp_name*/ @@ -83038,7 +82564,7 @@ static PyTypeObject __pyx_CyFunctionType_type = { 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ - __Pyx_CyFunction_Call, /*tp_call*/ + __Pyx_PyCFunction_Call, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ @@ -83074,16 +82600,15 @@ static PyTypeObject __pyx_CyFunctionType_type = { 0, /*tp_version_tag*/ #endif }; -static int __Pyx_CyFunction_init(void) { -#if !CYTHON_COMPILING_IN_PYPY - __pyx_CyFunctionType_type.tp_call = PyCFunction_Call; -#endif +static int __Pyx_CyFunction_init(void) +{ if (PyType_Ready(&__pyx_CyFunctionType_type) < 0) return -1; __pyx_CyFunctionType = &__pyx_CyFunctionType_type; return 0; } -static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { +void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) +{ __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyMem_Malloc(size); if (!m->defaults) @@ -83092,7 +82617,8 @@ static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t m->defaults_pyobjects = pyobjects; return m->defaults; } -static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { +static void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) +{ __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); @@ -83498,8 +83024,8 @@ static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* } } -static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, - CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename) { +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename) { PyObject *old_exc, *old_val, *old_tb; PyObject *ctx; __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); @@ -83519,7 +83045,6 @@ static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; -#if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; @@ -83527,10 +83052,6 @@ static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, tstate->exc_type = *type; tstate->exc_value = *value; tstate->exc_traceback = *tb; -#else - PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); - PyErr_SetExcInfo(*type, *value, *tb); -#endif *type = tmp_type; *value = tmp_value; *tb = tmp_tb; @@ -83540,70 +83061,9 @@ static PyObject *__Pyx_Generator_Next(PyObject *self); static PyObject *__Pyx_Generator_Send(PyObject *self, PyObject *value); static PyObject *__Pyx_Generator_Close(PyObject *self); static PyObject *__Pyx_Generator_Throw(PyObject *gen, PyObject *args); -static PyTypeObject *__pyx_GeneratorType = 0; -#define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType) -#define __Pyx_Generator_Undelegate(gen) Py_CLEAR((gen)->yieldfrom) -#if 1 || PY_VERSION_HEX < 0x030300B0 -static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue) { - PyObject *et, *ev, *tb; - PyObject *value = NULL; - __Pyx_ErrFetch(&et, &ev, &tb); - if (!et) { - Py_XDECREF(tb); - Py_XDECREF(ev); - Py_INCREF(Py_None); - *pvalue = Py_None; - return 0; - } - if (unlikely(et != PyExc_StopIteration) && - unlikely(!PyErr_GivenExceptionMatches(et, PyExc_StopIteration))) { - __Pyx_ErrRestore(et, ev, tb); - return -1; - } - if (likely(et == PyExc_StopIteration)) { - if (likely(!ev) || !PyObject_IsInstance(ev, PyExc_StopIteration)) { - if (!ev) { - Py_INCREF(Py_None); - ev = Py_None; - } - Py_XDECREF(tb); - Py_DECREF(et); - *pvalue = ev; - return 0; - } - } - PyErr_NormalizeException(&et, &ev, &tb); - if (unlikely(!PyObject_IsInstance(ev, PyExc_StopIteration))) { - __Pyx_ErrRestore(et, ev, tb); - return -1; - } - Py_XDECREF(tb); - Py_DECREF(et); -#if PY_VERSION_HEX >= 0x030300A0 - value = ((PyStopIterationObject *)ev)->value; - Py_INCREF(value); - Py_DECREF(ev); -#else - { - PyObject* args = PyObject_GetAttrString(ev, "args"); - Py_DECREF(ev); - if (likely(args)) { - value = PyObject_GetItem(args, 0); - Py_DECREF(args); - } - if (unlikely(!value)) { - __Pyx_ErrRestore(NULL, NULL, NULL); - Py_INCREF(Py_None); - value = Py_None; - } - } -#endif - *pvalue = value; - return 0; -} -#endif static CYTHON_INLINE -void __Pyx_Generator_ExceptionClear(__pyx_GeneratorObject *self) { +void __Pyx_Generator_ExceptionClear(__pyx_GeneratorObject *self) +{ PyObject *exc_type = self->exc_type; PyObject *exc_value = self->exc_value; PyObject *exc_traceback = self->exc_traceback; @@ -83615,18 +83075,14 @@ void __Pyx_Generator_ExceptionClear(__pyx_GeneratorObject *self) { Py_XDECREF(exc_traceback); } static CYTHON_INLINE -int __Pyx_Generator_CheckRunning(__pyx_GeneratorObject *gen) { - if (unlikely(gen->is_running)) { +PyObject *__Pyx_Generator_SendEx(__pyx_GeneratorObject *self, PyObject *value) +{ + PyObject *retval; + if (unlikely(self->is_running)) { PyErr_SetString(PyExc_ValueError, "generator already executing"); - return 1; + return NULL; } - return 0; -} -static CYTHON_INLINE -PyObject *__Pyx_Generator_SendEx(__pyx_GeneratorObject *self, PyObject *value) { - PyObject *retval; - assert(!self->is_running); if (unlikely(self->resume_label == 0)) { if (unlikely(value && value != Py_None)) { PyErr_SetString(PyExc_TypeError, @@ -83639,240 +83095,81 @@ PyObject *__Pyx_Generator_SendEx(__pyx_GeneratorObject *self, PyObject *value) { PyErr_SetNone(PyExc_StopIteration); return NULL; } - if (value) { -#if CYTHON_COMPILING_IN_PYPY -#else - /* Generators always return to their most recent caller, not - * necessarily their creator. */ - if (self->exc_traceback) { - PyThreadState *tstate = PyThreadState_GET(); - PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback; - PyFrameObject *f = tb->tb_frame; - Py_XINCREF(tstate->frame); - assert(f->f_back == NULL); - f->f_back = tstate->frame; - } -#endif - __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value, - &self->exc_traceback); - } else { + if (value) + __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value, &self->exc_traceback); + else __Pyx_Generator_ExceptionClear(self); - } self->is_running = 1; retval = self->body((PyObject *) self, value); self->is_running = 0; - if (retval) { - __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value, - &self->exc_traceback); -#if CYTHON_COMPILING_IN_PYPY -#else - /* Don't keep the reference to f_back any longer than necessary. It - * may keep a chain of frames alive or it could create a reference - * cycle. */ - if (self->exc_traceback) { - PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback; - PyFrameObject *f = tb->tb_frame; - Py_CLEAR(f->f_back); - } -#endif - } else { + if (retval) + __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value, &self->exc_traceback); + else __Pyx_Generator_ExceptionClear(self); - } return retval; } -static CYTHON_INLINE -PyObject *__Pyx_Generator_FinishDelegation(__pyx_GeneratorObject *gen) { - PyObject *ret; - PyObject *val = NULL; - __Pyx_Generator_Undelegate(gen); - __Pyx_PyGen_FetchStopIterationValue(&val); - ret = __Pyx_Generator_SendEx(gen, val); - Py_XDECREF(val); - return ret; -} -static PyObject *__Pyx_Generator_Next(PyObject *self) { - __pyx_GeneratorObject *gen = (__pyx_GeneratorObject*) self; - PyObject *yf = gen->yieldfrom; - if (unlikely(__Pyx_Generator_CheckRunning(gen))) - return NULL; - if (yf) { - PyObject *ret; - gen->is_running = 1; - ret = Py_TYPE(yf)->tp_iternext(yf); - gen->is_running = 0; - if (likely(ret)) { - return ret; - } - return __Pyx_Generator_FinishDelegation(gen); - } - return __Pyx_Generator_SendEx(gen, Py_None); -} -static PyObject *__Pyx_Generator_Send(PyObject *self, PyObject *value) { - __pyx_GeneratorObject *gen = (__pyx_GeneratorObject*) self; - PyObject *yf = gen->yieldfrom; - if (unlikely(__Pyx_Generator_CheckRunning(gen))) - return NULL; - if (yf) { - PyObject *ret; - gen->is_running = 1; - if (__Pyx_Generator_CheckExact(yf)) { - ret = __Pyx_Generator_Send(yf, value); - } else { - if (value == Py_None) - ret = PyIter_Next(yf); - else - ret = PyObject_CallMethod(yf, (char*)"send", (char*)"O", value); - } - gen->is_running = 0; - if (likely(ret)) { - return ret; - } - return __Pyx_Generator_FinishDelegation(gen); - } - return __Pyx_Generator_SendEx(gen, value); +static PyObject *__Pyx_Generator_Next(PyObject *self) +{ + return __Pyx_Generator_SendEx((__pyx_GeneratorObject *) self, Py_None); } -static int __Pyx_Generator_CloseIter(__pyx_GeneratorObject *gen, PyObject *yf) { - PyObject *retval = NULL; - int err = 0; - if (__Pyx_Generator_CheckExact(yf)) { - retval = __Pyx_Generator_Close(yf); - if (!retval) - return -1; - } else { - PyObject *meth; - gen->is_running = 1; - meth = PyObject_GetAttrString(yf, "close"); - if (unlikely(!meth)) { - if (!PyErr_ExceptionMatches(PyExc_AttributeError)) { - PyErr_WriteUnraisable(yf); - } - PyErr_Clear(); - } else { - retval = PyObject_CallFunction(meth, NULL); - Py_DECREF(meth); - if (!retval) - err = -1; - } - gen->is_running = 0; - } - Py_XDECREF(retval); - return err; +static PyObject *__Pyx_Generator_Send(PyObject *self, PyObject *value) +{ + return __Pyx_Generator_SendEx((__pyx_GeneratorObject *) self, value); } -static PyObject *__Pyx_Generator_Close(PyObject *self) { - __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self; - PyObject *retval, *raised_exception; - PyObject *yf = gen->yieldfrom; - int err = 0; - if (unlikely(__Pyx_Generator_CheckRunning(gen))) - return NULL; - if (yf) { - Py_INCREF(yf); - err = __Pyx_Generator_CloseIter(gen, yf); - __Pyx_Generator_Undelegate(gen); - Py_DECREF(yf); - } - if (err == 0) +static PyObject *__Pyx_Generator_Close(PyObject *self) +{ + __pyx_GeneratorObject *generator = (__pyx_GeneratorObject *) self; + PyObject *retval; #if PY_VERSION_HEX < 0x02050000 - PyErr_SetNone(PyExc_StopIteration); + PyErr_SetNone(PyExc_StopIteration); #else - PyErr_SetNone(PyExc_GeneratorExit); + PyErr_SetNone(PyExc_GeneratorExit); #endif - retval = __Pyx_Generator_SendEx(gen, NULL); + retval = __Pyx_Generator_SendEx(generator, NULL); if (retval) { Py_DECREF(retval); PyErr_SetString(PyExc_RuntimeError, "generator ignored GeneratorExit"); return NULL; } - raised_exception = PyErr_Occurred(); - if (!raised_exception - || raised_exception == PyExc_StopIteration -#if PY_VERSION_HEX >= 0x02050000 - || raised_exception == PyExc_GeneratorExit - || PyErr_GivenExceptionMatches(raised_exception, PyExc_GeneratorExit) +#if PY_VERSION_HEX < 0x02050000 + if (PyErr_ExceptionMatches(PyExc_StopIteration)) +#else + if (PyErr_ExceptionMatches(PyExc_StopIteration) + || PyErr_ExceptionMatches(PyExc_GeneratorExit)) #endif - || PyErr_GivenExceptionMatches(raised_exception, PyExc_StopIteration)) { - if (raised_exception) PyErr_Clear(); /* ignore these errors */ + PyErr_Clear(); /* ignore these errors */ Py_INCREF(Py_None); return Py_None; } return NULL; } -static PyObject *__Pyx_Generator_Throw(PyObject *self, PyObject *args) { - __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self; +static PyObject *__Pyx_Generator_Throw(PyObject *self, PyObject *args) +{ + __pyx_GeneratorObject *generator = (__pyx_GeneratorObject *) self; PyObject *typ; PyObject *tb = NULL; PyObject *val = NULL; - PyObject *yf = gen->yieldfrom; if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb)) return NULL; - if (unlikely(__Pyx_Generator_CheckRunning(gen))) - return NULL; - if (yf) { - PyObject *ret; - Py_INCREF(yf); -#if PY_VERSION_HEX >= 0x02050000 - if (PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit)) { - int err = __Pyx_Generator_CloseIter(gen, yf); - Py_DECREF(yf); - __Pyx_Generator_Undelegate(gen); - if (err < 0) - return __Pyx_Generator_SendEx(gen, NULL); - goto throw_here; - } -#endif - gen->is_running = 1; - if (__Pyx_Generator_CheckExact(yf)) { - ret = __Pyx_Generator_Throw(yf, args); - } else { - PyObject *meth = PyObject_GetAttrString(yf, "throw"); - if (unlikely(!meth)) { - Py_DECREF(yf); - if (!PyErr_ExceptionMatches(PyExc_AttributeError)) { - gen->is_running = 0; - return NULL; - } - PyErr_Clear(); - __Pyx_Generator_Undelegate(gen); - gen->is_running = 0; - goto throw_here; - } - ret = PyObject_CallObject(meth, args); - Py_DECREF(meth); - } - gen->is_running = 0; - Py_DECREF(yf); - if (!ret) { - ret = __Pyx_Generator_FinishDelegation(gen); - } - return ret; - } -throw_here: __Pyx_Raise(typ, val, tb, NULL); - return __Pyx_Generator_SendEx(gen, NULL); + return __Pyx_Generator_SendEx(generator, NULL); } -static int __Pyx_Generator_traverse(PyObject *self, visitproc visit, void *arg) { +static int +__Pyx_Generator_traverse(PyObject *self, visitproc visit, void *arg) +{ __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self; Py_VISIT(gen->closure); Py_VISIT(gen->classobj); - Py_VISIT(gen->yieldfrom); Py_VISIT(gen->exc_type); Py_VISIT(gen->exc_value); Py_VISIT(gen->exc_traceback); return 0; } -static int __Pyx_Generator_clear(PyObject *self) { - __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self; - Py_CLEAR(gen->closure); - Py_CLEAR(gen->classobj); - Py_CLEAR(gen->yieldfrom); - Py_CLEAR(gen->exc_type); - Py_CLEAR(gen->exc_value); - Py_CLEAR(gen->exc_traceback); - return 0; -} -static void __Pyx_Generator_dealloc(PyObject *self) { +static void +__Pyx_Generator_dealloc(PyObject *self) +{ __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self; PyObject_GC_UnTrack(gen); if (gen->gi_weakreflist != NULL) @@ -83884,10 +83181,16 @@ static void __Pyx_Generator_dealloc(PyObject *self) { return; /* resurrected. :( */ } PyObject_GC_UnTrack(self); - __Pyx_Generator_clear(self); + Py_CLEAR(gen->closure); + Py_CLEAR(gen->classobj); + Py_CLEAR(gen->exc_type); + Py_CLEAR(gen->exc_value); + Py_CLEAR(gen->exc_traceback); PyObject_GC_Del(gen); } -static void __Pyx_Generator_del(PyObject *self) { +static void +__Pyx_Generator_del(PyObject *self) +{ PyObject *res; PyObject *error_type, *error_value, *error_traceback; __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self; @@ -83916,13 +83219,11 @@ static void __Pyx_Generator_del(PyObject *self) { _Py_NewReference(self); self->ob_refcnt = refcnt; } -#if CYTHON_COMPILING_FOR_CPYTHON assert(PyType_IS_GC(self->ob_type) && _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED); /* If Py_REF_DEBUG, _Py_NewReference bumped _Py_RefTotal, so * we need to undo that. */ _Py_DEC_REFTOTAL; -#endif /* If Py_TRACE_REFS, _Py_NewReference re-added self to the object * chain, so no more to do there. * If COUNT_ALLOCS, the original decref bumped tp_frees, and @@ -83930,17 +83231,13 @@ static void __Pyx_Generator_del(PyObject *self) { * undone. */ #ifdef COUNT_ALLOCS - --Py_TYPE(self)->tp_frees; - --Py_TYPE(self)->tp_allocs; + --self->ob_type->tp_frees; + --self->ob_type->tp_allocs; #endif } static PyMemberDef __pyx_Generator_memberlist[] = { {(char *) "gi_running", -#if PY_VERSION_HEX >= 0x02060000 - T_BOOL, -#else - T_BYTE, -#endif + T_INT, offsetof(__pyx_GeneratorObject, is_running), READONLY, NULL}, @@ -83952,7 +83249,7 @@ static PyMethodDef __pyx_Generator_methods[] = { {__Pyx_NAMESTR("close"), (PyCFunction) __Pyx_Generator_Close, METH_NOARGS, 0}, {0, 0, 0, 0} }; -static PyTypeObject __pyx_GeneratorType_type = { +static PyTypeObject __pyx_GeneratorType = { PyVarObject_HEAD_INIT(0, 0) __Pyx_NAMESTR("generator"), /*tp_name*/ sizeof(__pyx_GeneratorObject), /*tp_basicsize*/ @@ -83973,7 +83270,7 @@ static PyTypeObject __pyx_GeneratorType_type = { 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ - 0, /*tp_getattro*/ + PyObject_GenericGetAttr, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags*/ @@ -83982,7 +83279,7 @@ static PyTypeObject __pyx_GeneratorType_type = { 0, /*tp_clear*/ 0, /*tp_richcompare*/ offsetof(__pyx_GeneratorObject, gi_weakreflist), /* tp_weaklistoffse */ - 0, /*tp_iter*/ + PyObject_SelfIter, /*tp_iter*/ (iternextfunc) __Pyx_Generator_Next, /*tp_iternext*/ __pyx_Generator_methods, /*tp_methods*/ __pyx_Generator_memberlist, /*tp_members*/ @@ -84007,10 +83304,12 @@ static PyTypeObject __pyx_GeneratorType_type = { 0, /*tp_version_tag*/ #endif }; -static __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body, - PyObject *closure) { +static +__pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body, + PyObject *closure) +{ __pyx_GeneratorObject *gen = - PyObject_GC_New(__pyx_GeneratorObject, &__pyx_GeneratorType_type); + PyObject_GC_New(__pyx_GeneratorObject, &__pyx_GeneratorType); if (gen == NULL) return NULL; gen->body = body; @@ -84019,7 +83318,6 @@ static __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body, gen->is_running = 0; gen->resume_label = 0; gen->classobj = NULL; - gen->yieldfrom = NULL; gen->exc_type = NULL; gen->exc_value = NULL; gen->exc_traceback = NULL; @@ -84027,14 +83325,9 @@ static __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body, PyObject_GC_Track(gen); return gen; } -static int __pyx_Generator_init(void) { - __pyx_GeneratorType_type.tp_getattro = PyObject_GenericGetAttr; - __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter; - if (PyType_Ready(&__pyx_GeneratorType_type)) { - return -1; - } - __pyx_GeneratorType = &__pyx_GeneratorType_type; - return 0; +static int __pyx_Generator_init(void) +{ + return PyType_Ready(&__pyx_GeneratorType); } static int __Pyx_check_binary_version(void) { -- cgit v1.2.3 From a283adae755aa8617119afb283b9b874f64cf911 Mon Sep 17 00:00:00 2001 From: Paul Baltescu Date: Wed, 6 Mar 2013 11:43:16 +0000 Subject: Fix memory leak in trie. --- extractor/matchings_trie.cc | 3 +++ extractor/mocks/mock_precomputation.h | 1 - extractor/precomputation.cc | 19 +------------------ extractor/precomputation.h | 2 -- extractor/precomputation_test.cc | 34 ---------------------------------- extractor/run_extractor.cc | 15 ++++++--------- python/pkg/cdec/sa/compile.py | 11 ----------- python/src/sa/_sa.c | 2 +- 8 files changed, 11 insertions(+), 76 deletions(-) (limited to 'python/pkg') diff --git a/extractor/matchings_trie.cc b/extractor/matchings_trie.cc index 921ec582..8ea795db 100644 --- a/extractor/matchings_trie.cc +++ b/extractor/matchings_trie.cc @@ -14,6 +14,9 @@ void MatchingsTrie::ResetTree(shared_ptr root) { for (auto child: root->children) { ResetTree(child.second); } + if (root->suffix_link != NULL) { + root->suffix_link.reset(); + } root.reset(); } } diff --git a/extractor/mocks/mock_precomputation.h b/extractor/mocks/mock_precomputation.h index 987bdb2f..9bc72235 100644 --- a/extractor/mocks/mock_precomputation.h +++ b/extractor/mocks/mock_precomputation.h @@ -4,6 +4,5 @@ class MockPrecomputation : public Precomputation { public: - MOCK_CONST_METHOD0(GetInvertedIndex, const Index&()); MOCK_CONST_METHOD0(GetCollocations, const Index&()); }; diff --git a/extractor/precomputation.cc b/extractor/precomputation.cc index 8a76beb1..189ac42c 100644 --- a/extractor/precomputation.cc +++ b/extractor/precomputation.cc @@ -41,7 +41,6 @@ Precomputation::Precomputation( for (int j = 1; j <= max_frequent_phrase_len && i + j <= data.size(); ++j) { pattern.push_back(data[i + j - 1]); if (frequent_patterns_set.count(pattern)) { - inverted_index[pattern].push_back(i); int is_super_frequent = super_frequent_patterns_set.count(pattern); matchings.push_back(make_tuple(i, j, is_super_frequent)); } else { @@ -158,19 +157,7 @@ void Precomputation::WriteBinary(const fs::path& filepath) const { FILE* file = fopen(filepath.string().c_str(), "w"); // TODO(pauldb): Refactor this code. - int size = inverted_index.size(); - fwrite(&size, sizeof(int), 1, file); - for (auto entry: inverted_index) { - size = entry.first.size(); - fwrite(&size, sizeof(int), 1, file); - fwrite(entry.first.data(), sizeof(int), size, file); - - size = entry.second.size(); - fwrite(&size, sizeof(int), 1, file); - fwrite(entry.second.data(), sizeof(int), size, file); - } - - size = collocations.size(); + int size = collocations.size(); fwrite(&size, sizeof(int), 1, file); for (auto entry: collocations) { size = entry.first.size(); @@ -183,10 +170,6 @@ void Precomputation::WriteBinary(const fs::path& filepath) const { } } -const Index& Precomputation::GetInvertedIndex() const { - return inverted_index; -} - const Index& Precomputation::GetCollocations() const { return collocations; } diff --git a/extractor/precomputation.h b/extractor/precomputation.h index 28426bfa..3d44c2a6 100644 --- a/extractor/precomputation.h +++ b/extractor/precomputation.h @@ -30,7 +30,6 @@ class Precomputation { void WriteBinary(const fs::path& filepath) const; - virtual const Index& GetInvertedIndex() const; virtual const Index& GetCollocations() const; static int NON_TERMINAL; @@ -49,7 +48,6 @@ class Precomputation { void AddStartPositions(vector& positions, int pos1, int pos2); void AddStartPositions(vector& positions, int pos1, int pos2, int pos3); - Index inverted_index; Index collocations; }; diff --git a/extractor/precomputation_test.cc b/extractor/precomputation_test.cc index 9edb29db..6b77b9c0 100644 --- a/extractor/precomputation_test.cc +++ b/extractor/precomputation_test.cc @@ -35,40 +35,6 @@ class PrecomputationTest : public Test { shared_ptr suffix_array; }; -TEST_F(PrecomputationTest, TestInvertedIndex) { - Precomputation precomputation(suffix_array, 100, 3, 10, 5, 1, 4, 2); - Index inverted_index = precomputation.GetInvertedIndex(); - - EXPECT_EQ(8, inverted_index.size()); - vector key = {2}; - vector expected_value = {1, 5, 8, 11}; - EXPECT_EQ(expected_value, inverted_index[key]); - key = {3}; - expected_value = {2, 6, 9}; - EXPECT_EQ(expected_value, inverted_index[key]); - key = {4}; - expected_value = {0, 10}; - EXPECT_EQ(expected_value, inverted_index[key]); - key = {5}; - expected_value = {3, 7}; - EXPECT_EQ(expected_value, inverted_index[key]); - key = {4, 2}; - expected_value = {0, 10}; - EXPECT_EQ(expected_value, inverted_index[key]); - key = {2, 3}; - expected_value = {1, 5, 8}; - EXPECT_EQ(expected_value, inverted_index[key]); - key = {3, 5}; - expected_value = {2, 6}; - EXPECT_EQ(expected_value, inverted_index[key]); - key = {2, 3, 5}; - expected_value = {1, 5}; - EXPECT_EQ(expected_value, inverted_index[key]); - - key = {2, 4}; - EXPECT_EQ(0, inverted_index.count(key)); -} - TEST_F(PrecomputationTest, TestCollocations) { Precomputation precomputation(suffix_array, 3, 3, 10, 5, 1, 4, 2); Index collocations = precomputation.GetCollocations(); diff --git a/extractor/run_extractor.cc b/extractor/run_extractor.cc index 36dbd7a0..5255737d 100644 --- a/extractor/run_extractor.cc +++ b/extractor/run_extractor.cc @@ -31,14 +31,6 @@ namespace fs = boost::filesystem; namespace po = boost::program_options; using namespace std; -void my_pause() { - cerr << "pausing..." << endl; - for (int i = 0; i < 10000000; ++i) { - cerr << endl; - } - cerr << "end pause" << endl; -} - int main(int argc, char** argv) { // TODO(pauldb): Also take arguments from config file. po::options_description desc("Command line options"); @@ -122,7 +114,7 @@ int main(int argc, char** argv) { cerr << "Reading alignment took " << GetDuration(start_time, stop_time) << " seconds" << endl; - cerr << "Precomputating collocations..." << endl; + cerr << "Precomputing collocations..." << endl; start_time = Clock::now(); shared_ptr precomputation = make_shared( source_suffix_array, @@ -150,6 +142,8 @@ int main(int argc, char** argv) { << GetDuration(preprocess_start_time, preprocess_stop_time) << " seconds" << endl; + cerr << "creating grammar extractor" << endl; + Clock::time_point extraction_start_time = Clock::now(); vector > features = { make_shared(), @@ -176,6 +170,9 @@ int main(int argc, char** argv) { vm["max_samples"].as(), vm["tight_phrases"].as()); + // Release extra memory used by the initial precomputation. + precomputation.reset(); + int grammar_id = 0; fs::path grammar_path = vm["grammars"].as(); if (!fs::is_directory(grammar_path)) { diff --git a/python/pkg/cdec/sa/compile.py b/python/pkg/cdec/sa/compile.py index 1362e7b5..d4cd8387 100644 --- a/python/pkg/cdec/sa/compile.py +++ b/python/pkg/cdec/sa/compile.py @@ -21,10 +21,6 @@ def precompute(f_sa, max_len, max_nt, max_size, min_gap, rank1, rank2, tight_phr train_min_gap_size=min_gap) return precomp -def my_pause(): - for i in range(10000000): - print >> sys.stderr, "" - def main(): preprocess_start_time = monitor_cpu() sys.setrecursionlimit(sys.getrecursionlimit() * 100) @@ -89,8 +85,6 @@ def main(): stop_time = monitor_cpu() logger.info('Compiling source suffix array took %f seconds', stop_time - start_time) - my_pause() - start_time = monitor_cpu() logger.info('Compiling target data array') if args.bitext: @@ -100,7 +94,6 @@ def main(): e.write_binary(e_bin) stop_time = monitor_cpu() logger.info('Compiling target data array took %f seconds', stop_time - start_time) - my_pause() start_time = monitor_cpu() logger.info('Precomputing frequent phrases') @@ -108,15 +101,12 @@ def main(): stop_time = monitor_cpu() logger.info('Compiling precomputations took %f seconds', stop_time - start_time) - my_pause() - start_time = monitor_cpu() logger.info('Compiling alignment') a = cdec.sa.Alignment(from_text=args.alignment) a.write_binary(a_bin) stop_time = monitor_cpu() logger.info('Compiling alignment took %f seonds', stop_time - start_time) - my_pause() start_time = monitor_cpu() logger.info('Compiling bilexical dictionary') @@ -124,7 +114,6 @@ def main(): lex.write_binary(lex_bin) stop_time = monitor_cpu() logger.info('Compiling bilexical dictionary took %f seconds', stop_time - start_time) - my_pause() # Write configuration config = cdec.configobj.ConfigObj(args.config, unrepr=True) diff --git a/python/src/sa/_sa.c b/python/src/sa/_sa.c index 92abd4c3..4bdabc17 100644 --- a/python/src/sa/_sa.c +++ b/python/src/sa/_sa.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.16 on Fri Feb 22 16:52:09 2013 */ +/* Generated by Cython 0.16 on Wed Mar 6 11:06:18 2013 */ #define PY_SSIZE_T_CLEAN #include "Python.h" -- cgit v1.2.3 From b34c347cd7f4f8965e4d943543a31f9a4e886f54 Mon Sep 17 00:00:00 2001 From: Paul Baltescu Date: Thu, 7 Mar 2013 14:38:23 +0000 Subject: Added unit test for loose phrases. --- extractor/data_array.h | 2 +- extractor/features/is_source_singleton.cc | 2 +- extractor/run_extractor.cc | 17 +- extractor/target_phrase_extractor_test.cc | 28 +- python/pkg/cdec/sa/features.py | 4 +- python/src/sa/_sa.c | 18569 +++++++++++++++------------- python/src/sa/rulefactory.pxi | 4 +- 7 files changed, 9810 insertions(+), 8816 deletions(-) (limited to 'python/pkg') diff --git a/extractor/data_array.h b/extractor/data_array.h index 42e12135..a26bbecf 100644 --- a/extractor/data_array.h +++ b/extractor/data_array.h @@ -17,7 +17,7 @@ enum Side { TARGET }; -// TODO: This class has features for both the source and target data arrays. +// Note: This class has features for both the source and target data arrays. // Maybe we can save some memory by having more specific implementations (e.g. // sentence_id is only needed for the source data array). class DataArray { diff --git a/extractor/features/is_source_singleton.cc b/extractor/features/is_source_singleton.cc index ab54e51a..1abb486f 100644 --- a/extractor/features/is_source_singleton.cc +++ b/extractor/features/is_source_singleton.cc @@ -6,7 +6,7 @@ namespace extractor { namespace features { double IsSourceSingleton::Score(const FeatureContext& context) const { - return context.source_phrase_count == 1; + return fabs(context.source_phrase_count - 1) < 1e-6; } string IsSourceSingleton::GetName() const { diff --git a/extractor/run_extractor.cc b/extractor/run_extractor.cc index 0f91236d..ae3a875e 100644 --- a/extractor/run_extractor.cc +++ b/extractor/run_extractor.cc @@ -60,7 +60,6 @@ int main(int argc, char** argv) { "Minimum number of occurences for a pharse to be considered frequent") ("max_samples", po::value()->default_value(300), "Maximum number of samples") - // TODO(pauldb): Check if this works when set to false. ("tight_phrases", po::value()->default_value(true), "False if phrases may be loose (better, but slower)"); @@ -144,17 +143,15 @@ int main(int argc, char** argv) { << GetDuration(preprocess_start_time, preprocess_stop_time) << " seconds" << endl; - cerr << "creating grammar extractor" << endl; - Clock::time_point extraction_start_time = Clock::now(); vector > features = { -// make_shared(), -// make_shared(), -// make_shared(), -// make_shared(table), -// make_shared(table), -// make_shared(), -// make_shared() + make_shared(), + make_shared(), + make_shared(), + make_shared(table), + make_shared(table), + make_shared(), + make_shared() }; shared_ptr scorer = make_shared(features); diff --git a/extractor/target_phrase_extractor_test.cc b/extractor/target_phrase_extractor_test.cc index a686d20b..80927dee 100644 --- a/extractor/target_phrase_extractor_test.cc +++ b/extractor/target_phrase_extractor_test.cc @@ -111,8 +111,32 @@ TEST_F(TargetPhraseExtractorTest, TestExtractPhrasesTightPhrasesFalse) { target_gaps, target_low, 1, 5, source_indexes, 0); EXPECT_EQ(10, results.size()); - // TODO(pauldb): Finish unit test once it's clear how these alignments should - // look like. + for (int i = 0; i < 2; ++i) { + for (int j = 4; j <= 6; ++j) { + for (int k = 4; k <= j; ++k) { + vector expected_words; + for (int l = i; l < 2; ++l) { + expected_words.push_back(target_words[l]); + } + for (int l = k; l < j; ++l) { + expected_words.push_back(target_words[l]); + } + + PhraseAlignment expected_alignment; + expected_alignment.push_back(make_pair(1, 1 - i)); + + bool found_expected_pair = false; + for (auto result: results) { + if (result.first.GetWords() == expected_words && + result.second == expected_alignment) { + found_expected_pair = true; + } + } + + EXPECT_TRUE(found_expected_pair); + } + } + } } } // namespace diff --git a/python/pkg/cdec/sa/features.py b/python/pkg/cdec/sa/features.py index 46412cd5..c8fc1cca 100644 --- a/python/pkg/cdec/sa/features.py +++ b/python/pkg/cdec/sa/features.py @@ -105,7 +105,7 @@ def IsSingletonF(ctx): count = ctx.fcount else: count = ctx.fcount + ctx.online.fcount - return (count == 1) + return math.fabs(count - 1) < 1e-6 def IsSingletonFE(ctx): if not ctx.online: @@ -139,4 +139,4 @@ def IsSupportedOnline(ctx): # Occurs in online data? if ctx.online: return (ctx.online.paircount > 0.01) else: - return False \ No newline at end of file + return False diff --git a/python/src/sa/_sa.c b/python/src/sa/_sa.c index 4bdabc17..fe79363e 100644 --- a/python/src/sa/_sa.c +++ b/python/src/sa/_sa.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.16 on Wed Mar 6 11:06:18 2013 */ +/* Generated by Cython 0.17.1 on Thu Mar 7 12:40:34 2013 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -11,7 +11,6 @@ #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif - #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall @@ -23,22 +22,18 @@ #define __fastcall #endif #endif - #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif - #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif - #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif - #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 @@ -46,28 +41,25 @@ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif - -#if CYTHON_COMPILING_IN_PYPY - #define __Pyx_PyCFunction_Call PyObject_Call -#else - #define __Pyx_PyCFunction_Call PyCFunction_Call -#endif - #if PY_VERSION_HEX < 0x02050000 typedef int Py_ssize_t; #define PY_SSIZE_T_MAX INT_MAX #define PY_SSIZE_T_MIN INT_MIN #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 PyNumber_Index(o) PyNumber_Int(o) - #define PyIndex_Check(o) PyNumber_Check(o) + #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ + (PyErr_Format(PyExc_TypeError, \ + "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ + (PyObject*)0)) + #define PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && !PyComplex_Check(o)) #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) #define __PYX_BUILD_PY_SSIZE_T "i" #else #define __PYX_BUILD_PY_SSIZE_T "n" + #define CYTHON_FORMAT_SSIZE_T "z" #endif - #if PY_VERSION_HEX < 0x02060000 #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) @@ -75,7 +67,6 @@ #define PyVarObject_HEAD_INIT(type, size) \ PyObject_HEAD_INIT(type) size, #define PyType_Modified(t) - typedef struct { void *buf; PyObject *obj; @@ -89,7 +80,6 @@ Py_ssize_t *suboffsets; void *internal; } Py_buffer; - #define PyBUF_SIMPLE 0 #define PyBUF_WRITABLE 0x0001 #define PyBUF_FORMAT 0x0004 @@ -101,11 +91,9 @@ #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) - typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); typedef void (*releasebufferproc)(PyObject *, Py_buffer *); #endif - #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) \ @@ -115,31 +103,30 @@ #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) #endif - #if PY_MAJOR_VERSION < 3 && PY_MINOR_VERSION < 6 #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") #endif - #if PY_MAJOR_VERSION >= 3 #define Py_TPFLAGS_CHECKTYPES 0 #define Py_TPFLAGS_HAVE_INDEX 0 #endif - #if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif - - -#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_GET_LENGTH) +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #else #define CYTHON_PEP393_ENABLED 0 - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_READ(k, d, i) ((k=k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #endif - #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject @@ -147,7 +134,6 @@ #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif - #if PY_VERSION_HEX < 0x02060000 #define PyBytesObject PyStringObject #define PyBytes_Type PyString_Type @@ -166,7 +152,6 @@ #define PyBytes_Concat PyString_Concat #define PyBytes_ConcatAndDel PyString_ConcatAndDel #endif - #if PY_VERSION_HEX < 0x02060000 #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) @@ -174,9 +159,7 @@ #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif - #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) - #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type @@ -193,11 +176,9 @@ #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #endif - #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif - #if PY_VERSION_HEX < 0x03020000 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong @@ -206,7 +187,6 @@ #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif - #if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) @@ -225,11 +205,9 @@ (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) #endif - #if PY_MAJOR_VERSION >= 3 #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #endif - #if PY_VERSION_HEX < 0x02050000 #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) @@ -239,7 +217,6 @@ #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) #endif - #if PY_VERSION_HEX < 0x02050000 #define __Pyx_NAMESTR(n) ((char *)(n)) #define __Pyx_DOCSTR(n) ((char *)(n)) @@ -248,6 +225,7 @@ #define __Pyx_DOCSTR(n) (n) #endif + #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) @@ -329,7 +307,11 @@ static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); +#if CYTHON_COMPILING_IN_CPYTHON #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #ifdef __GNUC__ @@ -438,7 +420,7 @@ struct __pyx_t_3_sa__Trie_Node; struct __pyx_t_3_sa_match_node; struct __pyx_t_3_sa_Matching; -/* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":9 +/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":9 * from libc.string cimport memset, strcpy * * cdef struct _node: # <<<<<<<<<<<<<< @@ -452,7 +434,7 @@ struct __pyx_t_3_sa__node { int val; }; -/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":30 +/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":30 * _init_lower_mask() * * cdef struct _BitSet: # <<<<<<<<<<<<<< @@ -466,7 +448,7 @@ struct __pyx_t_3_sa__BitSet { int size; }; -/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":168 +/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":168 * return result * * cdef struct _VEB: # <<<<<<<<<<<<<< @@ -483,7 +465,7 @@ struct __pyx_t_3_sa__VEB { void **bottom; }; -/* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":10 +/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":10 * cdef struct _Trie_Node # forward decl * * cdef struct _Trie_Edge: # <<<<<<<<<<<<<< @@ -497,7 +479,7 @@ struct __pyx_t_3_sa__Trie_Edge { struct __pyx_t_3_sa__Trie_Edge *smaller; }; -/* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":8 +/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":8 * from libc.string cimport memset, memcpy * * cdef struct _Trie_Node # forward decl # <<<<<<<<<<<<<< @@ -510,7 +492,7 @@ struct __pyx_t_3_sa__Trie_Node { int arr_len; }; -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":76 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":77 * * # linked list structure for storing matches in BaselineRuleFactory * cdef struct match_node: # <<<<<<<<<<<<<< @@ -522,7 +504,7 @@ struct __pyx_t_3_sa_match_node { struct __pyx_t_3_sa_match_node *next; }; -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":172 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":167 * * # struct used to encapsulate a single matching * cdef struct Matching: # <<<<<<<<<<<<<< @@ -537,7 +519,7 @@ struct __pyx_t_3_sa_Matching { int size; }; -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":228 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":223 * * * cdef class HieroCachingRuleFactory: # <<<<<<<<<<<<<< @@ -596,7 +578,7 @@ struct __pyx_obj_3_sa_HieroCachingRuleFactory { }; -/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":118 +/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":118 * for arc in node for node in lattice) * * def decode_sentence(lattice): # <<<<<<<<<<<<<< @@ -609,7 +591,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_9_decode_sentence { }; -/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":187 +/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":187 * 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())) # <<<<<<<<<<<<<< @@ -626,7 +608,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_17_genexpr { }; -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1187 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1190 * # Online rule extraction and scoring * if self.online: * f_syms = tuple(word[0][0] for word in fwords) # <<<<<<<<<<<<<< @@ -643,7 +625,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_20_genexpr { }; -/* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":36 +/* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":36 * logger.info("LCP array completed") * * def compute_stats(self, int max_n): # <<<<<<<<<<<<<< @@ -674,7 +656,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_3_compute_stats { }; -/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":122 +/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":122 * * def encode_words(words): * return tuple(sym_fromstring(word, True) for word in words) # <<<<<<<<<<<<<< @@ -691,7 +673,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_12_genexpr { }; -/* "/home/paulb/workspace/cdec/python/src/sa/features.pxi":21 +/* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":21 * * def __str__(self): * return ' '.join('%s=%s' % feat for feat in self) # <<<<<<<<<<<<<< @@ -725,7 +707,7 @@ struct __pyx_obj_3_sa_IntList { }; -/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":340 +/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":340 * * * cdef class VEBIterator: # <<<<<<<<<<<<<< @@ -739,7 +721,7 @@ struct __pyx_obj_3_sa_VEBIterator { }; -/* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":47 +/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":47 * * * cdef class BiLex: # <<<<<<<<<<<<<< @@ -760,7 +742,7 @@ struct __pyx_obj_3_sa_BiLex { }; -/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":354 +/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":354 * * * cdef class VEB: # <<<<<<<<<<<<<< @@ -774,7 +756,7 @@ struct __pyx_obj_3_sa_VEB { }; -/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":121 +/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":121 * return tuple(sym_tostring(sym) for ((sym, _, _),) in lattice) * * def encode_words(words): # <<<<<<<<<<<<<< @@ -787,7 +769,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_11_encode_words { }; -/* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":5 +/* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":5 * as k most frequent n-grams""" * * cdef class LCP: # <<<<<<<<<<<<<< @@ -801,7 +783,7 @@ struct __pyx_obj_3_sa_LCP { }; -/* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":9 +/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":9 * from libc.string cimport memset, strcpy * * cdef class DataArray: # <<<<<<<<<<<<<< @@ -820,7 +802,7 @@ struct __pyx_obj_3_sa_DataArray { }; -/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":100 +/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":100 * * * cdef class BitSetIterator: # <<<<<<<<<<<<<< @@ -834,7 +816,7 @@ struct __pyx_obj_3_sa_BitSetIterator { }; -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2115 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2121 * f = Phrase(f_sym) * e = Phrase(e_sym) * a = tuple(self.alignment.link(i, j) for (i, j) in links) # <<<<<<<<<<<<<< @@ -852,7 +834,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_23_genexpr { }; -/* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":188 +/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":188 * * * cdef class Precomputation: # <<<<<<<<<<<<<< @@ -873,7 +855,7 @@ struct __pyx_obj_3_sa_Precomputation { }; -/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":190 +/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":190 * return ' ||| '.join(fields) * * def alignments(self): # <<<<<<<<<<<<<< @@ -890,7 +872,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_18_alignments { }; -/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":125 +/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":125 * * def decode_words(syms): * return tuple(sym_tostring(sym) for sym in syms) # <<<<<<<<<<<<<< @@ -905,7 +887,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_14_genexpr { }; -/* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":6 +/* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":6 * from libc.stdio cimport FILE, fclose, fopen * * cdef class SuffixArray: # <<<<<<<<<<<<<< @@ -921,7 +903,7 @@ struct __pyx_obj_3_sa_SuffixArray { }; -/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":183 +/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":183 * return self.f.arity() * * def __str__(self): # <<<<<<<<<<<<<< @@ -934,7 +916,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_16___str__ { }; -/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":7 +/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":7 * cdef int INDEX_MASK = (1<= 0)) ? i : i + PyList_GET_SIZE(o); if (likely((n >= 0) & (n < PyList_GET_SIZE(o)))) { @@ -2017,30 +2015,36 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) Py_INCREF(r); return r; } - } - else if (likely(i >= 0)) { + } else { /* inlined PySequence_GetItem() */ PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; if (likely(m && m->sq_item)) { + if (unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (unlikely(l < 0)) return NULL; + i += l; + } return m->sq_item(o, i); } } +#else + if (PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } -static CYTHON_INLINE int __Pyx_NegateNonNeg(int b) { - return unlikely(b < 0) ? b : !b; -} -static CYTHON_INLINE PyObject* __Pyx_PyBoolOrNull_FromLong(long b) { - return unlikely(b < 0) ? NULL : __Pyx_PyBool_FromLong(b); +static CYTHON_INLINE int __Pyx_PySequence_Contains(PyObject* item, PyObject* seq, int eq) { + int result = PySequence_Contains(seq, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } static CYTHON_INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) { if (likely(PyList_CheckExact(L))) { - if (PyList_Append(L, x) < 0) return NULL; + if (unlikely(PyList_Append(L, x) < 0)) return NULL; Py_INCREF(Py_None); return Py_None; /* this is just to have an accurate signature */ - } - else { + } else { PyObject *r, *m; m = __Pyx_GetAttrString(L, "append"); if (!m) return NULL; @@ -2058,9 +2062,11 @@ static CYTHON_INLINE long __Pyx_div_long(long, long); /* proto */ static CYTHON_INLINE long __Pyx_mod_long(long, long); /* proto */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); +static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/ @@ -2075,6 +2081,7 @@ static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyOb return r; } static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v) { +#if CYTHON_COMPILING_IN_CPYTHON if (PyList_CheckExact(o)) { Py_ssize_t n = (likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if (likely((n >= 0) & (n < PyList_GET_SIZE(o)))) { @@ -2084,26 +2091,79 @@ static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObje Py_DECREF(old); return 1; } - } - else if (likely(i >= 0)) { + } else { /* inlined PySequence_SetItem() */ PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; if (likely(m && m->sq_ass_item)) { + if (unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (unlikely(l < 0)) return -1; + i += l; + } return m->sq_ass_item(o, i, v); } } +#else +#if CYTHON_COMPILING_IN_PYPY + if (PySequence_Check(o) && !PyDict_Check(o)) { +#else + if (PySequence_Check(o)) { +#endif + return PySequence_SetItem(o, i, v); + } +#endif return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v); } static double __Pyx__PyObject_AsDouble(PyObject* obj); /* proto */ +#if CYTHON_COMPILING_IN_PYPY +#define __Pyx_PyObject_AsDouble(obj) \ +(likely(PyFloat_CheckExact(obj)) ? PyFloat_AS_DOUBLE(obj) : \ + likely(PyInt_CheckExact(obj)) ? \ + PyFloat_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj)) +#else #define __Pyx_PyObject_AsDouble(obj) \ ((likely(PyFloat_CheckExact(obj))) ? \ PyFloat_AS_DOUBLE(obj) : __Pyx__PyObject_AsDouble(obj)) +#endif static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact); /*proto*/ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len)) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +static CYTHON_INLINE int __Pyx_PyDict_Contains(PyObject* item, PyObject* dict, int eq) { + int result = PyDict_Contains(dict, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); + +static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /*proto*/ + +static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** value1, PyObject** value2, + int is_tuple, int has_known_size, int decref_tuple); + +static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name, + Py_ssize_t* p_orig_length, int* p_is_dict); +static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos, + PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict); + #if PY_VERSION_HEX < 0x02050000 #ifndef PyAnySet_CheckExact #define PyAnySet_CheckExact(ob) \ @@ -2137,15 +2197,9 @@ static CYTHON_INLINE int PySet_Add(PyObject *set, PyObject *key) { #endif /* PyAnySet_CheckExact (<= Py2.4) */ #endif /* < Py2.5 */ -static CYTHON_INLINE void __Pyx_RaiseNoneIndexingError(void); - #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { PyObject *value; - if (unlikely(d == Py_None)) { - __Pyx_RaiseNoneIndexingError(); - return NULL; - } value = PyDict_GetItemWithError(d, key); if (unlikely(!value)) { if (!PyErr_Occurred()) @@ -2186,18 +2240,6 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level); static CYTHON_INLINE void __Pyx_RaiseImportError(PyObject *name); -#include - -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 - #define __Pyx_CyFunction_USED 1 #include #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 @@ -2240,6 +2282,12 @@ static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static int __Pyx_CyFunction_init(void); +static int __Pyx_Print(PyObject*, PyObject *, int); /*proto*/ +#if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3 +static PyObject* __pyx_print = 0; +static PyObject* __pyx_print_kwargs = 0; +#endif + static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *); static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *); @@ -2279,22 +2327,30 @@ static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, #define __Pyx_Generator_USED #include +#include typedef PyObject *(*__pyx_generator_body_t)(PyObject *, PyObject *); typedef struct { PyObject_HEAD __pyx_generator_body_t body; PyObject *closure; - int is_running; - int resume_label; PyObject *exc_type; PyObject *exc_value; PyObject *exc_traceback; PyObject *gi_weakreflist; PyObject *classobj; + PyObject *yieldfrom; + int resume_label; + char is_running; // using T_BOOL for property below requires char value } __pyx_GeneratorObject; static __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body, PyObject *closure); static int __pyx_Generator_init(void); +static int __Pyx_Generator_clear(PyObject* self); +#if 1 || PY_VERSION_HEX < 0x030300B0 +static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue); +#else +#define __Pyx_PyGen_FetchStopIterationValue(pvalue) PyGen_FetchStopIterationValue(pvalue) +#endif static int __Pyx_check_binary_version(void); @@ -2763,30 +2819,31 @@ static char __pyx_k_118[] = "}"; static char __pyx_k_119[] = "get_precomputed_collocation"; static char __pyx_k_120[] = "double binary"; static char __pyx_k_121[] = "Keyword trie error"; -static char __pyx_k_123[] = "get_all_nodes_isteps_away"; -static char __pyx_k_124[] = "Total time for rule lookup, extraction, and scoring = %f seconds"; -static char __pyx_k_125[] = " Extract time = %f seconds"; -static char __pyx_k_126[] = " Intersect time = %f seconds"; -static char __pyx_k_127[] = "No aligned terminals"; -static char __pyx_k_128[] = "Unaligned chunk"; -static char __pyx_k_129[] = "Gaps are not tight phrases"; -static char __pyx_k_130[] = "Inside edges of preceding subphrase are not tight"; -static char __pyx_k_131[] = "Inside edges of following subphrase are not tight"; -static char __pyx_k_132[] = "Subphrase [%d, %d] failed integrity check"; -static char __pyx_k_133[] = "Didn't extract anything from [%d, %d] -> [%d, %d]"; -static char __pyx_k_134[] = "Unable to extract basic phrase"; -static char __pyx_k_137[] = "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi"; -static char __pyx_k_138[] = "{0}-{1}"; -static char __pyx_k_139[] = "[X] ||| {0} ||| {1} ||| {2}"; -static char __pyx_k_140[] = "------------------------------"; -static char __pyx_k_142[] = " Online Stats "; -static char __pyx_k_146[] = " : "; -static char __pyx_k_152[] = "OnlineFeatureContext"; -static char __pyx_k_155[] = "%s=%s"; -static char __pyx_k_157[] = "/home/paulb/workspace/cdec/python/src/sa/_sa.pyx"; -static char __pyx_k_160[] = "cdec.sa"; -static char __pyx_k_164[] = "/home/paulb/workspace/cdec/python/src/sa/sym.pxi"; -static char __pyx_k_175[] = "*EPS*"; +static char __pyx_k_123[] = "[X,1] specific policy choices faced [X,2] , not"; +static char __pyx_k_124[] = "get_all_nodes_isteps_away"; +static char __pyx_k_125[] = "Total time for rule lookup, extraction, and scoring = %f seconds"; +static char __pyx_k_126[] = " Extract time = %f seconds"; +static char __pyx_k_127[] = " Intersect time = %f seconds"; +static char __pyx_k_128[] = "No aligned terminals"; +static char __pyx_k_129[] = "Unaligned chunk"; +static char __pyx_k_130[] = "Gaps are not tight phrases"; +static char __pyx_k_131[] = "Inside edges of preceding subphrase are not tight"; +static char __pyx_k_132[] = "Inside edges of following subphrase are not tight"; +static char __pyx_k_133[] = "Subphrase [%d, %d] failed integrity check"; +static char __pyx_k_134[] = "Didn't extract anything from [%d, %d] -> [%d, %d]"; +static char __pyx_k_135[] = "Unable to extract basic phrase"; +static char __pyx_k_138[] = "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi"; +static char __pyx_k_139[] = "{0}-{1}"; +static char __pyx_k_140[] = "[X] ||| {0} ||| {1} ||| {2}"; +static char __pyx_k_141[] = "------------------------------"; +static char __pyx_k_143[] = " Online Stats "; +static char __pyx_k_147[] = " : "; +static char __pyx_k_153[] = "OnlineFeatureContext"; +static char __pyx_k_156[] = "%s=%s"; +static char __pyx_k_158[] = "/home/pauldb/workspace/cdec/python/src/sa/_sa.pyx"; +static char __pyx_k_161[] = "cdec.sa"; +static char __pyx_k_165[] = "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi"; +static char __pyx_k_176[] = "*EPS*"; static char __pyx_k__FE[] = "FE"; static char __pyx_k__al[] = "al"; static char __pyx_k__fe[] = "fe"; @@ -2818,6 +2875,7 @@ 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__sys[] = "sys"; static char __pyx_k__vec[] = "vec"; static char __pyx_k__zip[] = "zip"; static char __pyx_k__NULL[] = "NULL"; @@ -2886,6 +2944,7 @@ 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__stderr[] = "stderr"; static char __pyx_k__unlink[] = "unlink"; static char __pyx_k__Counter[] = "Counter"; static char __pyx_k__advance[] = "advance"; @@ -3048,8 +3107,8 @@ static PyObject *__pyx_kp_s_118; static PyObject *__pyx_n_s_119; static PyObject *__pyx_kp_s_120; static PyObject *__pyx_kp_s_121; -static PyObject *__pyx_n_s_123; -static PyObject *__pyx_kp_s_124; +static PyObject *__pyx_kp_s_123; +static PyObject *__pyx_n_s_124; static PyObject *__pyx_kp_s_125; static PyObject *__pyx_kp_s_126; static PyObject *__pyx_kp_s_127; @@ -3061,18 +3120,19 @@ 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_137; +static PyObject *__pyx_kp_s_135; 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_142; -static PyObject *__pyx_kp_s_146; -static PyObject *__pyx_n_s_152; -static PyObject *__pyx_kp_s_155; -static PyObject *__pyx_kp_s_157; -static PyObject *__pyx_kp_s_160; -static PyObject *__pyx_kp_s_164; +static PyObject *__pyx_kp_s_141; +static PyObject *__pyx_kp_s_143; +static PyObject *__pyx_kp_s_147; +static PyObject *__pyx_n_s_153; +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_18; static PyObject *__pyx_kp_s_2; static PyObject *__pyx_kp_s_21; @@ -3349,10 +3409,12 @@ 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__stderr; 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__sys; static PyObject *__pyx_n_s__test_sentence; static PyObject *__pyx_n_s__tight_phrases; static PyObject *__pyx_n_s__toMap; @@ -3436,41 +3498,41 @@ static PyObject *__pyx_k_tuple_98; static PyObject *__pyx_k_tuple_102; static PyObject *__pyx_k_tuple_107; static PyObject *__pyx_k_tuple_122; -static PyObject *__pyx_k_tuple_135; -static PyObject *__pyx_k_tuple_141; -static PyObject *__pyx_k_tuple_143; +static PyObject *__pyx_k_tuple_136; +static PyObject *__pyx_k_tuple_142; static PyObject *__pyx_k_tuple_144; static PyObject *__pyx_k_tuple_145; -static PyObject *__pyx_k_tuple_147; +static PyObject *__pyx_k_tuple_146; static PyObject *__pyx_k_tuple_148; static PyObject *__pyx_k_tuple_149; static PyObject *__pyx_k_tuple_150; static PyObject *__pyx_k_tuple_151; -static PyObject *__pyx_k_tuple_153; -static PyObject *__pyx_k_tuple_158; -static PyObject *__pyx_k_tuple_161; +static PyObject *__pyx_k_tuple_152; +static PyObject *__pyx_k_tuple_154; +static PyObject *__pyx_k_tuple_159; static PyObject *__pyx_k_tuple_162; -static PyObject *__pyx_k_tuple_165; -static PyObject *__pyx_k_tuple_167; -static PyObject *__pyx_k_tuple_169; -static PyObject *__pyx_k_tuple_171; -static PyObject *__pyx_k_tuple_173; -static PyObject *__pyx_k_tuple_176; -static PyObject *__pyx_k_tuple_178; -static PyObject *__pyx_k_tuple_180; -static PyObject *__pyx_k_codeobj_136; -static PyObject *__pyx_k_codeobj_154; -static PyObject *__pyx_k_codeobj_156; -static PyObject *__pyx_k_codeobj_159; -static PyObject *__pyx_k_codeobj_163; -static PyObject *__pyx_k_codeobj_166; -static PyObject *__pyx_k_codeobj_168; -static PyObject *__pyx_k_codeobj_170; -static PyObject *__pyx_k_codeobj_172; -static PyObject *__pyx_k_codeobj_174; -static PyObject *__pyx_k_codeobj_177; -static PyObject *__pyx_k_codeobj_179; -static PyObject *__pyx_k_codeobj_181; +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_137; +static PyObject *__pyx_k_codeobj_155; +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; /* Python wrapper */ static PyObject *__pyx_pw_3_sa_1monitor_cpu(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ @@ -3479,7 +3541,6 @@ static PyObject *__pyx_pw_3_sa_1monitor_cpu(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("monitor_cpu (wrapper)", 0); - __pyx_self = __pyx_self; __pyx_r = __pyx_pf_3_sa_monitor_cpu(__pyx_self); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -3596,7 +3657,6 @@ static PyObject *__pyx_pw_3_sa_3gzip_or_text(PyObject *__pyx_self, PyObject *__p PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("gzip_or_text (wrapper)", 0); - __pyx_self = __pyx_self; assert(__pyx_arg_filename); { __pyx_v_filename = PyBytes_AsString(__pyx_arg_filename); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -3719,11 +3779,11 @@ static int __pyx_pw_3_sa_9FloatList_1__cinit__(PyObject *__pyx_v_self, PyObject int __pyx_v_size; int __pyx_v_increment; int __pyx_v_initial_len; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__size,&__pyx_n_s__increment,&__pyx_n_s__initial_len,0}; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__size,&__pyx_n_s__increment,&__pyx_n_s__initial_len,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -3756,18 +3816,6 @@ static int __pyx_pw_3_sa_9FloatList_1__cinit__(PyObject *__pyx_v_self, PyObject if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } - if (values[0]) { - } else { - __pyx_v_size = ((int)0); - } - if (values[1]) { - } else { - __pyx_v_increment = ((int)1); - } - if (values[2]) { - } else { - __pyx_v_initial_len = ((int)0); - } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); @@ -3806,7 +3854,7 @@ static int __pyx_pw_3_sa_9FloatList_1__cinit__(PyObject *__pyx_v_self, PyObject return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":11 +/* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":11 * cdef class FloatList: * * def __cinit__(self, int size=0, int increment=1, int initial_len=0): # <<<<<<<<<<<<<< @@ -3820,7 +3868,7 @@ static int __pyx_pf_3_sa_9FloatList___cinit__(struct __pyx_obj_3_sa_FloatList *_ int __pyx_t_1; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":12 + /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":12 * * def __cinit__(self, int size=0, int increment=1, int initial_len=0): * if initial_len > size: # <<<<<<<<<<<<<< @@ -3830,7 +3878,7 @@ static int __pyx_pf_3_sa_9FloatList___cinit__(struct __pyx_obj_3_sa_FloatList *_ __pyx_t_1 = (__pyx_v_initial_len > __pyx_v_size); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":13 + /* "/home/pauldb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -3842,7 +3890,7 @@ static int __pyx_pf_3_sa_9FloatList___cinit__(struct __pyx_obj_3_sa_FloatList *_ } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":14 + /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":14 * if initial_len > size: * size = initial_len * self.size = size # <<<<<<<<<<<<<< @@ -3851,7 +3899,7 @@ static int __pyx_pf_3_sa_9FloatList___cinit__(struct __pyx_obj_3_sa_FloatList *_ */ __pyx_v_self->size = __pyx_v_size; - /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":15 + /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":15 * size = initial_len * self.size = size * self.increment = increment # <<<<<<<<<<<<<< @@ -3860,7 +3908,7 @@ static int __pyx_pf_3_sa_9FloatList___cinit__(struct __pyx_obj_3_sa_FloatList *_ */ __pyx_v_self->increment = __pyx_v_increment; - /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":16 + /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":16 * self.size = size * self.increment = increment * self.len = initial_len # <<<<<<<<<<<<<< @@ -3869,7 +3917,7 @@ static int __pyx_pf_3_sa_9FloatList___cinit__(struct __pyx_obj_3_sa_FloatList *_ */ __pyx_v_self->len = __pyx_v_initial_len; - /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":17 + /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":17 * self.increment = increment * self.len = initial_len * self.arr = malloc(size*sizeof(float)) # <<<<<<<<<<<<<< @@ -3878,7 +3926,7 @@ static int __pyx_pf_3_sa_9FloatList___cinit__(struct __pyx_obj_3_sa_FloatList *_ */ __pyx_v_self->arr = ((float *)malloc((__pyx_v_size * (sizeof(float))))); - /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":18 + /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":18 * self.len = initial_len * self.arr = malloc(size*sizeof(float)) * memset(self.arr, 0, initial_len*sizeof(float)) # <<<<<<<<<<<<<< @@ -3901,7 +3949,7 @@ static void __pyx_pw_3_sa_9FloatList_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyFinishContext(); } -/* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":20 +/* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":20 * memset(self.arr, 0, initial_len*sizeof(float)) * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -3913,7 +3961,7 @@ static void __pyx_pf_3_sa_9FloatList_2__dealloc__(struct __pyx_obj_3_sa_FloatLis __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":21 + /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":21 * * def __dealloc__(self): * free(self.arr) # <<<<<<<<<<<<<< @@ -3936,7 +3984,7 @@ static PyObject *__pyx_pw_3_sa_9FloatList_5__getitem__(PyObject *__pyx_v_self, P return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":23 +/* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":23 * free(self.arr) * * def __getitem__(self, i): # <<<<<<<<<<<<<< @@ -3959,7 +4007,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_4__getitem__(struct __pyx_obj_3_sa_Flo int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":24 + /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":24 * * def __getitem__(self, i): * j = i # <<<<<<<<<<<<<< @@ -3969,20 +4017,19 @@ static PyObject *__pyx_pf_3_sa_9FloatList_4__getitem__(struct __pyx_obj_3_sa_Flo __Pyx_INCREF(__pyx_v_i); __pyx_v_j = __pyx_v_i; - /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":25 + /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":25 * def __getitem__(self, i): * j = i * if i<0: # <<<<<<<<<<<<<< * j = self.len + i * if j<0 or j>=self.len: */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_i, __pyx_int_0, Py_LT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_1 = PyObject_RichCompare(__pyx_v_i, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 25; __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[1]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":26 + /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":26 * j = i * if i<0: * j = self.len + i # <<<<<<<<<<<<<< @@ -4001,22 +4048,20 @@ static PyObject *__pyx_pf_3_sa_9FloatList_4__getitem__(struct __pyx_obj_3_sa_Flo } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":27 + /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":27 * 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)) * return self.arr[j] */ - __pyx_t_3 = PyObject_RichCompare(__pyx_v_j, __pyx_int_0, Py_LT); 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_3 = PyObject_RichCompare(__pyx_v_j, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 27; __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[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_GOTREF(__pyx_t_3); - __pyx_t_1 = PyObject_RichCompare(__pyx_v_j, __pyx_t_3, Py_GE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __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; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -4026,7 +4071,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_4__getitem__(struct __pyx_obj_3_sa_Flo } if (__pyx_t_5) { - /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":28 + /* "/home/pauldb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -4061,7 +4106,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_4__getitem__(struct __pyx_obj_3_sa_Flo } __pyx_L4:; - /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":29 + /* "/home/pauldb/workspace/cdec/python/src/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] # <<<<<<<<<<<<<< @@ -4090,7 +4135,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_4__getitem__(struct __pyx_obj_3_sa_Flo return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":31 +/* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":31 * return self.arr[j] * * cdef void set(self, int i, float v): # <<<<<<<<<<<<<< @@ -4112,7 +4157,7 @@ static void __pyx_f_3_sa_9FloatList_set(struct __pyx_obj_3_sa_FloatList *__pyx_v int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":32 + /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":32 * * cdef void set(self, int i, float v): * j = i # <<<<<<<<<<<<<< @@ -4121,7 +4166,7 @@ static void __pyx_f_3_sa_9FloatList_set(struct __pyx_obj_3_sa_FloatList *__pyx_v */ __pyx_v_j = __pyx_v_i; - /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":33 + /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":33 * cdef void set(self, int i, float v): * j = i * if i<0: # <<<<<<<<<<<<<< @@ -4131,7 +4176,7 @@ static void __pyx_f_3_sa_9FloatList_set(struct __pyx_obj_3_sa_FloatList *__pyx_v __pyx_t_1 = (__pyx_v_i < 0); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":34 + /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":34 * j = i * if i<0: * j = self.len + i # <<<<<<<<<<<<<< @@ -4143,7 +4188,7 @@ static void __pyx_f_3_sa_9FloatList_set(struct __pyx_obj_3_sa_FloatList *__pyx_v } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":35 + /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":35 * if i<0: * j = self.len + i * if j<0 or j>=self.len: # <<<<<<<<<<<<<< @@ -4159,7 +4204,7 @@ static void __pyx_f_3_sa_9FloatList_set(struct __pyx_obj_3_sa_FloatList *__pyx_v } if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":36 + /* "/home/pauldb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -4196,7 +4241,7 @@ static void __pyx_f_3_sa_9FloatList_set(struct __pyx_obj_3_sa_FloatList *__pyx_v } __pyx_L4:; - /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":37 + /* "/home/pauldb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -4226,7 +4271,7 @@ static int __pyx_pw_3_sa_9FloatList_7__setitem__(PyObject *__pyx_v_self, PyObjec return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":39 +/* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":39 * self.arr[j] = v * * def __setitem__(self, i, val): # <<<<<<<<<<<<<< @@ -4244,7 +4289,7 @@ static int __pyx_pf_3_sa_9FloatList_6__setitem__(struct __pyx_obj_3_sa_FloatList int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setitem__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":40 + /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":40 * * def __setitem__(self, i, val): * self.set(i, val) # <<<<<<<<<<<<<< @@ -4276,7 +4321,7 @@ static Py_ssize_t __pyx_pw_3_sa_9FloatList_9__len__(PyObject *__pyx_v_self) { return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":42 +/* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":42 * self.set(i, val) * * def __len__(self): # <<<<<<<<<<<<<< @@ -4289,7 +4334,7 @@ static Py_ssize_t __pyx_pf_3_sa_9FloatList_8__len__(struct __pyx_obj_3_sa_FloatL __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":43 + /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":43 * * def __len__(self): * return self.len # <<<<<<<<<<<<<< @@ -4326,7 +4371,7 @@ static PyObject *__pyx_pw_3_sa_9FloatList_11append(PyObject *__pyx_v_self, PyObj return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":45 +/* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":45 * return self.len * * def append(self, float val): # <<<<<<<<<<<<<< @@ -4340,7 +4385,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_10append(struct __pyx_obj_3_sa_FloatLi int __pyx_t_1; __Pyx_RefNannySetupContext("append", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":46 + /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":46 * * def append(self, float val): * if self.len == self.size: # <<<<<<<<<<<<<< @@ -4350,7 +4395,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_10append(struct __pyx_obj_3_sa_FloatLi __pyx_t_1 = (__pyx_v_self->len == __pyx_v_self->size); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":47 + /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":47 * def append(self, float val): * if self.len == self.size: * self.size = self.size + self.increment # <<<<<<<<<<<<<< @@ -4359,7 +4404,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_10append(struct __pyx_obj_3_sa_FloatLi */ __pyx_v_self->size = (__pyx_v_self->size + __pyx_v_self->increment); - /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":48 + /* "/home/pauldb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -4371,7 +4416,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_10append(struct __pyx_obj_3_sa_FloatLi } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":49 + /* "/home/pauldb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -4380,7 +4425,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_10append(struct __pyx_obj_3_sa_FloatLi */ (__pyx_v_self->arr[__pyx_v_self->len]) = __pyx_v_val; - /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":50 + /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":50 * self.arr = realloc(self.arr, self.size*sizeof(float)) * self.arr[self.len] = val * self.len = self.len + 1 # <<<<<<<<<<<<<< @@ -4395,7 +4440,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_10append(struct __pyx_obj_3_sa_FloatLi return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":52 +/* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":52 * self.len = self.len + 1 * * cdef void write_handle(self, FILE* f): # <<<<<<<<<<<<<< @@ -4407,7 +4452,7 @@ static void __pyx_f_3_sa_9FloatList_write_handle(struct __pyx_obj_3_sa_FloatList __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("write_handle", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":53 + /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":53 * * cdef void write_handle(self, FILE* f): * fwrite(&(self.len), sizeof(float), 1, f) # <<<<<<<<<<<<<< @@ -4416,7 +4461,7 @@ static void __pyx_f_3_sa_9FloatList_write_handle(struct __pyx_obj_3_sa_FloatList */ fwrite((&__pyx_v_self->len), (sizeof(float)), 1, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":54 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -4449,7 +4494,7 @@ static PyObject *__pyx_pw_3_sa_9FloatList_13write(PyObject *__pyx_v_self, PyObje return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":56 +/* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":56 * fwrite(self.arr, sizeof(float), self.len, f) * * def write(self, char* filename): # <<<<<<<<<<<<<< @@ -4463,7 +4508,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_12write(struct __pyx_obj_3_sa_FloatLis __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("write", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":58 + /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":58 * def write(self, char* filename): * cdef FILE* f * f = fopen(filename, "w") # <<<<<<<<<<<<<< @@ -4472,7 +4517,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_12write(struct __pyx_obj_3_sa_FloatLis */ __pyx_v_f = fopen(__pyx_v_filename, __pyx_k__w); - /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":59 + /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":59 * cdef FILE* f * f = fopen(filename, "w") * self.write_handle(f) # <<<<<<<<<<<<<< @@ -4481,7 +4526,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_12write(struct __pyx_obj_3_sa_FloatLis */ ((struct __pyx_vtabstruct_3_sa_FloatList *)__pyx_v_self->__pyx_vtab)->write_handle(__pyx_v_self, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":60 + /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":60 * f = fopen(filename, "w") * self.write_handle(f) * fclose(f) # <<<<<<<<<<<<<< @@ -4496,7 +4541,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_12write(struct __pyx_obj_3_sa_FloatLis return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":62 +/* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":62 * fclose(f) * * cdef void read_handle(self, FILE* f): # <<<<<<<<<<<<<< @@ -4508,7 +4553,7 @@ static void __pyx_f_3_sa_9FloatList_read_handle(struct __pyx_obj_3_sa_FloatList __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("read_handle", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":63 + /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":63 * * cdef void read_handle(self, FILE* f): * free(self.arr) # <<<<<<<<<<<<<< @@ -4517,7 +4562,7 @@ static void __pyx_f_3_sa_9FloatList_read_handle(struct __pyx_obj_3_sa_FloatList */ free(__pyx_v_self->arr); - /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":64 + /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":64 * cdef void read_handle(self, FILE* f): * free(self.arr) * fread(&(self.len), sizeof(float), 1, f) # <<<<<<<<<<<<<< @@ -4526,7 +4571,7 @@ static void __pyx_f_3_sa_9FloatList_read_handle(struct __pyx_obj_3_sa_FloatList */ fread((&__pyx_v_self->len), (sizeof(float)), 1, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":65 + /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":65 * free(self.arr) * fread(&(self.len), sizeof(float), 1, f) * self.arr = malloc(self.len * sizeof(float)) # <<<<<<<<<<<<<< @@ -4535,7 +4580,7 @@ static void __pyx_f_3_sa_9FloatList_read_handle(struct __pyx_obj_3_sa_FloatList */ __pyx_v_self->arr = ((float *)malloc((__pyx_v_self->len * (sizeof(float))))); - /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":66 + /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":66 * fread(&(self.len), sizeof(float), 1, f) * self.arr = malloc(self.len * sizeof(float)) * self.size = self.len # <<<<<<<<<<<<<< @@ -4544,7 +4589,7 @@ static void __pyx_f_3_sa_9FloatList_read_handle(struct __pyx_obj_3_sa_FloatList */ __pyx_v_self->size = __pyx_v_self->len; - /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":67 + /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":67 * self.arr = malloc(self.len * sizeof(float)) * self.size = self.len * fread(self.arr, sizeof(float), self.len, f) # <<<<<<<<<<<<<< @@ -4577,7 +4622,7 @@ static PyObject *__pyx_pw_3_sa_9FloatList_15read(PyObject *__pyx_v_self, PyObjec return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":69 +/* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":69 * fread(self.arr, sizeof(float), self.len, f) * * def read(self, char* filename): # <<<<<<<<<<<<<< @@ -4591,7 +4636,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_14read(struct __pyx_obj_3_sa_FloatList __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("read", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":71 + /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":71 * def read(self, char* filename): * cdef FILE* f * f = fopen(filename, "r") # <<<<<<<<<<<<<< @@ -4600,7 +4645,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_14read(struct __pyx_obj_3_sa_FloatList */ __pyx_v_f = fopen(__pyx_v_filename, __pyx_k__r); - /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":72 + /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":72 * cdef FILE* f * f = fopen(filename, "r") * self.read_handle(f) # <<<<<<<<<<<<<< @@ -4608,7 +4653,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_14read(struct __pyx_obj_3_sa_FloatList */ ((struct __pyx_vtabstruct_3_sa_FloatList *)__pyx_v_self->__pyx_vtab)->read_handle(__pyx_v_self, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/float_list.pxi":73 + /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":73 * f = fopen(filename, "r") * self.read_handle(f) * fclose(f) # <<<<<<<<<<<<<< @@ -4627,11 +4672,11 @@ static int __pyx_pw_3_sa_7IntList_1__cinit__(PyObject *__pyx_v_self, PyObject *_ int __pyx_v_size; int __pyx_v_increment; int __pyx_v_initial_len; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__size,&__pyx_n_s__increment,&__pyx_n_s__initial_len,0}; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__size,&__pyx_n_s__increment,&__pyx_n_s__initial_len,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -4664,18 +4709,6 @@ static int __pyx_pw_3_sa_7IntList_1__cinit__(PyObject *__pyx_v_self, PyObject *_ if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } - if (values[0]) { - } else { - __pyx_v_size = ((int)0); - } - if (values[1]) { - } else { - __pyx_v_increment = ((int)1); - } - if (values[2]) { - } else { - __pyx_v_initial_len = ((int)0); - } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); @@ -4714,7 +4747,7 @@ static int __pyx_pw_3_sa_7IntList_1__cinit__(PyObject *__pyx_v_self, PyObject *_ return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":11 +/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":11 * cdef class IntList: * * def __cinit__(self, int size=0, int increment=1, int initial_len=0): # <<<<<<<<<<<<<< @@ -4728,7 +4761,7 @@ static int __pyx_pf_3_sa_7IntList___cinit__(struct __pyx_obj_3_sa_IntList *__pyx int __pyx_t_1; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":12 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":12 * * def __cinit__(self, int size=0, int increment=1, int initial_len=0): * if initial_len > size: # <<<<<<<<<<<<<< @@ -4738,7 +4771,7 @@ static int __pyx_pf_3_sa_7IntList___cinit__(struct __pyx_obj_3_sa_IntList *__pyx __pyx_t_1 = (__pyx_v_initial_len > __pyx_v_size); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":13 + /* "/home/pauldb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -4750,7 +4783,7 @@ static int __pyx_pf_3_sa_7IntList___cinit__(struct __pyx_obj_3_sa_IntList *__pyx } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":14 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":14 * if initial_len > size: * size = initial_len * self.size = size # <<<<<<<<<<<<<< @@ -4759,7 +4792,7 @@ static int __pyx_pf_3_sa_7IntList___cinit__(struct __pyx_obj_3_sa_IntList *__pyx */ __pyx_v_self->size = __pyx_v_size; - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":15 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":15 * size = initial_len * self.size = size * self.increment = increment # <<<<<<<<<<<<<< @@ -4768,7 +4801,7 @@ static int __pyx_pf_3_sa_7IntList___cinit__(struct __pyx_obj_3_sa_IntList *__pyx */ __pyx_v_self->increment = __pyx_v_increment; - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":16 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":16 * self.size = size * self.increment = increment * self.len = initial_len # <<<<<<<<<<<<<< @@ -4777,7 +4810,7 @@ static int __pyx_pf_3_sa_7IntList___cinit__(struct __pyx_obj_3_sa_IntList *__pyx */ __pyx_v_self->len = __pyx_v_initial_len; - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":17 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":17 * self.increment = increment * self.len = initial_len * self.arr = malloc(size*sizeof(int)) # <<<<<<<<<<<<<< @@ -4786,7 +4819,7 @@ static int __pyx_pf_3_sa_7IntList___cinit__(struct __pyx_obj_3_sa_IntList *__pyx */ __pyx_v_self->arr = ((int *)malloc((__pyx_v_size * (sizeof(int))))); - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":18 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":18 * self.len = initial_len * self.arr = malloc(size*sizeof(int)) * memset(self.arr, 0, initial_len*sizeof(int)) # <<<<<<<<<<<<<< @@ -4811,7 +4844,7 @@ static PyObject *__pyx_pw_3_sa_7IntList_3__str__(PyObject *__pyx_v_self) { return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":20 +/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":20 * memset(self.arr, 0, initial_len*sizeof(int)) * * def __str__(self): # <<<<<<<<<<<<<< @@ -4834,7 +4867,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_2__str__(struct __pyx_obj_3_sa_IntList * int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__str__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":22 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":22 * def __str__(self): * cdef unsigned i * ret = "IntList[" # <<<<<<<<<<<<<< @@ -4844,7 +4877,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_2__str__(struct __pyx_obj_3_sa_IntList * __Pyx_INCREF(((PyObject *)__pyx_kp_s_3)); __pyx_v_ret = ((PyObject *)__pyx_kp_s_3); - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":23 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":23 * cdef unsigned i * ret = "IntList[" * for idx in range(self.size): # <<<<<<<<<<<<<< @@ -4855,7 +4888,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_2__str__(struct __pyx_obj_3_sa_IntList * for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_idx = __pyx_t_2; - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":24 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":24 * ret = "IntList[" * for idx in range(self.size): * if idx>0: # <<<<<<<<<<<<<< @@ -4865,7 +4898,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_2__str__(struct __pyx_obj_3_sa_IntList * __pyx_t_3 = (__pyx_v_idx > 0); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":25 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":25 * for idx in range(self.size): * if idx>0: * ret += "," # <<<<<<<<<<<<<< @@ -4881,7 +4914,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_2__str__(struct __pyx_obj_3_sa_IntList * } __pyx_L5:; - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":26 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":26 * if idx>0: * ret += "," * ret += str(self.arr[idx]) # <<<<<<<<<<<<<< @@ -4906,7 +4939,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_2__str__(struct __pyx_obj_3_sa_IntList * __pyx_t_5 = 0; } - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":27 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":27 * ret += "," * ret += str(self.arr[idx]) * ret += "]" # <<<<<<<<<<<<<< @@ -4919,7 +4952,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_2__str__(struct __pyx_obj_3_sa_IntList * __pyx_v_ret = __pyx_t_5; __pyx_t_5 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":28 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":28 * ret += str(self.arr[idx]) * ret += "]" * ret += "len=" # <<<<<<<<<<<<<< @@ -4932,7 +4965,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_2__str__(struct __pyx_obj_3_sa_IntList * __pyx_v_ret = __pyx_t_5; __pyx_t_5 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":29 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":29 * ret += "]" * ret += "len=" * ret += str(self.len) # <<<<<<<<<<<<<< @@ -4956,7 +4989,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_2__str__(struct __pyx_obj_3_sa_IntList * __pyx_v_ret = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":30 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":30 * ret += "len=" * ret += str(self.len) * return ret # <<<<<<<<<<<<<< @@ -4993,7 +5026,7 @@ static PyObject *__pyx_pw_3_sa_7IntList_5index(PyObject *__pyx_v_self, PyObject return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":32 +/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":32 * return ret * * def index(self, val): # <<<<<<<<<<<<<< @@ -5015,7 +5048,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_4index(struct __pyx_obj_3_sa_IntList *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("index", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":34 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":34 * def index(self, val): * cdef unsigned i * for i in range(self.len): # <<<<<<<<<<<<<< @@ -5026,7 +5059,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_4index(struct __pyx_obj_3_sa_IntList *__ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":35 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":35 * cdef unsigned i * for i in range(self.len): * if self.arr[i] == val: # <<<<<<<<<<<<<< @@ -5035,14 +5068,13 @@ static PyObject *__pyx_pf_3_sa_7IntList_4index(struct __pyx_obj_3_sa_IntList *__ */ __pyx_t_3 = PyInt_FromLong((__pyx_v_self->arr[__pyx_v_i])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_val, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_val, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":36 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":36 * for i in range(self.len): * if self.arr[i] == val: * return i # <<<<<<<<<<<<<< @@ -5060,7 +5092,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_4index(struct __pyx_obj_3_sa_IntList *__ __pyx_L5:; } - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":37 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":37 * if self.arr[i] == val: * return i * return IndexError # <<<<<<<<<<<<<< @@ -5090,11 +5122,11 @@ static PyObject *__pyx_pw_3_sa_7IntList_7partition(PyObject *__pyx_v_self, PyObj static PyObject *__pyx_pw_3_sa_7IntList_7partition(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_start = 0; PyObject *__pyx_v_end = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__start,&__pyx_n_s__end,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("partition (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__start,&__pyx_n_s__end,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -5108,12 +5140,10 @@ static PyObject *__pyx_pw_3_sa_7IntList_7partition(PyObject *__pyx_v_self, PyObj kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start); - if (likely(values[0])) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__end); - if (likely(values[1])) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__end)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("partition", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -5143,7 +5173,7 @@ static PyObject *__pyx_pw_3_sa_7IntList_7partition(PyObject *__pyx_v_self, PyObj return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":39 +/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":39 * return IndexError * * def partition(self,start,end): # <<<<<<<<<<<<<< @@ -5169,7 +5199,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList int __pyx_clineno = 0; __Pyx_RefNannySetupContext("partition", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":40 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":40 * * def partition(self,start,end): * pivot = self.arr[end] # <<<<<<<<<<<<<< @@ -5182,7 +5212,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList __pyx_v_pivot = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":41 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":41 * def partition(self,start,end): * pivot = self.arr[end] * bottom = start-1 # <<<<<<<<<<<<<< @@ -5194,7 +5224,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList __pyx_v_bottom = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":42 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":42 * pivot = self.arr[end] * bottom = start-1 * top = end # <<<<<<<<<<<<<< @@ -5204,7 +5234,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList __Pyx_INCREF(__pyx_v_end); __pyx_v_top = __pyx_v_end; - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":43 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":43 * bottom = start-1 * top = end * done = 0 # <<<<<<<<<<<<<< @@ -5213,7 +5243,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList */ __pyx_v_done = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":44 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":44 * top = end * done = 0 * while not done: # <<<<<<<<<<<<<< @@ -5224,7 +5254,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList __pyx_t_3 = (!__pyx_v_done); if (!__pyx_t_3) break; - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":45 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":45 * done = 0 * while not done: * while not done: # <<<<<<<<<<<<<< @@ -5235,7 +5265,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList __pyx_t_3 = (!__pyx_v_done); if (!__pyx_t_3) break; - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":46 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":46 * while not done: * while not done: * bottom += 1 # <<<<<<<<<<<<<< @@ -5248,20 +5278,19 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList __pyx_v_bottom = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":47 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":47 * while not done: * bottom += 1 * if bottom == top: # <<<<<<<<<<<<<< * done = 1 * break */ - __pyx_t_2 = PyObject_RichCompare(__pyx_v_bottom, __pyx_v_top, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_2 = PyObject_RichCompare(__pyx_v_bottom, __pyx_v_top, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 47; __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[2]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":48 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":48 * bottom += 1 * if bottom == top: * done = 1 # <<<<<<<<<<<<<< @@ -5270,7 +5299,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList */ __pyx_v_done = 1; - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":49 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":49 * if bottom == top: * done = 1 * break # <<<<<<<<<<<<<< @@ -5282,7 +5311,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList } __pyx_L7:; - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":50 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":50 * done = 1 * break * if self.arr[bottom] > pivot: # <<<<<<<<<<<<<< @@ -5292,14 +5321,13 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList __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_GOTREF(__pyx_t_2); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_v_pivot, Py_GT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __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; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":51 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":51 * break * if self.arr[bottom] > pivot: * self.arr[top] = self.arr[bottom] # <<<<<<<<<<<<<< @@ -5310,7 +5338,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList __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/paulb/workspace/cdec/python/src/sa/int_list.pxi":52 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":52 * if self.arr[bottom] > pivot: * self.arr[top] = self.arr[bottom] * break # <<<<<<<<<<<<<< @@ -5324,7 +5352,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList } __pyx_L6_break:; - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":53 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":53 * self.arr[top] = self.arr[bottom] * break * while not done: # <<<<<<<<<<<<<< @@ -5335,7 +5363,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList __pyx_t_3 = (!__pyx_v_done); if (!__pyx_t_3) break; - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":54 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":54 * break * while not done: * top -= 1 # <<<<<<<<<<<<<< @@ -5348,20 +5376,19 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList __pyx_v_top = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":55 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":55 * while not done: * top -= 1 * if top == bottom: # <<<<<<<<<<<<<< * done = 1 * break */ - __pyx_t_4 = PyObject_RichCompare(__pyx_v_top, __pyx_v_bottom, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_top, __pyx_v_bottom, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 55; __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[2]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":56 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":56 * top -= 1 * if top == bottom: * done = 1 # <<<<<<<<<<<<<< @@ -5370,7 +5397,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList */ __pyx_v_done = 1; - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":57 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":57 * if top == bottom: * done = 1 * break # <<<<<<<<<<<<<< @@ -5382,7 +5409,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList } __pyx_L11:; - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":58 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":58 * done = 1 * break * if self.arr[top] < pivot: # <<<<<<<<<<<<<< @@ -5392,14 +5419,13 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList __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_GOTREF(__pyx_t_4); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_v_pivot, Py_LT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __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; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":59 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":59 * break * if self.arr[top] < pivot: * self.arr[bottom] = self.arr[top] # <<<<<<<<<<<<<< @@ -5410,7 +5436,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList __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/paulb/workspace/cdec/python/src/sa/int_list.pxi":60 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":60 * if self.arr[top] < pivot: * self.arr[bottom] = self.arr[top] * break # <<<<<<<<<<<<<< @@ -5425,7 +5451,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList __pyx_L10_break:; } - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":61 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":61 * self.arr[bottom] = self.arr[top] * break * self.arr[top] = pivot # <<<<<<<<<<<<<< @@ -5436,7 +5462,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList __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/paulb/workspace/cdec/python/src/sa/int_list.pxi":62 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":62 * break * self.arr[top] = pivot * return top # <<<<<<<<<<<<<< @@ -5469,11 +5495,11 @@ static PyObject *__pyx_pw_3_sa_7IntList_9_doquicksort(PyObject *__pyx_v_self, Py static PyObject *__pyx_pw_3_sa_7IntList_9_doquicksort(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_start = 0; PyObject *__pyx_v_end = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__start,&__pyx_n_s__end,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_doquicksort (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__start,&__pyx_n_s__end,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -5487,12 +5513,10 @@ static PyObject *__pyx_pw_3_sa_7IntList_9_doquicksort(PyObject *__pyx_v_self, Py kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start); - if (likely(values[0])) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__end); - if (likely(values[1])) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__end)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_doquicksort", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -5522,7 +5546,7 @@ static PyObject *__pyx_pw_3_sa_7IntList_9_doquicksort(PyObject *__pyx_v_self, Py return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":64 +/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":64 * return top * * def _doquicksort(self,start,end): # <<<<<<<<<<<<<< @@ -5543,20 +5567,19 @@ static PyObject *__pyx_pf_3_sa_7IntList_8_doquicksort(struct __pyx_obj_3_sa_IntL int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_doquicksort", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":65 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":65 * * def _doquicksort(self,start,end): * if start < end: # <<<<<<<<<<<<<< * split = self.partition(start,end) * self._doquicksort(start,split-1) */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_start, __pyx_v_end, Py_LT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_1 = PyObject_RichCompare(__pyx_v_start, __pyx_v_end, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 65; __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[2]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":66 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":66 * def _doquicksort(self,start,end): * if start < end: * split = self.partition(start,end) # <<<<<<<<<<<<<< @@ -5580,7 +5603,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_8_doquicksort(struct __pyx_obj_3_sa_IntL __pyx_v_split = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":67 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":67 * if start < end: * split = self.partition(start,end) * self._doquicksort(start,split-1) # <<<<<<<<<<<<<< @@ -5605,7 +5628,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_8_doquicksort(struct __pyx_obj_3_sa_IntL __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":68 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":68 * split = self.partition(start,end) * self._doquicksort(start,split-1) * self._doquicksort(split+1,end) # <<<<<<<<<<<<<< @@ -5633,7 +5656,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_8_doquicksort(struct __pyx_obj_3_sa_IntL } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":70 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":70 * self._doquicksort(split+1,end) * else: * return # <<<<<<<<<<<<<< @@ -5672,7 +5695,7 @@ static PyObject *__pyx_pw_3_sa_7IntList_11sort(PyObject *__pyx_v_self, CYTHON_UN return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":72 +/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":72 * return * * def sort(self): # <<<<<<<<<<<<<< @@ -5691,7 +5714,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_10sort(struct __pyx_obj_3_sa_IntList *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sort", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":73 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":73 * * def sort(self): * self._doquicksort(0,self.len-1) # <<<<<<<<<<<<<< @@ -5741,7 +5764,7 @@ static PyObject *__pyx_pw_3_sa_7IntList_13reset(PyObject *__pyx_v_self, CYTHON_U return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":75 +/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":75 * self._doquicksort(0,self.len-1) * * def reset(self): # <<<<<<<<<<<<<< @@ -5754,7 +5777,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_12reset(struct __pyx_obj_3_sa_IntList *_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reset", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":76 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":76 * * def reset(self): * self.len = 0 # <<<<<<<<<<<<<< @@ -5778,7 +5801,7 @@ static void __pyx_pw_3_sa_7IntList_15__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyFinishContext(); } -/* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":78 +/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":78 * self.len = 0 * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -5790,7 +5813,7 @@ static void __pyx_pf_3_sa_7IntList_14__dealloc__(struct __pyx_obj_3_sa_IntList * __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":79 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":79 * * def __dealloc__(self): * free(self.arr) # <<<<<<<<<<<<<< @@ -5814,7 +5837,7 @@ static PyObject *__pyx_pw_3_sa_7IntList_17__iter__(PyObject *__pyx_v_self) { return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":81 +/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":81 * free(self.arr) * * def __iter__(self): # <<<<<<<<<<<<<< @@ -5877,7 +5900,7 @@ static PyObject *__pyx_gb_3_sa_7IntList_18generator(__pyx_GeneratorObject *__pyx __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/paulb/workspace/cdec/python/src/sa/int_list.pxi":83 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":83 * def __iter__(self): * cdef int i * for i in range(self.len): # <<<<<<<<<<<<<< @@ -5888,7 +5911,7 @@ static PyObject *__pyx_gb_3_sa_7IntList_18generator(__pyx_GeneratorObject *__pyx 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/paulb/workspace/cdec/python/src/sa/int_list.pxi":84 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":84 * cdef int i * for i in range(self.len): * yield self.arr[i] # <<<<<<<<<<<<<< @@ -5919,6 +5942,7 @@ static PyObject *__pyx_gb_3_sa_7IntList_18generator(__pyx_GeneratorObject *__pyx __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_generator->resume_label = -1; + __Pyx_Generator_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return NULL; } @@ -5934,7 +5958,7 @@ static PyObject *__pyx_pw_3_sa_7IntList_20__getitem__(PyObject *__pyx_v_self, Py return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":86 +/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":86 * yield self.arr[i] * * def __getitem__(self, index): # <<<<<<<<<<<<<< @@ -5964,7 +5988,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":88 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":88 * def __getitem__(self, index): * cdef int i, j, k * if isinstance(index, int): # <<<<<<<<<<<<<< @@ -5977,7 +6001,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":89 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":89 * cdef int i, j, k * if isinstance(index, int): * j = index # <<<<<<<<<<<<<< @@ -5987,7 +6011,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL __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_v_j = __pyx_t_3; - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":90 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":90 * if isinstance(index, int): * j = index * if j < 0: # <<<<<<<<<<<<<< @@ -5997,7 +6021,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL __pyx_t_2 = (__pyx_v_j < 0); if (__pyx_t_2) { - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":91 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":91 * j = index * if j < 0: * j = self.len + j # <<<<<<<<<<<<<< @@ -6009,7 +6033,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL } __pyx_L4:; - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":92 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":92 * if j < 0: * j = self.len + j * if j<0 or j>=self.len: # <<<<<<<<<<<<<< @@ -6025,7 +6049,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL } if (__pyx_t_5) { - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":93 + /* "/home/pauldb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -6060,7 +6084,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL } __pyx_L5:; - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":94 + /* "/home/pauldb/workspace/cdec/python/src/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] # <<<<<<<<<<<<<< @@ -6076,7 +6100,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL goto __pyx_L3; } - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":95 + /* "/home/pauldb/workspace/cdec/python/src/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): # <<<<<<<<<<<<<< @@ -6089,7 +6113,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":96 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":96 * return self.arr[j] * elif isinstance(index, slice): * i = index.start # <<<<<<<<<<<<<< @@ -6102,7 +6126,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_i = __pyx_t_3; - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":97 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":97 * elif isinstance(index, slice): * i = index.start * j = index.stop # <<<<<<<<<<<<<< @@ -6115,7 +6139,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_j = __pyx_t_3; - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":98 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":98 * i = index.start * j = index.stop * if i < 0: # <<<<<<<<<<<<<< @@ -6125,7 +6149,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL __pyx_t_5 = (__pyx_v_i < 0); if (__pyx_t_5) { - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":99 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":99 * j = index.stop * if i < 0: * i = self.len + i # <<<<<<<<<<<<<< @@ -6137,7 +6161,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL } __pyx_L6:; - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":100 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":100 * if i < 0: * i = self.len + i * if j < 0: # <<<<<<<<<<<<<< @@ -6147,7 +6171,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL __pyx_t_5 = (__pyx_v_j < 0); if (__pyx_t_5) { - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":101 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":101 * i = self.len + i * if j < 0: * j = self.len + j # <<<<<<<<<<<<<< @@ -6159,7 +6183,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL } __pyx_L7:; - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":102 + /* "/home/pauldb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -6187,7 +6211,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL } if (__pyx_t_2) { - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":103 + /* "/home/pauldb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -6229,7 +6253,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL } __pyx_L8:; - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":104 + /* "/home/pauldb/workspace/cdec/python/src/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 = () # <<<<<<<<<<<<<< @@ -6239,7 +6263,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL __Pyx_INCREF(((PyObject *)__pyx_empty_tuple)); __pyx_v_result = __pyx_empty_tuple; - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":105 + /* "/home/pauldb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -6249,7 +6273,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL __pyx_t_3 = __pyx_v_j; for (__pyx_v_k = __pyx_v_i; __pyx_v_k < __pyx_t_3; __pyx_v_k++) { - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":106 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":106 * result = () * for k from i <= k < j: * result = result + (self.arr[k],) # <<<<<<<<<<<<<< @@ -6271,7 +6295,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL __pyx_t_9 = 0; } - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":107 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":107 * for k from i <= k < j: * result = result + (self.arr[k],) * return result # <<<<<<<<<<<<<< @@ -6286,7 +6310,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":109 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":109 * return result * else: * raise TypeError("Illegal key type %s for IntList" % type(index)) # <<<<<<<<<<<<<< @@ -6325,7 +6349,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":111 +/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":111 * raise TypeError("Illegal key type %s for IntList" % type(index)) * * cdef void set(self, int i, int val): # <<<<<<<<<<<<<< @@ -6347,7 +6371,7 @@ static void __pyx_f_3_sa_7IntList_set(struct __pyx_obj_3_sa_IntList *__pyx_v_sel int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":112 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":112 * * cdef void set(self, int i, int val): * j = i # <<<<<<<<<<<<<< @@ -6356,7 +6380,7 @@ static void __pyx_f_3_sa_7IntList_set(struct __pyx_obj_3_sa_IntList *__pyx_v_sel */ __pyx_v_j = __pyx_v_i; - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":113 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":113 * cdef void set(self, int i, int val): * j = i * if i<0: # <<<<<<<<<<<<<< @@ -6366,7 +6390,7 @@ static void __pyx_f_3_sa_7IntList_set(struct __pyx_obj_3_sa_IntList *__pyx_v_sel __pyx_t_1 = (__pyx_v_i < 0); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":114 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":114 * j = i * if i<0: * j = self.len + i # <<<<<<<<<<<<<< @@ -6378,7 +6402,7 @@ static void __pyx_f_3_sa_7IntList_set(struct __pyx_obj_3_sa_IntList *__pyx_v_sel } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":115 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":115 * if i<0: * j = self.len + i * if j<0 or j>=self.len: # <<<<<<<<<<<<<< @@ -6394,7 +6418,7 @@ static void __pyx_f_3_sa_7IntList_set(struct __pyx_obj_3_sa_IntList *__pyx_v_sel } if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":116 + /* "/home/pauldb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -6431,7 +6455,7 @@ static void __pyx_f_3_sa_7IntList_set(struct __pyx_obj_3_sa_IntList *__pyx_v_sel } __pyx_L4:; - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":117 + /* "/home/pauldb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -6461,7 +6485,7 @@ static int __pyx_pw_3_sa_7IntList_22__setitem__(PyObject *__pyx_v_self, PyObject return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":119 +/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":119 * self.arr[j] = val * * def __setitem__(self, i, val): # <<<<<<<<<<<<<< @@ -6479,7 +6503,7 @@ static int __pyx_pf_3_sa_7IntList_21__setitem__(struct __pyx_obj_3_sa_IntList *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setitem__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":120 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":120 * * def __setitem__(self, i, val): * self.set(i, val) # <<<<<<<<<<<<<< @@ -6511,7 +6535,7 @@ static Py_ssize_t __pyx_pw_3_sa_7IntList_24__len__(PyObject *__pyx_v_self) { return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":122 +/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":122 * self.set(i, val) * * def __len__(self): # <<<<<<<<<<<<<< @@ -6524,7 +6548,7 @@ static Py_ssize_t __pyx_pf_3_sa_7IntList_23__len__(struct __pyx_obj_3_sa_IntList __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":123 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":123 * * def __len__(self): * return self.len # <<<<<<<<<<<<<< @@ -6551,7 +6575,7 @@ static PyObject *__pyx_pw_3_sa_7IntList_26get_size(PyObject *__pyx_v_self, CYTHO return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":125 +/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":125 * return self.len * * def get_size(self): # <<<<<<<<<<<<<< @@ -6568,7 +6592,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_25get_size(struct __pyx_obj_3_sa_IntList int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_size", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":126 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":126 * * def get_size(self): * return self.size # <<<<<<<<<<<<<< @@ -6615,7 +6639,7 @@ static PyObject *__pyx_pw_3_sa_7IntList_28append(PyObject *__pyx_v_self, PyObjec return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":128 +/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":128 * return self.size * * def append(self, int val): # <<<<<<<<<<<<<< @@ -6628,7 +6652,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_27append(struct __pyx_obj_3_sa_IntList * __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("append", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":129 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":129 * * def append(self, int val): * self._append(val) # <<<<<<<<<<<<<< @@ -6643,7 +6667,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_27append(struct __pyx_obj_3_sa_IntList * return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":131 +/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":131 * self._append(val) * * cdef void _append(self, int val): # <<<<<<<<<<<<<< @@ -6656,7 +6680,7 @@ static void __pyx_f_3_sa_7IntList__append(struct __pyx_obj_3_sa_IntList *__pyx_v int __pyx_t_1; __Pyx_RefNannySetupContext("_append", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":132 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":132 * * cdef void _append(self, int val): * if self.len == self.size: # <<<<<<<<<<<<<< @@ -6666,7 +6690,7 @@ static void __pyx_f_3_sa_7IntList__append(struct __pyx_obj_3_sa_IntList *__pyx_v __pyx_t_1 = (__pyx_v_self->len == __pyx_v_self->size); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":133 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":133 * cdef void _append(self, int val): * if self.len == self.size: * self.size = self.size + self.increment # <<<<<<<<<<<<<< @@ -6675,7 +6699,7 @@ static void __pyx_f_3_sa_7IntList__append(struct __pyx_obj_3_sa_IntList *__pyx_v */ __pyx_v_self->size = (__pyx_v_self->size + __pyx_v_self->increment); - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":134 + /* "/home/pauldb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -6687,7 +6711,7 @@ static void __pyx_f_3_sa_7IntList__append(struct __pyx_obj_3_sa_IntList *__pyx_v } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":135 + /* "/home/pauldb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -6696,7 +6720,7 @@ static void __pyx_f_3_sa_7IntList__append(struct __pyx_obj_3_sa_IntList *__pyx_v */ (__pyx_v_self->arr[__pyx_v_self->len]) = __pyx_v_val; - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":136 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":136 * self.arr = realloc(self.arr, self.size*sizeof(int)) * self.arr[self.len] = val * self.len = self.len + 1 # <<<<<<<<<<<<<< @@ -6719,7 +6743,7 @@ static PyObject *__pyx_pw_3_sa_7IntList_30extend(PyObject *__pyx_v_self, PyObjec return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":138 +/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":138 * self.len = self.len + 1 * * def extend(self, other): # <<<<<<<<<<<<<< @@ -6736,7 +6760,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_29extend(struct __pyx_obj_3_sa_IntList * int __pyx_clineno = 0; __Pyx_RefNannySetupContext("extend", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":139 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":139 * * def extend(self, other): * self._extend(other) # <<<<<<<<<<<<<< @@ -6761,7 +6785,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_29extend(struct __pyx_obj_3_sa_IntList * return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":141 +/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":141 * self._extend(other) * * cdef void _extend(self, IntList other): # <<<<<<<<<<<<<< @@ -6773,7 +6797,7 @@ static void __pyx_f_3_sa_7IntList__extend(struct __pyx_obj_3_sa_IntList *__pyx_v __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_extend", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":142 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":142 * * cdef void _extend(self, IntList other): * self._extend_arr(other.arr, other.len) # <<<<<<<<<<<<<< @@ -6785,7 +6809,7 @@ static void __pyx_f_3_sa_7IntList__extend(struct __pyx_obj_3_sa_IntList *__pyx_v __Pyx_RefNannyFinishContext(); } -/* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":144 +/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":144 * self._extend_arr(other.arr, other.len) * * cdef void _extend_arr(self, int* other, int other_len): # <<<<<<<<<<<<<< @@ -6798,7 +6822,7 @@ static void __pyx_f_3_sa_7IntList__extend_arr(struct __pyx_obj_3_sa_IntList *__p int __pyx_t_1; __Pyx_RefNannySetupContext("_extend_arr", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":145 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":145 * * cdef void _extend_arr(self, int* other, int other_len): * if self.size < self.len + other_len: # <<<<<<<<<<<<<< @@ -6808,7 +6832,7 @@ static void __pyx_f_3_sa_7IntList__extend_arr(struct __pyx_obj_3_sa_IntList *__p __pyx_t_1 = (__pyx_v_self->size < (__pyx_v_self->len + __pyx_v_other_len)); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":146 + /* "/home/pauldb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -6817,7 +6841,7 @@ static void __pyx_f_3_sa_7IntList__extend_arr(struct __pyx_obj_3_sa_IntList *__p */ __pyx_v_self->size = (__pyx_v_self->len + __pyx_v_other_len); - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":147 + /* "/home/pauldb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -6829,7 +6853,7 @@ static void __pyx_f_3_sa_7IntList__extend_arr(struct __pyx_obj_3_sa_IntList *__p } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":148 + /* "/home/pauldb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -6838,7 +6862,7 @@ static void __pyx_f_3_sa_7IntList__extend_arr(struct __pyx_obj_3_sa_IntList *__p */ memcpy((__pyx_v_self->arr + __pyx_v_self->len), __pyx_v_other, (__pyx_v_other_len * (sizeof(int)))); - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":149 + /* "/home/pauldb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -6850,7 +6874,7 @@ static void __pyx_f_3_sa_7IntList__extend_arr(struct __pyx_obj_3_sa_IntList *__p __Pyx_RefNannyFinishContext(); } -/* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":151 +/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":151 * self.len = self.len + other_len * * cdef void _clear(self): # <<<<<<<<<<<<<< @@ -6862,7 +6886,7 @@ static void __pyx_f_3_sa_7IntList__clear(struct __pyx_obj_3_sa_IntList *__pyx_v_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_clear", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":152 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":152 * * cdef void _clear(self): * free(self.arr) # <<<<<<<<<<<<<< @@ -6871,7 +6895,7 @@ static void __pyx_f_3_sa_7IntList__clear(struct __pyx_obj_3_sa_IntList *__pyx_v_ */ free(__pyx_v_self->arr); - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":153 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":153 * cdef void _clear(self): * free(self.arr) * self.len = 0 # <<<<<<<<<<<<<< @@ -6880,7 +6904,7 @@ static void __pyx_f_3_sa_7IntList__clear(struct __pyx_obj_3_sa_IntList *__pyx_v_ */ __pyx_v_self->len = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":154 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":154 * free(self.arr) * self.len = 0 * self.size = 0 # <<<<<<<<<<<<<< @@ -6889,7 +6913,7 @@ static void __pyx_f_3_sa_7IntList__clear(struct __pyx_obj_3_sa_IntList *__pyx_v_ */ __pyx_v_self->size = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":155 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":155 * self.len = 0 * self.size = 0 * self.arr = malloc(0) # <<<<<<<<<<<<<< @@ -6901,7 +6925,7 @@ static void __pyx_f_3_sa_7IntList__clear(struct __pyx_obj_3_sa_IntList *__pyx_v_ __Pyx_RefNannyFinishContext(); } -/* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":157 +/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":157 * self.arr = malloc(0) * * cdef void write_handle(self, FILE* f): # <<<<<<<<<<<<<< @@ -6913,7 +6937,7 @@ static void __pyx_f_3_sa_7IntList_write_handle(struct __pyx_obj_3_sa_IntList *__ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("write_handle", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":158 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":158 * * cdef void write_handle(self, FILE* f): * fwrite(&(self.len), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -6922,7 +6946,7 @@ static void __pyx_f_3_sa_7IntList_write_handle(struct __pyx_obj_3_sa_IntList *__ */ fwrite((&__pyx_v_self->len), (sizeof(int)), 1, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":159 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -6955,7 +6979,7 @@ static PyObject *__pyx_pw_3_sa_7IntList_32write(PyObject *__pyx_v_self, PyObject return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":161 +/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":161 * fwrite(self.arr, sizeof(int), self.len, f) * * def write(self, char* filename): # <<<<<<<<<<<<<< @@ -6969,7 +6993,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_31write(struct __pyx_obj_3_sa_IntList *_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("write", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":163 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":163 * def write(self, char* filename): * cdef FILE* f * f = fopen(filename, "w") # <<<<<<<<<<<<<< @@ -6978,7 +7002,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_31write(struct __pyx_obj_3_sa_IntList *_ */ __pyx_v_f = fopen(__pyx_v_filename, __pyx_k__w); - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":164 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":164 * cdef FILE* f * f = fopen(filename, "w") * self.write_handle(f) # <<<<<<<<<<<<<< @@ -6987,7 +7011,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_31write(struct __pyx_obj_3_sa_IntList *_ */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->__pyx_vtab)->write_handle(__pyx_v_self, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":165 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":165 * f = fopen(filename, "w") * self.write_handle(f) * fclose(f) # <<<<<<<<<<<<<< @@ -7002,7 +7026,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_31write(struct __pyx_obj_3_sa_IntList *_ return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":167 +/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":167 * fclose(f) * * cdef void read_handle(self, FILE* f): # <<<<<<<<<<<<<< @@ -7014,7 +7038,7 @@ static void __pyx_f_3_sa_7IntList_read_handle(struct __pyx_obj_3_sa_IntList *__p __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("read_handle", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":168 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":168 * * cdef void read_handle(self, FILE* f): * (self.arr) # <<<<<<<<<<<<<< @@ -7023,7 +7047,7 @@ static void __pyx_f_3_sa_7IntList_read_handle(struct __pyx_obj_3_sa_IntList *__p */ __pyx_v_self->arr; - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":169 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":169 * cdef void read_handle(self, FILE* f): * (self.arr) * fread(&(self.len), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -7032,7 +7056,7 @@ static void __pyx_f_3_sa_7IntList_read_handle(struct __pyx_obj_3_sa_IntList *__p */ fread((&__pyx_v_self->len), (sizeof(int)), 1, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":170 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":170 * (self.arr) * fread(&(self.len), sizeof(int), 1, f) * self.arr = malloc(self.len * sizeof(int)) # <<<<<<<<<<<<<< @@ -7041,7 +7065,7 @@ static void __pyx_f_3_sa_7IntList_read_handle(struct __pyx_obj_3_sa_IntList *__p */ __pyx_v_self->arr = ((int *)malloc((__pyx_v_self->len * (sizeof(int))))); - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":171 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":171 * fread(&(self.len), sizeof(int), 1, f) * self.arr = malloc(self.len * sizeof(int)) * self.size = self.len # <<<<<<<<<<<<<< @@ -7050,7 +7074,7 @@ static void __pyx_f_3_sa_7IntList_read_handle(struct __pyx_obj_3_sa_IntList *__p */ __pyx_v_self->size = __pyx_v_self->len; - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":172 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":172 * self.arr = malloc(self.len * sizeof(int)) * self.size = self.len * fread(self.arr, sizeof(int), self.len, f) # <<<<<<<<<<<<<< @@ -7083,7 +7107,7 @@ static PyObject *__pyx_pw_3_sa_7IntList_34read(PyObject *__pyx_v_self, PyObject return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":174 +/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":174 * fread(self.arr, sizeof(int), self.len, f) * * def read(self, char* filename): # <<<<<<<<<<<<<< @@ -7097,7 +7121,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_33read(struct __pyx_obj_3_sa_IntList *__ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("read", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":176 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":176 * def read(self, char* filename): * cdef FILE* f * f = fopen(filename, "r") # <<<<<<<<<<<<<< @@ -7106,7 +7130,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_33read(struct __pyx_obj_3_sa_IntList *__ */ __pyx_v_f = fopen(__pyx_v_filename, __pyx_k__r); - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":177 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":177 * cdef FILE* f * f = fopen(filename, "r") * self.read_handle(f) # <<<<<<<<<<<<<< @@ -7114,7 +7138,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_33read(struct __pyx_obj_3_sa_IntList *__ */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->__pyx_vtab)->read_handle(__pyx_v_self, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/int_list.pxi":178 + /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":178 * f = fopen(filename, "r") * self.read_handle(f) * fclose(f) # <<<<<<<<<<<<<< @@ -7141,7 +7165,7 @@ static int __pyx_pw_3_sa_9StringMap_1__cinit__(PyObject *__pyx_v_self, PyObject return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/str_map.pxi":13 +/* "/home/pauldb/workspace/cdec/python/src/sa/str_map.pxi":13 * cdef int index(self, char *s) * * def __cinit__(self): # <<<<<<<<<<<<<< @@ -7154,7 +7178,7 @@ static int __pyx_pf_3_sa_9StringMap___cinit__(struct __pyx_obj_3_sa_StringMap *_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/str_map.pxi":14 + /* "/home/pauldb/workspace/cdec/python/src/sa/str_map.pxi":14 * * def __cinit__(self): * self.vocab = stringmap_new() # <<<<<<<<<<<<<< @@ -7177,7 +7201,7 @@ static void __pyx_pw_3_sa_9StringMap_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyFinishContext(); } -/* "/home/paulb/workspace/cdec/python/src/sa/str_map.pxi":16 +/* "/home/pauldb/workspace/cdec/python/src/sa/str_map.pxi":16 * self.vocab = stringmap_new() * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -7189,7 +7213,7 @@ static void __pyx_pf_3_sa_9StringMap_2__dealloc__(struct __pyx_obj_3_sa_StringMa __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/str_map.pxi":17 + /* "/home/pauldb/workspace/cdec/python/src/sa/str_map.pxi":17 * * def __dealloc__(self): * stringmap_delete(self.vocab) # <<<<<<<<<<<<<< @@ -7201,7 +7225,7 @@ static void __pyx_pf_3_sa_9StringMap_2__dealloc__(struct __pyx_obj_3_sa_StringMa __Pyx_RefNannyFinishContext(); } -/* "/home/paulb/workspace/cdec/python/src/sa/str_map.pxi":19 +/* "/home/pauldb/workspace/cdec/python/src/sa/str_map.pxi":19 * stringmap_delete(self.vocab) * * cdef char *word(self, int i): # <<<<<<<<<<<<<< @@ -7214,7 +7238,7 @@ static char *__pyx_f_3_sa_9StringMap_word(struct __pyx_obj_3_sa_StringMap *__pyx __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("word", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/str_map.pxi":20 + /* "/home/pauldb/workspace/cdec/python/src/sa/str_map.pxi":20 * * cdef char *word(self, int i): * return stringmap_word(self.vocab, i) # <<<<<<<<<<<<<< @@ -7230,7 +7254,7 @@ static char *__pyx_f_3_sa_9StringMap_word(struct __pyx_obj_3_sa_StringMap *__pyx return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/str_map.pxi":22 +/* "/home/pauldb/workspace/cdec/python/src/sa/str_map.pxi":22 * return stringmap_word(self.vocab, i) * * cdef int index(self, char *s): # <<<<<<<<<<<<<< @@ -7242,7 +7266,7 @@ static int __pyx_f_3_sa_9StringMap_index(struct __pyx_obj_3_sa_StringMap *__pyx_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("index", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/str_map.pxi":23 + /* "/home/pauldb/workspace/cdec/python/src/sa/str_map.pxi":23 * * cdef int index(self, char *s): * return stringmap_index(self.vocab, s) # <<<<<<<<<<<<<< @@ -7263,14 +7287,14 @@ static int __pyx_pw_3_sa_9DataArray_1__cinit__(PyObject *__pyx_v_self, PyObject PyObject *__pyx_v_from_text = 0; PyObject *__pyx_v_side = 0; int __pyx_v_use_sent_id; - 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}; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__from_binary,&__pyx_n_s__from_text,&__pyx_n_s__side,&__pyx_n_s__use_sent_id,0}; PyObject* values[4] = {0,0,0,0}; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":17 + /* "/home/pauldb/workspace/cdec/python/src/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): # <<<<<<<<<<<<<< @@ -7317,10 +7341,6 @@ static int __pyx_pw_3_sa_9DataArray_1__cinit__(PyObject *__pyx_v_self, PyObject if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } - if (values[3]) { - } else { - __pyx_v_use_sent_id = ((int)0); - } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); @@ -7366,7 +7386,7 @@ static int __pyx_pf_3_sa_9DataArray___cinit__(struct __pyx_obj_3_sa_DataArray *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":18 + /* "/home/pauldb/workspace/cdec/python/src/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} # <<<<<<<<<<<<<< @@ -7383,7 +7403,7 @@ static int __pyx_pf_3_sa_9DataArray___cinit__(struct __pyx_obj_3_sa_DataArray *_ __pyx_v_self->word2id = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":19 + /* "/home/pauldb/workspace/cdec/python/src/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"] # <<<<<<<<<<<<<< @@ -7404,7 +7424,7 @@ static int __pyx_pf_3_sa_9DataArray___cinit__(struct __pyx_obj_3_sa_DataArray *_ __pyx_v_self->id2word = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":20 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -7419,7 +7439,7 @@ static int __pyx_pf_3_sa_9DataArray___cinit__(struct __pyx_obj_3_sa_DataArray *_ __pyx_v_self->data = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":21 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":21 * self.id2word = ["END_OF_FILE", "END_OF_LINE"] * self.data = IntList(1000,1000) * self.sent_id = IntList(1000,1000) # <<<<<<<<<<<<<< @@ -7434,7 +7454,7 @@ static int __pyx_pf_3_sa_9DataArray___cinit__(struct __pyx_obj_3_sa_DataArray *_ __pyx_v_self->sent_id = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":22 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":22 * self.data = IntList(1000,1000) * self.sent_id = IntList(1000,1000) * self.sent_index = IntList(1000,1000) # <<<<<<<<<<<<<< @@ -7449,7 +7469,7 @@ static int __pyx_pf_3_sa_9DataArray___cinit__(struct __pyx_obj_3_sa_DataArray *_ __pyx_v_self->sent_index = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":23 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":23 * self.sent_id = IntList(1000,1000) * self.sent_index = IntList(1000,1000) * self.use_sent_id = use_sent_id # <<<<<<<<<<<<<< @@ -7458,7 +7478,7 @@ static int __pyx_pf_3_sa_9DataArray___cinit__(struct __pyx_obj_3_sa_DataArray *_ */ __pyx_v_self->use_sent_id = __pyx_v_use_sent_id; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":24 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":24 * self.sent_index = IntList(1000,1000) * self.use_sent_id = use_sent_id * if from_binary: # <<<<<<<<<<<<<< @@ -7468,7 +7488,7 @@ static int __pyx_pf_3_sa_9DataArray___cinit__(struct __pyx_obj_3_sa_DataArray *_ __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/paulb/workspace/cdec/python/src/sa/data_array.pxi":25 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":25 * self.use_sent_id = use_sent_id * if from_binary: * self.read_binary(from_binary) # <<<<<<<<<<<<<< @@ -7490,7 +7510,7 @@ static int __pyx_pf_3_sa_9DataArray___cinit__(struct __pyx_obj_3_sa_DataArray *_ goto __pyx_L3; } - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":26 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":26 * if from_binary: * self.read_binary(from_binary) * elif from_text: # <<<<<<<<<<<<<< @@ -7500,7 +7520,7 @@ static int __pyx_pf_3_sa_9DataArray___cinit__(struct __pyx_obj_3_sa_DataArray *_ __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/paulb/workspace/cdec/python/src/sa/data_array.pxi":27 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":27 * self.read_binary(from_binary) * elif from_text: * if side: # <<<<<<<<<<<<<< @@ -7510,7 +7530,7 @@ static int __pyx_pf_3_sa_9DataArray___cinit__(struct __pyx_obj_3_sa_DataArray *_ __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/paulb/workspace/cdec/python/src/sa/data_array.pxi":28 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":28 * elif from_text: * if side: * self.read_bitext(from_text, (0 if side == 'source' else 1)) # <<<<<<<<<<<<<< @@ -7519,7 +7539,9 @@ static int __pyx_pf_3_sa_9DataArray___cinit__(struct __pyx_obj_3_sa_DataArray *_ */ __pyx_t_4 = PyObject_GetAttr(((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_2 = __Pyx_PyString_Equals(__pyx_v_side, ((PyObject *)__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;} + __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; if (__pyx_t_2) { __pyx_t_5 = 0; } else { @@ -7544,7 +7566,7 @@ static int __pyx_pf_3_sa_9DataArray___cinit__(struct __pyx_obj_3_sa_DataArray *_ } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":30 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":30 * self.read_bitext(from_text, (0 if side == 'source' else 1)) * else: * self.read_text(from_text) # <<<<<<<<<<<<<< @@ -7593,7 +7615,7 @@ static Py_ssize_t __pyx_pw_3_sa_9DataArray_3__len__(PyObject *__pyx_v_self) { return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":32 +/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":32 * self.read_text(from_text) * * def __len__(self): # <<<<<<<<<<<<<< @@ -7611,7 +7633,7 @@ static Py_ssize_t __pyx_pf_3_sa_9DataArray_2__len__(struct __pyx_obj_3_sa_DataAr int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__len__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":33 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":33 * * def __len__(self): * return len(self.data) # <<<<<<<<<<<<<< @@ -7647,7 +7669,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_5get_sentence_id(PyObject *__pyx_v_sel return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":35 +/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":35 * return len(self.data) * * def get_sentence_id(self, i): # <<<<<<<<<<<<<< @@ -7665,7 +7687,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_4get_sentence_id(struct __pyx_obj_3_sa int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_sentence_id", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":36 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":36 * * def get_sentence_id(self, i): * return self.sent_id.arr[i] # <<<<<<<<<<<<<< @@ -7703,7 +7725,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_7get_sentence(PyObject *__pyx_v_self, return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":38 +/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":38 * return self.sent_id.arr[i] * * def get_sentence(self, i): # <<<<<<<<<<<<<< @@ -7728,7 +7750,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_6get_sentence(struct __pyx_obj_3_sa_Da __Pyx_RefNannySetupContext("get_sentence", 0); __Pyx_INCREF(__pyx_v_i); - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":40 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":40 * def get_sentence(self, i): * cdef int j, start, stop * sent = [] # <<<<<<<<<<<<<< @@ -7740,7 +7762,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_6get_sentence(struct __pyx_obj_3_sa_Da __pyx_v_sent = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":41 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":41 * cdef int j, start, stop * sent = [] * start = self.sent_index.arr[i] # <<<<<<<<<<<<<< @@ -7750,7 +7772,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_6get_sentence(struct __pyx_obj_3_sa_Da __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/paulb/workspace/cdec/python/src/sa/data_array.pxi":42 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":42 * sent = [] * start = self.sent_index.arr[i] * stop = self.sent_index.arr[i+1] # <<<<<<<<<<<<<< @@ -7763,7 +7785,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_6get_sentence(struct __pyx_obj_3_sa_Da __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_stop = (__pyx_v_self->sent_index->arr[__pyx_t_2]); - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":43 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":43 * start = self.sent_index.arr[i] * stop = self.sent_index.arr[i+1] * for i from start <= i < stop: # <<<<<<<<<<<<<< @@ -7778,7 +7800,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_6get_sentence(struct __pyx_obj_3_sa_Da __pyx_v_i = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":44 + /* "/home/pauldb/workspace/cdec/python/src/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]]) # <<<<<<<<<<<<<< @@ -7793,7 +7815,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_6get_sentence(struct __pyx_obj_3_sa_Da __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;} } - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":43 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":43 * start = self.sent_index.arr[i] * stop = self.sent_index.arr[i+1] * for i from start <= i < stop: # <<<<<<<<<<<<<< @@ -7806,7 +7828,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_6get_sentence(struct __pyx_obj_3_sa_Da __pyx_v_i = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":45 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":45 * for i from start <= i < stop: * sent.append(self.id2word[self.data.arr[i]]) * return sent # <<<<<<<<<<<<<< @@ -7843,7 +7865,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_9get_id(PyObject *__pyx_v_self, PyObje return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":47 +/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":47 * return sent * * def get_id(self, word): # <<<<<<<<<<<<<< @@ -7863,18 +7885,18 @@ static PyObject *__pyx_pf_3_sa_9DataArray_8get_id(struct __pyx_obj_3_sa_DataArra int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_id", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":48 + /* "/home/pauldb/workspace/cdec/python/src/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 = ((PySequence_Contains(__pyx_v_self->word2id, __pyx_v_word))); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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); if (__pyx_t_2) { - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":49 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":49 * def get_id(self, word): * if not word in self.word2id: * self.word2id[word] = len(self.id2word) # <<<<<<<<<<<<<< @@ -7890,7 +7912,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_8get_id(struct __pyx_obj_3_sa_DataArra 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;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":50 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":50 * if not word in self.word2id: * self.word2id[word] = len(self.id2word) * self.id2word.append(word) # <<<<<<<<<<<<<< @@ -7904,7 +7926,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_8get_id(struct __pyx_obj_3_sa_DataArra } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":51 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":51 * self.word2id[word] = len(self.id2word) * self.id2word.append(word) * return self.word2id[word] # <<<<<<<<<<<<<< @@ -7941,7 +7963,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_11__getitem__(PyObject *__pyx_v_self, return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":53 +/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":53 * return self.word2id[word] * * def __getitem__(self, loc): # <<<<<<<<<<<<<< @@ -7959,7 +7981,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_10__getitem__(struct __pyx_obj_3_sa_Da int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":54 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":54 * * def __getitem__(self, loc): * return self.id2word[self.data.arr[loc]] # <<<<<<<<<<<<<< @@ -7997,7 +8019,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_13get_sentence_bounds(PyObject *__pyx_ return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":56 +/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":56 * return self.id2word[self.data.arr[loc]] * * def get_sentence_bounds(self, loc): # <<<<<<<<<<<<<< @@ -8018,7 +8040,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_12get_sentence_bounds(struct __pyx_obj int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_sentence_bounds", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":57 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":57 * * def get_sentence_bounds(self, loc): * cdef int sid = self.sent_id.arr[loc] # <<<<<<<<<<<<<< @@ -8028,7 +8050,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_12get_sentence_bounds(struct __pyx_obj __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/paulb/workspace/cdec/python/src/sa/data_array.pxi":58 + /* "/home/pauldb/workspace/cdec/python/src/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]) # <<<<<<<<<<<<<< @@ -8087,7 +8109,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_15write_text(PyObject *__pyx_v_self, P return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":60 +/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":60 * return (self.sent_index.arr[sid], self.sent_index.arr[sid+1]) * * def write_text(self, char* filename): # <<<<<<<<<<<<<< @@ -8119,7 +8141,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_14write_text(struct __pyx_obj_3_sa_Dat int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_text", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":61 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":61 * * def write_text(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -8159,7 +8181,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_14write_text(struct __pyx_obj_3_sa_Dat __pyx_v_f = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":62 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":62 * def write_text(self, char* filename): * with open(filename, "w") as f: * for w_id in self.data: # <<<<<<<<<<<<<< @@ -8177,10 +8199,18 @@ static PyObject *__pyx_pf_3_sa_9DataArray_14write_text(struct __pyx_obj_3_sa_Dat for (;;) { if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_4)) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_4)) break; - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #endif } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_4)) { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_4)) break; - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #endif } else { __pyx_t_1 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_1)) { @@ -8196,20 +8226,19 @@ static PyObject *__pyx_pf_3_sa_9DataArray_14write_text(struct __pyx_obj_3_sa_Dat __pyx_v_w_id = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":63 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":63 * with open(filename, "w") as f: * for w_id in self.data: * if w_id > 1: # <<<<<<<<<<<<<< * f.write("%s " % self.get_word(w_id)) * if w_id == 1: */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_w_id, __pyx_int_1, Py_GT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_1 = PyObject_RichCompare(__pyx_v_w_id, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_10) { - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":64 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":64 * for w_id in self.data: * if w_id > 1: * f.write("%s " % self.get_word(w_id)) # <<<<<<<<<<<<<< @@ -8246,20 +8275,19 @@ static PyObject *__pyx_pf_3_sa_9DataArray_14write_text(struct __pyx_obj_3_sa_Dat } __pyx_L18:; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":65 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":65 * if w_id > 1: * f.write("%s " % self.get_word(w_id)) * if w_id == 1: # <<<<<<<<<<<<<< * f.write("\n") * */ - __pyx_t_11 = PyObject_RichCompare(__pyx_v_w_id, __pyx_int_1, Py_EQ); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __Pyx_GOTREF(__pyx_t_11); + __pyx_t_11 = PyObject_RichCompare(__pyx_v_w_id, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_10) { - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":66 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":66 * f.write("%s " % self.get_word(w_id)) * if w_id == 1: * f.write("\n") # <<<<<<<<<<<<<< @@ -8289,7 +8317,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_14write_text(struct __pyx_obj_3_sa_Dat __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":61 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":61 * * def write_text(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -8408,7 +8436,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_17read_text(PyObject *__pyx_v_self, Py return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":68 +/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":68 * f.write("\n") * * def read_text(self, char* filename): # <<<<<<<<<<<<<< @@ -8436,7 +8464,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_16read_text(struct __pyx_obj_3_sa_Data int __pyx_clineno = 0; __Pyx_RefNannySetupContext("read_text", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":69 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":69 * * def read_text(self, char* filename): * with gzip_or_text(filename) as fp: # <<<<<<<<<<<<<< @@ -8476,7 +8504,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_16read_text(struct __pyx_obj_3_sa_Data __pyx_v_fp = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":70 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":70 * def read_text(self, char* filename): * with gzip_or_text(filename) as fp: * self.read_text_data(fp) # <<<<<<<<<<<<<< @@ -8505,7 +8533,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_16read_text(struct __pyx_obj_3_sa_Data __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":69 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":69 * * def read_text(self, char* filename): * with gzip_or_text(filename) as fp: # <<<<<<<<<<<<<< @@ -8606,11 +8634,11 @@ static PyObject *__pyx_pw_3_sa_9DataArray_19read_bitext(PyObject *__pyx_v_self, static PyObject *__pyx_pw_3_sa_9DataArray_19read_bitext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { char *__pyx_v_filename; int __pyx_v_side; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__filename,&__pyx_n_s__side,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("read_bitext (wrapper)", 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; @@ -8624,12 +8652,10 @@ static PyObject *__pyx_pw_3_sa_9DataArray_19read_bitext(PyObject *__pyx_v_self, kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__filename); - if (likely(values[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: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__side); - if (likely(values[1])) 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;} } @@ -8660,7 +8686,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_19read_bitext(PyObject *__pyx_v_self, } static PyObject *__pyx_gb_3_sa_9DataArray_11read_bitext_2generator6(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":74 +/* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -8736,10 +8762,18 @@ static PyObject *__pyx_gb_3_sa_9DataArray_11read_bitext_2generator6(__pyx_Genera for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #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[3]; __pyx_lineno = 74; __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[3]; __pyx_lineno = 74; __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; - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #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[3]; __pyx_lineno = 74; __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[3]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { @@ -8794,11 +8828,12 @@ static PyObject *__pyx_gb_3_sa_9DataArray_11read_bitext_2generator6(__pyx_Genera __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_generator->resume_label = -1; + __Pyx_Generator_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return NULL; } -/* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":72 +/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":72 * self.read_text_data(fp) * * def read_bitext(self, char* filename, int side): # <<<<<<<<<<<<<< @@ -8834,7 +8869,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_18read_bitext(struct __pyx_obj_3_sa_Da __Pyx_GOTREF(__pyx_cur_scope); __pyx_cur_scope->__pyx_v_side = __pyx_v_side; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":73 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":73 * * def read_bitext(self, char* filename, int side): * with gzip_or_text(filename) as fp: # <<<<<<<<<<<<<< @@ -8875,7 +8910,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_18read_bitext(struct __pyx_obj_3_sa_Da __pyx_cur_scope->__pyx_v_fp = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":74 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -8887,7 +8922,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_18read_bitext(struct __pyx_obj_3_sa_Da __pyx_v_data = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":75 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -8916,7 +8951,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_18read_bitext(struct __pyx_obj_3_sa_Da __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":73 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":73 * * def read_bitext(self, char* filename, int side): * with gzip_or_text(filename) as fp: # <<<<<<<<<<<<<< @@ -9024,7 +9059,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_21read_text_data(PyObject *__pyx_v_sel return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":77 +/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":77 * self.read_text_data(data) * * def read_text_data(self, data): # <<<<<<<<<<<<<< @@ -9054,7 +9089,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa int __pyx_clineno = 0; __Pyx_RefNannySetupContext("read_text_data", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":78 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":78 * * def read_text_data(self, data): * cdef int word_count = 0 # <<<<<<<<<<<<<< @@ -9063,7 +9098,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa */ __pyx_v_word_count = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":79 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":79 * def read_text_data(self, data): * cdef int word_count = 0 * for line_num, line in enumerate(data): # <<<<<<<<<<<<<< @@ -9083,10 +9118,18 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa for (;;) { if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else { __pyx_t_5 = __pyx_t_4(__pyx_t_2); if (unlikely(!__pyx_t_5)) { @@ -9110,7 +9153,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":80 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":80 * cdef int word_count = 0 * for line_num, line in enumerate(data): * self.sent_index.append(word_count) # <<<<<<<<<<<<<< @@ -9124,7 +9167,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":81 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":81 * for line_num, line in enumerate(data): * self.sent_index.append(word_count) * for word in line.split(): # <<<<<<<<<<<<<< @@ -9148,10 +9191,18 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa for (;;) { if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_6)) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_6)) break; - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; + #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;} + #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;} + #endif } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_6)) { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_6)) break; - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; + #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;} + #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;} + #endif } else { __pyx_t_5 = __pyx_t_8(__pyx_t_6); if (unlikely(!__pyx_t_5)) { @@ -9167,7 +9218,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa __pyx_v_word = __pyx_t_5; __pyx_t_5 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":82 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":82 * self.sent_index.append(word_count) * for word in line.split(): * self.data.append(self.get_id(word)) # <<<<<<<<<<<<<< @@ -9190,7 +9241,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":83 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":83 * for word in line.split(): * self.data.append(self.get_id(word)) * if self.use_sent_id: # <<<<<<<<<<<<<< @@ -9199,7 +9250,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa */ if (__pyx_v_self->use_sent_id) { - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":84 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":84 * self.data.append(self.get_id(word)) * if self.use_sent_id: * self.sent_id.append(line_num) # <<<<<<<<<<<<<< @@ -9213,7 +9264,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa } __pyx_L7:; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":85 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":85 * if self.use_sent_id: * self.sent_id.append(line_num) * word_count = word_count + 1 # <<<<<<<<<<<<<< @@ -9224,7 +9275,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":86 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":86 * self.sent_id.append(line_num) * word_count = word_count + 1 * self.data.append(1) # <<<<<<<<<<<<<< @@ -9235,7 +9286,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":87 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":87 * word_count = word_count + 1 * self.data.append(1) * if self.use_sent_id: # <<<<<<<<<<<<<< @@ -9244,7 +9295,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa */ if (__pyx_v_self->use_sent_id) { - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":88 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":88 * self.data.append(1) * if self.use_sent_id: * self.sent_id.append(line_num) # <<<<<<<<<<<<<< @@ -9258,7 +9309,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa } __pyx_L8:; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":89 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":89 * if self.use_sent_id: * self.sent_id.append(line_num) * word_count = word_count + 1 # <<<<<<<<<<<<<< @@ -9270,7 +9321,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":90 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":90 * self.sent_id.append(line_num) * word_count = word_count + 1 * self.data.append(0) # <<<<<<<<<<<<<< @@ -9281,7 +9332,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":91 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":91 * word_count = word_count + 1 * self.data.append(0) * self.sent_index.append(word_count) # <<<<<<<<<<<<<< @@ -9336,7 +9387,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_23read_binary(PyObject *__pyx_v_self, return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":94 +/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":94 * * * def read_binary(self, char* filename): # <<<<<<<<<<<<<< @@ -9350,7 +9401,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_22read_binary(struct __pyx_obj_3_sa_Da __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("read_binary", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":96 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":96 * def read_binary(self, char* filename): * cdef FILE* f * f = fopen(filename, "r") # <<<<<<<<<<<<<< @@ -9359,7 +9410,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_22read_binary(struct __pyx_obj_3_sa_Da */ __pyx_v_f = fopen(__pyx_v_filename, __pyx_k__r); - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":97 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":97 * cdef FILE* f * f = fopen(filename, "r") * self.read_handle(f) # <<<<<<<<<<<<<< @@ -9368,7 +9419,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_22read_binary(struct __pyx_obj_3_sa_Da */ ((struct __pyx_vtabstruct_3_sa_DataArray *)__pyx_v_self->__pyx_vtab)->read_handle(__pyx_v_self, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":98 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":98 * f = fopen(filename, "r") * self.read_handle(f) * fclose(f) # <<<<<<<<<<<<<< @@ -9383,7 +9434,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_22read_binary(struct __pyx_obj_3_sa_Da return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":100 +/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":100 * fclose(f) * * cdef void read_handle(self, FILE* f): # <<<<<<<<<<<<<< @@ -9408,7 +9459,7 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray int __pyx_clineno = 0; __Pyx_RefNannySetupContext("read_handle", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":105 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":105 * cdef char* word * * self.data.read_handle(f) # <<<<<<<<<<<<<< @@ -9417,7 +9468,7 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->data->__pyx_vtab)->read_handle(__pyx_v_self->data, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":106 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":106 * * self.data.read_handle(f) * self.sent_index.read_handle(f) # <<<<<<<<<<<<<< @@ -9426,7 +9477,7 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->sent_index->__pyx_vtab)->read_handle(__pyx_v_self->sent_index, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":107 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":107 * self.data.read_handle(f) * self.sent_index.read_handle(f) * self.sent_id.read_handle(f) # <<<<<<<<<<<<<< @@ -9435,7 +9486,7 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->sent_id->__pyx_vtab)->read_handle(__pyx_v_self->sent_id, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":108 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":108 * self.sent_index.read_handle(f) * self.sent_id.read_handle(f) * fread(&(num_words), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -9444,7 +9495,7 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray */ fread((&__pyx_v_num_words), (sizeof(int)), 1, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":109 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":109 * self.sent_id.read_handle(f) * fread(&(num_words), sizeof(int), 1, f) * for i in range(num_words): # <<<<<<<<<<<<<< @@ -9455,7 +9506,7 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":110 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -9464,7 +9515,7 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray */ fread((&__pyx_v_word_len), (sizeof(int)), 1, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":111 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":111 * for i in range(num_words): * fread(&(word_len), sizeof(int), 1, f) * word = malloc (word_len * sizeof(char)) # <<<<<<<<<<<<<< @@ -9473,7 +9524,7 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray */ __pyx_v_word = ((char *)malloc((__pyx_v_word_len * (sizeof(char))))); - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":112 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -9482,7 +9533,7 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray */ fread(__pyx_v_word, (sizeof(char)), __pyx_v_word_len, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":113 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":113 * word = malloc (word_len * sizeof(char)) * fread(word, sizeof(char), word_len, f) * self.word2id[word] = len(self.id2word) # <<<<<<<<<<<<<< @@ -9501,7 +9552,7 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":114 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":114 * fread(word, sizeof(char), word_len, f) * self.word2id[word] = len(self.id2word) * self.id2word.append(word) # <<<<<<<<<<<<<< @@ -9515,7 +9566,7 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":115 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":115 * self.word2id[word] = len(self.id2word) * self.id2word.append(word) * free(word) # <<<<<<<<<<<<<< @@ -9525,7 +9576,7 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray free(__pyx_v_word); } - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":116 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":116 * self.id2word.append(word) * free(word) * if len(self.sent_id) == 0: # <<<<<<<<<<<<<< @@ -9539,7 +9590,7 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray __pyx_t_6 = (__pyx_t_4 == 0); if (__pyx_t_6) { - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":117 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":117 * free(word) * if len(self.sent_id) == 0: * self.use_sent_id = False # <<<<<<<<<<<<<< @@ -9551,7 +9602,7 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":119 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":119 * self.use_sent_id = False * else: * self.use_sent_id = True # <<<<<<<<<<<<<< @@ -9571,7 +9622,7 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray __Pyx_RefNannyFinishContext(); } -/* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":121 +/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":121 * self.use_sent_id = True * * cdef void write_handle(self, FILE* f): # <<<<<<<<<<<<<< @@ -9595,7 +9646,7 @@ static void __pyx_f_3_sa_9DataArray_write_handle(struct __pyx_obj_3_sa_DataArray int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_handle", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":125 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":125 * cdef int num_words * * self.data.write_handle(f) # <<<<<<<<<<<<<< @@ -9604,7 +9655,7 @@ static void __pyx_f_3_sa_9DataArray_write_handle(struct __pyx_obj_3_sa_DataArray */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->data->__pyx_vtab)->write_handle(__pyx_v_self->data, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":126 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":126 * * self.data.write_handle(f) * self.sent_index.write_handle(f) # <<<<<<<<<<<<<< @@ -9613,7 +9664,7 @@ static void __pyx_f_3_sa_9DataArray_write_handle(struct __pyx_obj_3_sa_DataArray */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->sent_index->__pyx_vtab)->write_handle(__pyx_v_self->sent_index, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":127 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":127 * self.data.write_handle(f) * self.sent_index.write_handle(f) * self.sent_id.write_handle(f) # <<<<<<<<<<<<<< @@ -9622,7 +9673,7 @@ static void __pyx_f_3_sa_9DataArray_write_handle(struct __pyx_obj_3_sa_DataArray */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->sent_id->__pyx_vtab)->write_handle(__pyx_v_self->sent_id, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":128 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":128 * self.sent_index.write_handle(f) * self.sent_id.write_handle(f) * num_words = len(self.id2word) - 2 # <<<<<<<<<<<<<< @@ -9635,7 +9686,7 @@ static void __pyx_f_3_sa_9DataArray_write_handle(struct __pyx_obj_3_sa_DataArray __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_num_words = (__pyx_t_2 - 2); - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":129 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":129 * self.sent_id.write_handle(f) * num_words = len(self.id2word) - 2 * fwrite(&(num_words), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -9644,7 +9695,7 @@ static void __pyx_f_3_sa_9DataArray_write_handle(struct __pyx_obj_3_sa_DataArray */ fwrite((&__pyx_v_num_words), (sizeof(int)), 1, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":130 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":130 * num_words = len(self.id2word) - 2 * fwrite(&(num_words), sizeof(int), 1, f) * for word in self.id2word[2:]: # <<<<<<<<<<<<<< @@ -9665,10 +9716,18 @@ static void __pyx_f_3_sa_9DataArray_write_handle(struct __pyx_obj_3_sa_DataArray for (;;) { if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_3)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break; - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_3)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break; - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else { __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) { @@ -9684,7 +9743,7 @@ static void __pyx_f_3_sa_9DataArray_write_handle(struct __pyx_obj_3_sa_DataArray __pyx_v_word = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":131 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":131 * fwrite(&(num_words), sizeof(int), 1, f) * for word in self.id2word[2:]: * word_len = len(word) + 1 # <<<<<<<<<<<<<< @@ -9694,7 +9753,7 @@ static void __pyx_f_3_sa_9DataArray_write_handle(struct __pyx_obj_3_sa_DataArray __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/paulb/workspace/cdec/python/src/sa/data_array.pxi":132 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":132 * for word in self.id2word[2:]: * word_len = len(word) + 1 * fwrite(&(word_len), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -9703,7 +9762,7 @@ static void __pyx_f_3_sa_9DataArray_write_handle(struct __pyx_obj_3_sa_DataArray */ fwrite((&__pyx_v_word_len), (sizeof(int)), 1, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":133 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":133 * word_len = len(word) + 1 * fwrite(&(word_len), sizeof(int), 1, f) * fwrite(word, sizeof(char), word_len, f) # <<<<<<<<<<<<<< @@ -9746,7 +9805,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_25write_binary(PyObject *__pyx_v_self, return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":135 +/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":135 * fwrite(word, sizeof(char), word_len, f) * * def write_binary(self, char* filename): # <<<<<<<<<<<<<< @@ -9760,7 +9819,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_24write_binary(struct __pyx_obj_3_sa_D __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("write_binary", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":137 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":137 * def write_binary(self, char* filename): * cdef FILE* f * f = fopen(filename, "w") # <<<<<<<<<<<<<< @@ -9769,7 +9828,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_24write_binary(struct __pyx_obj_3_sa_D */ __pyx_v_f = fopen(__pyx_v_filename, __pyx_k__w); - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":138 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":138 * cdef FILE* f * f = fopen(filename, "w") * self.write_handle(f) # <<<<<<<<<<<<<< @@ -9778,7 +9837,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_24write_binary(struct __pyx_obj_3_sa_D */ ((struct __pyx_vtabstruct_3_sa_DataArray *)__pyx_v_self->__pyx_vtab)->write_handle(__pyx_v_self, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":139 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":139 * f = fopen(filename, "w") * self.write_handle(f) * fclose(f) # <<<<<<<<<<<<<< @@ -9804,7 +9863,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_27write_enhanced_handle(PyObject *__py return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":141 +/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":141 * fclose(f) * * def write_enhanced_handle(self, f): # <<<<<<<<<<<<<< @@ -9828,7 +9887,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_o int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_enhanced_handle", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":142 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":142 * * def write_enhanced_handle(self, f): * for i in self.data: # <<<<<<<<<<<<<< @@ -9846,10 +9905,18 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_o for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #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[3]; __pyx_lineno = 142; __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[3]; __pyx_lineno = 142; __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; - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #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[3]; __pyx_lineno = 142; __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[3]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { @@ -9865,7 +9932,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_o __pyx_v_i = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":143 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":143 * def write_enhanced_handle(self, f): * for i in self.data: * f.write("%d " %i) # <<<<<<<<<<<<<< @@ -9889,7 +9956,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_o } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":144 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":144 * for i in self.data: * f.write("%d " %i) * f.write("\n") # <<<<<<<<<<<<<< @@ -9903,7 +9970,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_o __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":145 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":145 * f.write("%d " %i) * f.write("\n") * for i in self.sent_index: # <<<<<<<<<<<<<< @@ -9921,10 +9988,18 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_o for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_5)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_5)) break; - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_5)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_5)) break; - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else { __pyx_t_1 = __pyx_t_3(__pyx_t_5); if (unlikely(!__pyx_t_1)) { @@ -9940,7 +10015,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_o __pyx_v_i = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":146 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":146 * f.write("\n") * for i in self.sent_index: * f.write("%d " %i) # <<<<<<<<<<<<<< @@ -9964,7 +10039,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_o } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":147 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":147 * for i in self.sent_index: * f.write("%d " %i) * f.write("\n") # <<<<<<<<<<<<<< @@ -9978,7 +10053,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_o __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":148 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":148 * f.write("%d " %i) * f.write("\n") * for i in self.sent_id: # <<<<<<<<<<<<<< @@ -9996,10 +10071,18 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_o for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_6)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_6)) break; - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_6)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_6)) break; - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else { __pyx_t_5 = __pyx_t_3(__pyx_t_6); if (unlikely(!__pyx_t_5)) { @@ -10015,7 +10098,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_o __pyx_v_i = __pyx_t_5; __pyx_t_5 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":149 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":149 * f.write("\n") * for i in self.sent_id: * f.write("%d " %i) # <<<<<<<<<<<<<< @@ -10039,7 +10122,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_o } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":150 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":150 * for i in self.sent_id: * f.write("%d " %i) * f.write("\n") # <<<<<<<<<<<<<< @@ -10053,7 +10136,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_o __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":151 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":151 * f.write("%d " %i) * f.write("\n") * for word in self.id2word: # <<<<<<<<<<<<<< @@ -10071,10 +10154,18 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_o for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_4)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break; - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 151; __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; - __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else { __pyx_t_6 = __pyx_t_3(__pyx_t_4); if (unlikely(!__pyx_t_6)) { @@ -10090,7 +10181,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_o __pyx_v_word = __pyx_t_6; __pyx_t_6 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":152 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":152 * f.write("\n") * for word in self.id2word: * f.write("%s %d " % (word, self.word2id[word])) # <<<<<<<<<<<<<< @@ -10125,7 +10216,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_o } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":153 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":153 * for word in self.id2word: * f.write("%s %d " % (word, self.word2id[word])) * f.write("\n") # <<<<<<<<<<<<<< @@ -10177,7 +10268,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_29write_enhanced(PyObject *__pyx_v_sel return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":155 +/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":155 * f.write("\n") * * def write_enhanced(self, char* filename): # <<<<<<<<<<<<<< @@ -10205,7 +10296,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_28write_enhanced(struct __pyx_obj_3_sa int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_enhanced", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":156 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":156 * * def write_enhanced(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -10244,7 +10335,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_28write_enhanced(struct __pyx_obj_3_sa __pyx_v_f = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":157 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":157 * def write_enhanced(self, char* filename): * with open(filename, "w") as f: * self.write_enhanced_handle(self, f) # <<<<<<<<<<<<<< @@ -10274,7 +10365,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_28write_enhanced(struct __pyx_obj_3_sa __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":156 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":156 * * def write_enhanced(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -10380,7 +10471,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_7word2id_1__get__(PyObject *__pyx_v_se return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":10 +/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":10 * * cdef class DataArray: * cdef public word2id # <<<<<<<<<<<<<< @@ -10467,7 +10558,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_7id2word_1__get__(PyObject *__pyx_v_se return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":11 +/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":11 * cdef class DataArray: * cdef public word2id * cdef public id2word # <<<<<<<<<<<<<< @@ -10554,7 +10645,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_4data_1__get__(PyObject *__pyx_v_self) return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":12 +/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":12 * cdef public word2id * cdef public id2word * cdef public IntList data # <<<<<<<<<<<<<< @@ -10650,7 +10741,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_7sent_id_1__get__(PyObject *__pyx_v_se return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":13 +/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":13 * cdef public id2word * cdef public IntList data * cdef public IntList sent_id # <<<<<<<<<<<<<< @@ -10746,7 +10837,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_10sent_index_1__get__(PyObject *__pyx_ return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":14 +/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":14 * cdef public IntList data * cdef public IntList sent_id * cdef public IntList sent_index # <<<<<<<<<<<<<< @@ -10831,7 +10922,7 @@ static int __pyx_pf_3_sa_9DataArray_10sent_index_4__del__(struct __pyx_obj_3_sa_ return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":12 +/* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":12 * cdef IntList sent_index * * cdef int link(self, int i, int j): # <<<<<<<<<<<<<< @@ -10844,7 +10935,7 @@ static int __pyx_f_3_sa_9Alignment_link(CYTHON_UNUSED struct __pyx_obj_3_sa_Alig __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("link", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":14 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":14 * cdef int link(self, int i, int j): * """Integerizes an alignment link pair""" * return i*65536 + j # <<<<<<<<<<<<<< @@ -10872,7 +10963,7 @@ static PyObject *__pyx_pw_3_sa_9Alignment_1unlink(PyObject *__pyx_v_self, PyObje return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":16 +/* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":16 * return i*65536 + j * * def unlink(self, link): # <<<<<<<<<<<<<< @@ -10891,7 +10982,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_unlink(CYTHON_UNUSED struct __pyx_obj_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("unlink", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":18 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":18 * def unlink(self, link): * """De-integerizes an alignment link pair""" * return (link/65536, link%65536) # <<<<<<<<<<<<<< @@ -10929,7 +11020,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_unlink(CYTHON_UNUSED struct __pyx_obj_ return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":20 +/* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":20 * return (link/65536, link%65536) * * cdef _unlink(self, int link, int* f, int* e): # <<<<<<<<<<<<<< @@ -10942,7 +11033,7 @@ static PyObject *__pyx_f_3_sa_9Alignment__unlink(CYTHON_UNUSED struct __pyx_obj_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_unlink", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":21 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":21 * * cdef _unlink(self, int link, int* f, int* e): * f[0] = link/65536 # <<<<<<<<<<<<<< @@ -10951,7 +11042,7 @@ static PyObject *__pyx_f_3_sa_9Alignment__unlink(CYTHON_UNUSED struct __pyx_obj_ */ (__pyx_v_f[0]) = __Pyx_div_long(__pyx_v_link, 65536); - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":22 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":22 * cdef _unlink(self, int link, int* f, int* e): * f[0] = link/65536 * e[0] = link%65536 # <<<<<<<<<<<<<< @@ -10987,7 +11078,7 @@ static PyObject *__pyx_pw_3_sa_9Alignment_3get_sent_links(PyObject *__pyx_v_self return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":24 +/* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":24 * e[0] = link%65536 * * def get_sent_links(self, int sent_id): # <<<<<<<<<<<<<< @@ -11007,7 +11098,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_2get_sent_links(struct __pyx_obj_3_sa_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_sent_links", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":28 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":28 * cdef int* arr * cdef int arr_len * sent_links = IntList() # <<<<<<<<<<<<<< @@ -11019,7 +11110,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_2get_sent_links(struct __pyx_obj_3_sa_ __pyx_v_sent_links = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":29 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":29 * cdef int arr_len * sent_links = IntList() * arr = self._get_sent_links(sent_id, &arr_len) # <<<<<<<<<<<<<< @@ -11028,7 +11119,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_2get_sent_links(struct __pyx_obj_3_sa_ */ __pyx_v_arr = ((struct __pyx_vtabstruct_3_sa_Alignment *)__pyx_v_self->__pyx_vtab)->_get_sent_links(__pyx_v_self, __pyx_v_sent_id, (&__pyx_v_arr_len)); - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":30 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":30 * sent_links = IntList() * arr = self._get_sent_links(sent_id, &arr_len) * sent_links._extend_arr(arr, arr_len*2) # <<<<<<<<<<<<<< @@ -11037,7 +11128,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_2get_sent_links(struct __pyx_obj_3_sa_ */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_sent_links->__pyx_vtab)->_extend_arr(__pyx_v_sent_links, __pyx_v_arr, (__pyx_v_arr_len * 2)); - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":31 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":31 * arr = self._get_sent_links(sent_id, &arr_len) * sent_links._extend_arr(arr, arr_len*2) * free(arr) # <<<<<<<<<<<<<< @@ -11046,7 +11137,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_2get_sent_links(struct __pyx_obj_3_sa_ */ free(__pyx_v_arr); - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":32 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":32 * sent_links._extend_arr(arr, arr_len*2) * free(arr) * return sent_links # <<<<<<<<<<<<<< @@ -11071,7 +11162,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_2get_sent_links(struct __pyx_obj_3_sa_ return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":34 +/* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":34 * return sent_links * * cdef int* _get_sent_links(self, int sent_id, int* num_links): # <<<<<<<<<<<<<< @@ -11093,7 +11184,7 @@ static int *__pyx_f_3_sa_9Alignment__get_sent_links(struct __pyx_obj_3_sa_Alignm int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_sent_links", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":37 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":37 * cdef int* sent_links * cdef int i, start, end * start = self.sent_index.arr[sent_id] # <<<<<<<<<<<<<< @@ -11102,7 +11193,7 @@ static int *__pyx_f_3_sa_9Alignment__get_sent_links(struct __pyx_obj_3_sa_Alignm */ __pyx_v_start = (__pyx_v_self->sent_index->arr[__pyx_v_sent_id]); - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":38 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":38 * cdef int i, start, end * start = self.sent_index.arr[sent_id] * end = self.sent_index.arr[sent_id+1] # <<<<<<<<<<<<<< @@ -11111,7 +11202,7 @@ static int *__pyx_f_3_sa_9Alignment__get_sent_links(struct __pyx_obj_3_sa_Alignm */ __pyx_v_end = (__pyx_v_self->sent_index->arr[(__pyx_v_sent_id + 1)]); - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":39 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":39 * start = self.sent_index.arr[sent_id] * end = self.sent_index.arr[sent_id+1] * num_links[0] = end - start # <<<<<<<<<<<<<< @@ -11120,7 +11211,7 @@ static int *__pyx_f_3_sa_9Alignment__get_sent_links(struct __pyx_obj_3_sa_Alignm */ (__pyx_v_num_links[0]) = (__pyx_v_end - __pyx_v_start); - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":40 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":40 * end = self.sent_index.arr[sent_id+1] * num_links[0] = end - start * sent_links = malloc(2*num_links[0]*sizeof(int)) # <<<<<<<<<<<<<< @@ -11129,7 +11220,7 @@ static int *__pyx_f_3_sa_9Alignment__get_sent_links(struct __pyx_obj_3_sa_Alignm */ __pyx_v_sent_links = ((int *)malloc(((2 * (__pyx_v_num_links[0])) * (sizeof(int))))); - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":41 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":41 * num_links[0] = end - start * sent_links = malloc(2*num_links[0]*sizeof(int)) * for i from 0 <= i < num_links[0]: # <<<<<<<<<<<<<< @@ -11139,7 +11230,7 @@ static int *__pyx_f_3_sa_9Alignment__get_sent_links(struct __pyx_obj_3_sa_Alignm __pyx_t_1 = (__pyx_v_num_links[0]); for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":42 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":42 * 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) # <<<<<<<<<<<<<< @@ -11151,7 +11242,7 @@ static int *__pyx_f_3_sa_9Alignment__get_sent_links(struct __pyx_obj_3_sa_Alignm __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":43 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":43 * 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 # <<<<<<<<<<<<<< @@ -11177,14 +11268,14 @@ static int __pyx_pw_3_sa_9Alignment_5__cinit__(PyObject *__pyx_v_self, PyObject static int __pyx_pw_3_sa_9Alignment_5__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_from_binary = 0; PyObject *__pyx_v_from_text = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__from_binary,&__pyx_n_s__from_text,0}; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__from_binary,&__pyx_n_s__from_text,0}; PyObject* values[2] = {0,0}; - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":45 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":45 * return sent_links * * def __cinit__(self, from_binary=None, from_text=None): # <<<<<<<<<<<<<< @@ -11254,7 +11345,7 @@ static int __pyx_pf_3_sa_9Alignment_4__cinit__(struct __pyx_obj_3_sa_Alignment * int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":46 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":46 * * def __cinit__(self, from_binary=None, from_text=None): * self.links = IntList(1000,1000) # <<<<<<<<<<<<<< @@ -11269,7 +11360,7 @@ static int __pyx_pf_3_sa_9Alignment_4__cinit__(struct __pyx_obj_3_sa_Alignment * __pyx_v_self->links = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":47 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":47 * def __cinit__(self, from_binary=None, from_text=None): * self.links = IntList(1000,1000) * self.sent_index = IntList(1000,1000) # <<<<<<<<<<<<<< @@ -11284,7 +11375,7 @@ static int __pyx_pf_3_sa_9Alignment_4__cinit__(struct __pyx_obj_3_sa_Alignment * __pyx_v_self->sent_index = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":48 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":48 * self.links = IntList(1000,1000) * self.sent_index = IntList(1000,1000) * if from_binary: # <<<<<<<<<<<<<< @@ -11294,7 +11385,7 @@ static int __pyx_pf_3_sa_9Alignment_4__cinit__(struct __pyx_obj_3_sa_Alignment * __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_from_binary); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":49 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":49 * self.sent_index = IntList(1000,1000) * if from_binary: * self.read_binary(from_binary) # <<<<<<<<<<<<<< @@ -11316,7 +11407,7 @@ static int __pyx_pf_3_sa_9Alignment_4__cinit__(struct __pyx_obj_3_sa_Alignment * goto __pyx_L3; } - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":50 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":50 * if from_binary: * self.read_binary(from_binary) * elif from_text: # <<<<<<<<<<<<<< @@ -11326,7 +11417,7 @@ static int __pyx_pf_3_sa_9Alignment_4__cinit__(struct __pyx_obj_3_sa_Alignment * __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_from_text); 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/paulb/workspace/cdec/python/src/sa/alignment.pxi":51 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":51 * self.read_binary(from_binary) * elif from_text: * self.read_text(from_text) # <<<<<<<<<<<<<< @@ -11383,7 +11474,7 @@ static PyObject *__pyx_pw_3_sa_9Alignment_7read_text(PyObject *__pyx_v_self, PyO return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":53 +/* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":53 * self.read_text(from_text) * * def read_text(self, char* filename): # <<<<<<<<<<<<<< @@ -11425,7 +11516,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_6read_text(struct __pyx_obj_3_sa_Align int __pyx_clineno = 0; __Pyx_RefNannySetupContext("read_text", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":54 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":54 * * def read_text(self, char* filename): * with gzip_or_text(filename) as f: # <<<<<<<<<<<<<< @@ -11465,7 +11556,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_6read_text(struct __pyx_obj_3_sa_Align __pyx_v_f = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":55 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":55 * def read_text(self, char* filename): * with gzip_or_text(filename) as f: * for line in f: # <<<<<<<<<<<<<< @@ -11483,10 +11574,18 @@ static PyObject *__pyx_pf_3_sa_9Alignment_6read_text(struct __pyx_obj_3_sa_Align for (;;) { if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #endif } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #endif } else { __pyx_t_2 = __pyx_t_9(__pyx_t_1); if (unlikely(!__pyx_t_2)) { @@ -11502,7 +11601,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_6read_text(struct __pyx_obj_3_sa_Align __pyx_v_line = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":56 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":56 * with gzip_or_text(filename) as f: * for line in f: * self.sent_index.append(len(self.links)) # <<<<<<<<<<<<<< @@ -11520,7 +11619,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_6read_text(struct __pyx_obj_3_sa_Align __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":57 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":57 * for line in f: * self.sent_index.append(len(self.links)) * pairs = line.split() # <<<<<<<<<<<<<< @@ -11536,7 +11635,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_6read_text(struct __pyx_obj_3_sa_Align __pyx_v_pairs = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":58 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":58 * self.sent_index.append(len(self.links)) * pairs = line.split() * for pair in pairs: # <<<<<<<<<<<<<< @@ -11554,10 +11653,18 @@ static PyObject *__pyx_pf_3_sa_9Alignment_6read_text(struct __pyx_obj_3_sa_Align for (;;) { if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_2)) { if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_2)) break; - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; + #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 = 58; __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 = 58; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #endif } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_2)) { if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; + #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 = 58; __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 = 58; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #endif } else { __pyx_t_3 = __pyx_t_11(__pyx_t_2); if (unlikely(!__pyx_t_3)) { @@ -11573,7 +11680,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_6read_text(struct __pyx_obj_3_sa_Align __pyx_v_pair = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":59 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":59 * pairs = line.split() * for pair in pairs: * (i, j) = map(int, pair.split('-')) # <<<<<<<<<<<<<< @@ -11598,27 +11705,33 @@ static PyObject *__pyx_pf_3_sa_9Alignment_6read_text(struct __pyx_obj_3_sa_Align __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_12))) || (PyList_CheckExact(__pyx_t_12))) { PyObject* sequence = __pyx_t_12; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[4]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { - if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[4]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - } __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_13 = PyTuple_GET_ITEM(sequence, 1); } else { - if (unlikely(PyList_GET_SIZE(sequence) != 2)) { - if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[4]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - } __pyx_t_3 = PyList_GET_ITEM(sequence, 0); __pyx_t_13 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_13); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_13 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #endif __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - } else { + } else + { Py_ssize_t index = -1; __pyx_t_14 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_14); @@ -11629,12 +11742,13 @@ static PyObject *__pyx_pf_3_sa_9Alignment_6read_text(struct __pyx_obj_3_sa_Align index = 1; __pyx_t_13 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_13)) goto __pyx_L20_unpacking_failed; __Pyx_GOTREF(__pyx_t_13); if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L21_unpacking_done; __pyx_L20_unpacking_failed:; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); + __pyx_t_15 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __pyx_L21_unpacking_done:; } @@ -11645,7 +11759,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_6read_text(struct __pyx_obj_3_sa_Align __pyx_v_j = __pyx_t_13; __pyx_t_13 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":60 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":60 * for pair in pairs: * (i, j) = map(int, pair.split('-')) * self.links.append(self.link(i, j)) # <<<<<<<<<<<<<< @@ -11665,7 +11779,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_6read_text(struct __pyx_obj_3_sa_Align } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":61 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":61 * (i, j) = map(int, pair.split('-')) * self.links.append(self.link(i, j)) * self.sent_index.append(len(self.links)) # <<<<<<<<<<<<<< @@ -11695,7 +11809,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_6read_text(struct __pyx_obj_3_sa_Align __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":54 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":54 * * def read_text(self, char* filename): * with gzip_or_text(filename) as f: # <<<<<<<<<<<<<< @@ -11819,7 +11933,7 @@ static PyObject *__pyx_pw_3_sa_9Alignment_9read_binary(PyObject *__pyx_v_self, P return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":63 +/* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":63 * self.sent_index.append(len(self.links)) * * def read_binary(self, char* filename): # <<<<<<<<<<<<<< @@ -11833,7 +11947,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_8read_binary(struct __pyx_obj_3_sa_Ali __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("read_binary", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":65 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":65 * def read_binary(self, char* filename): * cdef FILE* f * f = fopen(filename, "r") # <<<<<<<<<<<<<< @@ -11842,7 +11956,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_8read_binary(struct __pyx_obj_3_sa_Ali */ __pyx_v_f = fopen(__pyx_v_filename, __pyx_k__r); - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":66 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":66 * cdef FILE* f * f = fopen(filename, "r") * self.links.read_handle(f) # <<<<<<<<<<<<<< @@ -11851,7 +11965,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_8read_binary(struct __pyx_obj_3_sa_Ali */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->links->__pyx_vtab)->read_handle(__pyx_v_self->links, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":67 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":67 * f = fopen(filename, "r") * self.links.read_handle(f) * self.sent_index.read_handle(f) # <<<<<<<<<<<<<< @@ -11860,7 +11974,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_8read_binary(struct __pyx_obj_3_sa_Ali */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->sent_index->__pyx_vtab)->read_handle(__pyx_v_self->sent_index, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":68 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":68 * self.links.read_handle(f) * self.sent_index.read_handle(f) * fclose(f) # <<<<<<<<<<<<<< @@ -11896,7 +12010,7 @@ static PyObject *__pyx_pw_3_sa_9Alignment_11write_text(PyObject *__pyx_v_self, P return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":70 +/* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":70 * fclose(f) * * def write_text(self, char* filename): # <<<<<<<<<<<<<< @@ -11931,7 +12045,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_10write_text(struct __pyx_obj_3_sa_Ali int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_text", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":71 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":71 * * def write_text(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -11971,7 +12085,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_10write_text(struct __pyx_obj_3_sa_Ali __pyx_v_f = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":72 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":72 * def write_text(self, char* filename): * with open(filename, "w") as f: * sent_num = 0 # <<<<<<<<<<<<<< @@ -11981,7 +12095,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_10write_text(struct __pyx_obj_3_sa_Ali __Pyx_INCREF(__pyx_int_0); __pyx_v_sent_num = __pyx_int_0; - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":73 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":73 * with open(filename, "w") as f: * sent_num = 0 * for i, link in enumerate(self.links): # <<<<<<<<<<<<<< @@ -12001,10 +12115,18 @@ static PyObject *__pyx_pf_3_sa_9Alignment_10write_text(struct __pyx_obj_3_sa_Ali for (;;) { if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #endif } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #endif } else { __pyx_t_2 = __pyx_t_9(__pyx_t_1); if (unlikely(!__pyx_t_2)) { @@ -12028,7 +12150,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_10write_text(struct __pyx_obj_3_sa_Ali __pyx_t_4 = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":74 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":74 * sent_num = 0 * for i, link in enumerate(self.links): * while i >= self.sent_index[sent_num]: # <<<<<<<<<<<<<< @@ -12038,14 +12160,13 @@ static PyObject *__pyx_pf_3_sa_9Alignment_10write_text(struct __pyx_obj_3_sa_Ali 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 = 74; __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); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __Pyx_GOTREF(__pyx_t_10); + __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 = 74; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (!__pyx_t_11) break; - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":75 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":75 * for i, link in enumerate(self.links): * while i >= self.sent_index[sent_num]: * f.write("\n") # <<<<<<<<<<<<<< @@ -12059,7 +12180,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_10write_text(struct __pyx_obj_3_sa_Ali __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":76 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":76 * while i >= self.sent_index[sent_num]: * f.write("\n") * sent_num = sent_num + 1 # <<<<<<<<<<<<<< @@ -12073,7 +12194,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_10write_text(struct __pyx_obj_3_sa_Ali __pyx_t_2 = 0; } - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":77 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":77 * f.write("\n") * sent_num = sent_num + 1 * f.write("%d-%d " % self.unlink(link)) # <<<<<<<<<<<<<< @@ -12110,7 +12231,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_10write_text(struct __pyx_obj_3_sa_Ali __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":78 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":78 * sent_num = sent_num + 1 * f.write("%d-%d " % self.unlink(link)) * f.write("\n") # <<<<<<<<<<<<<< @@ -12136,7 +12257,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_10write_text(struct __pyx_obj_3_sa_Ali __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":71 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":71 * * def write_text(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -12258,7 +12379,7 @@ static PyObject *__pyx_pw_3_sa_9Alignment_13write_binary(PyObject *__pyx_v_self, return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":80 +/* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":80 * f.write("\n") * * def write_binary(self, char* filename): # <<<<<<<<<<<<<< @@ -12272,7 +12393,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_12write_binary(struct __pyx_obj_3_sa_A __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("write_binary", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":82 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":82 * def write_binary(self, char* filename): * cdef FILE* f * f = fopen(filename, "w") # <<<<<<<<<<<<<< @@ -12281,7 +12402,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_12write_binary(struct __pyx_obj_3_sa_A */ __pyx_v_f = fopen(__pyx_v_filename, __pyx_k__w); - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":83 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":83 * cdef FILE* f * f = fopen(filename, "w") * self.links.write_handle(f) # <<<<<<<<<<<<<< @@ -12290,7 +12411,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_12write_binary(struct __pyx_obj_3_sa_A */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->links->__pyx_vtab)->write_handle(__pyx_v_self->links, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":84 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":84 * f = fopen(filename, "w") * self.links.write_handle(f) * self.sent_index.write_handle(f) # <<<<<<<<<<<<<< @@ -12299,7 +12420,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_12write_binary(struct __pyx_obj_3_sa_A */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->sent_index->__pyx_vtab)->write_handle(__pyx_v_self->sent_index, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":85 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":85 * self.links.write_handle(f) * self.sent_index.write_handle(f) * fclose(f) # <<<<<<<<<<<<<< @@ -12335,7 +12456,7 @@ static PyObject *__pyx_pw_3_sa_9Alignment_15write_enhanced(PyObject *__pyx_v_sel return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":87 +/* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":87 * fclose(f) * * def write_enhanced(self, char* filename): # <<<<<<<<<<<<<< @@ -12368,7 +12489,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_14write_enhanced(struct __pyx_obj_3_sa int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_enhanced", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":88 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":88 * * def write_enhanced(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -12408,7 +12529,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_14write_enhanced(struct __pyx_obj_3_sa __pyx_v_f = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":89 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":89 * def write_enhanced(self, char* filename): * with open(filename, "w") as f: * sent_num = 1 # <<<<<<<<<<<<<< @@ -12417,7 +12538,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_14write_enhanced(struct __pyx_obj_3_sa */ __pyx_v_sent_num = 1; - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":90 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":90 * with open(filename, "w") as f: * sent_num = 1 * for link in self.links: # <<<<<<<<<<<<<< @@ -12435,10 +12556,18 @@ static PyObject *__pyx_pf_3_sa_9Alignment_14write_enhanced(struct __pyx_obj_3_sa for (;;) { if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_4)) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_4)) break; - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #endif } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_4)) { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_4)) break; - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #endif } else { __pyx_t_1 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_1)) { @@ -12454,7 +12583,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_14write_enhanced(struct __pyx_obj_3_sa __pyx_v_link = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":91 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":91 * sent_num = 1 * for link in self.links: * f.write("%d " % link) # <<<<<<<<<<<<<< @@ -12478,7 +12607,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_14write_enhanced(struct __pyx_obj_3_sa } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":92 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":92 * for link in self.links: * f.write("%d " % link) * f.write("\n") # <<<<<<<<<<<<<< @@ -12492,7 +12621,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_14write_enhanced(struct __pyx_obj_3_sa __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":93 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":93 * f.write("%d " % link) * f.write("\n") * for i in self.sent_index: # <<<<<<<<<<<<<< @@ -12510,10 +12639,18 @@ static PyObject *__pyx_pf_3_sa_9Alignment_14write_enhanced(struct __pyx_obj_3_sa for (;;) { if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_2)) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_2)) break; - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #endif } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_2)) { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #endif } else { __pyx_t_4 = __pyx_t_9(__pyx_t_2); if (unlikely(!__pyx_t_4)) { @@ -12529,7 +12666,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_14write_enhanced(struct __pyx_obj_3_sa __pyx_v_i = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":94 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":94 * f.write("\n") * for i in self.sent_index: * f.write("%d " % i) # <<<<<<<<<<<<<< @@ -12553,7 +12690,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_14write_enhanced(struct __pyx_obj_3_sa } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":95 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":95 * for i in self.sent_index: * f.write("%d " % i) * f.write("\n") # <<<<<<<<<<<<<< @@ -12577,7 +12714,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_14write_enhanced(struct __pyx_obj_3_sa __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":88 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":88 * * def write_enhanced(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -12687,7 +12824,7 @@ static PyObject *__pyx_pw_3_sa_9Alignment_17alignment(PyObject *__pyx_v_self, Py return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":97 +/* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":97 * f.write("\n") * * def alignment(self, i): # <<<<<<<<<<<<<< @@ -12713,7 +12850,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_16alignment(struct __pyx_obj_3_sa_Alig int __pyx_clineno = 0; __Pyx_RefNannySetupContext("alignment", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":100 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":100 * """Return all (e,f) pairs for sentence i""" * cdef int j, start, end * result = [] # <<<<<<<<<<<<<< @@ -12725,7 +12862,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_16alignment(struct __pyx_obj_3_sa_Alig __pyx_v_result = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":101 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":101 * cdef int j, start, end * result = [] * start = self.sent_index.arr[i] # <<<<<<<<<<<<<< @@ -12735,7 +12872,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_16alignment(struct __pyx_obj_3_sa_Alig __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 = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_start = (__pyx_v_self->sent_index->arr[__pyx_t_2]); - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":102 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":102 * result = [] * start = self.sent_index.arr[i] * end = self.sent_index.arr[i+1] # <<<<<<<<<<<<<< @@ -12748,7 +12885,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_16alignment(struct __pyx_obj_3_sa_Alig __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_end = (__pyx_v_self->sent_index->arr[__pyx_t_2]); - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":103 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":103 * start = self.sent_index.arr[i] * end = self.sent_index.arr[i+1] * for j from start <= j < end: # <<<<<<<<<<<<<< @@ -12758,7 +12895,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_16alignment(struct __pyx_obj_3_sa_Alig __pyx_t_3 = __pyx_v_end; for (__pyx_v_j = __pyx_v_start; __pyx_v_j < __pyx_t_3; __pyx_v_j++) { - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":104 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":104 * end = self.sent_index.arr[i+1] * for j from start <= j < end: * result.append(self.unlink(self.links.arr[j])) # <<<<<<<<<<<<<< @@ -12781,7 +12918,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_16alignment(struct __pyx_obj_3_sa_Alig __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":105 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":105 * for j from start <= j < end: * result.append(self.unlink(self.links.arr[j])) * return result # <<<<<<<<<<<<<< @@ -12806,7 +12943,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_16alignment(struct __pyx_obj_3_sa_Alig return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":15 +/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":15 * int val * * cdef _node* new_node(int key): # <<<<<<<<<<<<<< @@ -12820,7 +12957,7 @@ static struct __pyx_t_3_sa__node *__pyx_f_3_sa_new_node(int __pyx_v_key) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("new_node", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":17 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":17 * cdef _node* new_node(int key): * cdef _node* n * n = <_node*> malloc(sizeof(_node)) # <<<<<<<<<<<<<< @@ -12829,7 +12966,7 @@ static struct __pyx_t_3_sa__node *__pyx_f_3_sa_new_node(int __pyx_v_key) { */ __pyx_v_n = ((struct __pyx_t_3_sa__node *)malloc((sizeof(struct __pyx_t_3_sa__node)))); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":18 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":18 * cdef _node* n * n = <_node*> malloc(sizeof(_node)) * n.smaller = NULL # <<<<<<<<<<<<<< @@ -12838,7 +12975,7 @@ static struct __pyx_t_3_sa__node *__pyx_f_3_sa_new_node(int __pyx_v_key) { */ __pyx_v_n->smaller = NULL; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":19 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":19 * n = <_node*> malloc(sizeof(_node)) * n.smaller = NULL * n.bigger = NULL # <<<<<<<<<<<<<< @@ -12847,7 +12984,7 @@ static struct __pyx_t_3_sa__node *__pyx_f_3_sa_new_node(int __pyx_v_key) { */ __pyx_v_n->bigger = NULL; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":20 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":20 * n.smaller = NULL * n.bigger = NULL * n.key = key # <<<<<<<<<<<<<< @@ -12856,7 +12993,7 @@ static struct __pyx_t_3_sa__node *__pyx_f_3_sa_new_node(int __pyx_v_key) { */ __pyx_v_n->key = __pyx_v_key; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":21 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":21 * n.bigger = NULL * n.key = key * n.val = 0 # <<<<<<<<<<<<<< @@ -12865,7 +13002,7 @@ static struct __pyx_t_3_sa__node *__pyx_f_3_sa_new_node(int __pyx_v_key) { */ __pyx_v_n->val = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":22 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":22 * n.key = key * n.val = 0 * return n # <<<<<<<<<<<<<< @@ -12881,7 +13018,7 @@ static struct __pyx_t_3_sa__node *__pyx_f_3_sa_new_node(int __pyx_v_key) { return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":25 +/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":25 * * * cdef del_node(_node* n): # <<<<<<<<<<<<<< @@ -12899,7 +13036,7 @@ static PyObject *__pyx_f_3_sa_del_node(struct __pyx_t_3_sa__node *__pyx_v_n) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("del_node", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":26 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":26 * * cdef del_node(_node* n): * if n.smaller != NULL: # <<<<<<<<<<<<<< @@ -12909,7 +13046,7 @@ static PyObject *__pyx_f_3_sa_del_node(struct __pyx_t_3_sa__node *__pyx_v_n) { __pyx_t_1 = (__pyx_v_n->smaller != NULL); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":27 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":27 * cdef del_node(_node* n): * if n.smaller != NULL: * del_node(n.smaller) # <<<<<<<<<<<<<< @@ -12923,7 +13060,7 @@ static PyObject *__pyx_f_3_sa_del_node(struct __pyx_t_3_sa__node *__pyx_v_n) { } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":28 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":28 * if n.smaller != NULL: * del_node(n.smaller) * if n.bigger != NULL: # <<<<<<<<<<<<<< @@ -12933,7 +13070,7 @@ static PyObject *__pyx_f_3_sa_del_node(struct __pyx_t_3_sa__node *__pyx_v_n) { __pyx_t_1 = (__pyx_v_n->bigger != NULL); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":29 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":29 * del_node(n.smaller) * if n.bigger != NULL: * del_node(n.bigger) # <<<<<<<<<<<<<< @@ -12947,7 +13084,7 @@ static PyObject *__pyx_f_3_sa_del_node(struct __pyx_t_3_sa__node *__pyx_v_n) { } __pyx_L4:; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":30 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":30 * if n.bigger != NULL: * del_node(n.bigger) * free(n) # <<<<<<<<<<<<<< @@ -12968,7 +13105,7 @@ static PyObject *__pyx_f_3_sa_del_node(struct __pyx_t_3_sa__node *__pyx_v_n) { return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":32 +/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":32 * free(n) * * cdef int* get_val(_node* n, int key): # <<<<<<<<<<<<<< @@ -12982,7 +13119,7 @@ static int *__pyx_f_3_sa_get_val(struct __pyx_t_3_sa__node *__pyx_v_n, int __pyx int __pyx_t_1; __Pyx_RefNannySetupContext("get_val", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":33 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":33 * * cdef int* get_val(_node* n, int key): * if key == n.key: # <<<<<<<<<<<<<< @@ -12992,7 +13129,7 @@ static int *__pyx_f_3_sa_get_val(struct __pyx_t_3_sa__node *__pyx_v_n, int __pyx __pyx_t_1 = (__pyx_v_key == __pyx_v_n->key); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":34 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":34 * cdef int* get_val(_node* n, int key): * if key == n.key: * return &n.val # <<<<<<<<<<<<<< @@ -13004,7 +13141,7 @@ static int *__pyx_f_3_sa_get_val(struct __pyx_t_3_sa__node *__pyx_v_n, int __pyx goto __pyx_L3; } - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":35 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":35 * if key == n.key: * return &n.val * elif key < n.key: # <<<<<<<<<<<<<< @@ -13014,7 +13151,7 @@ static int *__pyx_f_3_sa_get_val(struct __pyx_t_3_sa__node *__pyx_v_n, int __pyx __pyx_t_1 = (__pyx_v_key < __pyx_v_n->key); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":36 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":36 * return &n.val * elif key < n.key: * if n.smaller == NULL: # <<<<<<<<<<<<<< @@ -13024,7 +13161,7 @@ static int *__pyx_f_3_sa_get_val(struct __pyx_t_3_sa__node *__pyx_v_n, int __pyx __pyx_t_1 = (__pyx_v_n->smaller == NULL); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":37 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":37 * elif key < n.key: * if n.smaller == NULL: * n.smaller = new_node(key) # <<<<<<<<<<<<<< @@ -13033,7 +13170,7 @@ static int *__pyx_f_3_sa_get_val(struct __pyx_t_3_sa__node *__pyx_v_n, int __pyx */ __pyx_v_n->smaller = __pyx_f_3_sa_new_node(__pyx_v_key); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":38 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":38 * if n.smaller == NULL: * n.smaller = new_node(key) * return &(n.smaller.val) # <<<<<<<<<<<<<< @@ -13046,7 +13183,7 @@ static int *__pyx_f_3_sa_get_val(struct __pyx_t_3_sa__node *__pyx_v_n, int __pyx } __pyx_L4:; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":39 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":39 * n.smaller = new_node(key) * return &(n.smaller.val) * return get_val(n.smaller, key) # <<<<<<<<<<<<<< @@ -13059,7 +13196,7 @@ static int *__pyx_f_3_sa_get_val(struct __pyx_t_3_sa__node *__pyx_v_n, int __pyx } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":41 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":41 * return get_val(n.smaller, key) * else: * if n.bigger == NULL: # <<<<<<<<<<<<<< @@ -13069,7 +13206,7 @@ static int *__pyx_f_3_sa_get_val(struct __pyx_t_3_sa__node *__pyx_v_n, int __pyx __pyx_t_1 = (__pyx_v_n->bigger == NULL); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":42 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":42 * else: * if n.bigger == NULL: * n.bigger = new_node(key) # <<<<<<<<<<<<<< @@ -13078,7 +13215,7 @@ static int *__pyx_f_3_sa_get_val(struct __pyx_t_3_sa__node *__pyx_v_n, int __pyx */ __pyx_v_n->bigger = __pyx_f_3_sa_new_node(__pyx_v_key); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":43 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":43 * if n.bigger == NULL: * n.bigger = new_node(key) * return &(n.bigger.val) # <<<<<<<<<<<<<< @@ -13091,7 +13228,7 @@ static int *__pyx_f_3_sa_get_val(struct __pyx_t_3_sa__node *__pyx_v_n, int __pyx } __pyx_L5:; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":44 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":44 * n.bigger = new_node(key) * return &(n.bigger.val) * return get_val(n.bigger, key) # <<<<<<<<<<<<<< @@ -13118,14 +13255,14 @@ static int __pyx_pw_3_sa_5BiLex_1__cinit__(PyObject *__pyx_v_self, PyObject *__p PyObject *__pyx_v_earray = 0; PyObject *__pyx_v_fsarray = 0; PyObject *__pyx_v_alignment = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__from_text,&__pyx_n_s__from_data,&__pyx_n_s__from_binary,&__pyx_n_s__earray,&__pyx_n_s__fsarray,&__pyx_n_s__alignment,0}; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__from_text,&__pyx_n_s__from_data,&__pyx_n_s__from_binary,&__pyx_n_s__earray,&__pyx_n_s__fsarray,&__pyx_n_s__alignment,0}; PyObject* values[6] = {0,0,0,0,0,0}; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":54 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":54 * cdef id2eword, id2fword, eword2id, fword2id * * def __cinit__(self, from_text=None, from_data=False, from_binary=None, # <<<<<<<<<<<<<< @@ -13136,7 +13273,7 @@ static int __pyx_pw_3_sa_5BiLex_1__cinit__(PyObject *__pyx_v_self, PyObject *__p values[1] = __pyx_k_41; values[2] = ((PyObject *)Py_None); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":55 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":55 * * def __cinit__(self, from_text=None, from_data=False, from_binary=None, * earray=None, fsarray=None, alignment=None): # <<<<<<<<<<<<<< @@ -13227,7 +13364,7 @@ static int __pyx_pw_3_sa_5BiLex_1__cinit__(PyObject *__pyx_v_self, PyObject *__p return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":54 +/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":54 * cdef id2eword, id2fword, eword2id, fword2id * * def __cinit__(self, from_text=None, from_data=False, from_binary=None, # <<<<<<<<<<<<<< @@ -13248,7 +13385,7 @@ static int __pyx_pf_3_sa_5BiLex___cinit__(struct __pyx_obj_3_sa_BiLex *__pyx_v_s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":56 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":56 * def __cinit__(self, from_text=None, from_data=False, from_binary=None, * earray=None, fsarray=None, alignment=None): * self.id2eword = [] # <<<<<<<<<<<<<< @@ -13263,7 +13400,7 @@ static int __pyx_pf_3_sa_5BiLex___cinit__(struct __pyx_obj_3_sa_BiLex *__pyx_v_s __pyx_v_self->id2eword = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":57 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":57 * earray=None, fsarray=None, alignment=None): * self.id2eword = [] * self.id2fword = [] # <<<<<<<<<<<<<< @@ -13278,7 +13415,7 @@ static int __pyx_pf_3_sa_5BiLex___cinit__(struct __pyx_obj_3_sa_BiLex *__pyx_v_s __pyx_v_self->id2fword = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":58 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":58 * self.id2eword = [] * self.id2fword = [] * self.eword2id = {} # <<<<<<<<<<<<<< @@ -13293,7 +13430,7 @@ static int __pyx_pf_3_sa_5BiLex___cinit__(struct __pyx_obj_3_sa_BiLex *__pyx_v_s __pyx_v_self->eword2id = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":59 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":59 * self.id2fword = [] * self.eword2id = {} * self.fword2id = {} # <<<<<<<<<<<<<< @@ -13308,7 +13445,7 @@ static int __pyx_pf_3_sa_5BiLex___cinit__(struct __pyx_obj_3_sa_BiLex *__pyx_v_s __pyx_v_self->fword2id = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":60 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":60 * self.eword2id = {} * self.fword2id = {} * self.e_index = IntList() # <<<<<<<<<<<<<< @@ -13323,7 +13460,7 @@ static int __pyx_pf_3_sa_5BiLex___cinit__(struct __pyx_obj_3_sa_BiLex *__pyx_v_s __pyx_v_self->e_index = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":61 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":61 * self.fword2id = {} * self.e_index = IntList() * self.f_index = IntList() # <<<<<<<<<<<<<< @@ -13338,7 +13475,7 @@ static int __pyx_pf_3_sa_5BiLex___cinit__(struct __pyx_obj_3_sa_BiLex *__pyx_v_s __pyx_v_self->f_index = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":62 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":62 * self.e_index = IntList() * self.f_index = IntList() * self.col1 = FloatList() # <<<<<<<<<<<<<< @@ -13353,7 +13490,7 @@ static int __pyx_pf_3_sa_5BiLex___cinit__(struct __pyx_obj_3_sa_BiLex *__pyx_v_s __pyx_v_self->col1 = ((struct __pyx_obj_3_sa_FloatList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":63 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":63 * self.f_index = IntList() * self.col1 = FloatList() * self.col2 = FloatList() # <<<<<<<<<<<<<< @@ -13368,7 +13505,7 @@ static int __pyx_pf_3_sa_5BiLex___cinit__(struct __pyx_obj_3_sa_BiLex *__pyx_v_s __pyx_v_self->col2 = ((struct __pyx_obj_3_sa_FloatList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":64 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":64 * self.col1 = FloatList() * self.col2 = FloatList() * if from_binary: # <<<<<<<<<<<<<< @@ -13378,7 +13515,7 @@ static int __pyx_pf_3_sa_5BiLex___cinit__(struct __pyx_obj_3_sa_BiLex *__pyx_v_s __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/paulb/workspace/cdec/python/src/sa/bilex.pxi":65 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":65 * self.col2 = FloatList() * if from_binary: * self.read_binary(from_binary) # <<<<<<<<<<<<<< @@ -13400,7 +13537,7 @@ static int __pyx_pf_3_sa_5BiLex___cinit__(struct __pyx_obj_3_sa_BiLex *__pyx_v_s goto __pyx_L3; } - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":66 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":66 * if from_binary: * self.read_binary(from_binary) * elif from_data: # <<<<<<<<<<<<<< @@ -13410,7 +13547,7 @@ static int __pyx_pf_3_sa_5BiLex___cinit__(struct __pyx_obj_3_sa_BiLex *__pyx_v_s __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/paulb/workspace/cdec/python/src/sa/bilex.pxi":67 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":67 * self.read_binary(from_binary) * elif from_data: * self.compute_from_data(fsarray, earray, alignment) # <<<<<<<<<<<<<< @@ -13436,7 +13573,7 @@ static int __pyx_pf_3_sa_5BiLex___cinit__(struct __pyx_obj_3_sa_BiLex *__pyx_v_s } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":69 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":69 * self.compute_from_data(fsarray, earray, alignment) * else: * self.read_text(from_text) # <<<<<<<<<<<<<< @@ -13472,7 +13609,7 @@ static int __pyx_pf_3_sa_5BiLex___cinit__(struct __pyx_obj_3_sa_BiLex *__pyx_v_s return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":72 +/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":72 * * * cdef compute_from_data(self, SuffixArray fsa, DataArray eda, Alignment aa): # <<<<<<<<<<<<<< @@ -13526,7 +13663,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL int __pyx_clineno = 0; __Pyx_RefNannySetupContext("compute_from_data", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":79 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":79 * cdef int null_word * * null_word = 0 # <<<<<<<<<<<<<< @@ -13535,7 +13672,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ __pyx_v_null_word = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":80 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":80 * * null_word = 0 * for word in fsa.darray.id2word: # I miss list comprehensions # <<<<<<<<<<<<<< @@ -13553,10 +13690,18 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #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[5]; __pyx_lineno = 80; __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[5]; __pyx_lineno = 80; __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; - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #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[5]; __pyx_lineno = 80; __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[5]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { @@ -13572,7 +13717,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_v_word = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":81 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":81 * null_word = 0 * for word in fsa.darray.id2word: # I miss list comprehensions * self.id2fword.append(word) # <<<<<<<<<<<<<< @@ -13585,7 +13730,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":82 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":82 * for word in fsa.darray.id2word: # I miss list comprehensions * self.id2fword.append(word) * self.id2fword[null_word] = "NULL" # <<<<<<<<<<<<<< @@ -13594,7 +13739,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ if (__Pyx_SetItemInt(__pyx_v_self->id2fword, __pyx_v_null_word, ((PyObject *)__pyx_n_s__NULL), sizeof(int), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":83 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":83 * self.id2fword.append(word) * self.id2fword[null_word] = "NULL" * for id, word in enumerate(self.id2fword): # <<<<<<<<<<<<<< @@ -13614,10 +13759,18 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_4)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break; - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; + #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;} + #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;} + #endif } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_4)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_4)) break; - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; + #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;} + #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;} + #endif } else { __pyx_t_5 = __pyx_t_3(__pyx_t_4); if (unlikely(!__pyx_t_5)) { @@ -13641,7 +13794,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":84 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":84 * self.id2fword[null_word] = "NULL" * for id, word in enumerate(self.id2fword): * self.fword2id[word] = id # <<<<<<<<<<<<<< @@ -13653,7 +13806,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":86 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":86 * self.fword2id[word] = id * * for word in eda.id2word: # <<<<<<<<<<<<<< @@ -13671,10 +13824,18 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #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[5]; __pyx_lineno = 86; __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[5]; __pyx_lineno = 86; __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; - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #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[5]; __pyx_lineno = 86; __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[5]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { @@ -13690,7 +13851,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_v_word = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":87 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":87 * * for word in eda.id2word: * self.id2eword.append(word) # <<<<<<<<<<<<<< @@ -13703,7 +13864,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":88 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":88 * for word in eda.id2word: * self.id2eword.append(word) * self.id2eword[null_word] = "NULL" # <<<<<<<<<<<<<< @@ -13712,7 +13873,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ if (__Pyx_SetItemInt(__pyx_v_self->id2eword, __pyx_v_null_word, ((PyObject *)__pyx_n_s__NULL), sizeof(int), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":89 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":89 * self.id2eword.append(word) * self.id2eword[null_word] = "NULL" * for id, word in enumerate(self.id2eword): # <<<<<<<<<<<<<< @@ -13732,10 +13893,18 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_4)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break; - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; + #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;} + #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;} + #endif } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_4)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_4)) break; - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; + #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;} + #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;} + #endif } else { __pyx_t_5 = __pyx_t_3(__pyx_t_4); if (unlikely(!__pyx_t_5)) { @@ -13759,7 +13928,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":90 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":90 * self.id2eword[null_word] = "NULL" * for id, word in enumerate(self.id2eword): * self.eword2id[word] = id # <<<<<<<<<<<<<< @@ -13771,7 +13940,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":92 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":92 * self.eword2id[word] = id * * num_pairs = 0 # <<<<<<<<<<<<<< @@ -13780,7 +13949,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ __pyx_v_num_pairs = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":94 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":94 * num_pairs = 0 * * V_E = len(eda.id2word) # <<<<<<<<<<<<<< @@ -13793,7 +13962,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_V_E = __pyx_t_2; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":95 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":95 * * V_E = len(eda.id2word) * V_F = len(fsa.darray.id2word) # <<<<<<<<<<<<<< @@ -13806,7 +13975,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_V_F = __pyx_t_2; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":96 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":96 * V_E = len(eda.id2word) * V_F = len(fsa.darray.id2word) * fmargin = malloc(V_F*sizeof(int)) # <<<<<<<<<<<<<< @@ -13815,7 +13984,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ __pyx_v_fmargin = ((int *)malloc((__pyx_v_V_F * (sizeof(int))))); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":97 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":97 * V_F = len(fsa.darray.id2word) * fmargin = malloc(V_F*sizeof(int)) * emargin = malloc(V_E*sizeof(int)) # <<<<<<<<<<<<<< @@ -13824,7 +13993,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ __pyx_v_emargin = ((int *)malloc((__pyx_v_V_E * (sizeof(int))))); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":98 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":98 * fmargin = malloc(V_F*sizeof(int)) * emargin = malloc(V_E*sizeof(int)) * memset(fmargin, 0, V_F*sizeof(int)) # <<<<<<<<<<<<<< @@ -13833,7 +14002,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ memset(__pyx_v_fmargin, 0, (__pyx_v_V_F * (sizeof(int)))); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":99 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":99 * emargin = malloc(V_E*sizeof(int)) * memset(fmargin, 0, V_F*sizeof(int)) * memset(emargin, 0, V_E*sizeof(int)) # <<<<<<<<<<<<<< @@ -13842,7 +14011,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ memset(__pyx_v_emargin, 0, (__pyx_v_V_E * (sizeof(int)))); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":101 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":101 * memset(emargin, 0, V_E*sizeof(int)) * * dict = <_node**> malloc(V_F*sizeof(_node*)) # <<<<<<<<<<<<<< @@ -13851,7 +14020,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ __pyx_v_dict = ((struct __pyx_t_3_sa__node **)malloc((__pyx_v_V_F * (sizeof(struct __pyx_t_3_sa__node *))))); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":102 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":102 * * dict = <_node**> malloc(V_F*sizeof(_node*)) * memset(dict, 0, V_F*sizeof(_node*)) # <<<<<<<<<<<<<< @@ -13860,7 +14029,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ memset(__pyx_v_dict, 0, (__pyx_v_V_F * (sizeof(struct __pyx_t_3_sa__node *)))); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":104 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":104 * memset(dict, 0, V_F*sizeof(_node*)) * * num_sents = len(fsa.darray.sent_index) # <<<<<<<<<<<<<< @@ -13876,7 +14045,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_v_num_sents = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":105 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":105 * * num_sents = len(fsa.darray.sent_index) * for sent_id from 0 <= sent_id < num_sents-1: # <<<<<<<<<<<<<< @@ -13889,7 +14058,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __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++) { - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":107 + /* "/home/pauldb/workspace/cdec/python/src/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] # <<<<<<<<<<<<<< @@ -13898,7 +14067,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ __pyx_v_fsent = (__pyx_v_fsa->darray->data->arr + (__pyx_v_fsa->darray->sent_index->arr[__pyx_v_sent_id])); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":108 + /* "/home/pauldb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -13907,7 +14076,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ __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/paulb/workspace/cdec/python/src/sa/bilex.pxi":109 + /* "/home/pauldb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -13916,7 +14085,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ __pyx_v_faligned = ((int *)malloc((__pyx_v_I * (sizeof(int))))); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":110 + /* "/home/pauldb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -13925,7 +14094,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ memset(__pyx_v_faligned, 0, (__pyx_v_I * (sizeof(int)))); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":112 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":112 * memset(faligned, 0, I*sizeof(int)) * * esent = eda.data.arr + eda.sent_index.arr[sent_id] # <<<<<<<<<<<<<< @@ -13934,7 +14103,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ __pyx_v_esent = (__pyx_v_eda->data->arr + (__pyx_v_eda->sent_index->arr[__pyx_v_sent_id])); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":113 + /* "/home/pauldb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -13943,7 +14112,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ __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/paulb/workspace/cdec/python/src/sa/bilex.pxi":114 + /* "/home/pauldb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -13952,7 +14121,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ __pyx_v_ealigned = ((int *)malloc((__pyx_v_J * (sizeof(int))))); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":115 + /* "/home/pauldb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -13961,7 +14130,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ memset(__pyx_v_ealigned, 0, (__pyx_v_J * (sizeof(int)))); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":117 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":117 * memset(ealigned, 0, J*sizeof(int)) * * links = aa._get_sent_links(sent_id, &num_links) # <<<<<<<<<<<<<< @@ -13970,7 +14139,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ __pyx_v_links = ((struct __pyx_vtabstruct_3_sa_Alignment *)__pyx_v_aa->__pyx_vtab)->_get_sent_links(__pyx_v_aa, __pyx_v_sent_id, (&__pyx_v_num_links)); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":119 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":119 * links = aa._get_sent_links(sent_id, &num_links) * * for l from 0 <= l < num_links: # <<<<<<<<<<<<<< @@ -13980,7 +14149,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_t_7 = __pyx_v_num_links; for (__pyx_v_l = 0; __pyx_v_l < __pyx_t_7; __pyx_v_l++) { - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":120 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":120 * * for l from 0 <= l < num_links: * i = links[l*2] # <<<<<<<<<<<<<< @@ -13989,7 +14158,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ __pyx_v_i = (__pyx_v_links[(__pyx_v_l * 2)]); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":121 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":121 * for l from 0 <= l < num_links: * i = links[l*2] * j = links[l*2+1] # <<<<<<<<<<<<<< @@ -13998,7 +14167,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ __pyx_v_j = (__pyx_v_links[((__pyx_v_l * 2) + 1)]); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":122 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":122 * i = links[l*2] * j = links[l*2+1] * if i >= I or j >= J: # <<<<<<<<<<<<<< @@ -14014,7 +14183,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL } if (__pyx_t_10) { - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":123 + /* "/home/pauldb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -14066,7 +14235,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL } __pyx_L15:; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":124 + /* "/home/pauldb/workspace/cdec/python/src/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] # <<<<<<<<<<<<<< @@ -14075,7 +14244,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ __pyx_v_f_i = (__pyx_v_fsent[__pyx_v_i]); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":125 + /* "/home/pauldb/workspace/cdec/python/src/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] # <<<<<<<<<<<<<< @@ -14084,7 +14253,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ __pyx_v_e_j = (__pyx_v_esent[__pyx_v_j]); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":126 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":126 * f_i = fsent[i] * e_j = esent[j] * fmargin[f_i] = fmargin[f_i]+1 # <<<<<<<<<<<<<< @@ -14093,7 +14262,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ (__pyx_v_fmargin[__pyx_v_f_i]) = ((__pyx_v_fmargin[__pyx_v_f_i]) + 1); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":127 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":127 * e_j = esent[j] * fmargin[f_i] = fmargin[f_i]+1 * emargin[e_j] = emargin[e_j]+1 # <<<<<<<<<<<<<< @@ -14102,7 +14271,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ (__pyx_v_emargin[__pyx_v_e_j]) = ((__pyx_v_emargin[__pyx_v_e_j]) + 1); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":128 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":128 * fmargin[f_i] = fmargin[f_i]+1 * emargin[e_j] = emargin[e_j]+1 * if dict[f_i] == NULL: # <<<<<<<<<<<<<< @@ -14112,7 +14281,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_t_10 = ((__pyx_v_dict[__pyx_v_f_i]) == NULL); if (__pyx_t_10) { - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":129 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":129 * emargin[e_j] = emargin[e_j]+1 * if dict[f_i] == NULL: * dict[f_i] = new_node(e_j) # <<<<<<<<<<<<<< @@ -14121,7 +14290,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ (__pyx_v_dict[__pyx_v_f_i]) = __pyx_f_3_sa_new_node(__pyx_v_e_j); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":130 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":130 * if dict[f_i] == NULL: * dict[f_i] = new_node(e_j) * dict[f_i].val = 1 # <<<<<<<<<<<<<< @@ -14130,7 +14299,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ (__pyx_v_dict[__pyx_v_f_i])->val = 1; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":131 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":131 * dict[f_i] = new_node(e_j) * dict[f_i].val = 1 * num_pairs = num_pairs + 1 # <<<<<<<<<<<<<< @@ -14142,7 +14311,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":133 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":133 * num_pairs = num_pairs + 1 * else: * count = get_val(dict[f_i], e_j) # <<<<<<<<<<<<<< @@ -14151,7 +14320,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ __pyx_v_count = __pyx_f_3_sa_get_val((__pyx_v_dict[__pyx_v_f_i]), __pyx_v_e_j); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":134 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":134 * else: * count = get_val(dict[f_i], e_j) * if count[0] == 0: # <<<<<<<<<<<<<< @@ -14161,7 +14330,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_t_10 = ((__pyx_v_count[0]) == 0); if (__pyx_t_10) { - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":135 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":135 * count = get_val(dict[f_i], e_j) * if count[0] == 0: * num_pairs = num_pairs + 1 # <<<<<<<<<<<<<< @@ -14173,7 +14342,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL } __pyx_L17:; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":136 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":136 * if count[0] == 0: * num_pairs = num_pairs + 1 * count[0] = count[0] + 1 # <<<<<<<<<<<<<< @@ -14184,7 +14353,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL } __pyx_L16:; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":138 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":138 * count[0] = count[0] + 1 * # add count * faligned[i] = 1 # <<<<<<<<<<<<<< @@ -14193,7 +14362,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ (__pyx_v_faligned[__pyx_v_i]) = 1; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":139 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":139 * # add count * faligned[i] = 1 * ealigned[j] = 1 # <<<<<<<<<<<<<< @@ -14203,7 +14372,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL (__pyx_v_ealigned[__pyx_v_j]) = 1; } - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":140 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":140 * faligned[i] = 1 * ealigned[j] = 1 * for i from 0 <= i < I: # <<<<<<<<<<<<<< @@ -14213,7 +14382,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_t_7 = __pyx_v_I; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) { - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":141 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":141 * ealigned[j] = 1 * for i from 0 <= i < I: * if faligned[i] == 0: # <<<<<<<<<<<<<< @@ -14223,7 +14392,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_t_10 = ((__pyx_v_faligned[__pyx_v_i]) == 0); if (__pyx_t_10) { - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":142 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":142 * for i from 0 <= i < I: * if faligned[i] == 0: * f_i = fsent[i] # <<<<<<<<<<<<<< @@ -14232,7 +14401,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ __pyx_v_f_i = (__pyx_v_fsent[__pyx_v_i]); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":143 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":143 * if faligned[i] == 0: * f_i = fsent[i] * fmargin[f_i] = fmargin[f_i] + 1 # <<<<<<<<<<<<<< @@ -14241,7 +14410,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ (__pyx_v_fmargin[__pyx_v_f_i]) = ((__pyx_v_fmargin[__pyx_v_f_i]) + 1); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":144 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":144 * f_i = fsent[i] * fmargin[f_i] = fmargin[f_i] + 1 * emargin[null_word] = emargin[null_word] + 1 # <<<<<<<<<<<<<< @@ -14250,7 +14419,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ (__pyx_v_emargin[__pyx_v_null_word]) = ((__pyx_v_emargin[__pyx_v_null_word]) + 1); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":145 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":145 * fmargin[f_i] = fmargin[f_i] + 1 * emargin[null_word] = emargin[null_word] + 1 * if dict[f_i] == NULL: # <<<<<<<<<<<<<< @@ -14260,7 +14429,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_t_10 = ((__pyx_v_dict[__pyx_v_f_i]) == NULL); if (__pyx_t_10) { - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":146 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":146 * emargin[null_word] = emargin[null_word] + 1 * if dict[f_i] == NULL: * dict[f_i] = new_node(null_word) # <<<<<<<<<<<<<< @@ -14269,7 +14438,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ (__pyx_v_dict[__pyx_v_f_i]) = __pyx_f_3_sa_new_node(__pyx_v_null_word); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":147 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":147 * if dict[f_i] == NULL: * dict[f_i] = new_node(null_word) * dict[f_i].val = 1 # <<<<<<<<<<<<<< @@ -14278,7 +14447,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ (__pyx_v_dict[__pyx_v_f_i])->val = 1; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":148 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":148 * dict[f_i] = new_node(null_word) * dict[f_i].val = 1 * num_pairs = num_pairs + 1 # <<<<<<<<<<<<<< @@ -14290,7 +14459,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":150 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":150 * num_pairs = num_pairs + 1 * else: * count = get_val(dict[f_i], null_word) # <<<<<<<<<<<<<< @@ -14299,7 +14468,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ __pyx_v_count = __pyx_f_3_sa_get_val((__pyx_v_dict[__pyx_v_f_i]), __pyx_v_null_word); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":151 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":151 * else: * count = get_val(dict[f_i], null_word) * if count[0] == 0: # <<<<<<<<<<<<<< @@ -14309,7 +14478,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_t_10 = ((__pyx_v_count[0]) == 0); if (__pyx_t_10) { - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":152 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":152 * count = get_val(dict[f_i], null_word) * if count[0] == 0: * num_pairs = num_pairs + 1 # <<<<<<<<<<<<<< @@ -14321,7 +14490,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL } __pyx_L22:; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":153 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":153 * if count[0] == 0: * num_pairs = num_pairs + 1 * count[0] = count[0] + 1 # <<<<<<<<<<<<<< @@ -14336,7 +14505,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_L20:; } - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":154 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":154 * num_pairs = num_pairs + 1 * count[0] = count[0] + 1 * for j from 0 <= j < J: # <<<<<<<<<<<<<< @@ -14346,7 +14515,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_t_7 = __pyx_v_J; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) { - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":155 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":155 * count[0] = count[0] + 1 * for j from 0 <= j < J: * if ealigned[j] == 0: # <<<<<<<<<<<<<< @@ -14356,7 +14525,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_t_10 = ((__pyx_v_ealigned[__pyx_v_j]) == 0); if (__pyx_t_10) { - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":156 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":156 * for j from 0 <= j < J: * if ealigned[j] == 0: * e_j = esent[j] # <<<<<<<<<<<<<< @@ -14365,7 +14534,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ __pyx_v_e_j = (__pyx_v_esent[__pyx_v_j]); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":157 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":157 * if ealigned[j] == 0: * e_j = esent[j] * fmargin[null_word] = fmargin[null_word] + 1 # <<<<<<<<<<<<<< @@ -14374,7 +14543,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ (__pyx_v_fmargin[__pyx_v_null_word]) = ((__pyx_v_fmargin[__pyx_v_null_word]) + 1); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":158 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":158 * e_j = esent[j] * fmargin[null_word] = fmargin[null_word] + 1 * emargin[e_j] = emargin[e_j] + 1 # <<<<<<<<<<<<<< @@ -14383,7 +14552,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ (__pyx_v_emargin[__pyx_v_e_j]) = ((__pyx_v_emargin[__pyx_v_e_j]) + 1); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":159 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":159 * fmargin[null_word] = fmargin[null_word] + 1 * emargin[e_j] = emargin[e_j] + 1 * if dict[null_word] == NULL: # <<<<<<<<<<<<<< @@ -14393,7 +14562,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_t_10 = ((__pyx_v_dict[__pyx_v_null_word]) == NULL); if (__pyx_t_10) { - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":160 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":160 * emargin[e_j] = emargin[e_j] + 1 * if dict[null_word] == NULL: * dict[null_word] = new_node(e_j) # <<<<<<<<<<<<<< @@ -14402,7 +14571,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ (__pyx_v_dict[__pyx_v_null_word]) = __pyx_f_3_sa_new_node(__pyx_v_e_j); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":161 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":161 * if dict[null_word] == NULL: * dict[null_word] = new_node(e_j) * dict[null_word].val = 1 # <<<<<<<<<<<<<< @@ -14411,7 +14580,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ (__pyx_v_dict[__pyx_v_null_word])->val = 1; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":162 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":162 * dict[null_word] = new_node(e_j) * dict[null_word].val = 1 * num_pairs = num_pairs + 1 # <<<<<<<<<<<<<< @@ -14423,7 +14592,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":164 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":164 * num_pairs = num_pairs + 1 * else: * count = get_val(dict[null_word], e_j) # <<<<<<<<<<<<<< @@ -14432,7 +14601,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ __pyx_v_count = __pyx_f_3_sa_get_val((__pyx_v_dict[__pyx_v_null_word]), __pyx_v_e_j); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":165 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":165 * else: * count = get_val(dict[null_word], e_j) * if count[0] == 0: # <<<<<<<<<<<<<< @@ -14442,7 +14611,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_t_10 = ((__pyx_v_count[0]) == 0); if (__pyx_t_10) { - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":166 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":166 * count = get_val(dict[null_word], e_j) * if count[0] == 0: * num_pairs = num_pairs + 1 # <<<<<<<<<<<<<< @@ -14454,7 +14623,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL } __pyx_L27:; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":167 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":167 * if count[0] == 0: * num_pairs = num_pairs + 1 * count[0] = count[0] + 1 # <<<<<<<<<<<<<< @@ -14469,7 +14638,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_L25:; } - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":168 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":168 * num_pairs = num_pairs + 1 * count[0] = count[0] + 1 * free(links) # <<<<<<<<<<<<<< @@ -14478,7 +14647,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ free(__pyx_v_links); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":169 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":169 * count[0] = count[0] + 1 * free(links) * free(faligned) # <<<<<<<<<<<<<< @@ -14487,7 +14656,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ free(__pyx_v_faligned); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":170 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":170 * free(links) * free(faligned) * free(ealigned) # <<<<<<<<<<<<<< @@ -14497,7 +14666,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL free(__pyx_v_ealigned); } - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":171 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":171 * free(faligned) * free(ealigned) * self.f_index = IntList(initial_len=V_F) # <<<<<<<<<<<<<< @@ -14519,7 +14688,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_v_self->f_index = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_13); __pyx_t_13 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":172 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":172 * free(ealigned) * self.f_index = IntList(initial_len=V_F) * self.e_index = IntList(initial_len=num_pairs) # <<<<<<<<<<<<<< @@ -14541,7 +14710,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_v_self->e_index = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_12); __pyx_t_12 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":173 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -14563,7 +14732,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_v_self->col1 = ((struct __pyx_obj_3_sa_FloatList *)__pyx_t_13); __pyx_t_13 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":174 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -14585,7 +14754,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_v_self->col2 = ((struct __pyx_obj_3_sa_FloatList *)__pyx_t_12); __pyx_t_12 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":176 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":176 * self.col2 = FloatList(initial_len=num_pairs) * * num_pairs = 0 # <<<<<<<<<<<<<< @@ -14594,7 +14763,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ __pyx_v_num_pairs = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":177 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":177 * * num_pairs = 0 * for i from 0 <= i < V_F: # <<<<<<<<<<<<<< @@ -14604,7 +14773,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_t_6 = __pyx_v_V_F; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) { - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":179 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":179 * for i from 0 <= i < V_F: * #self.f_index[i] = num_pairs * self.f_index.set(i, num_pairs) # <<<<<<<<<<<<<< @@ -14613,7 +14782,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->f_index->__pyx_vtab)->set(__pyx_v_self->f_index, __pyx_v_i, __pyx_v_num_pairs); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":180 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":180 * #self.f_index[i] = num_pairs * self.f_index.set(i, num_pairs) * if dict[i] != NULL: # <<<<<<<<<<<<<< @@ -14623,7 +14792,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_t_10 = ((__pyx_v_dict[__pyx_v_i]) != NULL); if (__pyx_t_10) { - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":181 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -14634,7 +14803,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":182 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":182 * if dict[i] != NULL: * self._add_node(dict[i], &num_pairs, float(fmargin[i]), emargin) * del_node(dict[i]) # <<<<<<<<<<<<<< @@ -14649,7 +14818,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL __pyx_L30:; } - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":183 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":183 * self._add_node(dict[i], &num_pairs, float(fmargin[i]), emargin) * del_node(dict[i]) * free(fmargin) # <<<<<<<<<<<<<< @@ -14658,7 +14827,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ free(__pyx_v_fmargin); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":184 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":184 * del_node(dict[i]) * free(fmargin) * free(emargin) # <<<<<<<<<<<<<< @@ -14667,7 +14836,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ free(__pyx_v_emargin); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":185 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":185 * free(fmargin) * free(emargin) * free(dict) # <<<<<<<<<<<<<< @@ -14676,7 +14845,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL */ free(__pyx_v_dict); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":186 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":186 * free(emargin) * free(dict) * return # <<<<<<<<<<<<<< @@ -14707,7 +14876,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":189 +/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":189 * * * cdef _add_node(self, _node* n, int* num_pairs, float fmargin, int* emargin): # <<<<<<<<<<<<<< @@ -14726,7 +14895,7 @@ static PyObject *__pyx_f_3_sa_5BiLex__add_node(struct __pyx_obj_3_sa_BiLex *__py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_add_node", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":191 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":191 * cdef _add_node(self, _node* n, int* num_pairs, float fmargin, int* emargin): * cdef int loc * if n.smaller != NULL: # <<<<<<<<<<<<<< @@ -14736,7 +14905,7 @@ static PyObject *__pyx_f_3_sa_5BiLex__add_node(struct __pyx_obj_3_sa_BiLex *__py __pyx_t_1 = (__pyx_v_n->smaller != NULL); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":192 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":192 * cdef int loc * if n.smaller != NULL: * self._add_node(n.smaller, num_pairs, fmargin, emargin) # <<<<<<<<<<<<<< @@ -14750,7 +14919,7 @@ static PyObject *__pyx_f_3_sa_5BiLex__add_node(struct __pyx_obj_3_sa_BiLex *__py } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":193 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":193 * if n.smaller != NULL: * self._add_node(n.smaller, num_pairs, fmargin, emargin) * loc = num_pairs[0] # <<<<<<<<<<<<<< @@ -14759,7 +14928,7 @@ static PyObject *__pyx_f_3_sa_5BiLex__add_node(struct __pyx_obj_3_sa_BiLex *__py */ __pyx_v_loc = (__pyx_v_num_pairs[0]); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":194 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":194 * self._add_node(n.smaller, num_pairs, fmargin, emargin) * loc = num_pairs[0] * self.e_index.set(loc, n.key) # <<<<<<<<<<<<<< @@ -14768,7 +14937,7 @@ static PyObject *__pyx_f_3_sa_5BiLex__add_node(struct __pyx_obj_3_sa_BiLex *__py */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->e_index->__pyx_vtab)->set(__pyx_v_self->e_index, __pyx_v_loc, __pyx_v_n->key); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":195 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":195 * loc = num_pairs[0] * self.e_index.set(loc, n.key) * self.col1.set(loc, float(n.val)/fmargin) # <<<<<<<<<<<<<< @@ -14781,7 +14950,7 @@ static PyObject *__pyx_f_3_sa_5BiLex__add_node(struct __pyx_obj_3_sa_BiLex *__py } ((struct __pyx_vtabstruct_3_sa_FloatList *)__pyx_v_self->col1->__pyx_vtab)->set(__pyx_v_self->col1, __pyx_v_loc, (((double)__pyx_v_n->val) / __pyx_v_fmargin)); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":196 + /* "/home/pauldb/workspace/cdec/python/src/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])) # <<<<<<<<<<<<<< @@ -14794,7 +14963,7 @@ static PyObject *__pyx_f_3_sa_5BiLex__add_node(struct __pyx_obj_3_sa_BiLex *__py } ((struct __pyx_vtabstruct_3_sa_FloatList *)__pyx_v_self->col2->__pyx_vtab)->set(__pyx_v_self->col2, __pyx_v_loc, (((double)__pyx_v_n->val) / ((double)(__pyx_v_emargin[__pyx_v_n->key])))); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":197 + /* "/home/pauldb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -14803,7 +14972,7 @@ static PyObject *__pyx_f_3_sa_5BiLex__add_node(struct __pyx_obj_3_sa_BiLex *__py */ (__pyx_v_num_pairs[0]) = (__pyx_v_loc + 1); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":198 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":198 * self.col2.set(loc, float(n.val)/float(emargin[n.key])) * num_pairs[0] = loc + 1 * if n.bigger != NULL: # <<<<<<<<<<<<<< @@ -14813,7 +14982,7 @@ static PyObject *__pyx_f_3_sa_5BiLex__add_node(struct __pyx_obj_3_sa_BiLex *__py __pyx_t_1 = (__pyx_v_n->bigger != NULL); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":199 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":199 * num_pairs[0] = loc + 1 * if n.bigger != NULL: * self._add_node(n.bigger, num_pairs, fmargin, emargin) # <<<<<<<<<<<<<< @@ -14860,7 +15029,7 @@ static PyObject *__pyx_pw_3_sa_5BiLex_3write_binary(PyObject *__pyx_v_self, PyOb return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":202 +/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":202 * * * def write_binary(self, char* filename): # <<<<<<<<<<<<<< @@ -14879,7 +15048,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_2write_binary(struct __pyx_obj_3_sa_BiLex int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_binary", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":204 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":204 * def write_binary(self, char* filename): * cdef FILE* f * f = fopen(filename, "w") # <<<<<<<<<<<<<< @@ -14888,7 +15057,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_2write_binary(struct __pyx_obj_3_sa_BiLex */ __pyx_v_f = fopen(__pyx_v_filename, __pyx_k__w); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":205 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":205 * cdef FILE* f * f = fopen(filename, "w") * self.f_index.write_handle(f) # <<<<<<<<<<<<<< @@ -14897,7 +15066,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_2write_binary(struct __pyx_obj_3_sa_BiLex */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->f_index->__pyx_vtab)->write_handle(__pyx_v_self->f_index, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":206 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":206 * f = fopen(filename, "w") * self.f_index.write_handle(f) * self.e_index.write_handle(f) # <<<<<<<<<<<<<< @@ -14906,7 +15075,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_2write_binary(struct __pyx_obj_3_sa_BiLex */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->e_index->__pyx_vtab)->write_handle(__pyx_v_self->e_index, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":207 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":207 * self.f_index.write_handle(f) * self.e_index.write_handle(f) * self.col1.write_handle(f) # <<<<<<<<<<<<<< @@ -14915,7 +15084,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_2write_binary(struct __pyx_obj_3_sa_BiLex */ ((struct __pyx_vtabstruct_3_sa_FloatList *)__pyx_v_self->col1->__pyx_vtab)->write_handle(__pyx_v_self->col1, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":208 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":208 * self.e_index.write_handle(f) * self.col1.write_handle(f) * self.col2.write_handle(f) # <<<<<<<<<<<<<< @@ -14924,7 +15093,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_2write_binary(struct __pyx_obj_3_sa_BiLex */ ((struct __pyx_vtabstruct_3_sa_FloatList *)__pyx_v_self->col2->__pyx_vtab)->write_handle(__pyx_v_self->col2, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":209 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":209 * self.col1.write_handle(f) * self.col2.write_handle(f) * self.write_wordlist(self.id2fword, f) # <<<<<<<<<<<<<< @@ -14938,7 +15107,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_2write_binary(struct __pyx_obj_3_sa_BiLex __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":210 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":210 * self.col2.write_handle(f) * self.write_wordlist(self.id2fword, f) * self.write_wordlist(self.id2eword, f) # <<<<<<<<<<<<<< @@ -14952,7 +15121,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_2write_binary(struct __pyx_obj_3_sa_BiLex __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":211 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":211 * self.write_wordlist(self.id2fword, f) * self.write_wordlist(self.id2eword, f) * fclose(f) # <<<<<<<<<<<<<< @@ -14974,7 +15143,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_2write_binary(struct __pyx_obj_3_sa_BiLex return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":214 +/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":214 * * * cdef write_wordlist(self, wordlist, FILE* f): # <<<<<<<<<<<<<< @@ -14999,7 +15168,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_write_wordlist(CYTHON_UNUSED struct __pyx_o int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_wordlist", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":218 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":218 * cdef int num_words * * num_words = len(wordlist) # <<<<<<<<<<<<<< @@ -15009,7 +15178,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_write_wordlist(CYTHON_UNUSED struct __pyx_o __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/paulb/workspace/cdec/python/src/sa/bilex.pxi":219 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":219 * * num_words = len(wordlist) * fwrite(&(num_words), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -15018,7 +15187,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_write_wordlist(CYTHON_UNUSED struct __pyx_o */ fwrite((&__pyx_v_num_words), (sizeof(int)), 1, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":220 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":220 * num_words = len(wordlist) * fwrite(&(num_words), sizeof(int), 1, f) * for word in wordlist: # <<<<<<<<<<<<<< @@ -15036,10 +15205,18 @@ static PyObject *__pyx_f_3_sa_5BiLex_write_wordlist(CYTHON_UNUSED struct __pyx_o for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_2)) { if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_2)) break; - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_2)) { if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else { __pyx_t_4 = __pyx_t_3(__pyx_t_2); if (unlikely(!__pyx_t_4)) { @@ -15055,7 +15232,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_write_wordlist(CYTHON_UNUSED struct __pyx_o __pyx_v_word = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":221 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":221 * fwrite(&(num_words), sizeof(int), 1, f) * for word in wordlist: * word_len = len(word) + 1 # <<<<<<<<<<<<<< @@ -15065,7 +15242,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_write_wordlist(CYTHON_UNUSED struct __pyx_o __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/paulb/workspace/cdec/python/src/sa/bilex.pxi":222 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":222 * for word in wordlist: * word_len = len(word) + 1 * fwrite(&(word_len), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -15074,7 +15251,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_write_wordlist(CYTHON_UNUSED struct __pyx_o */ fwrite((&__pyx_v_word_len), (sizeof(int)), 1, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":223 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":223 * word_len = len(word) + 1 * fwrite(&(word_len), sizeof(int), 1, f) * fwrite(word, sizeof(char), word_len, f) # <<<<<<<<<<<<<< @@ -15100,7 +15277,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_write_wordlist(CYTHON_UNUSED struct __pyx_o return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":226 +/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":226 * * * cdef read_wordlist(self, word2id, id2word, FILE* f): # <<<<<<<<<<<<<< @@ -15124,7 +15301,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_read_wordlist(CYTHON_UNUSED struct __pyx_ob int __pyx_clineno = 0; __Pyx_RefNannySetupContext("read_wordlist", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":231 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":231 * cdef char* word * * fread(&(num_words), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -15133,7 +15310,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_read_wordlist(CYTHON_UNUSED struct __pyx_ob */ fread((&__pyx_v_num_words), (sizeof(int)), 1, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":232 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":232 * * fread(&(num_words), sizeof(int), 1, f) * for i from 0 <= i < num_words: # <<<<<<<<<<<<<< @@ -15143,7 +15320,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_read_wordlist(CYTHON_UNUSED struct __pyx_ob __pyx_t_1 = __pyx_v_num_words; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":233 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -15152,7 +15329,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_read_wordlist(CYTHON_UNUSED struct __pyx_ob */ fread((&__pyx_v_word_len), (sizeof(int)), 1, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":234 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":234 * for i from 0 <= i < num_words: * fread(&(word_len), sizeof(int), 1, f) * word = malloc (word_len * sizeof(char)) # <<<<<<<<<<<<<< @@ -15161,7 +15338,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_read_wordlist(CYTHON_UNUSED struct __pyx_ob */ __pyx_v_word = ((char *)malloc((__pyx_v_word_len * (sizeof(char))))); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":235 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":235 * fread(&(word_len), sizeof(int), 1, f) * word = malloc (word_len * sizeof(char)) * fread(word, sizeof(char), word_len, f) # <<<<<<<<<<<<<< @@ -15170,7 +15347,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_read_wordlist(CYTHON_UNUSED struct __pyx_ob */ fread(__pyx_v_word, (sizeof(char)), __pyx_v_word_len, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":236 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":236 * word = malloc (word_len * sizeof(char)) * fread(word, sizeof(char), word_len, f) * word2id[word] = len(id2word) # <<<<<<<<<<<<<< @@ -15186,7 +15363,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_read_wordlist(CYTHON_UNUSED struct __pyx_ob __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":237 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":237 * fread(word, sizeof(char), word_len, f) * word2id[word] = len(id2word) * id2word.append(word) # <<<<<<<<<<<<<< @@ -15200,7 +15377,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_read_wordlist(CYTHON_UNUSED struct __pyx_ob __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":238 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":238 * word2id[word] = len(id2word) * id2word.append(word) * free(word) # <<<<<<<<<<<<<< @@ -15244,7 +15421,7 @@ static PyObject *__pyx_pw_3_sa_5BiLex_5read_binary(PyObject *__pyx_v_self, PyObj return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":240 +/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":240 * free(word) * * def read_binary(self, char* filename): # <<<<<<<<<<<<<< @@ -15264,7 +15441,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_4read_binary(struct __pyx_obj_3_sa_BiLex * int __pyx_clineno = 0; __Pyx_RefNannySetupContext("read_binary", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":242 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":242 * def read_binary(self, char* filename): * cdef FILE* f * f = fopen(filename, "r") # <<<<<<<<<<<<<< @@ -15273,7 +15450,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_4read_binary(struct __pyx_obj_3_sa_BiLex * */ __pyx_v_f = fopen(__pyx_v_filename, __pyx_k__r); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":243 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":243 * cdef FILE* f * f = fopen(filename, "r") * self.f_index.read_handle(f) # <<<<<<<<<<<<<< @@ -15282,7 +15459,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_4read_binary(struct __pyx_obj_3_sa_BiLex * */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->f_index->__pyx_vtab)->read_handle(__pyx_v_self->f_index, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":244 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":244 * f = fopen(filename, "r") * self.f_index.read_handle(f) * self.e_index.read_handle(f) # <<<<<<<<<<<<<< @@ -15291,7 +15468,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_4read_binary(struct __pyx_obj_3_sa_BiLex * */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->e_index->__pyx_vtab)->read_handle(__pyx_v_self->e_index, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":245 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":245 * self.f_index.read_handle(f) * self.e_index.read_handle(f) * self.col1.read_handle(f) # <<<<<<<<<<<<<< @@ -15300,7 +15477,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_4read_binary(struct __pyx_obj_3_sa_BiLex * */ ((struct __pyx_vtabstruct_3_sa_FloatList *)__pyx_v_self->col1->__pyx_vtab)->read_handle(__pyx_v_self->col1, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":246 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":246 * self.e_index.read_handle(f) * self.col1.read_handle(f) * self.col2.read_handle(f) # <<<<<<<<<<<<<< @@ -15309,7 +15486,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_4read_binary(struct __pyx_obj_3_sa_BiLex * */ ((struct __pyx_vtabstruct_3_sa_FloatList *)__pyx_v_self->col2->__pyx_vtab)->read_handle(__pyx_v_self->col2, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":247 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":247 * self.col1.read_handle(f) * self.col2.read_handle(f) * self.read_wordlist(self.fword2id, self.id2fword, f) # <<<<<<<<<<<<<< @@ -15326,7 +15503,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_4read_binary(struct __pyx_obj_3_sa_BiLex * __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":248 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -15343,7 +15520,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_4read_binary(struct __pyx_obj_3_sa_BiLex * __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":249 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":249 * self.read_wordlist(self.fword2id, self.id2fword, f) * self.read_wordlist(self.eword2id, self.id2eword, f) * fclose(f) # <<<<<<<<<<<<<< @@ -15377,7 +15554,7 @@ static PyObject *__pyx_pw_3_sa_5BiLex_7get_e_id(PyObject *__pyx_v_self, PyObject return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":252 +/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":252 * * * def get_e_id(self, eword): # <<<<<<<<<<<<<< @@ -15397,17 +15574,17 @@ static PyObject *__pyx_pf_3_sa_5BiLex_6get_e_id(struct __pyx_obj_3_sa_BiLex *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_e_id", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":253 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":253 * * def get_e_id(self, eword): * if eword not in self.eword2id: # <<<<<<<<<<<<<< * e_id = len(self.id2eword) * self.id2eword.append(eword) */ - __pyx_t_1 = (__Pyx_NegateNonNeg(PySequence_Contains(__pyx_v_self->eword2id, __pyx_v_eword))); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_eword, __pyx_v_self->eword2id, Py_NE)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":254 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":254 * def get_e_id(self, eword): * if eword not in self.eword2id: * e_id = len(self.id2eword) # <<<<<<<<<<<<<< @@ -15423,7 +15600,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_6get_e_id(struct __pyx_obj_3_sa_BiLex *__p __pyx_v_e_id = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":255 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":255 * if eword not in self.eword2id: * e_id = len(self.id2eword) * self.id2eword.append(eword) # <<<<<<<<<<<<<< @@ -15434,7 +15611,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_6get_e_id(struct __pyx_obj_3_sa_BiLex *__p __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":256 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":256 * e_id = len(self.id2eword) * self.id2eword.append(eword) * self.eword2id[eword] = e_id # <<<<<<<<<<<<<< @@ -15446,7 +15623,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_6get_e_id(struct __pyx_obj_3_sa_BiLex *__p } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":257 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":257 * self.id2eword.append(eword) * self.eword2id[eword] = e_id * return self.eword2id[eword] # <<<<<<<<<<<<<< @@ -15484,7 +15661,7 @@ static PyObject *__pyx_pw_3_sa_5BiLex_9get_f_id(PyObject *__pyx_v_self, PyObject return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":260 +/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":260 * * * def get_f_id(self, fword): # <<<<<<<<<<<<<< @@ -15504,17 +15681,17 @@ static PyObject *__pyx_pf_3_sa_5BiLex_8get_f_id(struct __pyx_obj_3_sa_BiLex *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_f_id", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":261 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":261 * * def get_f_id(self, fword): * if fword not in self.fword2id: # <<<<<<<<<<<<<< * f_id = len(self.id2fword) * self.id2fword.append(fword) */ - __pyx_t_1 = (__Pyx_NegateNonNeg(PySequence_Contains(__pyx_v_self->fword2id, __pyx_v_fword))); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_fword, __pyx_v_self->fword2id, Py_NE)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":262 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":262 * def get_f_id(self, fword): * if fword not in self.fword2id: * f_id = len(self.id2fword) # <<<<<<<<<<<<<< @@ -15530,7 +15707,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_8get_f_id(struct __pyx_obj_3_sa_BiLex *__p __pyx_v_f_id = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":263 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":263 * if fword not in self.fword2id: * f_id = len(self.id2fword) * self.id2fword.append(fword) # <<<<<<<<<<<<<< @@ -15541,7 +15718,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_8get_f_id(struct __pyx_obj_3_sa_BiLex *__p __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":264 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":264 * f_id = len(self.id2fword) * self.id2fword.append(fword) * self.fword2id[fword] = f_id # <<<<<<<<<<<<<< @@ -15553,7 +15730,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_8get_f_id(struct __pyx_obj_3_sa_BiLex *__p } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":265 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":265 * self.id2fword.append(fword) * self.fword2id[fword] = f_id * return self.fword2id[fword] # <<<<<<<<<<<<<< @@ -15601,7 +15778,7 @@ static PyObject *__pyx_pw_3_sa_5BiLex_11read_text(PyObject *__pyx_v_self, PyObje return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":268 +/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":268 * * * def read_text(self, char* filename): # <<<<<<<<<<<<<< @@ -15656,7 +15833,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("read_text", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":272 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":272 * cdef IntList fcount * * fcount = IntList() # <<<<<<<<<<<<<< @@ -15668,7 +15845,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_fcount = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":273 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":273 * * fcount = IntList() * with gzip_or_text(filename) as f: # <<<<<<<<<<<<<< @@ -15708,7 +15885,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_f = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":275 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":275 * with gzip_or_text(filename) as f: * # first loop merely establishes size of array objects * for line in f: # <<<<<<<<<<<<<< @@ -15726,10 +15903,18 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ for (;;) { if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #endif } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #endif } else { __pyx_t_2 = __pyx_t_9(__pyx_t_1); if (unlikely(!__pyx_t_2)) { @@ -15745,7 +15930,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_line = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":276 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":276 * # first loop merely establishes size of array objects * for line in f: * (fword, eword, score1, score2) = line.split() # <<<<<<<<<<<<<< @@ -15759,22 +15944,23 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 4)) { + if (size > 4) __Pyx_RaiseTooManyValuesError(4); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[5]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 4)) { - if (PyTuple_GET_SIZE(sequence) > 4) __Pyx_RaiseTooManyValuesError(4); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[5]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - } __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_11 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_12 = PyTuple_GET_ITEM(sequence, 3); } else { - if (unlikely(PyList_GET_SIZE(sequence) != 4)) { - if (PyList_GET_SIZE(sequence) > 4) __Pyx_RaiseTooManyValuesError(4); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[5]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - } __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_10 = PyList_GET_ITEM(sequence, 1); __pyx_t_11 = PyList_GET_ITEM(sequence, 2); @@ -15784,28 +15970,36 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx_t_12); + #else + Py_ssize_t i; + PyObject** temps[4] = {&__pyx_t_2,&__pyx_t_10,&__pyx_t_11,&__pyx_t_12}; + for (i=0; i < 4; i++) { + PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + *(temps[i]) = item; + } + #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { + } else + { Py_ssize_t index = -1; + PyObject** temps[4] = {&__pyx_t_2,&__pyx_t_10,&__pyx_t_11,&__pyx_t_12}; __pyx_t_13 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext; - index = 0; __pyx_t_2 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_2)) goto __pyx_L18_unpacking_failed; - __Pyx_GOTREF(__pyx_t_2); - index = 1; __pyx_t_10 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_10)) goto __pyx_L18_unpacking_failed; - __Pyx_GOTREF(__pyx_t_10); - index = 2; __pyx_t_11 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_11)) goto __pyx_L18_unpacking_failed; - __Pyx_GOTREF(__pyx_t_11); - index = 3; __pyx_t_12 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_12)) goto __pyx_L18_unpacking_failed; - __Pyx_GOTREF(__pyx_t_12); + for (index=0; index < 4; index++) { + PyObject* item = __pyx_t_14(__pyx_t_13); if (unlikely(!item)) goto __pyx_L18_unpacking_failed; + __Pyx_GOTREF(item); + *(temps[index]) = item; + } if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 4) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L19_unpacking_done; __pyx_L18_unpacking_failed:; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); + __pyx_t_14 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __pyx_L19_unpacking_done:; } @@ -15822,7 +16016,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_score2 = __pyx_t_12; __pyx_t_12 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":277 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":277 * for line in f: * (fword, eword, score1, score2) = line.split() * f_id = self.get_f_id(fword) # <<<<<<<<<<<<<< @@ -15844,7 +16038,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_f_id = __pyx_t_11; __pyx_t_11 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":278 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":278 * (fword, eword, score1, score2) = line.split() * f_id = self.get_f_id(fword) * e_id = self.get_e_id(eword) # <<<<<<<<<<<<<< @@ -15866,7 +16060,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_e_id = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":279 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":279 * f_id = self.get_f_id(fword) * e_id = self.get_e_id(eword) * while f_id >= len(fcount): # <<<<<<<<<<<<<< @@ -15877,14 +16071,13 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __pyx_t_15 = PyObject_Length(((PyObject *)__pyx_v_fcount)); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_15); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_12 = PyObject_RichCompare(__pyx_v_f_id, __pyx_t_3, Py_GE); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __Pyx_GOTREF(__pyx_t_12); + __pyx_t_12 = PyObject_RichCompare(__pyx_v_f_id, __pyx_t_3, Py_GE); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (!__pyx_t_16) break; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":280 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":280 * e_id = self.get_e_id(eword) * while f_id >= len(fcount): * fcount.append(0) # <<<<<<<<<<<<<< @@ -15896,7 +16089,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":281 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":281 * while f_id >= len(fcount): * fcount.append(0) * fcount.arr[f_id] = fcount.arr[f_id] + 1 # <<<<<<<<<<<<<< @@ -15909,7 +16102,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":284 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":284 * * # Allocate space for dictionary in arrays * N = 0 # <<<<<<<<<<<<<< @@ -15919,7 +16112,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __Pyx_INCREF(__pyx_int_0); __pyx_v_N = __pyx_int_0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":285 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":285 * # Allocate space for dictionary in arrays * N = 0 * n_f = len(fcount) # <<<<<<<<<<<<<< @@ -15932,7 +16125,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_n_f = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":286 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":286 * N = 0 * n_f = len(fcount) * self.f_index = IntList(initial_len=n_f+1) # <<<<<<<<<<<<<< @@ -15954,7 +16147,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_self->f_index = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_12); __pyx_t_12 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":287 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":287 * n_f = len(fcount) * self.f_index = IntList(initial_len=n_f+1) * for i from 0 <= i < n_f: # <<<<<<<<<<<<<< @@ -15969,7 +16162,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_i = __pyx_t_12; __pyx_t_12 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":288 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":288 * self.f_index = IntList(initial_len=n_f+1) * for i from 0 <= i < n_f: * self.f_index.arr[i] = N # <<<<<<<<<<<<<< @@ -15980,7 +16173,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __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 = 288; __pyx_clineno = __LINE__; goto __pyx_L7_error;} (__pyx_v_self->f_index->arr[__pyx_t_8]) = __pyx_t_20; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":289 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":289 * for i from 0 <= i < n_f: * self.f_index.arr[i] = N * N = N + fcount.arr[i] # <<<<<<<<<<<<<< @@ -15997,7 +16190,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_N = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":290 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":290 * self.f_index.arr[i] = N * N = N + fcount.arr[i] * fcount.arr[i] = 0 # <<<<<<<<<<<<<< @@ -16009,7 +16202,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __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 = 287; __pyx_clineno = __LINE__; goto __pyx_L7_error;} } - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":287 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":287 * n_f = len(fcount) * self.f_index = IntList(initial_len=n_f+1) * for i from 0 <= i < n_f: # <<<<<<<<<<<<<< @@ -16022,7 +16215,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_i = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":291 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":291 * N = N + fcount.arr[i] * fcount.arr[i] = 0 * self.f_index.arr[n_f] = N # <<<<<<<<<<<<<< @@ -16033,7 +16226,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __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 = 291; __pyx_clineno = __LINE__; goto __pyx_L7_error;} (__pyx_v_self->f_index->arr[__pyx_t_8]) = __pyx_t_20; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":292 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":292 * fcount.arr[i] = 0 * self.f_index.arr[n_f] = N * self.e_index = IntList(initial_len=N) # <<<<<<<<<<<<<< @@ -16052,7 +16245,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_self->e_index = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_12); __pyx_t_12 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":293 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":293 * self.f_index.arr[n_f] = N * self.e_index = IntList(initial_len=N) * self.col1 = FloatList(initial_len=N) # <<<<<<<<<<<<<< @@ -16071,7 +16264,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_self->col1 = ((struct __pyx_obj_3_sa_FloatList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":294 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":294 * self.e_index = IntList(initial_len=N) * self.col1 = FloatList(initial_len=N) * self.col2 = FloatList(initial_len=N) # <<<<<<<<<<<<<< @@ -16090,7 +16283,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_self->col2 = ((struct __pyx_obj_3_sa_FloatList *)__pyx_t_12); __pyx_t_12 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":297 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":297 * * # Re-read file, placing words into buckets * f.seek(0) # <<<<<<<<<<<<<< @@ -16104,7 +16297,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":298 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":298 * # Re-read file, placing words into buckets * f.seek(0) * for line in f: # <<<<<<<<<<<<<< @@ -16122,10 +16315,18 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ for (;;) { if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_12 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_12); __pyx_t_8++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_12 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_12); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #else + __pyx_t_12 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #endif } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_12); __pyx_t_8++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_12); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #else + __pyx_t_12 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #endif } else { __pyx_t_12 = __pyx_t_9(__pyx_t_1); if (unlikely(!__pyx_t_12)) { @@ -16141,7 +16342,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_line = __pyx_t_12; __pyx_t_12 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":299 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":299 * f.seek(0) * for line in f: * (fword, eword, score1, score2) = line.split() # <<<<<<<<<<<<<< @@ -16155,22 +16356,23 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 4)) { + if (size > 4) __Pyx_RaiseTooManyValuesError(4); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[5]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 4)) { - if (PyTuple_GET_SIZE(sequence) > 4) __Pyx_RaiseTooManyValuesError(4); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[5]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - } __pyx_t_12 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_10 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 3); } else { - if (unlikely(PyList_GET_SIZE(sequence) != 4)) { - if (PyList_GET_SIZE(sequence) > 4) __Pyx_RaiseTooManyValuesError(4); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[5]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - } __pyx_t_12 = PyList_GET_ITEM(sequence, 0); __pyx_t_11 = PyList_GET_ITEM(sequence, 1); __pyx_t_10 = PyList_GET_ITEM(sequence, 2); @@ -16180,28 +16382,36 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(__pyx_t_2); + #else + Py_ssize_t i; + PyObject** temps[4] = {&__pyx_t_12,&__pyx_t_11,&__pyx_t_10,&__pyx_t_2}; + for (i=0; i < 4; i++) { + PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + *(temps[i]) = item; + } + #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { + } else + { Py_ssize_t index = -1; + PyObject** temps[4] = {&__pyx_t_12,&__pyx_t_11,&__pyx_t_10,&__pyx_t_2}; __pyx_t_13 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext; - index = 0; __pyx_t_12 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_12)) goto __pyx_L26_unpacking_failed; - __Pyx_GOTREF(__pyx_t_12); - index = 1; __pyx_t_11 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_11)) goto __pyx_L26_unpacking_failed; - __Pyx_GOTREF(__pyx_t_11); - index = 2; __pyx_t_10 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_10)) goto __pyx_L26_unpacking_failed; - __Pyx_GOTREF(__pyx_t_10); - index = 3; __pyx_t_2 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_2)) goto __pyx_L26_unpacking_failed; - __Pyx_GOTREF(__pyx_t_2); + for (index=0; index < 4; index++) { + PyObject* item = __pyx_t_14(__pyx_t_13); if (unlikely(!item)) goto __pyx_L26_unpacking_failed; + __Pyx_GOTREF(item); + *(temps[index]) = item; + } if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 4) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L27_unpacking_done; __pyx_L26_unpacking_failed:; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); + __pyx_t_14 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __pyx_L27_unpacking_done:; } @@ -16218,7 +16428,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_score2 = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":300 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":300 * for line in f: * (fword, eword, score1, score2) = line.split() * f_id = self.get_f_id(fword) # <<<<<<<<<<<<<< @@ -16240,7 +16450,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_f_id = __pyx_t_10; __pyx_t_10 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":301 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":301 * (fword, eword, score1, score2) = line.split() * f_id = self.get_f_id(fword) * e_id = self.get_e_id(eword) # <<<<<<<<<<<<<< @@ -16262,7 +16472,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_e_id = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":302 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":302 * 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] # <<<<<<<<<<<<<< @@ -16277,7 +16487,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_index = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":303 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":303 * 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 # <<<<<<<<<<<<<< @@ -16288,7 +16498,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __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 = 303; __pyx_clineno = __LINE__; goto __pyx_L7_error;} (__pyx_v_fcount->arr[__pyx_t_15]) = ((__pyx_v_fcount->arr[__pyx_t_17]) + 1); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":304 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":304 * 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) # <<<<<<<<<<<<<< @@ -16308,7 +16518,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __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 = 304; __pyx_clineno = __LINE__; goto __pyx_L7_error;} (__pyx_v_self->e_index->arr[__pyx_t_17]) = __pyx_t_20; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":305 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":305 * fcount.arr[f_id] = fcount.arr[f_id] + 1 * self.e_index.arr[index] = int(e_id) * self.col1[index] = float(score1) # <<<<<<<<<<<<<< @@ -16321,7 +16531,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ if (PyObject_SetItem(((PyObject *)__pyx_v_self->col1), __pyx_v_index, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":306 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":306 * self.e_index.arr[index] = int(e_id) * self.col1[index] = float(score1) * self.col2[index] = float(score2) # <<<<<<<<<<<<<< @@ -16349,7 +16559,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":273 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":273 * * fcount = IntList() * with gzip_or_text(filename) as f: # <<<<<<<<<<<<<< @@ -16429,7 +16639,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __pyx_L31:; } - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":309 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":309 * * # Sort buckets by eword * for b from 0 <= b < n_f: # <<<<<<<<<<<<<< @@ -16445,7 +16655,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_b = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":310 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":310 * # Sort buckets by eword * for b from 0 <= b < n_f: * i = self.f_index.arr[b] # <<<<<<<<<<<<<< @@ -16459,7 +16669,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_i = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":311 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":311 * for b from 0 <= b < n_f: * i = self.f_index.arr[b] * j = self.f_index.arr[b+1] # <<<<<<<<<<<<<< @@ -16476,7 +16686,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_j = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":312 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":312 * i = self.f_index.arr[b] * j = self.f_index.arr[b+1] * self.qsort(i,j, "") # <<<<<<<<<<<<<< @@ -16494,7 +16704,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ __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 = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":309 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":309 * * # Sort buckets by eword * for b from 0 <= b < n_f: # <<<<<<<<<<<<<< @@ -16540,7 +16750,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_ return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":315 +/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":315 * * * cdef swap(self, int i, int j): # <<<<<<<<<<<<<< @@ -16556,7 +16766,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_swap(struct __pyx_obj_3_sa_BiLex *__pyx_v_s int __pyx_t_1; __Pyx_RefNannySetupContext("swap", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":319 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":319 * cdef float ftmp * * if i == j: # <<<<<<<<<<<<<< @@ -16566,7 +16776,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_swap(struct __pyx_obj_3_sa_BiLex *__pyx_v_s __pyx_t_1 = (__pyx_v_i == __pyx_v_j); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":320 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":320 * * if i == j: * return # <<<<<<<<<<<<<< @@ -16580,7 +16790,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_swap(struct __pyx_obj_3_sa_BiLex *__pyx_v_s } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":322 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":322 * return * * itmp = self.e_index.arr[i] # <<<<<<<<<<<<<< @@ -16589,7 +16799,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_swap(struct __pyx_obj_3_sa_BiLex *__pyx_v_s */ __pyx_v_itmp = (__pyx_v_self->e_index->arr[__pyx_v_i]); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":323 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":323 * * itmp = self.e_index.arr[i] * self.e_index.arr[i] = self.e_index.arr[j] # <<<<<<<<<<<<<< @@ -16598,7 +16808,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_swap(struct __pyx_obj_3_sa_BiLex *__pyx_v_s */ (__pyx_v_self->e_index->arr[__pyx_v_i]) = (__pyx_v_self->e_index->arr[__pyx_v_j]); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":324 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":324 * itmp = self.e_index.arr[i] * self.e_index.arr[i] = self.e_index.arr[j] * self.e_index.arr[j] = itmp # <<<<<<<<<<<<<< @@ -16607,7 +16817,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_swap(struct __pyx_obj_3_sa_BiLex *__pyx_v_s */ (__pyx_v_self->e_index->arr[__pyx_v_j]) = __pyx_v_itmp; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":326 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":326 * self.e_index.arr[j] = itmp * * ftmp = self.col1.arr[i] # <<<<<<<<<<<<<< @@ -16616,7 +16826,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_swap(struct __pyx_obj_3_sa_BiLex *__pyx_v_s */ __pyx_v_ftmp = (__pyx_v_self->col1->arr[__pyx_v_i]); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":327 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":327 * * ftmp = self.col1.arr[i] * self.col1.arr[i] = self.col1.arr[j] # <<<<<<<<<<<<<< @@ -16625,7 +16835,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_swap(struct __pyx_obj_3_sa_BiLex *__pyx_v_s */ (__pyx_v_self->col1->arr[__pyx_v_i]) = (__pyx_v_self->col1->arr[__pyx_v_j]); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":328 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":328 * ftmp = self.col1.arr[i] * self.col1.arr[i] = self.col1.arr[j] * self.col1.arr[j] = ftmp # <<<<<<<<<<<<<< @@ -16634,7 +16844,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_swap(struct __pyx_obj_3_sa_BiLex *__pyx_v_s */ (__pyx_v_self->col1->arr[__pyx_v_j]) = __pyx_v_ftmp; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":330 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":330 * self.col1.arr[j] = ftmp * * ftmp = self.col2.arr[i] # <<<<<<<<<<<<<< @@ -16643,7 +16853,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_swap(struct __pyx_obj_3_sa_BiLex *__pyx_v_s */ __pyx_v_ftmp = (__pyx_v_self->col2->arr[__pyx_v_i]); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":331 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":331 * * ftmp = self.col2.arr[i] * self.col2.arr[i] = self.col2.arr[j] # <<<<<<<<<<<<<< @@ -16652,7 +16862,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_swap(struct __pyx_obj_3_sa_BiLex *__pyx_v_s */ (__pyx_v_self->col2->arr[__pyx_v_i]) = (__pyx_v_self->col2->arr[__pyx_v_j]); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":332 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":332 * ftmp = self.col2.arr[i] * self.col2.arr[i] = self.col2.arr[j] * self.col2.arr[j] = ftmp # <<<<<<<<<<<<<< @@ -16668,7 +16878,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_swap(struct __pyx_obj_3_sa_BiLex *__pyx_v_s return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":335 +/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":335 * * * cdef qsort(self, int i, int j, pad): # <<<<<<<<<<<<<< @@ -16691,7 +16901,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("qsort", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":338 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":338 * cdef int pval, p * * if i > j: # <<<<<<<<<<<<<< @@ -16701,7 +16911,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_ __pyx_t_1 = (__pyx_v_i > __pyx_v_j); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":339 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":339 * * if i > j: * raise Exception("Sort error in CLex") # <<<<<<<<<<<<<< @@ -16717,7 +16927,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_ } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":340 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":340 * if i > j: * raise Exception("Sort error in CLex") * if i == j: #empty interval # <<<<<<<<<<<<<< @@ -16727,7 +16937,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_ __pyx_t_1 = (__pyx_v_i == __pyx_v_j); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":341 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":341 * raise Exception("Sort error in CLex") * if i == j: #empty interval * return # <<<<<<<<<<<<<< @@ -16741,7 +16951,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_ } __pyx_L4:; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":342 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":342 * if i == j: #empty interval * return * if i == j-1: # singleton interval # <<<<<<<<<<<<<< @@ -16751,7 +16961,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_ __pyx_t_1 = (__pyx_v_i == (__pyx_v_j - 1)); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":343 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":343 * return * if i == j-1: # singleton interval * return # <<<<<<<<<<<<<< @@ -16765,7 +16975,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_ } __pyx_L5:; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":345 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":345 * return * * p = (i+j)/2 # <<<<<<<<<<<<<< @@ -16774,7 +16984,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_ */ __pyx_v_p = __Pyx_div_long((__pyx_v_i + __pyx_v_j), 2); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":346 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":346 * * p = (i+j)/2 * pval = self.e_index.arr[p] # <<<<<<<<<<<<<< @@ -16783,7 +16993,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_ */ __pyx_v_pval = (__pyx_v_self->e_index->arr[__pyx_v_p]); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":347 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":347 * p = (i+j)/2 * pval = self.e_index.arr[p] * self.swap(i, p) # <<<<<<<<<<<<<< @@ -16794,7 +17004,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_ __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":348 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":348 * pval = self.e_index.arr[p] * self.swap(i, p) * p = i # <<<<<<<<<<<<<< @@ -16803,7 +17013,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_ */ __pyx_v_p = __pyx_v_i; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":349 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":349 * self.swap(i, p) * p = i * for k from i+1 <= k < j: # <<<<<<<<<<<<<< @@ -16813,7 +17023,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_ __pyx_t_3 = __pyx_v_j; for (__pyx_v_k = (__pyx_v_i + 1); __pyx_v_k < __pyx_t_3; __pyx_v_k++) { - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":350 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":350 * p = i * for k from i+1 <= k < j: * if pval >= self.e_index.arr[k]: # <<<<<<<<<<<<<< @@ -16823,7 +17033,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_ __pyx_t_1 = (__pyx_v_pval >= (__pyx_v_self->e_index->arr[__pyx_v_k])); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":351 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":351 * for k from i+1 <= k < j: * if pval >= self.e_index.arr[k]: * self.swap(p+1, k) # <<<<<<<<<<<<<< @@ -16834,7 +17044,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_ __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":352 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":352 * if pval >= self.e_index.arr[k]: * self.swap(p+1, k) * self.swap(p, p+1) # <<<<<<<<<<<<<< @@ -16845,7 +17055,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_ __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":353 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":353 * self.swap(p+1, k) * self.swap(p, p+1) * p = p + 1 # <<<<<<<<<<<<<< @@ -16858,7 +17068,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_ __pyx_L8:; } - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":354 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":354 * self.swap(p, p+1) * p = p + 1 * self.qsort(i,p, pad+" ") # <<<<<<<<<<<<<< @@ -16872,7 +17082,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":355 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":355 * p = p + 1 * self.qsort(i,p, pad+" ") * self.qsort(p+1,j, pad+" ") # <<<<<<<<<<<<<< @@ -16920,7 +17130,7 @@ static PyObject *__pyx_pw_3_sa_5BiLex_13write_enhanced(PyObject *__pyx_v_self, P return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":358 +/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":358 * * * def write_enhanced(self, char* filename): # <<<<<<<<<<<<<< @@ -16957,7 +17167,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_enhanced", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":359 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":359 * * def write_enhanced(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -16997,7 +17207,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL __pyx_v_f = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":360 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":360 * def write_enhanced(self, char* filename): * with open(filename, "w") as f: * for i in self.f_index: # <<<<<<<<<<<<<< @@ -17015,10 +17225,18 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL for (;;) { if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_4)) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_4)) break; - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #endif } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_4)) { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_4)) break; - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #endif } else { __pyx_t_1 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_1)) { @@ -17034,7 +17252,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL __pyx_v_i = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":361 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":361 * with open(filename, "w") as f: * for i in self.f_index: * f.write("%d " % i) # <<<<<<<<<<<<<< @@ -17058,7 +17276,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":362 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":362 * for i in self.f_index: * f.write("%d " % i) * f.write("\n") # <<<<<<<<<<<<<< @@ -17072,7 +17290,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":363 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":363 * f.write("%d " % i) * f.write("\n") * for i, s1, s2 in zip(self.e_index, self.col1, self.col2): # <<<<<<<<<<<<<< @@ -17105,10 +17323,18 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL for (;;) { if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_2)) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_2)) break; - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #endif } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_2)) { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #endif } else { __pyx_t_4 = __pyx_t_9(__pyx_t_2); if (unlikely(!__pyx_t_4)) { @@ -17122,21 +17348,22 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL } if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { PyObject* sequence = __pyx_t_4; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 3)) { + if (size > 3) __Pyx_RaiseTooManyValuesError(3); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[5]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 3)) { - if (PyTuple_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[5]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - } __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_11 = PyTuple_GET_ITEM(sequence, 2); } else { - if (unlikely(PyList_GET_SIZE(sequence) != 3)) { - if (PyList_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[5]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - } __pyx_t_10 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); __pyx_t_11 = PyList_GET_ITEM(sequence, 2); @@ -17144,8 +17371,14 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_11); + #else + __pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_11 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } else { + } else + { Py_ssize_t index = -1; __pyx_t_12 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_12); @@ -17158,12 +17391,13 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL index = 2; __pyx_t_11 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_11)) goto __pyx_L20_unpacking_failed; __Pyx_GOTREF(__pyx_t_11); if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 3) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_13 = NULL; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; goto __pyx_L21_unpacking_done; __pyx_L20_unpacking_failed:; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); + __pyx_t_13 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __pyx_L21_unpacking_done:; } @@ -17177,7 +17411,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL __pyx_v_s2 = __pyx_t_11; __pyx_t_11 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":364 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":364 * f.write("\n") * for i, s1, s2 in zip(self.e_index, self.col1, self.col2): * f.write("%d %f %f " % (i, s1, s2)) # <<<<<<<<<<<<<< @@ -17213,7 +17447,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":365 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":365 * for i, s1, s2 in zip(self.e_index, self.col1, self.col2): * f.write("%d %f %f " % (i, s1, s2)) * f.write("\n") # <<<<<<<<<<<<<< @@ -17227,7 +17461,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":366 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":366 * f.write("%d %f %f " % (i, s1, s2)) * f.write("\n") * for i, w in enumerate(self.id2fword): # <<<<<<<<<<<<<< @@ -17247,10 +17481,18 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL for (;;) { if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_2)) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_2)) break; - __pyx_t_11 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_11); __pyx_t_8++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_11 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_11); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #else + __pyx_t_11 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #endif } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_2)) { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_11); __pyx_t_8++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_11); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #else + __pyx_t_11 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #endif } else { __pyx_t_11 = __pyx_t_9(__pyx_t_2); if (unlikely(!__pyx_t_11)) { @@ -17274,7 +17516,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL __pyx_t_1 = __pyx_t_11; __pyx_t_11 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":367 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":367 * f.write("\n") * for i, w in enumerate(self.id2fword): * f.write("%d %s " % (i, w)) # <<<<<<<<<<<<<< @@ -17308,7 +17550,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":368 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":368 * for i, w in enumerate(self.id2fword): * f.write("%d %s " % (i, w)) * f.write("\n") # <<<<<<<<<<<<<< @@ -17322,7 +17564,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":369 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":369 * f.write("%d %s " % (i, w)) * f.write("\n") * for i, w in enumerate(self.id2eword): # <<<<<<<<<<<<<< @@ -17342,10 +17584,18 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL for (;;) { if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_10 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_10 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #else + __pyx_t_10 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #endif } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #else + __pyx_t_10 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #endif } else { __pyx_t_10 = __pyx_t_9(__pyx_t_1); if (unlikely(!__pyx_t_10)) { @@ -17369,7 +17619,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL __pyx_t_2 = __pyx_t_10; __pyx_t_10 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":370 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":370 * f.write("\n") * for i, w in enumerate(self.id2eword): * f.write("%d %s " % (i, w)) # <<<<<<<<<<<<<< @@ -17403,7 +17653,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":371 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":371 * for i, w in enumerate(self.id2eword): * f.write("%d %s " % (i, w)) * f.write("\n") # <<<<<<<<<<<<<< @@ -17429,7 +17679,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":359 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":359 * * def write_enhanced(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -17537,11 +17787,11 @@ static PyObject *__pyx_pw_3_sa_5BiLex_15get_score(PyObject *__pyx_v_self, PyObje PyObject *__pyx_v_fword = 0; PyObject *__pyx_v_eword = 0; PyObject *__pyx_v_col = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fword,&__pyx_n_s__eword,&__pyx_n_s__col,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_score (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fword,&__pyx_n_s__eword,&__pyx_n_s__col,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -17556,18 +17806,15 @@ static PyObject *__pyx_pw_3_sa_5BiLex_15get_score(PyObject *__pyx_v_self, PyObje kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fword); - if (likely(values[0])) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fword)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__eword); - if (likely(values[1])) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__eword)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("get_score", 1, 3, 3, 1); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: - values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__col); - if (likely(values[2])) kw_args--; + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__col)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("get_score", 1, 3, 3, 2); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -17599,7 +17846,7 @@ static PyObject *__pyx_pw_3_sa_5BiLex_15get_score(PyObject *__pyx_v_self, PyObje return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":374 +/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":374 * * * def get_score(self, fword, eword, col): # <<<<<<<<<<<<<< @@ -17625,17 +17872,17 @@ static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_score", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":377 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":377 * cdef e_id, f_id, low, high, midpoint, val * * if eword not in self.eword2id: # <<<<<<<<<<<<<< * return None * if fword not in self.fword2id: */ - __pyx_t_1 = (__Pyx_NegateNonNeg(PySequence_Contains(__pyx_v_self->eword2id, __pyx_v_eword))); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_eword, __pyx_v_self->eword2id, Py_NE)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":378 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":378 * * if eword not in self.eword2id: * return None # <<<<<<<<<<<<<< @@ -17650,17 +17897,17 @@ static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *_ } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":379 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":379 * if eword not in self.eword2id: * return None * if fword not in self.fword2id: # <<<<<<<<<<<<<< * return None * f_id = self.fword2id[fword] */ - __pyx_t_1 = (__Pyx_NegateNonNeg(PySequence_Contains(__pyx_v_self->fword2id, __pyx_v_fword))); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_fword, __pyx_v_self->fword2id, Py_NE)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":380 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":380 * return None * if fword not in self.fword2id: * return None # <<<<<<<<<<<<<< @@ -17675,7 +17922,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *_ } __pyx_L4:; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":381 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":381 * if fword not in self.fword2id: * return None * f_id = self.fword2id[fword] # <<<<<<<<<<<<<< @@ -17687,7 +17934,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_f_id = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":382 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":382 * return None * f_id = self.fword2id[fword] * e_id = self.eword2id[eword] # <<<<<<<<<<<<<< @@ -17699,7 +17946,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_e_id = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":383 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":383 * f_id = self.fword2id[fword] * e_id = self.eword2id[eword] * low = self.f_index.arr[f_id] # <<<<<<<<<<<<<< @@ -17712,7 +17959,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_low = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":384 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":384 * e_id = self.eword2id[eword] * low = self.f_index.arr[f_id] * high = self.f_index.arr[f_id+1] # <<<<<<<<<<<<<< @@ -17728,7 +17975,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_high = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":385 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":385 * low = self.f_index.arr[f_id] * high = self.f_index.arr[f_id+1] * while high - low > 0: # <<<<<<<<<<<<<< @@ -17738,14 +17985,13 @@ static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *_ while (1) { __pyx_t_2 = PyNumber_Subtract(__pyx_v_high, __pyx_v_low); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_int_0, Py_GT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_1) break; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":386 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":386 * high = self.f_index.arr[f_id+1] * while high - low > 0: * midpoint = (low+high)/2 # <<<<<<<<<<<<<< @@ -17761,7 +18007,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_midpoint = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":387 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":387 * while high - low > 0: * midpoint = (low+high)/2 * val = self.e_index.arr[midpoint] # <<<<<<<<<<<<<< @@ -17775,33 +18021,31 @@ static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *_ __pyx_v_val = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":388 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":388 * midpoint = (low+high)/2 * val = self.e_index.arr[midpoint] * if val == e_id: # <<<<<<<<<<<<<< * if col == 0: * return self.col1.arr[midpoint] */ - __pyx_t_2 = PyObject_RichCompare(__pyx_v_val, __pyx_v_e_id, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_2 = PyObject_RichCompare(__pyx_v_val, __pyx_v_e_id, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":389 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":389 * val = self.e_index.arr[midpoint] * if val == e_id: * if col == 0: # <<<<<<<<<<<<<< * return self.col1.arr[midpoint] * if col == 1: */ - __pyx_t_2 = PyObject_RichCompare(__pyx_v_col, __pyx_int_0, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_2 = PyObject_RichCompare(__pyx_v_col, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":390 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":390 * if val == e_id: * if col == 0: * return self.col1.arr[midpoint] # <<<<<<<<<<<<<< @@ -17819,20 +18063,19 @@ static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *_ } __pyx_L8:; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":391 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":391 * if col == 0: * return self.col1.arr[midpoint] * if col == 1: # <<<<<<<<<<<<<< * return self.col2.arr[midpoint] * if val > e_id: */ - __pyx_t_2 = PyObject_RichCompare(__pyx_v_col, __pyx_int_1, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_2 = PyObject_RichCompare(__pyx_v_col, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":392 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":392 * return self.col1.arr[midpoint] * if col == 1: * return self.col2.arr[midpoint] # <<<<<<<<<<<<<< @@ -17853,20 +18096,19 @@ static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *_ } __pyx_L7:; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":393 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":393 * if col == 1: * return self.col2.arr[midpoint] * if val > e_id: # <<<<<<<<<<<<<< * high = midpoint * if val < e_id: */ - __pyx_t_2 = PyObject_RichCompare(__pyx_v_val, __pyx_v_e_id, Py_GT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_2 = PyObject_RichCompare(__pyx_v_val, __pyx_v_e_id, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":394 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":394 * return self.col2.arr[midpoint] * if val > e_id: * high = midpoint # <<<<<<<<<<<<<< @@ -17880,20 +18122,19 @@ static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *_ } __pyx_L10:; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":395 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":395 * if val > e_id: * high = midpoint * if val < e_id: # <<<<<<<<<<<<<< * low = midpoint + 1 * return None */ - __pyx_t_2 = PyObject_RichCompare(__pyx_v_val, __pyx_v_e_id, Py_LT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_2 = PyObject_RichCompare(__pyx_v_val, __pyx_v_e_id, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":396 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":396 * high = midpoint * if val < e_id: * low = midpoint + 1 # <<<<<<<<<<<<<< @@ -17910,7 +18151,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *_ __pyx_L11:; } - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":397 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":397 * if val < e_id: * low = midpoint + 1 * return None # <<<<<<<<<<<<<< @@ -17963,7 +18204,7 @@ static PyObject *__pyx_pw_3_sa_5BiLex_17write_text(PyObject *__pyx_v_self, PyObj return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":400 +/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":400 * * * def write_text(self, char* filename): # <<<<<<<<<<<<<< @@ -18000,7 +18241,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_16write_text(struct __pyx_obj_3_sa_BiLex * int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_text", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":404 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":404 * cdef i, N, e_id, f_id * * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -18040,7 +18281,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_16write_text(struct __pyx_obj_3_sa_BiLex * __pyx_v_f = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":405 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":405 * * with open(filename, "w") as f: * N = len(self.e_index) # <<<<<<<<<<<<<< @@ -18056,7 +18297,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_16write_text(struct __pyx_obj_3_sa_BiLex * __pyx_v_N = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":406 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":406 * with open(filename, "w") as f: * N = len(self.e_index) * f_id = 0 # <<<<<<<<<<<<<< @@ -18066,7 +18307,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_16write_text(struct __pyx_obj_3_sa_BiLex * __Pyx_INCREF(__pyx_int_0); __pyx_v_f_id = __pyx_int_0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":407 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":407 * N = len(self.e_index) * f_id = 0 * for i from 0 <= i < N: # <<<<<<<<<<<<<< @@ -18081,7 +18322,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_16write_text(struct __pyx_obj_3_sa_BiLex * __pyx_v_i = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":408 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":408 * f_id = 0 * for i from 0 <= i < N: * while self.f_index.arr[f_id+1] == i: # <<<<<<<<<<<<<< @@ -18095,14 +18336,13 @@ static PyObject *__pyx_pf_3_sa_5BiLex_16write_text(struct __pyx_obj_3_sa_BiLex * __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 = 408; __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); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __Pyx_GOTREF(__pyx_t_1); + __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 = 408; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_11) break; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":409 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":409 * for i from 0 <= i < N: * while self.f_index.arr[f_id+1] == i: * f_id = f_id + 1 # <<<<<<<<<<<<<< @@ -18116,7 +18356,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_16write_text(struct __pyx_obj_3_sa_BiLex * __pyx_t_1 = 0; } - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":410 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":410 * while self.f_index.arr[f_id+1] == i: * f_id = f_id + 1 * e_id = self.e_index.arr[i] # <<<<<<<<<<<<<< @@ -18130,7 +18370,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_16write_text(struct __pyx_obj_3_sa_BiLex * __pyx_v_e_id = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":411 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":411 * f_id = f_id + 1 * e_id = self.e_index.arr[i] * score1 = self.col1.arr[i] # <<<<<<<<<<<<<< @@ -18144,7 +18384,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_16write_text(struct __pyx_obj_3_sa_BiLex * __pyx_v_score1 = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":412 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":412 * e_id = self.e_index.arr[i] * score1 = self.col1.arr[i] * score2 = self.col2.arr[i] # <<<<<<<<<<<<<< @@ -18157,7 +18397,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_16write_text(struct __pyx_obj_3_sa_BiLex * __pyx_v_score2 = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":413 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":413 * 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)) # <<<<<<<<<<<<<< @@ -18198,7 +18438,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_16write_text(struct __pyx_obj_3_sa_BiLex * __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 = 407; __pyx_clineno = __LINE__; goto __pyx_L7_error;} } - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":407 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":407 * N = len(self.e_index) * f_id = 0 * for i from 0 <= i < N: # <<<<<<<<<<<<<< @@ -18221,7 +18461,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_16write_text(struct __pyx_obj_3_sa_BiLex * __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":404 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":404 * cdef i, N, e_id, f_id * * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -18323,7 +18563,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_16write_text(struct __pyx_obj_3_sa_BiLex * return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":21 +/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":21 * cdef int LOWER_MASK[32] * * cdef void _init_lower_mask(): # <<<<<<<<<<<<<< @@ -18339,7 +18579,7 @@ static void __pyx_f_3_sa__init_lower_mask(void) { unsigned int __pyx_t_2; __Pyx_RefNannySetupContext("_init_lower_mask", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":23 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":23 * cdef void _init_lower_mask(): * cdef unsigned i * cdef int mask = 0 # <<<<<<<<<<<<<< @@ -18348,7 +18588,7 @@ static void __pyx_f_3_sa__init_lower_mask(void) { */ __pyx_v_mask = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":24 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":24 * cdef unsigned i * cdef int mask = 0 * for i in range(MIN_BOTTOM_SIZE): # <<<<<<<<<<<<<< @@ -18359,7 +18599,7 @@ static void __pyx_f_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/paulb/workspace/cdec/python/src/sa/veb.pxi":25 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":25 * cdef int mask = 0 * for i in range(MIN_BOTTOM_SIZE): * mask = (mask << 1) + 1 # <<<<<<<<<<<<<< @@ -18368,7 +18608,7 @@ static void __pyx_f_3_sa__init_lower_mask(void) { */ __pyx_v_mask = ((__pyx_v_mask << 1) + 1); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":26 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":26 * for i in range(MIN_BOTTOM_SIZE): * mask = (mask << 1) + 1 * LOWER_MASK[i] = mask # <<<<<<<<<<<<<< @@ -18381,7 +18621,7 @@ static void __pyx_f_3_sa__init_lower_mask(void) { __Pyx_RefNannyFinishContext(); } -/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":37 +/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":37 * * * cdef _BitSet* new_BitSet(): # <<<<<<<<<<<<<< @@ -18395,7 +18635,7 @@ static struct __pyx_t_3_sa__BitSet *__pyx_f_3_sa_new_BitSet(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("new_BitSet", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":40 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":40 * cdef _BitSet* b * * b = <_BitSet*> malloc(sizeof(_BitSet)) # <<<<<<<<<<<<<< @@ -18404,7 +18644,7 @@ static struct __pyx_t_3_sa__BitSet *__pyx_f_3_sa_new_BitSet(void) { */ __pyx_v_b = ((struct __pyx_t_3_sa__BitSet *)malloc((sizeof(struct __pyx_t_3_sa__BitSet)))); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":41 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":41 * * b = <_BitSet*> malloc(sizeof(_BitSet)) * b.bitset = 0 # <<<<<<<<<<<<<< @@ -18413,7 +18653,7 @@ static struct __pyx_t_3_sa__BitSet *__pyx_f_3_sa_new_BitSet(void) { */ __pyx_v_b->bitset = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":42 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":42 * b = <_BitSet*> malloc(sizeof(_BitSet)) * b.bitset = 0 * b.min_val = -1 # <<<<<<<<<<<<<< @@ -18422,7 +18662,7 @@ static struct __pyx_t_3_sa__BitSet *__pyx_f_3_sa_new_BitSet(void) { */ __pyx_v_b->min_val = -1; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":43 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":43 * b.bitset = 0 * b.min_val = -1 * b.max_val = -1 # <<<<<<<<<<<<<< @@ -18431,7 +18671,7 @@ static struct __pyx_t_3_sa__BitSet *__pyx_f_3_sa_new_BitSet(void) { */ __pyx_v_b->max_val = -1; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":44 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":44 * b.min_val = -1 * b.max_val = -1 * b.size = 0 # <<<<<<<<<<<<<< @@ -18440,7 +18680,7 @@ static struct __pyx_t_3_sa__BitSet *__pyx_f_3_sa_new_BitSet(void) { */ __pyx_v_b->size = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":45 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":45 * b.max_val = -1 * b.size = 0 * return b # <<<<<<<<<<<<<< @@ -18456,7 +18696,7 @@ static struct __pyx_t_3_sa__BitSet *__pyx_f_3_sa_new_BitSet(void) { return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":48 +/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":48 * * * cdef int bitset_findsucc(_BitSet* b, int i): # <<<<<<<<<<<<<< @@ -18477,7 +18717,7 @@ static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *__pyx_v_b, int __pyx_t_3; __Pyx_RefNannySetupContext("bitset_findsucc", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":52 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":52 * cdef int low, high, mid * * if b.max_val == -1 or i >= b.max_val: # <<<<<<<<<<<<<< @@ -18493,7 +18733,7 @@ static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *__pyx_v_b, } if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":53 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":53 * * if b.max_val == -1 or i >= b.max_val: * return -1 # <<<<<<<<<<<<<< @@ -18506,7 +18746,7 @@ static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *__pyx_v_b, } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":54 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":54 * if b.max_val == -1 or i >= b.max_val: * return -1 * if i < b.min_val: # <<<<<<<<<<<<<< @@ -18516,7 +18756,7 @@ static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *__pyx_v_b, __pyx_t_3 = (__pyx_v_i < __pyx_v_b->min_val); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":55 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":55 * return -1 * if i < b.min_val: * return b.min_val # <<<<<<<<<<<<<< @@ -18529,7 +18769,7 @@ static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *__pyx_v_b, } __pyx_L4:; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":57 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":57 * return b.min_val * * bitset = b.bitset & ~LOWER_MASK[i] # <<<<<<<<<<<<<< @@ -18538,7 +18778,7 @@ static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *__pyx_v_b, */ __pyx_v_bitset = (__pyx_v_b->bitset & (~(__pyx_v_3_sa_LOWER_MASK[__pyx_v_i]))); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":58 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":58 * * bitset = b.bitset & ~LOWER_MASK[i] * low = i+1 # <<<<<<<<<<<<<< @@ -18547,7 +18787,7 @@ static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *__pyx_v_b, */ __pyx_v_low = (__pyx_v_i + 1); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":59 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":59 * bitset = b.bitset & ~LOWER_MASK[i] * low = i+1 * high = b.max_val+1 # <<<<<<<<<<<<<< @@ -18556,7 +18796,7 @@ static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *__pyx_v_b, */ __pyx_v_high = (__pyx_v_b->max_val + 1); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":60 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":60 * low = i+1 * high = b.max_val+1 * while low < high-1: # <<<<<<<<<<<<<< @@ -18567,7 +18807,7 @@ static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *__pyx_v_b, __pyx_t_3 = (__pyx_v_low < (__pyx_v_high - 1)); if (!__pyx_t_3) break; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":61 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":61 * high = b.max_val+1 * while low < high-1: * mid = (high + low)/2 # <<<<<<<<<<<<<< @@ -18576,7 +18816,7 @@ static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *__pyx_v_b, */ __pyx_v_mid = __Pyx_div_long((__pyx_v_high + __pyx_v_low), 2); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":62 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":62 * while low < high-1: * mid = (high + low)/2 * mask = ~(LOWER_MASK[high-1] ^ LOWER_MASK[mid-1]) # <<<<<<<<<<<<<< @@ -18585,7 +18825,7 @@ static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *__pyx_v_b, */ __pyx_v_mask = (~((__pyx_v_3_sa_LOWER_MASK[(__pyx_v_high - 1)]) ^ (__pyx_v_3_sa_LOWER_MASK[(__pyx_v_mid - 1)]))); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":63 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":63 * mid = (high + low)/2 * mask = ~(LOWER_MASK[high-1] ^ LOWER_MASK[mid-1]) * if bitset & mask == 0: # <<<<<<<<<<<<<< @@ -18595,7 +18835,7 @@ static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *__pyx_v_b, __pyx_t_3 = ((__pyx_v_bitset & __pyx_v_mask) == 0); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":64 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":64 * mask = ~(LOWER_MASK[high-1] ^ LOWER_MASK[mid-1]) * if bitset & mask == 0: * low = mid # <<<<<<<<<<<<<< @@ -18607,7 +18847,7 @@ static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *__pyx_v_b, } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":66 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":66 * low = mid * else: * bitset = bitset & mask # <<<<<<<<<<<<<< @@ -18616,7 +18856,7 @@ static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *__pyx_v_b, */ __pyx_v_bitset = (__pyx_v_bitset & __pyx_v_mask); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":67 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":67 * else: * bitset = bitset & mask * high = mid # <<<<<<<<<<<<<< @@ -18628,7 +18868,7 @@ static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *__pyx_v_b, __pyx_L7:; } - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":68 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":68 * bitset = bitset & mask * high = mid * return low # <<<<<<<<<<<<<< @@ -18644,7 +18884,7 @@ static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *__pyx_v_b, return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":71 +/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":71 * * * cdef int bitset_insert(_BitSet* b, int i): # <<<<<<<<<<<<<< @@ -18659,7 +18899,7 @@ static int __pyx_f_3_sa_bitset_insert(struct __pyx_t_3_sa__BitSet *__pyx_v_b, in int __pyx_t_1; __Pyx_RefNannySetupContext("bitset_insert", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":74 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":74 * cdef int val * * val = 1 << i # <<<<<<<<<<<<<< @@ -18668,7 +18908,7 @@ static int __pyx_f_3_sa_bitset_insert(struct __pyx_t_3_sa__BitSet *__pyx_v_b, in */ __pyx_v_val = (1 << __pyx_v_i); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":75 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":75 * * val = 1 << i * if b.bitset & val == 0: # <<<<<<<<<<<<<< @@ -18678,7 +18918,7 @@ static int __pyx_f_3_sa_bitset_insert(struct __pyx_t_3_sa__BitSet *__pyx_v_b, in __pyx_t_1 = ((__pyx_v_b->bitset & __pyx_v_val) == 0); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":76 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":76 * val = 1 << i * if b.bitset & val == 0: * b.bitset = b.bitset | val # <<<<<<<<<<<<<< @@ -18687,7 +18927,7 @@ static int __pyx_f_3_sa_bitset_insert(struct __pyx_t_3_sa__BitSet *__pyx_v_b, in */ __pyx_v_b->bitset = (__pyx_v_b->bitset | __pyx_v_val); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":77 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":77 * if b.bitset & val == 0: * b.bitset = b.bitset | val * if b.size == 0: # <<<<<<<<<<<<<< @@ -18697,7 +18937,7 @@ static int __pyx_f_3_sa_bitset_insert(struct __pyx_t_3_sa__BitSet *__pyx_v_b, in __pyx_t_1 = (__pyx_v_b->size == 0); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":78 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":78 * b.bitset = b.bitset | val * if b.size == 0: * b.min_val = i # <<<<<<<<<<<<<< @@ -18706,7 +18946,7 @@ static int __pyx_f_3_sa_bitset_insert(struct __pyx_t_3_sa__BitSet *__pyx_v_b, in */ __pyx_v_b->min_val = __pyx_v_i; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":79 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":79 * if b.size == 0: * b.min_val = i * b.max_val = i # <<<<<<<<<<<<<< @@ -18718,7 +18958,7 @@ static int __pyx_f_3_sa_bitset_insert(struct __pyx_t_3_sa__BitSet *__pyx_v_b, in } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":81 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":81 * b.max_val = i * else: * if i < b.min_val: # <<<<<<<<<<<<<< @@ -18728,7 +18968,7 @@ static int __pyx_f_3_sa_bitset_insert(struct __pyx_t_3_sa__BitSet *__pyx_v_b, in __pyx_t_1 = (__pyx_v_i < __pyx_v_b->min_val); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":82 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":82 * else: * if i < b.min_val: * b.min_val = i # <<<<<<<<<<<<<< @@ -18740,7 +18980,7 @@ static int __pyx_f_3_sa_bitset_insert(struct __pyx_t_3_sa__BitSet *__pyx_v_b, in } __pyx_L5:; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":83 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":83 * if i < b.min_val: * b.min_val = i * if i > b.max_val: # <<<<<<<<<<<<<< @@ -18750,7 +18990,7 @@ static int __pyx_f_3_sa_bitset_insert(struct __pyx_t_3_sa__BitSet *__pyx_v_b, in __pyx_t_1 = (__pyx_v_i > __pyx_v_b->max_val); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":84 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":84 * b.min_val = i * if i > b.max_val: * b.max_val = i # <<<<<<<<<<<<<< @@ -18764,7 +19004,7 @@ static int __pyx_f_3_sa_bitset_insert(struct __pyx_t_3_sa__BitSet *__pyx_v_b, in } __pyx_L4:; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":85 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":85 * if i > b.max_val: * b.max_val = i * b.size = b.size + 1 # <<<<<<<<<<<<<< @@ -18773,7 +19013,7 @@ static int __pyx_f_3_sa_bitset_insert(struct __pyx_t_3_sa__BitSet *__pyx_v_b, in */ __pyx_v_b->size = (__pyx_v_b->size + 1); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":86 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":86 * b.max_val = i * b.size = b.size + 1 * return 1 # <<<<<<<<<<<<<< @@ -18786,7 +19026,7 @@ static int __pyx_f_3_sa_bitset_insert(struct __pyx_t_3_sa__BitSet *__pyx_v_b, in } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":87 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":87 * b.size = b.size + 1 * return 1 * return 0 # <<<<<<<<<<<<<< @@ -18802,7 +19042,7 @@ static int __pyx_f_3_sa_bitset_insert(struct __pyx_t_3_sa__BitSet *__pyx_v_b, in return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":90 +/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":90 * * * cdef int bitset_contains(_BitSet* b, int i): # <<<<<<<<<<<<<< @@ -18817,7 +19057,7 @@ static int __pyx_f_3_sa_bitset_contains(struct __pyx_t_3_sa__BitSet *__pyx_v_b, int __pyx_t_1; __Pyx_RefNannySetupContext("bitset_contains", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":93 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":93 * cdef int val * * val = 1 << i # <<<<<<<<<<<<<< @@ -18826,7 +19066,7 @@ static int __pyx_f_3_sa_bitset_contains(struct __pyx_t_3_sa__BitSet *__pyx_v_b, */ __pyx_v_val = (1 << __pyx_v_i); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":94 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":94 * * val = 1 << i * if b.bitset & val == 0: # <<<<<<<<<<<<<< @@ -18836,7 +19076,7 @@ static int __pyx_f_3_sa_bitset_contains(struct __pyx_t_3_sa__BitSet *__pyx_v_b, __pyx_t_1 = ((__pyx_v_b->bitset & __pyx_v_val) == 0); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":95 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":95 * val = 1 << i * if b.bitset & val == 0: * return 0 # <<<<<<<<<<<<<< @@ -18849,7 +19089,7 @@ static int __pyx_f_3_sa_bitset_contains(struct __pyx_t_3_sa__BitSet *__pyx_v_b, } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":97 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":97 * return 0 * else: * return 1 # <<<<<<<<<<<<<< @@ -18878,7 +19118,7 @@ static PyObject *__pyx_pw_3_sa_14BitSetIterator_1__next__(PyObject *__pyx_v_self return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":104 +/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":104 * cdef int next_val * * def __next__(self): # <<<<<<<<<<<<<< @@ -18897,7 +19137,7 @@ static PyObject *__pyx_pf_3_sa_14BitSetIterator___next__(struct __pyx_obj_3_sa_B int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__next__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":107 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":107 * cdef int ret_val * * if self.next_val == -1: # <<<<<<<<<<<<<< @@ -18907,7 +19147,7 @@ static PyObject *__pyx_pf_3_sa_14BitSetIterator___next__(struct __pyx_obj_3_sa_B __pyx_t_1 = (__pyx_v_self->next_val == -1); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":108 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":108 * * if self.next_val == -1: * raise StopIteration() # <<<<<<<<<<<<<< @@ -18923,7 +19163,7 @@ static PyObject *__pyx_pf_3_sa_14BitSetIterator___next__(struct __pyx_obj_3_sa_B } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":109 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":109 * if self.next_val == -1: * raise StopIteration() * ret_val = self.next_val # <<<<<<<<<<<<<< @@ -18932,7 +19172,7 @@ static PyObject *__pyx_pf_3_sa_14BitSetIterator___next__(struct __pyx_obj_3_sa_B */ __pyx_v_ret_val = __pyx_v_self->next_val; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":110 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":110 * raise StopIteration() * ret_val = self.next_val * self.next_val = bitset_findsucc(self.b, ret_val) # <<<<<<<<<<<<<< @@ -18941,7 +19181,7 @@ static PyObject *__pyx_pf_3_sa_14BitSetIterator___next__(struct __pyx_obj_3_sa_B */ __pyx_v_self->next_val = __pyx_f_3_sa_bitset_findsucc(__pyx_v_self->b, __pyx_v_ret_val); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":111 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":111 * ret_val = self.next_val * self.next_val = bitset_findsucc(self.b, ret_val) * return ret_val # <<<<<<<<<<<<<< @@ -18981,7 +19221,7 @@ static int __pyx_pw_3_sa_6BitSet_1__cinit__(PyObject *__pyx_v_self, PyObject *__ return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":122 +/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":122 * cdef _BitSet* b * * def __cinit__(self): # <<<<<<<<<<<<<< @@ -18994,7 +19234,7 @@ static int __pyx_pf_3_sa_6BitSet___cinit__(struct __pyx_obj_3_sa_BitSet *__pyx_v __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":123 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":123 * * def __cinit__(self): * self.b = new_BitSet() # <<<<<<<<<<<<<< @@ -19017,7 +19257,7 @@ static void __pyx_pw_3_sa_6BitSet_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyFinishContext(); } -/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":125 +/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":125 * self.b = new_BitSet() * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -19029,7 +19269,7 @@ static void __pyx_pf_3_sa_6BitSet_2__dealloc__(struct __pyx_obj_3_sa_BitSet *__p __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":126 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":126 * * def __dealloc__(self): * free(self.b) # <<<<<<<<<<<<<< @@ -19052,7 +19292,7 @@ static PyObject *__pyx_pw_3_sa_6BitSet_5__iter__(PyObject *__pyx_v_self) { return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":128 +/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":128 * free(self.b) * * def __iter__(self): # <<<<<<<<<<<<<< @@ -19070,7 +19310,7 @@ static PyObject *__pyx_pf_3_sa_6BitSet_4__iter__(struct __pyx_obj_3_sa_BitSet *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__iter__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":130 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":130 * def __iter__(self): * cdef BitSetIterator it * it = BitSetIterator() # <<<<<<<<<<<<<< @@ -19082,7 +19322,7 @@ static PyObject *__pyx_pf_3_sa_6BitSet_4__iter__(struct __pyx_obj_3_sa_BitSet *_ __pyx_v_it = ((struct __pyx_obj_3_sa_BitSetIterator *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":131 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":131 * cdef BitSetIterator it * it = BitSetIterator() * it.b = self.b # <<<<<<<<<<<<<< @@ -19091,7 +19331,7 @@ static PyObject *__pyx_pf_3_sa_6BitSet_4__iter__(struct __pyx_obj_3_sa_BitSet *_ */ __pyx_v_it->b = __pyx_v_self->b; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":132 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":132 * it = BitSetIterator() * it.b = self.b * it.next_val = self.b.min_val # <<<<<<<<<<<<<< @@ -19100,7 +19340,7 @@ static PyObject *__pyx_pf_3_sa_6BitSet_4__iter__(struct __pyx_obj_3_sa_BitSet *_ */ __pyx_v_it->next_val = __pyx_v_self->b->min_val; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":133 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":133 * it.b = self.b * it.next_val = self.b.min_val * return it # <<<<<<<<<<<<<< @@ -19136,7 +19376,7 @@ static PyObject *__pyx_pw_3_sa_6BitSet_7insert(PyObject *__pyx_v_self, PyObject return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":135 +/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":135 * return it * * def insert(self, i): # <<<<<<<<<<<<<< @@ -19154,7 +19394,7 @@ static PyObject *__pyx_pf_3_sa_6BitSet_6insert(struct __pyx_obj_3_sa_BitSet *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("insert", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":136 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":136 * * def insert(self, i): * return bitset_insert(self.b, i) # <<<<<<<<<<<<<< @@ -19192,7 +19432,7 @@ static PyObject *__pyx_pw_3_sa_6BitSet_9findsucc(PyObject *__pyx_v_self, PyObjec return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":138 +/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":138 * return bitset_insert(self.b, i) * * def findsucc(self, i): # <<<<<<<<<<<<<< @@ -19210,7 +19450,7 @@ static PyObject *__pyx_pf_3_sa_6BitSet_8findsucc(struct __pyx_obj_3_sa_BitSet *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("findsucc", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":139 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":139 * * def findsucc(self, i): * return bitset_findsucc(self.b, i) # <<<<<<<<<<<<<< @@ -19248,7 +19488,7 @@ static PyObject *__pyx_pw_3_sa_6BitSet_11__str__(PyObject *__pyx_v_self) { return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":141 +/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":141 * return bitset_findsucc(self.b, i) * * def __str__(self): # <<<<<<<<<<<<<< @@ -19267,7 +19507,7 @@ static PyObject *__pyx_pf_3_sa_6BitSet_10__str__(struct __pyx_obj_3_sa_BitSet *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__str__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":142 + /* "/home/pauldb/workspace/cdec/python/src/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)+")" # <<<<<<<<<<<<<< @@ -19360,7 +19600,7 @@ static PyObject *__pyx_pw_3_sa_6BitSet_13min(PyObject *__pyx_v_self, CYTHON_UNUS return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":144 +/* "/home/pauldb/workspace/cdec/python/src/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): # <<<<<<<<<<<<<< @@ -19377,7 +19617,7 @@ static PyObject *__pyx_pf_3_sa_6BitSet_12min(struct __pyx_obj_3_sa_BitSet *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("min", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":145 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":145 * * def min(self): * return self.b.min_val # <<<<<<<<<<<<<< @@ -19414,7 +19654,7 @@ static PyObject *__pyx_pw_3_sa_6BitSet_15max(PyObject *__pyx_v_self, CYTHON_UNUS return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":147 +/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":147 * return self.b.min_val * * def max(self): # <<<<<<<<<<<<<< @@ -19431,7 +19671,7 @@ static PyObject *__pyx_pf_3_sa_6BitSet_14max(struct __pyx_obj_3_sa_BitSet *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("max", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":148 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":148 * * def max(self): * return self.b.max_val # <<<<<<<<<<<<<< @@ -19468,7 +19708,7 @@ static Py_ssize_t __pyx_pw_3_sa_6BitSet_17__len__(PyObject *__pyx_v_self) { return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":150 +/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":150 * return self.b.max_val * * def __len__(self): # <<<<<<<<<<<<<< @@ -19481,7 +19721,7 @@ static Py_ssize_t __pyx_pf_3_sa_6BitSet_16__len__(struct __pyx_obj_3_sa_BitSet * __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":151 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":151 * * def __len__(self): * return self.b.size # <<<<<<<<<<<<<< @@ -19508,7 +19748,7 @@ static int __pyx_pw_3_sa_6BitSet_19__contains__(PyObject *__pyx_v_self, PyObject return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":153 +/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":153 * return self.b.size * * def __contains__(self, i): # <<<<<<<<<<<<<< @@ -19527,7 +19767,7 @@ static int __pyx_pf_3_sa_6BitSet_18__contains__(struct __pyx_obj_3_sa_BitSet *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__contains__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":154 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":154 * * def __contains__(self, i): * return bool(bitset_contains(self.b, i)) # <<<<<<<<<<<<<< @@ -19553,7 +19793,7 @@ static int __pyx_pf_3_sa_6BitSet_18__contains__(struct __pyx_obj_3_sa_BitSet *__ return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":157 +/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":157 * * * cdef str dec2bin(long i): # <<<<<<<<<<<<<< @@ -19575,7 +19815,7 @@ static PyObject *__pyx_f_3_sa_dec2bin(long __pyx_v_i) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("dec2bin", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":158 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":158 * * cdef str dec2bin(long i): * cdef str result = "" # <<<<<<<<<<<<<< @@ -19585,7 +19825,7 @@ static PyObject *__pyx_f_3_sa_dec2bin(long __pyx_v_i) { __Pyx_INCREF(((PyObject *)__pyx_kp_s_45)); __pyx_v_result = __pyx_kp_s_45; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":160 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":160 * cdef str result = "" * cdef unsigned d * for d in range(MIN_BOTTOM_SIZE): # <<<<<<<<<<<<<< @@ -19596,7 +19836,7 @@ static PyObject *__pyx_f_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/paulb/workspace/cdec/python/src/sa/veb.pxi":161 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":161 * cdef unsigned d * for d in range(MIN_BOTTOM_SIZE): * if i & LOWER_MASK[0] == 0: # <<<<<<<<<<<<<< @@ -19606,7 +19846,7 @@ static PyObject *__pyx_f_3_sa_dec2bin(long __pyx_v_i) { __pyx_t_3 = ((__pyx_v_i & (__pyx_v_3_sa_LOWER_MASK[0])) == 0); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":162 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":162 * for d in range(MIN_BOTTOM_SIZE): * if i & LOWER_MASK[0] == 0: * result = "0"+result # <<<<<<<<<<<<<< @@ -19622,7 +19862,7 @@ static PyObject *__pyx_f_3_sa_dec2bin(long __pyx_v_i) { } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":164 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":164 * result = "0"+result * else: * result = "1"+result # <<<<<<<<<<<<<< @@ -19637,7 +19877,7 @@ static PyObject *__pyx_f_3_sa_dec2bin(long __pyx_v_i) { } __pyx_L5:; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":165 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":165 * else: * result = "1"+result * i = i >> 1 # <<<<<<<<<<<<<< @@ -19647,7 +19887,7 @@ static PyObject *__pyx_f_3_sa_dec2bin(long __pyx_v_i) { __pyx_v_i = (__pyx_v_i >> 1); } - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":166 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":166 * result = "1"+result * i = i >> 1 * return result # <<<<<<<<<<<<<< @@ -19672,7 +19912,7 @@ static PyObject *__pyx_f_3_sa_dec2bin(long __pyx_v_i) { return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":177 +/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":177 * void** bottom * * cdef _VEB* new_VEB(int n): # <<<<<<<<<<<<<< @@ -19693,7 +19933,7 @@ static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int __pyx_v_n) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("new_VEB", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":181 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":181 * cdef int num_bits, num_top_bits, i * * veb = <_VEB*> malloc(sizeof(_VEB)) # <<<<<<<<<<<<<< @@ -19702,7 +19942,7 @@ static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int __pyx_v_n) { */ __pyx_v_veb = ((struct __pyx_t_3_sa__VEB *)malloc((sizeof(struct __pyx_t_3_sa__VEB)))); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":183 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":183 * veb = <_VEB*> malloc(sizeof(_VEB)) * * num_bits = int(ceil(log(n) / log(2))) # <<<<<<<<<<<<<< @@ -19717,7 +19957,7 @@ static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int __pyx_v_n) { } __pyx_v_num_bits = ((int)ceil((__pyx_t_1 / __pyx_t_2))); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":184 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":184 * * num_bits = int(ceil(log(n) / log(2))) * veb.num_bottom_bits = num_bits/2 # <<<<<<<<<<<<<< @@ -19726,7 +19966,7 @@ static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int __pyx_v_n) { */ __pyx_v_veb->num_bottom_bits = __Pyx_div_long(__pyx_v_num_bits, 2); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":185 + /* "/home/pauldb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -19736,7 +19976,7 @@ static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int __pyx_v_n) { __pyx_t_3 = (__pyx_v_veb->num_bottom_bits < __pyx_v_3_sa_MIN_BOTTOM_BITS); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":186 + /* "/home/pauldb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -19748,7 +19988,7 @@ static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int __pyx_v_n) { } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":187 + /* "/home/pauldb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -19757,7 +19997,7 @@ static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int __pyx_v_n) { */ __pyx_v_veb->top_universe_size = ((__pyx_v_n >> __pyx_v_veb->num_bottom_bits) + 1); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":189 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":189 * veb.top_universe_size = (n >> veb.num_bottom_bits) + 1 * * veb.bottom = malloc(veb.top_universe_size * sizeof(void*)) # <<<<<<<<<<<<<< @@ -19766,7 +20006,7 @@ static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int __pyx_v_n) { */ __pyx_v_veb->bottom = ((void **)malloc((__pyx_v_veb->top_universe_size * (sizeof(void *))))); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":190 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":190 * * veb.bottom = malloc(veb.top_universe_size * sizeof(void*)) * memset(veb.bottom, 0, veb.top_universe_size * sizeof(void*)) # <<<<<<<<<<<<<< @@ -19775,7 +20015,7 @@ static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int __pyx_v_n) { */ memset(__pyx_v_veb->bottom, 0, (__pyx_v_veb->top_universe_size * (sizeof(void *)))); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":192 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":192 * memset(veb.bottom, 0, veb.top_universe_size * sizeof(void*)) * * if veb.top_universe_size > MIN_BOTTOM_SIZE: # <<<<<<<<<<<<<< @@ -19785,7 +20025,7 @@ static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int __pyx_v_n) { __pyx_t_3 = (__pyx_v_veb->top_universe_size > __pyx_v_3_sa_MIN_BOTTOM_SIZE); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":193 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":193 * * if veb.top_universe_size > MIN_BOTTOM_SIZE: * veb.top = new_VEB(veb.top_universe_size) # <<<<<<<<<<<<<< @@ -19797,7 +20037,7 @@ static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int __pyx_v_n) { } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":195 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":195 * veb.top = new_VEB(veb.top_universe_size) * else: * veb.top = new_BitSet() # <<<<<<<<<<<<<< @@ -19808,7 +20048,7 @@ static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int __pyx_v_n) { } __pyx_L4:; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":197 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":197 * veb.top = new_BitSet() * * veb.max_val = -1 # <<<<<<<<<<<<<< @@ -19817,7 +20057,7 @@ static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int __pyx_v_n) { */ __pyx_v_veb->max_val = -1; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":198 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":198 * * veb.max_val = -1 * veb.min_val = -1 # <<<<<<<<<<<<<< @@ -19826,7 +20066,7 @@ static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int __pyx_v_n) { */ __pyx_v_veb->min_val = -1; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":199 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":199 * veb.max_val = -1 * veb.min_val = -1 * veb.size = 0 # <<<<<<<<<<<<<< @@ -19835,7 +20075,7 @@ static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int __pyx_v_n) { */ __pyx_v_veb->size = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":200 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":200 * veb.min_val = -1 * veb.size = 0 * return veb # <<<<<<<<<<<<<< @@ -19855,7 +20095,7 @@ static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int __pyx_v_n) { return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":203 +/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":203 * * * cdef int VEB_insert(_VEB* veb, int i): # <<<<<<<<<<<<<< @@ -19876,7 +20116,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ int __pyx_t_3; __Pyx_RefNannySetupContext("VEB_insert", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":208 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":208 * cdef int a, b, tmp * * if veb.size == 0: # <<<<<<<<<<<<<< @@ -19886,7 +20126,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ __pyx_t_1 = (__pyx_v_veb->size == 0); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":209 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":209 * * if veb.size == 0: * veb.min_val = i # <<<<<<<<<<<<<< @@ -19895,7 +20135,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ */ __pyx_v_veb->min_val = __pyx_v_i; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":210 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":210 * if veb.size == 0: * veb.min_val = i * veb.max_val = i # <<<<<<<<<<<<<< @@ -19906,7 +20146,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ goto __pyx_L3; } - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":211 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":211 * veb.min_val = i * veb.max_val = i * elif i == veb.min_val or i == veb.max_val: # <<<<<<<<<<<<<< @@ -19922,7 +20162,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ } if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":212 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":212 * veb.max_val = i * elif i == veb.min_val or i == veb.max_val: * return 0 # <<<<<<<<<<<<<< @@ -19935,7 +20175,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":214 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":214 * return 0 * else: * if i < veb.min_val: # <<<<<<<<<<<<<< @@ -19945,7 +20185,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ __pyx_t_3 = (__pyx_v_i < __pyx_v_veb->min_val); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":215 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":215 * else: * if i < veb.min_val: * tmp = i # <<<<<<<<<<<<<< @@ -19954,7 +20194,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ */ __pyx_v_tmp = __pyx_v_i; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":216 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":216 * if i < veb.min_val: * tmp = i * i = veb.min_val # <<<<<<<<<<<<<< @@ -19963,7 +20203,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ */ __pyx_v_i = __pyx_v_veb->min_val; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":217 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":217 * tmp = i * i = veb.min_val * veb.min_val = tmp # <<<<<<<<<<<<<< @@ -19975,7 +20215,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ } __pyx_L4:; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":218 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":218 * i = veb.min_val * veb.min_val = tmp * a = i >> veb.num_bottom_bits # <<<<<<<<<<<<<< @@ -19984,7 +20224,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ */ __pyx_v_a = (__pyx_v_i >> __pyx_v_veb->num_bottom_bits); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":219 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":219 * veb.min_val = tmp * a = i >> veb.num_bottom_bits * b = i & LOWER_MASK[veb.num_bottom_bits-1] # <<<<<<<<<<<<<< @@ -19993,7 +20233,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ */ __pyx_v_b = (__pyx_v_i & (__pyx_v_3_sa_LOWER_MASK[(__pyx_v_veb->num_bottom_bits - 1)])); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":220 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":220 * a = i >> veb.num_bottom_bits * b = i & LOWER_MASK[veb.num_bottom_bits-1] * if veb.bottom[a] == NULL: # <<<<<<<<<<<<<< @@ -20003,7 +20243,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ __pyx_t_3 = ((__pyx_v_veb->bottom[__pyx_v_a]) == NULL); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":221 + /* "/home/pauldb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -20013,7 +20253,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ __pyx_t_3 = (__pyx_v_veb->top_universe_size > __pyx_v_3_sa_MIN_BOTTOM_SIZE); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":222 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":222 * if veb.bottom[a] == NULL: * if veb.top_universe_size > MIN_BOTTOM_SIZE: * subv = <_VEB*> veb.top # <<<<<<<<<<<<<< @@ -20022,7 +20262,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ */ __pyx_v_subv = ((struct __pyx_t_3_sa__VEB *)__pyx_v_veb->top); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":223 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":223 * if veb.top_universe_size > MIN_BOTTOM_SIZE: * subv = <_VEB*> veb.top * VEB_insert(subv, a) # <<<<<<<<<<<<<< @@ -20034,7 +20274,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":225 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":225 * VEB_insert(subv, a) * else: * subb = <_BitSet*> veb.top # <<<<<<<<<<<<<< @@ -20043,7 +20283,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ */ __pyx_v_subb = ((struct __pyx_t_3_sa__BitSet *)__pyx_v_veb->top); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":226 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":226 * else: * subb = <_BitSet*> veb.top * bitset_insert(subb, a) # <<<<<<<<<<<<<< @@ -20054,7 +20294,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ } __pyx_L6:; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":227 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":227 * subb = <_BitSet*> veb.top * bitset_insert(subb, a) * if veb.num_bottom_bits > MIN_BOTTOM_BITS: # <<<<<<<<<<<<<< @@ -20064,7 +20304,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ __pyx_t_3 = (__pyx_v_veb->num_bottom_bits > __pyx_v_3_sa_MIN_BOTTOM_BITS); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":228 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -20076,7 +20316,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":230 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":230 * veb.bottom[a] = new_VEB(1 << veb.num_bottom_bits) * else: * veb.bottom[a] = new_BitSet() # <<<<<<<<<<<<<< @@ -20090,7 +20330,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ } __pyx_L5:; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":231 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":231 * else: * veb.bottom[a] = new_BitSet() * if veb.num_bottom_bits > MIN_BOTTOM_BITS: # <<<<<<<<<<<<<< @@ -20100,7 +20340,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ __pyx_t_3 = (__pyx_v_veb->num_bottom_bits > __pyx_v_3_sa_MIN_BOTTOM_BITS); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":232 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":232 * veb.bottom[a] = new_BitSet() * if veb.num_bottom_bits > MIN_BOTTOM_BITS: * subv = <_VEB*> veb.bottom[a] # <<<<<<<<<<<<<< @@ -20109,7 +20349,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ */ __pyx_v_subv = ((struct __pyx_t_3_sa__VEB *)(__pyx_v_veb->bottom[__pyx_v_a])); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":233 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":233 * if veb.num_bottom_bits > MIN_BOTTOM_BITS: * subv = <_VEB*> veb.bottom[a] * if VEB_insert(subv, b) == 0: # <<<<<<<<<<<<<< @@ -20119,7 +20359,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ __pyx_t_3 = (__pyx_f_3_sa_VEB_insert(__pyx_v_subv, __pyx_v_b) == 0); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":234 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":234 * subv = <_VEB*> veb.bottom[a] * if VEB_insert(subv, b) == 0: * return 0 # <<<<<<<<<<<<<< @@ -20135,7 +20375,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":236 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":236 * return 0 * else: * subb = <_BitSet*> veb.bottom[a] # <<<<<<<<<<<<<< @@ -20144,7 +20384,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ */ __pyx_v_subb = ((struct __pyx_t_3_sa__BitSet *)(__pyx_v_veb->bottom[__pyx_v_a])); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":237 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":237 * else: * subb = <_BitSet*> veb.bottom[a] * if bitset_insert(subb, b) == 0: # <<<<<<<<<<<<<< @@ -20154,7 +20394,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ __pyx_t_3 = (__pyx_f_3_sa_bitset_insert(__pyx_v_subb, __pyx_v_b) == 0); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":238 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":238 * subb = <_BitSet*> veb.bottom[a] * if bitset_insert(subb, b) == 0: * return 0 # <<<<<<<<<<<<<< @@ -20169,7 +20409,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ } __pyx_L8:; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":240 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":240 * return 0 * * if i > veb.max_val: # <<<<<<<<<<<<<< @@ -20179,7 +20419,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ __pyx_t_3 = (__pyx_v_i > __pyx_v_veb->max_val); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":241 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":241 * * if i > veb.max_val: * veb.max_val = i # <<<<<<<<<<<<<< @@ -20193,7 +20433,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":242 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":242 * if i > veb.max_val: * veb.max_val = i * veb.size = veb.size + 1 # <<<<<<<<<<<<<< @@ -20202,7 +20442,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ */ __pyx_v_veb->size = (__pyx_v_veb->size + 1); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":243 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":243 * veb.max_val = i * veb.size = veb.size + 1 * return 1 # <<<<<<<<<<<<<< @@ -20218,7 +20458,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __ return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":246 +/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":246 * * * cdef del_VEB(_VEB* veb): # <<<<<<<<<<<<<< @@ -20237,7 +20477,7 @@ static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *__pyx_v_veb) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("del_VEB", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":249 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":249 * cdef int i * * if veb.top_universe_size > MIN_BOTTOM_SIZE: # <<<<<<<<<<<<<< @@ -20247,7 +20487,7 @@ static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *__pyx_v_veb) { __pyx_t_1 = (__pyx_v_veb->top_universe_size > __pyx_v_3_sa_MIN_BOTTOM_SIZE); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":250 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":250 * * if veb.top_universe_size > MIN_BOTTOM_SIZE: * i = (<_VEB*> veb.top).min_val # <<<<<<<<<<<<<< @@ -20259,7 +20499,7 @@ static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *__pyx_v_veb) { } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":252 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":252 * i = (<_VEB*> veb.top).min_val * else: * i = (<_BitSet*> veb.top).min_val # <<<<<<<<<<<<<< @@ -20270,7 +20510,7 @@ static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *__pyx_v_veb) { } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":254 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":254 * i = (<_BitSet*> veb.top).min_val * * while i != -1: # <<<<<<<<<<<<<< @@ -20281,7 +20521,7 @@ static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *__pyx_v_veb) { __pyx_t_1 = (__pyx_v_i != -1); if (!__pyx_t_1) break; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":255 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":255 * * while i != -1: * if veb.num_bottom_bits > MIN_BOTTOM_BITS: # <<<<<<<<<<<<<< @@ -20291,7 +20531,7 @@ static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *__pyx_v_veb) { __pyx_t_1 = (__pyx_v_veb->num_bottom_bits > __pyx_v_3_sa_MIN_BOTTOM_BITS); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":256 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":256 * while i != -1: * if veb.num_bottom_bits > MIN_BOTTOM_BITS: * del_VEB(<_VEB*> veb.bottom[i]) # <<<<<<<<<<<<<< @@ -20305,7 +20545,7 @@ static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *__pyx_v_veb) { } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":258 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":258 * del_VEB(<_VEB*> veb.bottom[i]) * else: * free(<_BitSet*> veb.bottom[i]) # <<<<<<<<<<<<<< @@ -20316,7 +20556,7 @@ static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *__pyx_v_veb) { } __pyx_L6:; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":260 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":260 * free(<_BitSet*> veb.bottom[i]) * * if veb.top_universe_size > MIN_BOTTOM_SIZE: # <<<<<<<<<<<<<< @@ -20326,7 +20566,7 @@ static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *__pyx_v_veb) { __pyx_t_1 = (__pyx_v_veb->top_universe_size > __pyx_v_3_sa_MIN_BOTTOM_SIZE); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":261 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":261 * * if veb.top_universe_size > MIN_BOTTOM_SIZE: * i = VEB_findsucc(<_VEB*> veb.top, i) # <<<<<<<<<<<<<< @@ -20338,7 +20578,7 @@ static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *__pyx_v_veb) { } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":263 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":263 * i = VEB_findsucc(<_VEB*> veb.top, i) * else: * i = bitset_findsucc(<_BitSet*> veb.top, i) # <<<<<<<<<<<<<< @@ -20350,7 +20590,7 @@ static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *__pyx_v_veb) { __pyx_L7:; } - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":265 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":265 * i = bitset_findsucc(<_BitSet*> veb.top, i) * * if veb.top_universe_size > MIN_BOTTOM_SIZE: # <<<<<<<<<<<<<< @@ -20360,7 +20600,7 @@ static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *__pyx_v_veb) { __pyx_t_1 = (__pyx_v_veb->top_universe_size > __pyx_v_3_sa_MIN_BOTTOM_SIZE); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":266 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":266 * * if veb.top_universe_size > MIN_BOTTOM_SIZE: * del_VEB(<_VEB*> veb.top) # <<<<<<<<<<<<<< @@ -20374,7 +20614,7 @@ static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *__pyx_v_veb) { } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":268 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":268 * del_VEB(<_VEB*> veb.top) * else: * free(<_BitSet*> veb.top) # <<<<<<<<<<<<<< @@ -20385,7 +20625,7 @@ static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *__pyx_v_veb) { } __pyx_L8:; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":269 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":269 * else: * free(<_BitSet*> veb.top) * free(veb.bottom) # <<<<<<<<<<<<<< @@ -20394,7 +20634,7 @@ static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *__pyx_v_veb) { */ free(__pyx_v_veb->bottom); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":270 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":270 * free(<_BitSet*> veb.top) * free(veb.bottom) * free(veb) # <<<<<<<<<<<<<< @@ -20415,7 +20655,7 @@ static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *__pyx_v_veb) { return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":273 +/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":273 * * * cdef int VEB_findsucc(_VEB* veb, int i): # <<<<<<<<<<<<<< @@ -20438,7 +20678,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int int __pyx_t_3; __Pyx_RefNannySetupContext("VEB_findsucc", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":278 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":278 * cdef int a, b, j, c, found * * if veb.max_val == -1 or i>=veb.max_val: # <<<<<<<<<<<<<< @@ -20454,7 +20694,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int } if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":279 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":279 * * if veb.max_val == -1 or i>=veb.max_val: * return -1 # <<<<<<<<<<<<<< @@ -20467,7 +20707,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":280 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":280 * if veb.max_val == -1 or i>=veb.max_val: * return -1 * if i < veb.min_val: # <<<<<<<<<<<<<< @@ -20477,7 +20717,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __pyx_t_3 = (__pyx_v_i < __pyx_v_veb->min_val); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":281 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":281 * return -1 * if i < veb.min_val: * return veb.min_val # <<<<<<<<<<<<<< @@ -20490,7 +20730,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int } __pyx_L4:; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":283 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":283 * return veb.min_val * * a = i >> veb.num_bottom_bits # <<<<<<<<<<<<<< @@ -20499,7 +20739,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int */ __pyx_v_a = (__pyx_v_i >> __pyx_v_veb->num_bottom_bits); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":284 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":284 * * a = i >> veb.num_bottom_bits * b = i & LOWER_MASK[veb.num_bottom_bits-1] # <<<<<<<<<<<<<< @@ -20508,7 +20748,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int */ __pyx_v_b = (__pyx_v_i & (__pyx_v_3_sa_LOWER_MASK[(__pyx_v_veb->num_bottom_bits - 1)])); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":285 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":285 * a = i >> veb.num_bottom_bits * b = i & LOWER_MASK[veb.num_bottom_bits-1] * found = 0 # <<<<<<<<<<<<<< @@ -20517,7 +20757,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int */ __pyx_v_found = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":286 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":286 * b = i & LOWER_MASK[veb.num_bottom_bits-1] * found = 0 * if veb.bottom[a] != NULL: # <<<<<<<<<<<<<< @@ -20527,7 +20767,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __pyx_t_3 = ((__pyx_v_veb->bottom[__pyx_v_a]) != NULL); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":287 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":287 * found = 0 * if veb.bottom[a] != NULL: * if veb.num_bottom_bits > MIN_BOTTOM_BITS: # <<<<<<<<<<<<<< @@ -20537,7 +20777,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __pyx_t_3 = (__pyx_v_veb->num_bottom_bits > __pyx_v_3_sa_MIN_BOTTOM_BITS); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":288 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":288 * if veb.bottom[a] != NULL: * if veb.num_bottom_bits > MIN_BOTTOM_BITS: * subv = <_VEB*> veb.bottom[a] # <<<<<<<<<<<<<< @@ -20546,7 +20786,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int */ __pyx_v_subv = ((struct __pyx_t_3_sa__VEB *)(__pyx_v_veb->bottom[__pyx_v_a])); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":289 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":289 * if veb.num_bottom_bits > MIN_BOTTOM_BITS: * subv = <_VEB*> veb.bottom[a] * if subv.max_val > b: # <<<<<<<<<<<<<< @@ -20556,7 +20796,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __pyx_t_3 = (__pyx_v_subv->max_val > __pyx_v_b); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":290 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":290 * subv = <_VEB*> veb.bottom[a] * if subv.max_val > b: * j = (a << veb.num_bottom_bits) + VEB_findsucc(subv, b) # <<<<<<<<<<<<<< @@ -20565,7 +20805,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int */ __pyx_v_j = ((__pyx_v_a << __pyx_v_veb->num_bottom_bits) + __pyx_f_3_sa_VEB_findsucc(__pyx_v_subv, __pyx_v_b)); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":291 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":291 * if subv.max_val > b: * j = (a << veb.num_bottom_bits) + VEB_findsucc(subv, b) * found = 1 # <<<<<<<<<<<<<< @@ -20580,7 +20820,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":293 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":293 * found = 1 * else: * subb = <_BitSet*> veb.bottom[a] # <<<<<<<<<<<<<< @@ -20589,7 +20829,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int */ __pyx_v_subb = ((struct __pyx_t_3_sa__BitSet *)(__pyx_v_veb->bottom[__pyx_v_a])); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":294 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":294 * else: * subb = <_BitSet*> veb.bottom[a] * if subb.max_val > b: # <<<<<<<<<<<<<< @@ -20599,7 +20839,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __pyx_t_3 = (__pyx_v_subb->max_val > __pyx_v_b); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":295 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":295 * subb = <_BitSet*> veb.bottom[a] * if subb.max_val > b: * j = (a << veb.num_bottom_bits) + bitset_findsucc(subb, b) # <<<<<<<<<<<<<< @@ -20608,7 +20848,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int */ __pyx_v_j = ((__pyx_v_a << __pyx_v_veb->num_bottom_bits) + __pyx_f_3_sa_bitset_findsucc(__pyx_v_subb, __pyx_v_b)); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":296 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":296 * if subb.max_val > b: * j = (a << veb.num_bottom_bits) + bitset_findsucc(subb, b) * found = 1 # <<<<<<<<<<<<<< @@ -20625,7 +20865,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int } __pyx_L5:; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":297 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":297 * j = (a << veb.num_bottom_bits) + bitset_findsucc(subb, b) * found = 1 * if found==0: # <<<<<<<<<<<<<< @@ -20635,7 +20875,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __pyx_t_3 = (__pyx_v_found == 0); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":298 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":298 * found = 1 * if found==0: * if veb.top_universe_size > MIN_BOTTOM_SIZE: # <<<<<<<<<<<<<< @@ -20645,7 +20885,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __pyx_t_3 = (__pyx_v_veb->top_universe_size > __pyx_v_3_sa_MIN_BOTTOM_SIZE); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":299 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":299 * if found==0: * if veb.top_universe_size > MIN_BOTTOM_SIZE: * subv = <_VEB*> veb.top # <<<<<<<<<<<<<< @@ -20654,7 +20894,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int */ __pyx_v_subv = ((struct __pyx_t_3_sa__VEB *)__pyx_v_veb->top); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":300 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":300 * if veb.top_universe_size > MIN_BOTTOM_SIZE: * subv = <_VEB*> veb.top * c = VEB_findsucc(subv, a) # <<<<<<<<<<<<<< @@ -20666,7 +20906,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":302 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":302 * c = VEB_findsucc(subv, a) * else: * subb = <_BitSet*> veb.top # <<<<<<<<<<<<<< @@ -20675,7 +20915,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int */ __pyx_v_subb = ((struct __pyx_t_3_sa__BitSet *)__pyx_v_veb->top); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":303 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":303 * else: * subb = <_BitSet*> veb.top * c = bitset_findsucc(subb, a) # <<<<<<<<<<<<<< @@ -20686,7 +20926,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int } __pyx_L10:; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":304 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":304 * subb = <_BitSet*> veb.top * c = bitset_findsucc(subb, a) * if veb.num_bottom_bits > MIN_BOTTOM_BITS: # <<<<<<<<<<<<<< @@ -20696,7 +20936,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __pyx_t_3 = (__pyx_v_veb->num_bottom_bits > __pyx_v_3_sa_MIN_BOTTOM_BITS); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":305 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":305 * c = bitset_findsucc(subb, a) * if veb.num_bottom_bits > MIN_BOTTOM_BITS: * subv = <_VEB*> veb.bottom[c] # <<<<<<<<<<<<<< @@ -20705,7 +20945,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int */ __pyx_v_subv = ((struct __pyx_t_3_sa__VEB *)(__pyx_v_veb->bottom[__pyx_v_c])); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":306 + /* "/home/pauldb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -20717,7 +20957,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":308 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":308 * j = (c << veb.num_bottom_bits) + subv.min_val * else: * subb = <_BitSet*> veb.bottom[c] # <<<<<<<<<<<<<< @@ -20726,7 +20966,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int */ __pyx_v_subb = ((struct __pyx_t_3_sa__BitSet *)(__pyx_v_veb->bottom[__pyx_v_c])); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":309 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":309 * else: * subb = <_BitSet*> veb.bottom[c] * j = (c << veb.num_bottom_bits) + subb.min_val # <<<<<<<<<<<<<< @@ -20740,7 +20980,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int } __pyx_L9:; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":310 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":310 * subb = <_BitSet*> veb.bottom[c] * j = (c << veb.num_bottom_bits) + subb.min_val * return j # <<<<<<<<<<<<<< @@ -20756,7 +20996,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":313 +/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":313 * * * cdef int VEB_contains(_VEB* veb, int i): # <<<<<<<<<<<<<< @@ -20777,7 +21017,7 @@ static int __pyx_f_3_sa_VEB_contains(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int int __pyx_t_4; __Pyx_RefNannySetupContext("VEB_contains", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":318 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":318 * cdef int a, b * * if veb.size == 0 or i < veb.min_val or i > veb.max_val: # <<<<<<<<<<<<<< @@ -20799,7 +21039,7 @@ static int __pyx_f_3_sa_VEB_contains(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int } if (__pyx_t_2) { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":319 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":319 * * if veb.size == 0 or i < veb.min_val or i > veb.max_val: * return 0 # <<<<<<<<<<<<<< @@ -20812,7 +21052,7 @@ static int __pyx_f_3_sa_VEB_contains(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":321 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":321 * return 0 * * if veb.min_val == i: # <<<<<<<<<<<<<< @@ -20822,7 +21062,7 @@ static int __pyx_f_3_sa_VEB_contains(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __pyx_t_2 = (__pyx_v_veb->min_val == __pyx_v_i); if (__pyx_t_2) { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":322 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":322 * * if veb.min_val == i: * return 1 # <<<<<<<<<<<<<< @@ -20835,7 +21075,7 @@ static int __pyx_f_3_sa_VEB_contains(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":324 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":324 * return 1 * else: * if veb.size == 1: # <<<<<<<<<<<<<< @@ -20845,7 +21085,7 @@ static int __pyx_f_3_sa_VEB_contains(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __pyx_t_2 = (__pyx_v_veb->size == 1); if (__pyx_t_2) { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":325 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":325 * else: * if veb.size == 1: * return 0 # <<<<<<<<<<<<<< @@ -20860,7 +21100,7 @@ static int __pyx_f_3_sa_VEB_contains(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int } __pyx_L4:; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":327 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":327 * return 0 * * a = i >> veb.num_bottom_bits # <<<<<<<<<<<<<< @@ -20869,7 +21109,7 @@ static int __pyx_f_3_sa_VEB_contains(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int */ __pyx_v_a = (__pyx_v_i >> __pyx_v_veb->num_bottom_bits); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":328 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":328 * * a = i >> veb.num_bottom_bits * b = i & LOWER_MASK[veb.num_bottom_bits-1] # <<<<<<<<<<<<<< @@ -20878,7 +21118,7 @@ static int __pyx_f_3_sa_VEB_contains(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int */ __pyx_v_b = (__pyx_v_i & (__pyx_v_3_sa_LOWER_MASK[(__pyx_v_veb->num_bottom_bits - 1)])); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":329 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":329 * a = i >> veb.num_bottom_bits * b = i & LOWER_MASK[veb.num_bottom_bits-1] * if veb.bottom[a] == NULL: # <<<<<<<<<<<<<< @@ -20888,7 +21128,7 @@ static int __pyx_f_3_sa_VEB_contains(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __pyx_t_2 = ((__pyx_v_veb->bottom[__pyx_v_a]) == NULL); if (__pyx_t_2) { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":330 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":330 * b = i & LOWER_MASK[veb.num_bottom_bits-1] * if veb.bottom[a] == NULL: * return 0 # <<<<<<<<<<<<<< @@ -20901,7 +21141,7 @@ static int __pyx_f_3_sa_VEB_contains(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":332 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":332 * return 0 * else: * if veb.num_bottom_bits > MIN_BOTTOM_BITS: # <<<<<<<<<<<<<< @@ -20911,7 +21151,7 @@ static int __pyx_f_3_sa_VEB_contains(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __pyx_t_2 = (__pyx_v_veb->num_bottom_bits > __pyx_v_3_sa_MIN_BOTTOM_BITS); if (__pyx_t_2) { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":333 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":333 * else: * if veb.num_bottom_bits > MIN_BOTTOM_BITS: * subv = <_VEB*> veb.bottom[a] # <<<<<<<<<<<<<< @@ -20920,7 +21160,7 @@ static int __pyx_f_3_sa_VEB_contains(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int */ __pyx_v_subv = ((struct __pyx_t_3_sa__VEB *)(__pyx_v_veb->bottom[__pyx_v_a])); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":334 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":334 * if veb.num_bottom_bits > MIN_BOTTOM_BITS: * subv = <_VEB*> veb.bottom[a] * return VEB_contains(subv, b) # <<<<<<<<<<<<<< @@ -20933,7 +21173,7 @@ static int __pyx_f_3_sa_VEB_contains(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":336 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":336 * return VEB_contains(subv, b) * else: * subb = <_BitSet*> veb.bottom[a] # <<<<<<<<<<<<<< @@ -20942,7 +21182,7 @@ static int __pyx_f_3_sa_VEB_contains(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int */ __pyx_v_subb = ((struct __pyx_t_3_sa__BitSet *)(__pyx_v_veb->bottom[__pyx_v_a])); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":337 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":337 * else: * subb = <_BitSet*> veb.bottom[a] * return bitset_contains(subb, b) # <<<<<<<<<<<<<< @@ -20973,7 +21213,7 @@ static PyObject *__pyx_pw_3_sa_11VEBIterator_1__next__(PyObject *__pyx_v_self) { return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":344 +/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":344 * cdef int next_val * * def __next__(self): # <<<<<<<<<<<<<< @@ -20992,7 +21232,7 @@ static PyObject *__pyx_pf_3_sa_11VEBIterator___next__(struct __pyx_obj_3_sa_VEBI int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__next__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":347 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":347 * cdef int ret_val * * if self.next_val == -1: # <<<<<<<<<<<<<< @@ -21002,7 +21242,7 @@ static PyObject *__pyx_pf_3_sa_11VEBIterator___next__(struct __pyx_obj_3_sa_VEBI __pyx_t_1 = (__pyx_v_self->next_val == -1); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":348 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":348 * * if self.next_val == -1: * raise StopIteration() # <<<<<<<<<<<<<< @@ -21018,7 +21258,7 @@ static PyObject *__pyx_pf_3_sa_11VEBIterator___next__(struct __pyx_obj_3_sa_VEBI } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":349 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":349 * if self.next_val == -1: * raise StopIteration() * ret_val = self.next_val # <<<<<<<<<<<<<< @@ -21027,7 +21267,7 @@ static PyObject *__pyx_pf_3_sa_11VEBIterator___next__(struct __pyx_obj_3_sa_VEBI */ __pyx_v_ret_val = __pyx_v_self->next_val; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":350 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":350 * raise StopIteration() * ret_val = self.next_val * self.next_val = VEB_findsucc(self.v, ret_val) # <<<<<<<<<<<<<< @@ -21036,7 +21276,7 @@ static PyObject *__pyx_pf_3_sa_11VEBIterator___next__(struct __pyx_obj_3_sa_VEBI */ __pyx_v_self->next_val = __pyx_f_3_sa_VEB_findsucc(__pyx_v_self->v, __pyx_v_ret_val); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":351 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":351 * ret_val = self.next_val * self.next_val = VEB_findsucc(self.v, ret_val) * return ret_val # <<<<<<<<<<<<<< @@ -21066,11 +21306,11 @@ static PyObject *__pyx_pf_3_sa_11VEBIterator___next__(struct __pyx_obj_3_sa_VEBI static int __pyx_pw_3_sa_3VEB_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_3_sa_3VEB_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_v_size; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__size,0}; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__size,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -21083,8 +21323,7 @@ static int __pyx_pw_3_sa_3VEB_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size); - if (likely(values[0])) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { @@ -21110,7 +21349,7 @@ static int __pyx_pw_3_sa_3VEB_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":360 +/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":360 * cdef int _first(self) * * def __cinit__(self, int size): # <<<<<<<<<<<<<< @@ -21123,7 +21362,7 @@ static int __pyx_pf_3_sa_3VEB___cinit__(struct __pyx_obj_3_sa_VEB *__pyx_v_self, __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":361 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":361 * * def __cinit__(self, int size): * self.veb = new_VEB(size) # <<<<<<<<<<<<<< @@ -21146,7 +21385,7 @@ static void __pyx_pw_3_sa_3VEB_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyFinishContext(); } -/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":363 +/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":363 * self.veb = new_VEB(size) * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -21162,7 +21401,7 @@ static void __pyx_pf_3_sa_3VEB_2__dealloc__(struct __pyx_obj_3_sa_VEB *__pyx_v_s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":364 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":364 * * def __dealloc__(self): * del_VEB(self.veb) # <<<<<<<<<<<<<< @@ -21192,7 +21431,7 @@ static PyObject *__pyx_pw_3_sa_3VEB_5__iter__(PyObject *__pyx_v_self) { return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":366 +/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":366 * del_VEB(self.veb) * * def __iter__(self): # <<<<<<<<<<<<<< @@ -21210,7 +21449,7 @@ static PyObject *__pyx_pf_3_sa_3VEB_4__iter__(struct __pyx_obj_3_sa_VEB *__pyx_v int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__iter__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":368 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":368 * def __iter__(self): * cdef VEBIterator it * it = VEBIterator() # <<<<<<<<<<<<<< @@ -21222,7 +21461,7 @@ static PyObject *__pyx_pf_3_sa_3VEB_4__iter__(struct __pyx_obj_3_sa_VEB *__pyx_v __pyx_v_it = ((struct __pyx_obj_3_sa_VEBIterator *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":369 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":369 * cdef VEBIterator it * it = VEBIterator() * it.v = self.veb # <<<<<<<<<<<<<< @@ -21231,7 +21470,7 @@ static PyObject *__pyx_pf_3_sa_3VEB_4__iter__(struct __pyx_obj_3_sa_VEB *__pyx_v */ __pyx_v_it->v = __pyx_v_self->veb; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":370 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":370 * it = VEBIterator() * it.v = self.veb * it.next_val = self.veb.min_val # <<<<<<<<<<<<<< @@ -21240,7 +21479,7 @@ static PyObject *__pyx_pf_3_sa_3VEB_4__iter__(struct __pyx_obj_3_sa_VEB *__pyx_v */ __pyx_v_it->next_val = __pyx_v_self->veb->min_val; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":371 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":371 * it.v = self.veb * it.next_val = self.veb.min_val * return it # <<<<<<<<<<<<<< @@ -21276,7 +21515,7 @@ static PyObject *__pyx_pw_3_sa_3VEB_7insert(PyObject *__pyx_v_self, PyObject *__ return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":373 +/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":373 * return it * * def insert(self, i): # <<<<<<<<<<<<<< @@ -21294,7 +21533,7 @@ static PyObject *__pyx_pf_3_sa_3VEB_6insert(struct __pyx_obj_3_sa_VEB *__pyx_v_s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("insert", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":374 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":374 * * def insert(self, i): * return VEB_insert(self.veb, i) # <<<<<<<<<<<<<< @@ -21321,7 +21560,7 @@ static PyObject *__pyx_pf_3_sa_3VEB_6insert(struct __pyx_obj_3_sa_VEB *__pyx_v_s return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":376 +/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":376 * return VEB_insert(self.veb, i) * * cdef int _insert(self, int i): # <<<<<<<<<<<<<< @@ -21334,7 +21573,7 @@ static int __pyx_f_3_sa_3VEB__insert(struct __pyx_obj_3_sa_VEB *__pyx_v_self, in __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_insert", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":377 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":377 * * cdef int _insert(self, int i): * return VEB_insert(self.veb, i) # <<<<<<<<<<<<<< @@ -21361,7 +21600,7 @@ static PyObject *__pyx_pw_3_sa_3VEB_9findsucc(PyObject *__pyx_v_self, PyObject * return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":379 +/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":379 * return VEB_insert(self.veb, i) * * def findsucc(self, i): # <<<<<<<<<<<<<< @@ -21379,7 +21618,7 @@ static PyObject *__pyx_pf_3_sa_3VEB_8findsucc(struct __pyx_obj_3_sa_VEB *__pyx_v int __pyx_clineno = 0; __Pyx_RefNannySetupContext("findsucc", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":380 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":380 * * def findsucc(self, i): * return VEB_findsucc(self.veb, i) # <<<<<<<<<<<<<< @@ -21406,7 +21645,7 @@ static PyObject *__pyx_pf_3_sa_3VEB_8findsucc(struct __pyx_obj_3_sa_VEB *__pyx_v return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":382 +/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":382 * return VEB_findsucc(self.veb, i) * * cdef int _first(self): # <<<<<<<<<<<<<< @@ -21419,7 +21658,7 @@ static int __pyx_f_3_sa_3VEB__first(struct __pyx_obj_3_sa_VEB *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_first", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":383 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":383 * * cdef int _first(self): * return self.veb.min_val # <<<<<<<<<<<<<< @@ -21435,7 +21674,7 @@ static int __pyx_f_3_sa_3VEB__first(struct __pyx_obj_3_sa_VEB *__pyx_v_self) { return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":385 +/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":385 * return self.veb.min_val * * cdef int _findsucc(self, int i): # <<<<<<<<<<<<<< @@ -21448,7 +21687,7 @@ static int __pyx_f_3_sa_3VEB__findsucc(struct __pyx_obj_3_sa_VEB *__pyx_v_self, __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_findsucc", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":386 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":386 * * cdef int _findsucc(self, int i): * return VEB_findsucc(self.veb, i) # <<<<<<<<<<<<<< @@ -21475,7 +21714,7 @@ static Py_ssize_t __pyx_pw_3_sa_3VEB_11__len__(PyObject *__pyx_v_self) { return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":388 +/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":388 * return VEB_findsucc(self.veb, i) * * def __len__(self): # <<<<<<<<<<<<<< @@ -21488,7 +21727,7 @@ static Py_ssize_t __pyx_pf_3_sa_3VEB_10__len__(struct __pyx_obj_3_sa_VEB *__pyx_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":389 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":389 * * def __len__(self): * return self.veb.size # <<<<<<<<<<<<<< @@ -21515,7 +21754,7 @@ static int __pyx_pw_3_sa_3VEB_13__contains__(PyObject *__pyx_v_self, PyObject *_ return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":391 +/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":391 * return self.veb.size * * def __contains__(self, i): # <<<<<<<<<<<<<< @@ -21531,7 +21770,7 @@ static int __pyx_pf_3_sa_3VEB_12__contains__(struct __pyx_obj_3_sa_VEB *__pyx_v_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__contains__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":392 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":392 * * def __contains__(self, i): * return VEB_contains(self.veb, i) # <<<<<<<<<<<<<< @@ -21554,11 +21793,11 @@ static int __pyx_pf_3_sa_3VEB_12__contains__(struct __pyx_obj_3_sa_VEB *__pyx_v_ static int __pyx_pw_3_sa_3LCP_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_3_sa_3LCP_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_3_sa_SuffixArray *__pyx_v_sa = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__sa,0}; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__sa,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -21571,8 +21810,7 @@ static int __pyx_pw_3_sa_3LCP_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sa); - if (likely(values[0])) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sa)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { @@ -21603,7 +21841,7 @@ static int __pyx_pw_3_sa_3LCP_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":9 +/* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":9 * cdef IntList lcp * * def __cinit__(self, SuffixArray sa): # <<<<<<<<<<<<<< @@ -21632,7 +21870,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self, int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":13 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":13 * cdef IntList rank * * logger.info("Constructing LCP array") # <<<<<<<<<<<<<< @@ -21649,7 +21887,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self, __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":14 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":14 * * logger.info("Constructing LCP array") * self.sa = sa # <<<<<<<<<<<<<< @@ -21662,7 +21900,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self, __Pyx_DECREF(((PyObject *)__pyx_v_self->sa)); __pyx_v_self->sa = __pyx_v_sa; - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":15 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":15 * logger.info("Constructing LCP array") * self.sa = sa * n = self.sa.sa.len # <<<<<<<<<<<<<< @@ -21671,7 +21909,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self, */ __pyx_v_n = __pyx_v_self->sa->sa->len; - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":16 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":16 * self.sa = sa * n = self.sa.sa.len * self.lcp = IntList(initial_len=n) # <<<<<<<<<<<<<< @@ -21693,7 +21931,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self, __pyx_v_self->lcp = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":18 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":18 * self.lcp = IntList(initial_len=n) * * rank = IntList(initial_len=n) # <<<<<<<<<<<<<< @@ -21712,7 +21950,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self, __pyx_v_rank = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":19 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":19 * * rank = IntList(initial_len=n) * for i from 0 <= i < n: # <<<<<<<<<<<<<< @@ -21722,7 +21960,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self, __pyx_t_3 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":20 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":20 * rank = IntList(initial_len=n) * for i from 0 <= i < n: * rank.arr[sa.sa.arr[i]] = i # <<<<<<<<<<<<<< @@ -21732,7 +21970,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self, (__pyx_v_rank->arr[(__pyx_v_sa->sa->arr[__pyx_v_i])]) = __pyx_v_i; } - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":22 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":22 * rank.arr[sa.sa.arr[i]] = i * * h = 0 # <<<<<<<<<<<<<< @@ -21741,7 +21979,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self, */ __pyx_v_h = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":23 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":23 * * h = 0 * for i from 0 <= i < n: # <<<<<<<<<<<<<< @@ -21751,7 +21989,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self, __pyx_t_3 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":24 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":24 * h = 0 * for i from 0 <= i < n: * k = rank.arr[i] # <<<<<<<<<<<<<< @@ -21760,7 +21998,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self, */ __pyx_v_k = (__pyx_v_rank->arr[__pyx_v_i]); - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":25 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":25 * for i from 0 <= i < n: * k = rank.arr[i] * if k == 0: # <<<<<<<<<<<<<< @@ -21770,7 +22008,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self, __pyx_t_4 = (__pyx_v_k == 0); if (__pyx_t_4) { - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":26 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":26 * k = rank.arr[i] * if k == 0: * self.lcp.arr[k] = -1 # <<<<<<<<<<<<<< @@ -21782,7 +22020,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self, } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":28 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":28 * self.lcp.arr[k] = -1 * else: * j = sa.sa.arr[k-1] # <<<<<<<<<<<<<< @@ -21791,7 +22029,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self, */ __pyx_v_j = (__pyx_v_sa->sa->arr[(__pyx_v_k - 1)]); - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":29 + /* "/home/pauldb/workspace/cdec/python/src/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]: # <<<<<<<<<<<<<< @@ -21814,7 +22052,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self, } if (!__pyx_t_5) break; - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":30 + /* "/home/pauldb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -21824,7 +22062,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self, __pyx_v_h = (__pyx_v_h + 1); } - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":31 + /* "/home/pauldb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -21835,7 +22073,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self, } __pyx_L7:; - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":32 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":32 * h = h+1 * self.lcp.arr[k] = h * if h > 0: # <<<<<<<<<<<<<< @@ -21845,7 +22083,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self, __pyx_t_5 = (__pyx_v_h > 0); if (__pyx_t_5) { - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":33 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":33 * self.lcp.arr[k] = h * if h > 0: * h = h-1 # <<<<<<<<<<<<<< @@ -21858,7 +22096,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self, __pyx_L10:; } - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":34 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":34 * if h > 0: * h = h-1 * logger.info("LCP array completed") # <<<<<<<<<<<<<< @@ -21911,7 +22149,7 @@ static PyObject *__pyx_pw_3_sa_3LCP_3compute_stats(PyObject *__pyx_v_self, PyObj return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":36 +/* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":36 * logger.info("LCP array completed") * * def compute_stats(self, int max_n): # <<<<<<<<<<<<<< @@ -21982,7 +22220,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen __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/paulb/workspace/cdec/python/src/sa/lcp.pxi":48 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":48 * cdef VEB veb * * N = self.sa.sa.len # <<<<<<<<<<<<<< @@ -21991,7 +22229,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen */ __pyx_cur_scope->__pyx_v_N = __pyx_cur_scope->__pyx_v_self->sa->sa->len; - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":50 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":50 * N = self.sa.sa.len * * ngram_starts = [] # <<<<<<<<<<<<<< @@ -22004,7 +22242,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen __pyx_cur_scope->__pyx_v_ngram_starts = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":51 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":51 * * ngram_starts = [] * for n from 0 <= n < max_n: # <<<<<<<<<<<<<< @@ -22014,7 +22252,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen __pyx_t_2 = __pyx_cur_scope->__pyx_v_max_n; for (__pyx_cur_scope->__pyx_v_n = 0; __pyx_cur_scope->__pyx_v_n < __pyx_t_2; __pyx_cur_scope->__pyx_v_n++) { - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":52 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":52 * ngram_starts = [] * for n from 0 <= n < max_n: * ngram_starts.append(IntList(initial_len=N)) # <<<<<<<<<<<<<< @@ -22034,7 +22272,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":54 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":54 * ngram_starts.append(IntList(initial_len=N)) * * run_start = IntList(initial_len=max_n) # <<<<<<<<<<<<<< @@ -22054,7 +22292,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen __pyx_cur_scope->__pyx_v_run_start = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":55 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":55 * * run_start = IntList(initial_len=max_n) * veb = VEB(N) # <<<<<<<<<<<<<< @@ -22075,7 +22313,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen __pyx_cur_scope->__pyx_v_veb = ((struct __pyx_obj_3_sa_VEB *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":57 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":57 * veb = VEB(N) * * for i from 0 <= i < N: # <<<<<<<<<<<<<< @@ -22085,7 +22323,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen __pyx_t_2 = __pyx_cur_scope->__pyx_v_N; for (__pyx_cur_scope->__pyx_v_i = 0; __pyx_cur_scope->__pyx_v_i < __pyx_t_2; __pyx_cur_scope->__pyx_v_i++) { - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":58 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":58 * * for i from 0 <= i < N: * h = self.lcp.arr[i] # <<<<<<<<<<<<<< @@ -22094,7 +22332,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen */ __pyx_cur_scope->__pyx_v_h = (__pyx_cur_scope->__pyx_v_self->lcp->arr[__pyx_cur_scope->__pyx_v_i]); - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":59 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":59 * for i from 0 <= i < N: * h = self.lcp.arr[i] * if h < 0: # <<<<<<<<<<<<<< @@ -22104,7 +22342,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen __pyx_t_5 = (__pyx_cur_scope->__pyx_v_h < 0); if (__pyx_t_5) { - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":60 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":60 * h = self.lcp.arr[i] * if h < 0: * h = 0 # <<<<<<<<<<<<<< @@ -22116,7 +22354,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen } __pyx_L8:; - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":61 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":61 * if h < 0: * h = 0 * for n from h <= n < max_n: # <<<<<<<<<<<<<< @@ -22126,7 +22364,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen __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/paulb/workspace/cdec/python/src/sa/lcp.pxi":62 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":62 * h = 0 * for n from h <= n < max_n: * rs = run_start.arr[n] # <<<<<<<<<<<<<< @@ -22135,7 +22373,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen */ __pyx_cur_scope->__pyx_v_rs = (__pyx_cur_scope->__pyx_v_run_start->arr[__pyx_cur_scope->__pyx_v_n]); - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":63 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":63 * for n from h <= n < max_n: * rs = run_start.arr[n] * run_start.arr[n] = i # <<<<<<<<<<<<<< @@ -22144,7 +22382,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen */ (__pyx_cur_scope->__pyx_v_run_start->arr[__pyx_cur_scope->__pyx_v_n]) = __pyx_cur_scope->__pyx_v_i; - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":64 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":64 * rs = run_start.arr[n] * run_start.arr[n] = i * freq = i - rs # <<<<<<<<<<<<<< @@ -22153,7 +22391,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen */ __pyx_cur_scope->__pyx_v_freq = (__pyx_cur_scope->__pyx_v_i - __pyx_cur_scope->__pyx_v_rs); - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":65 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":65 * run_start.arr[n] = i * freq = i - rs * if freq > 1000: # arbitrary, but see note below # <<<<<<<<<<<<<< @@ -22163,7 +22401,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen __pyx_t_5 = (__pyx_cur_scope->__pyx_v_freq > 1000); if (__pyx_t_5) { - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":66 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":66 * freq = i - rs * if freq > 1000: # arbitrary, but see note below * veb._insert(freq) # <<<<<<<<<<<<<< @@ -22172,7 +22410,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen */ ((struct __pyx_vtabstruct_3_sa_VEB *)__pyx_cur_scope->__pyx_v_veb->__pyx_vtab)->_insert(__pyx_cur_scope->__pyx_v_veb, __pyx_cur_scope->__pyx_v_freq); - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":67 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":67 * if freq > 1000: # arbitrary, but see note below * veb._insert(freq) * ngram_start = ngram_starts[n] # <<<<<<<<<<<<<< @@ -22188,7 +22426,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen __pyx_cur_scope->__pyx_v_ngram_start = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":68 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":68 * veb._insert(freq) * ngram_start = ngram_starts[n] * while ngram_start.arr[freq] > 0: # <<<<<<<<<<<<<< @@ -22199,7 +22437,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen __pyx_t_5 = ((__pyx_cur_scope->__pyx_v_ngram_start->arr[__pyx_cur_scope->__pyx_v_freq]) > 0); if (!__pyx_t_5) break; - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":69 + /* "/home/pauldb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -22209,7 +22447,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen __pyx_cur_scope->__pyx_v_freq = (__pyx_cur_scope->__pyx_v_freq + 1); } - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":70 + /* "/home/pauldb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -22223,7 +22461,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen } } - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":71 + /* "/home/pauldb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -22232,7 +22470,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen */ __pyx_cur_scope->__pyx_v_i = __pyx_cur_scope->__pyx_v_veb->veb->min_val; - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":72 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":72 * ngram_start.arr[freq] = rs * i = veb.veb.min_val * while i != -1: # <<<<<<<<<<<<<< @@ -22243,7 +22481,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen __pyx_t_5 = (__pyx_cur_scope->__pyx_v_i != -1); if (!__pyx_t_5) break; - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":73 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":73 * i = veb.veb.min_val * while i != -1: * ii = veb._findsucc(i) # <<<<<<<<<<<<<< @@ -22252,7 +22490,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen */ __pyx_cur_scope->__pyx_v_ii = ((struct __pyx_vtabstruct_3_sa_VEB *)__pyx_cur_scope->__pyx_v_veb->__pyx_vtab)->_findsucc(__pyx_cur_scope->__pyx_v_veb, __pyx_cur_scope->__pyx_v_i); - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":74 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":74 * while i != -1: * ii = veb._findsucc(i) * for n from 0 <= n < max_n: # <<<<<<<<<<<<<< @@ -22262,7 +22500,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen __pyx_t_2 = __pyx_cur_scope->__pyx_v_max_n; for (__pyx_cur_scope->__pyx_v_n = 0; __pyx_cur_scope->__pyx_v_n < __pyx_t_2; __pyx_cur_scope->__pyx_v_n++) { - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":75 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":75 * ii = veb._findsucc(i) * for n from 0 <= n < max_n: * ngram_start = ngram_starts[n] # <<<<<<<<<<<<<< @@ -22278,7 +22516,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen __pyx_cur_scope->__pyx_v_ngram_start = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":76 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":76 * for n from 0 <= n < max_n: * ngram_start = ngram_starts[n] * iii = i # <<<<<<<<<<<<<< @@ -22287,7 +22525,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen */ __pyx_cur_scope->__pyx_v_iii = __pyx_cur_scope->__pyx_v_i; - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":77 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":77 * ngram_start = ngram_starts[n] * iii = i * rs = ngram_start.arr[iii] # <<<<<<<<<<<<<< @@ -22296,7 +22534,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen */ __pyx_cur_scope->__pyx_v_rs = (__pyx_cur_scope->__pyx_v_ngram_start->arr[__pyx_cur_scope->__pyx_v_iii]); - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":78 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":78 * iii = i * rs = ngram_start.arr[iii] * while (ii==-1 or iii < ii) and rs != 0: # <<<<<<<<<<<<<< @@ -22319,7 +22557,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen } if (!__pyx_t_7) break; - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":79 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":79 * rs = ngram_start.arr[iii] * while (ii==-1 or iii < ii) and rs != 0: * j = self.sa.sa.arr[rs] # <<<<<<<<<<<<<< @@ -22328,7 +22566,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen */ __pyx_cur_scope->__pyx_v_j = (__pyx_cur_scope->__pyx_v_self->sa->sa->arr[__pyx_cur_scope->__pyx_v_rs]); - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":80 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":80 * while (ii==-1 or iii < ii) and rs != 0: * j = self.sa.sa.arr[rs] * valid = 1 # <<<<<<<<<<<<<< @@ -22337,7 +22575,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen */ __pyx_cur_scope->__pyx_v_valid = 1; - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":81 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":81 * j = self.sa.sa.arr[rs] * valid = 1 * for k from 0 <= k < n+1: # <<<<<<<<<<<<<< @@ -22347,7 +22585,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen __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/paulb/workspace/cdec/python/src/sa/lcp.pxi":82 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":82 * valid = 1 * for k from 0 <= k < n+1: * if self.sa.darray.data.arr[j+k] < 2: # <<<<<<<<<<<<<< @@ -22357,7 +22595,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen __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); if (__pyx_t_7) { - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":83 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":83 * for k from 0 <= k < n+1: * if self.sa.darray.data.arr[j+k] < 2: * valid = 0 # <<<<<<<<<<<<<< @@ -22370,7 +22608,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen __pyx_L22:; } - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":84 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":84 * if self.sa.darray.data.arr[j+k] < 2: * valid = 0 * if valid: # <<<<<<<<<<<<<< @@ -22379,7 +22617,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen */ if (__pyx_cur_scope->__pyx_v_valid) { - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":85 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":85 * valid = 0 * if valid: * ngram = tuple([self.sa.darray.data.arr[j+k] for k in range(n+1)]) # <<<<<<<<<<<<<< @@ -22393,7 +22631,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen __pyx_cur_scope->__pyx_v_k = __pyx_t_6; __pyx_t_3 = PyInt_FromLong((__pyx_cur_scope->__pyx_v_self->sa->darray->data->arr[(__pyx_cur_scope->__pyx_v_j + __pyx_cur_scope->__pyx_v_k)])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (unlikely(PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_3 = ((PyObject *)PyList_AsTuple(__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -22405,7 +22643,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen __pyx_cur_scope->__pyx_v_ngram = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":86 + /* "/home/pauldb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -22442,7 +22680,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen } __pyx_L23:; - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":87 + /* "/home/pauldb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -22451,7 +22689,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen */ __pyx_cur_scope->__pyx_v_iii = (__pyx_cur_scope->__pyx_v_iii + 1); - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":88 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":88 * yield i, n+1, ngram * iii = iii + 1 * rs = ngram_start.arr[iii] # <<<<<<<<<<<<<< @@ -22461,7 +22699,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen } } - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":89 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":89 * iii = iii + 1 * rs = ngram_start.arr[iii] * i = ii # <<<<<<<<<<<<<< @@ -22478,6 +22716,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_generator->resume_label = -1; + __Pyx_Generator_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return NULL; } @@ -22496,7 +22735,7 @@ static int __pyx_pw_3_sa_8Alphabet_1__cinit__(PyObject *__pyx_v_self, PyObject * return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":12 +/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":12 * cdef dict id2sym * * def __cinit__(self): # <<<<<<<<<<<<<< @@ -22513,7 +22752,7 @@ static int __pyx_pf_3_sa_8Alphabet___cinit__(struct __pyx_obj_3_sa_Alphabet *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":13 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":13 * * def __cinit__(self): * self.terminals = StringMap() # <<<<<<<<<<<<<< @@ -22528,7 +22767,7 @@ static int __pyx_pf_3_sa_8Alphabet___cinit__(struct __pyx_obj_3_sa_Alphabet *__p __pyx_v_self->terminals = ((struct __pyx_obj_3_sa_StringMap *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":14 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":14 * def __cinit__(self): * self.terminals = StringMap() * self.nonterminals = StringMap() # <<<<<<<<<<<<<< @@ -22543,7 +22782,7 @@ static int __pyx_pf_3_sa_8Alphabet___cinit__(struct __pyx_obj_3_sa_Alphabet *__p __pyx_v_self->nonterminals = ((struct __pyx_obj_3_sa_StringMap *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":15 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":15 * self.terminals = StringMap() * self.nonterminals = StringMap() * self.id2sym = {} # <<<<<<<<<<<<<< @@ -22558,7 +22797,7 @@ static int __pyx_pf_3_sa_8Alphabet___cinit__(struct __pyx_obj_3_sa_Alphabet *__p __pyx_v_self->id2sym = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":16 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":16 * self.nonterminals = StringMap() * self.id2sym = {} * self.first_nonterminal = -1 # <<<<<<<<<<<<<< @@ -22587,7 +22826,7 @@ static void __pyx_pw_3_sa_8Alphabet_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyFinishContext(); } -/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":18 +/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":18 * self.first_nonterminal = -1 * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -22602,7 +22841,7 @@ static void __pyx_pf_3_sa_8Alphabet_2__dealloc__(CYTHON_UNUSED struct __pyx_obj_ __Pyx_RefNannyFinishContext(); } -/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":21 +/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":21 * pass * * cdef int isvar(self, int sym): # <<<<<<<<<<<<<< @@ -22615,7 +22854,7 @@ static int __pyx_f_3_sa_8Alphabet_isvar(CYTHON_UNUSED struct __pyx_obj_3_sa_Alph __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("isvar", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":22 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":22 * * cdef int isvar(self, int sym): * return sym < 0 # <<<<<<<<<<<<<< @@ -22631,7 +22870,7 @@ static int __pyx_f_3_sa_8Alphabet_isvar(CYTHON_UNUSED struct __pyx_obj_3_sa_Alph return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":24 +/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":24 * return sym < 0 * * cdef int isword(self, int sym): # <<<<<<<<<<<<<< @@ -22644,7 +22883,7 @@ static int __pyx_f_3_sa_8Alphabet_isword(CYTHON_UNUSED struct __pyx_obj_3_sa_Alp __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("isword", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":25 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":25 * * cdef int isword(self, int sym): * return sym >= 0 # <<<<<<<<<<<<<< @@ -22660,7 +22899,7 @@ static int __pyx_f_3_sa_8Alphabet_isword(CYTHON_UNUSED struct __pyx_obj_3_sa_Alp return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":27 +/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":27 * return sym >= 0 * * cdef int getindex(self, int sym): # <<<<<<<<<<<<<< @@ -22673,7 +22912,7 @@ static int __pyx_f_3_sa_8Alphabet_getindex(CYTHON_UNUSED struct __pyx_obj_3_sa_A __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getindex", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":28 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":28 * * cdef int getindex(self, int sym): * return -sym & INDEX_MASK # <<<<<<<<<<<<<< @@ -22689,7 +22928,7 @@ static int __pyx_f_3_sa_8Alphabet_getindex(CYTHON_UNUSED struct __pyx_obj_3_sa_A return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":30 +/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":30 * return -sym & INDEX_MASK * * cdef int setindex(self, int sym, int ind): # <<<<<<<<<<<<<< @@ -22702,7 +22941,7 @@ static int __pyx_f_3_sa_8Alphabet_setindex(CYTHON_UNUSED struct __pyx_obj_3_sa_A __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setindex", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":31 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":31 * * cdef int setindex(self, int sym, int ind): * return -(-sym & ~INDEX_MASK | ind) # <<<<<<<<<<<<<< @@ -22718,7 +22957,7 @@ static int __pyx_f_3_sa_8Alphabet_setindex(CYTHON_UNUSED struct __pyx_obj_3_sa_A return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":33 +/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":33 * return -(-sym & ~INDEX_MASK | ind) * * cdef int clearindex(self, int sym): # <<<<<<<<<<<<<< @@ -22731,7 +22970,7 @@ static int __pyx_f_3_sa_8Alphabet_clearindex(CYTHON_UNUSED struct __pyx_obj_3_sa __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clearindex", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":34 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":34 * * cdef int clearindex(self, int sym): * return -(-sym& ~INDEX_MASK) # <<<<<<<<<<<<<< @@ -22747,7 +22986,7 @@ static int __pyx_f_3_sa_8Alphabet_clearindex(CYTHON_UNUSED struct __pyx_obj_3_sa return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":36 +/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":36 * return -(-sym& ~INDEX_MASK) * * cdef int match(self, int sym1, int sym2): # <<<<<<<<<<<<<< @@ -22760,7 +22999,7 @@ static int __pyx_f_3_sa_8Alphabet_match(struct __pyx_obj_3_sa_Alphabet *__pyx_v_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("match", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":37 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":37 * * cdef int match(self, int sym1, int sym2): * return self.clearindex(sym1) == self.clearindex(sym2); # <<<<<<<<<<<<<< @@ -22776,7 +23015,7 @@ static int __pyx_f_3_sa_8Alphabet_match(struct __pyx_obj_3_sa_Alphabet *__pyx_v_ return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":39 +/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":39 * return self.clearindex(sym1) == self.clearindex(sym2); * * cdef char* tocat(self, int sym): # <<<<<<<<<<<<<< @@ -22789,7 +23028,7 @@ static char *__pyx_f_3_sa_8Alphabet_tocat(struct __pyx_obj_3_sa_Alphabet *__pyx_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("tocat", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":40 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":40 * * cdef char* tocat(self, int sym): * return self.nonterminals.word((-sym >> INDEX_SHIFT)-1) # <<<<<<<<<<<<<< @@ -22805,7 +23044,7 @@ static char *__pyx_f_3_sa_8Alphabet_tocat(struct __pyx_obj_3_sa_Alphabet *__pyx_ return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":42 +/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":42 * return self.nonterminals.word((-sym >> INDEX_SHIFT)-1) * * cdef int fromcat(self, char *s): # <<<<<<<<<<<<<< @@ -22820,7 +23059,7 @@ static int __pyx_f_3_sa_8Alphabet_fromcat(struct __pyx_obj_3_sa_Alphabet *__pyx_ int __pyx_t_1; __Pyx_RefNannySetupContext("fromcat", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":44 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":44 * cdef int fromcat(self, char *s): * cdef int i * i = self.nonterminals.index(s) # <<<<<<<<<<<<<< @@ -22829,7 +23068,7 @@ static int __pyx_f_3_sa_8Alphabet_fromcat(struct __pyx_obj_3_sa_Alphabet *__pyx_ */ __pyx_v_i = ((struct __pyx_vtabstruct_3_sa_StringMap *)__pyx_v_self->nonterminals->__pyx_vtab)->index(__pyx_v_self->nonterminals, __pyx_v_s); - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":45 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":45 * cdef int i * i = self.nonterminals.index(s) * if self.first_nonterminal == -1: # <<<<<<<<<<<<<< @@ -22839,7 +23078,7 @@ static int __pyx_f_3_sa_8Alphabet_fromcat(struct __pyx_obj_3_sa_Alphabet *__pyx_ __pyx_t_1 = (__pyx_v_self->first_nonterminal == -1); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":46 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":46 * i = self.nonterminals.index(s) * if self.first_nonterminal == -1: * self.first_nonterminal = i # <<<<<<<<<<<<<< @@ -22851,7 +23090,7 @@ static int __pyx_f_3_sa_8Alphabet_fromcat(struct __pyx_obj_3_sa_Alphabet *__pyx_ } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":47 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":47 * if self.first_nonterminal == -1: * self.first_nonterminal = i * if i > self.last_nonterminal: # <<<<<<<<<<<<<< @@ -22861,7 +23100,7 @@ static int __pyx_f_3_sa_8Alphabet_fromcat(struct __pyx_obj_3_sa_Alphabet *__pyx_ __pyx_t_1 = (__pyx_v_i > __pyx_v_self->last_nonterminal); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":48 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":48 * self.first_nonterminal = i * if i > self.last_nonterminal: * self.last_nonterminal = i # <<<<<<<<<<<<<< @@ -22873,7 +23112,7 @@ static int __pyx_f_3_sa_8Alphabet_fromcat(struct __pyx_obj_3_sa_Alphabet *__pyx_ } __pyx_L4:; - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":49 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":49 * if i > self.last_nonterminal: * self.last_nonterminal = i * return -(i+1 << INDEX_SHIFT) # <<<<<<<<<<<<<< @@ -22889,7 +23128,7 @@ static int __pyx_f_3_sa_8Alphabet_fromcat(struct __pyx_obj_3_sa_Alphabet *__pyx_ return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":51 +/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":51 * return -(i+1 << INDEX_SHIFT) * * cdef char* tostring(self, int sym): # <<<<<<<<<<<<<< @@ -22912,7 +23151,7 @@ static char *__pyx_f_3_sa_8Alphabet_tostring(struct __pyx_obj_3_sa_Alphabet *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("tostring", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":53 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":53 * cdef char* tostring(self, int sym): * cdef int ind * if self.isvar(sym): # <<<<<<<<<<<<<< @@ -22922,7 +23161,7 @@ static char *__pyx_f_3_sa_8Alphabet_tostring(struct __pyx_obj_3_sa_Alphabet *__p __pyx_t_1 = ((struct __pyx_vtabstruct_3_sa_Alphabet *)__pyx_v_self->__pyx_vtab)->isvar(__pyx_v_self, __pyx_v_sym); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":54 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":54 * cdef int ind * if self.isvar(sym): * if sym in self.id2sym: # <<<<<<<<<<<<<< @@ -22932,19 +23171,24 @@ static char *__pyx_f_3_sa_8Alphabet_tostring(struct __pyx_obj_3_sa_Alphabet *__p __pyx_t_2 = PyInt_FromLong(__pyx_v_sym); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (unlikely(((PyObject *)__pyx_v_self->id2sym) == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + {__pyx_filename = __pyx_f[10]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_3 = ((PyDict_Contains(((PyObject *)__pyx_v_self->id2sym), __pyx_t_2))); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = (__Pyx_PyDict_Contains(__pyx_t_2, ((PyObject *)__pyx_v_self->id2sym), Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":55 + /* "/home/pauldb/workspace/cdec/python/src/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)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[10]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->id2sym), __pyx_v_sym, sizeof(int), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyBytes_AsString(__pyx_t_2); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -22955,7 +23199,7 @@ static char *__pyx_f_3_sa_8Alphabet_tostring(struct __pyx_obj_3_sa_Alphabet *__p } __pyx_L4:; - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":56 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":56 * if sym in self.id2sym: * return self.id2sym[sym] * ind = self.getindex(sym) # <<<<<<<<<<<<<< @@ -22964,7 +23208,7 @@ static char *__pyx_f_3_sa_8Alphabet_tostring(struct __pyx_obj_3_sa_Alphabet *__p */ __pyx_v_ind = ((struct __pyx_vtabstruct_3_sa_Alphabet *)__pyx_v_self->__pyx_vtab)->getindex(__pyx_v_self, __pyx_v_sym); - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":57 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":57 * return self.id2sym[sym] * ind = self.getindex(sym) * if ind > 0: # <<<<<<<<<<<<<< @@ -22974,7 +23218,7 @@ static char *__pyx_f_3_sa_8Alphabet_tostring(struct __pyx_obj_3_sa_Alphabet *__p __pyx_t_3 = (__pyx_v_ind > 0); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":58 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":58 * ind = self.getindex(sym) * if ind > 0: * self.id2sym[sym] = "[%s,%d]" % (self.tocat(sym), ind) # <<<<<<<<<<<<<< @@ -22996,13 +23240,17 @@ static char *__pyx_f_3_sa_8Alphabet_tostring(struct __pyx_obj_3_sa_Alphabet *__p __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_64), ((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)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[10]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } if (__Pyx_SetItemInt(((PyObject *)__pyx_v_self->id2sym), __pyx_v_sym, ((PyObject *)__pyx_t_5), sizeof(int), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; goto __pyx_L5; } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":60 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":60 * self.id2sym[sym] = "[%s,%d]" % (self.tocat(sym), ind) * else: * self.id2sym[sym] = "[%s]" % self.tocat(sym) # <<<<<<<<<<<<<< @@ -23014,18 +23262,26 @@ static char *__pyx_f_3_sa_8Alphabet_tostring(struct __pyx_obj_3_sa_Alphabet *__p __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_65), ((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)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[10]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } if (__Pyx_SetItemInt(((PyObject *)__pyx_v_self->id2sym), __pyx_v_sym, ((PyObject *)__pyx_t_6), sizeof(int), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; } __pyx_L5:; - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":61 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":61 * else: * self.id2sym[sym] = "[%s]" % self.tocat(sym) * return self.id2sym[sym] # <<<<<<<<<<<<<< * else: * return self.terminals.word(sym) */ + if (unlikely(((PyObject *)__pyx_v_self->id2sym) == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[10]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } __pyx_t_6 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->id2sym), __pyx_v_sym, sizeof(int), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = PyBytes_AsString(__pyx_t_6); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -23036,7 +23292,7 @@ static char *__pyx_f_3_sa_8Alphabet_tostring(struct __pyx_obj_3_sa_Alphabet *__p } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":63 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":63 * return self.id2sym[sym] * else: * return self.terminals.word(sym) # <<<<<<<<<<<<<< @@ -23061,7 +23317,7 @@ static char *__pyx_f_3_sa_8Alphabet_tostring(struct __pyx_obj_3_sa_Alphabet *__p return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":65 +/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":65 * return self.terminals.word(sym) * * cdef int fromstring(self, char *s, bint terminal): # <<<<<<<<<<<<<< @@ -23089,7 +23345,7 @@ static int __pyx_f_3_sa_8Alphabet_fromstring(struct __pyx_obj_3_sa_Alphabet *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fromstring", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":69 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":69 * cdef char *comma * cdef int n * n = strlen(s) # <<<<<<<<<<<<<< @@ -23098,7 +23354,7 @@ static int __pyx_f_3_sa_8Alphabet_fromstring(struct __pyx_obj_3_sa_Alphabet *__p */ __pyx_v_n = strlen(__pyx_v_s); - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":71 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":71 * n = strlen(s) * cdef char *sep * sep = strstr(s,"_SEP_") # <<<<<<<<<<<<<< @@ -23107,7 +23363,7 @@ static int __pyx_f_3_sa_8Alphabet_fromstring(struct __pyx_obj_3_sa_Alphabet *__p */ __pyx_v_sep = strstr(__pyx_v_s, __pyx_k___SEP_); - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":72 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":72 * cdef char *sep * sep = strstr(s,"_SEP_") * if n >= 3 and s[0] == c'[' and s[n-1] == c']' and sep == NULL: # <<<<<<<<<<<<<< @@ -23135,7 +23391,7 @@ static int __pyx_f_3_sa_8Alphabet_fromstring(struct __pyx_obj_3_sa_Alphabet *__p } if (__pyx_t_2) { - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":73 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":73 * sep = strstr(s,"_SEP_") * if n >= 3 and s[0] == c'[' and s[n-1] == c']' and sep == NULL: * if terminal: # <<<<<<<<<<<<<< @@ -23144,7 +23400,7 @@ static int __pyx_f_3_sa_8Alphabet_fromstring(struct __pyx_obj_3_sa_Alphabet *__p */ if (__pyx_v_terminal) { - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":74 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":74 * if n >= 3 and s[0] == c'[' and s[n-1] == c']' and sep == NULL: * if terminal: * s1 = "\\"+s # <<<<<<<<<<<<<< @@ -23159,7 +23415,7 @@ static int __pyx_f_3_sa_8Alphabet_fromstring(struct __pyx_obj_3_sa_Alphabet *__p __pyx_v_s1 = __pyx_t_7; __pyx_t_7 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":75 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":75 * if terminal: * s1 = "\\"+s * return self.terminals.index(s1) # <<<<<<<<<<<<<< @@ -23173,7 +23429,7 @@ static int __pyx_f_3_sa_8Alphabet_fromstring(struct __pyx_obj_3_sa_Alphabet *__p } __pyx_L4:; - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":76 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":76 * s1 = "\\"+s * return self.terminals.index(s1) * s[n-1] = c'\0' # <<<<<<<<<<<<<< @@ -23182,7 +23438,7 @@ static int __pyx_f_3_sa_8Alphabet_fromstring(struct __pyx_obj_3_sa_Alphabet *__p */ (__pyx_v_s[(__pyx_v_n - 1)]) = '\x00'; - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":77 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":77 * return self.terminals.index(s1) * s[n-1] = c'\0' * s = s + 1 # <<<<<<<<<<<<<< @@ -23191,7 +23447,7 @@ static int __pyx_f_3_sa_8Alphabet_fromstring(struct __pyx_obj_3_sa_Alphabet *__p */ __pyx_v_s = (__pyx_v_s + 1); - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":78 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":78 * s[n-1] = c'\0' * s = s + 1 * comma = strrchr(s, c',') # <<<<<<<<<<<<<< @@ -23200,7 +23456,7 @@ static int __pyx_f_3_sa_8Alphabet_fromstring(struct __pyx_obj_3_sa_Alphabet *__p */ __pyx_v_comma = strrchr(__pyx_v_s, ','); - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":79 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":79 * s = s + 1 * comma = strrchr(s, c',') * if comma != NULL: # <<<<<<<<<<<<<< @@ -23210,7 +23466,7 @@ static int __pyx_f_3_sa_8Alphabet_fromstring(struct __pyx_obj_3_sa_Alphabet *__p __pyx_t_2 = (__pyx_v_comma != NULL); if (__pyx_t_2) { - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":80 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":80 * comma = strrchr(s, c',') * if comma != NULL: * comma[0] = c'\0' # <<<<<<<<<<<<<< @@ -23219,7 +23475,7 @@ static int __pyx_f_3_sa_8Alphabet_fromstring(struct __pyx_obj_3_sa_Alphabet *__p */ (__pyx_v_comma[0]) = '\x00'; - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":81 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":81 * if comma != NULL: * comma[0] = c'\0' * return self.setindex(self.fromcat(s), strtol(comma+1, NULL, 10)) # <<<<<<<<<<<<<< @@ -23232,7 +23488,7 @@ static int __pyx_f_3_sa_8Alphabet_fromstring(struct __pyx_obj_3_sa_Alphabet *__p } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":83 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":83 * return self.setindex(self.fromcat(s), strtol(comma+1, NULL, 10)) * else: * return self.fromcat(s) # <<<<<<<<<<<<<< @@ -23247,7 +23503,7 @@ static int __pyx_f_3_sa_8Alphabet_fromstring(struct __pyx_obj_3_sa_Alphabet *__p } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":85 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":85 * return self.fromcat(s) * else: * return self.terminals.index(s) # <<<<<<<<<<<<<< @@ -23283,7 +23539,7 @@ static PyObject *__pyx_pw_3_sa_8Alphabet_9terminals_1__get__(PyObject *__pyx_v_s return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":8 +/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":8 * * cdef class Alphabet: * cdef readonly StringMap terminals, nonterminals # <<<<<<<<<<<<<< @@ -23334,7 +23590,7 @@ static PyObject *__pyx_pf_3_sa_8Alphabet_12nonterminals___get__(struct __pyx_obj return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":89 +/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":89 * cdef Alphabet ALPHABET = Alphabet() * * cdef char* sym_tostring(int sym): # <<<<<<<<<<<<<< @@ -23347,7 +23603,7 @@ static char *__pyx_f_3_sa_sym_tostring(int __pyx_v_sym) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sym_tostring", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":90 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":90 * * cdef char* sym_tostring(int sym): * return ALPHABET.tostring(sym) # <<<<<<<<<<<<<< @@ -23363,7 +23619,7 @@ static char *__pyx_f_3_sa_sym_tostring(int __pyx_v_sym) { return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":92 +/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":92 * return ALPHABET.tostring(sym) * * cdef char* sym_tocat(int sym): # <<<<<<<<<<<<<< @@ -23376,7 +23632,7 @@ static char *__pyx_f_3_sa_sym_tocat(int __pyx_v_sym) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sym_tocat", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":93 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":93 * * cdef char* sym_tocat(int sym): * return ALPHABET.tocat(sym) # <<<<<<<<<<<<<< @@ -23392,7 +23648,7 @@ static char *__pyx_f_3_sa_sym_tocat(int __pyx_v_sym) { return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":95 +/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":95 * return ALPHABET.tocat(sym) * * cdef int sym_isvar(int sym): # <<<<<<<<<<<<<< @@ -23405,7 +23661,7 @@ static int __pyx_f_3_sa_sym_isvar(int __pyx_v_sym) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sym_isvar", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":96 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":96 * * cdef int sym_isvar(int sym): * return ALPHABET.isvar(sym) # <<<<<<<<<<<<<< @@ -23421,7 +23677,7 @@ static int __pyx_f_3_sa_sym_isvar(int __pyx_v_sym) { return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":98 +/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":98 * return ALPHABET.isvar(sym) * * cdef int sym_getindex(int sym): # <<<<<<<<<<<<<< @@ -23434,7 +23690,7 @@ static int __pyx_f_3_sa_sym_getindex(int __pyx_v_sym) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sym_getindex", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":99 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":99 * * cdef int sym_getindex(int sym): * return ALPHABET.getindex(sym) # <<<<<<<<<<<<<< @@ -23450,7 +23706,7 @@ static int __pyx_f_3_sa_sym_getindex(int __pyx_v_sym) { return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":101 +/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":101 * return ALPHABET.getindex(sym) * * cdef int sym_setindex(int sym, int id): # <<<<<<<<<<<<<< @@ -23463,7 +23719,7 @@ static int __pyx_f_3_sa_sym_setindex(int __pyx_v_sym, int __pyx_v_id) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sym_setindex", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":102 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":102 * * cdef int sym_setindex(int sym, int id): * return ALPHABET.setindex(sym, id) # <<<<<<<<<<<<<< @@ -23479,7 +23735,7 @@ static int __pyx_f_3_sa_sym_setindex(int __pyx_v_sym, int __pyx_v_id) { return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":104 +/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":104 * return ALPHABET.setindex(sym, id) * * cdef int sym_fromstring(char* string, bint terminal): # <<<<<<<<<<<<<< @@ -23492,7 +23748,7 @@ static int __pyx_f_3_sa_sym_fromstring(char *__pyx_v_string, int __pyx_v_termina __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sym_fromstring", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":105 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":105 * * cdef int sym_fromstring(char* string, bint terminal): * return ALPHABET.fromstring(string, terminal) # <<<<<<<<<<<<<< @@ -23515,13 +23771,12 @@ static PyObject *__pyx_pw_3_sa_5isvar(PyObject *__pyx_self, PyObject *__pyx_v_sy PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("isvar (wrapper)", 0); - __pyx_self = __pyx_self; __pyx_r = __pyx_pf_3_sa_4isvar(__pyx_self, ((PyObject *)__pyx_v_sym)); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":107 +/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":107 * return ALPHABET.fromstring(string, terminal) * * def isvar(sym): # <<<<<<<<<<<<<< @@ -23539,7 +23794,7 @@ static PyObject *__pyx_pf_3_sa_4isvar(CYTHON_UNUSED PyObject *__pyx_self, PyObje int __pyx_clineno = 0; __Pyx_RefNannySetupContext("isvar", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":108 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":108 * * def isvar(sym): * return sym_isvar(sym) # <<<<<<<<<<<<<< @@ -23573,14 +23828,13 @@ static PyObject *__pyx_pw_3_sa_7make_lattice(PyObject *__pyx_self, PyObject *__p PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("make_lattice (wrapper)", 0); - __pyx_self = __pyx_self; __pyx_r = __pyx_pf_3_sa_6make_lattice(__pyx_self, ((PyObject *)__pyx_v_words)); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_3_sa_12make_lattice_2generator7(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":111 +/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":111 * * def make_lattice(words): * word_ids = (sym_fromstring(word, True) for word in words) # <<<<<<<<<<<<<< @@ -23656,10 +23910,18 @@ static PyObject *__pyx_gb_3_sa_12make_lattice_2generator7(__pyx_GeneratorObject for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #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[10]; __pyx_lineno = 111; __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[10]; __pyx_lineno = 111; __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; - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #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[10]; __pyx_lineno = 111; __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[10]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { @@ -23708,12 +23970,13 @@ static PyObject *__pyx_gb_3_sa_12make_lattice_2generator7(__pyx_GeneratorObject __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_generator->resume_label = -1; + __Pyx_Generator_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return NULL; } static PyObject *__pyx_gb_3_sa_12make_lattice_5generator8(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":112 +/* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -23789,10 +24052,18 @@ static PyObject *__pyx_gb_3_sa_12make_lattice_5generator8(__pyx_GeneratorObject for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #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[10]; __pyx_lineno = 112; __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[10]; __pyx_lineno = 112; __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; - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #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[10]; __pyx_lineno = 112; __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[10]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { @@ -23855,11 +24126,12 @@ static PyObject *__pyx_gb_3_sa_12make_lattice_5generator8(__pyx_GeneratorObject __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_generator->resume_label = -1; + __Pyx_Generator_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return NULL; } -/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":110 +/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":110 * return sym_isvar(sym) * * def make_lattice(words): # <<<<<<<<<<<<<< @@ -23887,7 +24159,7 @@ static PyObject *__pyx_pf_3_sa_6make_lattice(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_INCREF(__pyx_cur_scope->__pyx_v_words); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_words); - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":111 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":111 * * def make_lattice(words): * word_ids = (sym_fromstring(word, True) for word in words) # <<<<<<<<<<<<<< @@ -23900,7 +24172,7 @@ static PyObject *__pyx_pf_3_sa_6make_lattice(CYTHON_UNUSED PyObject *__pyx_self, __pyx_cur_scope->__pyx_v_word_ids = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":112 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -23943,14 +24215,13 @@ static PyObject *__pyx_pw_3_sa_9decode_lattice(PyObject *__pyx_self, PyObject *_ PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("decode_lattice (wrapper)", 0); - __pyx_self = __pyx_self; __pyx_r = __pyx_pf_3_sa_8decode_lattice(__pyx_self, ((PyObject *)__pyx_v_lattice)); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_3_sa_14decode_lattice_2generator9(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":115 +/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":115 * * def decode_lattice(lattice): * return tuple((sym_tostring(sym), weight, dist) for (sym, weight, dist) in arc # <<<<<<<<<<<<<< @@ -24024,7 +24295,7 @@ static PyObject *__pyx_gb_3_sa_14decode_lattice_2generator9(__pyx_GeneratorObjec __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/paulb/workspace/cdec/python/src/sa/sym.pxi":116 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -24042,7 +24313,7 @@ static PyObject *__pyx_gb_3_sa_14decode_lattice_2generator9(__pyx_GeneratorObjec } for (;;) { - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":115 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":115 * * def decode_lattice(lattice): * return tuple((sym_tostring(sym), weight, dist) for (sym, weight, dist) in arc # <<<<<<<<<<<<<< @@ -24051,10 +24322,18 @@ static PyObject *__pyx_gb_3_sa_14decode_lattice_2generator9(__pyx_GeneratorObjec */ if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #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[10]; __pyx_lineno = 115; __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[10]; __pyx_lineno = 115; __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; - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #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[10]; __pyx_lineno = 115; __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[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { @@ -24068,21 +24347,22 @@ static PyObject *__pyx_gb_3_sa_14decode_lattice_2generator9(__pyx_GeneratorObjec } if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { PyObject* sequence = __pyx_t_4; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 3)) { + if (size > 3) __Pyx_RaiseTooManyValuesError(3); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 3)) { - if (PyTuple_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); } else { - if (unlikely(PyList_GET_SIZE(sequence) != 3)) { - if (PyList_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); __pyx_t_7 = PyList_GET_ITEM(sequence, 2); @@ -24090,8 +24370,14 @@ static PyObject *__pyx_gb_3_sa_14decode_lattice_2generator9(__pyx_GeneratorObjec __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); + #else + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } else { + } else + { Py_ssize_t index = -1; __pyx_t_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); @@ -24104,12 +24390,13 @@ static PyObject *__pyx_gb_3_sa_14decode_lattice_2generator9(__pyx_GeneratorObjec index = 2; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); + __pyx_t_9 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L7_unpacking_done:; } @@ -24129,7 +24416,7 @@ static PyObject *__pyx_gb_3_sa_14decode_lattice_2generator9(__pyx_GeneratorObjec __pyx_cur_scope->__pyx_v_dist = __pyx_t_7; __pyx_t_7 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":116 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -24148,10 +24435,18 @@ static PyObject *__pyx_gb_3_sa_14decode_lattice_2generator9(__pyx_GeneratorObjec for (;;) { if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_4)) { if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_4)) break; - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_4)) { if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_4)) break; - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else { __pyx_t_7 = __pyx_t_11(__pyx_t_4); if (unlikely(!__pyx_t_7)) { @@ -24180,10 +24475,18 @@ static PyObject *__pyx_gb_3_sa_14decode_lattice_2generator9(__pyx_GeneratorObjec for (;;) { if (!__pyx_t_13 && PyList_CheckExact(__pyx_t_7)) { if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_7)) break; - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_12); __Pyx_INCREF(__pyx_t_6); __pyx_t_12++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_12); __Pyx_INCREF(__pyx_t_6); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else if (!__pyx_t_13 && PyTuple_CheckExact(__pyx_t_7)) { if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_7)) break; - __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_12); __Pyx_INCREF(__pyx_t_6); __pyx_t_12++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_12); __Pyx_INCREF(__pyx_t_6); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else { __pyx_t_6 = __pyx_t_13(__pyx_t_7); if (unlikely(!__pyx_t_6)) { @@ -24201,7 +24504,7 @@ static PyObject *__pyx_gb_3_sa_14decode_lattice_2generator9(__pyx_GeneratorObjec __pyx_cur_scope->__pyx_v_node = __pyx_t_6; __pyx_t_6 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":115 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":115 * * def decode_lattice(lattice): * return tuple((sym_tostring(sym), weight, dist) for (sym, weight, dist) in arc # <<<<<<<<<<<<<< @@ -24277,11 +24580,12 @@ static PyObject *__pyx_gb_3_sa_14decode_lattice_2generator9(__pyx_GeneratorObjec __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_generator->resume_label = -1; + __Pyx_Generator_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return NULL; } -/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":114 +/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":114 * return tuple(((word, None, 1), ) for word in word_ids) * * def decode_lattice(lattice): # <<<<<<<<<<<<<< @@ -24309,7 +24613,7 @@ static PyObject *__pyx_pf_3_sa_8decode_lattice(CYTHON_UNUSED PyObject *__pyx_sel __Pyx_INCREF(__pyx_cur_scope->__pyx_v_lattice); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_lattice); - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":115 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":115 * * def decode_lattice(lattice): * return tuple((sym_tostring(sym), weight, dist) for (sym, weight, dist) in arc # <<<<<<<<<<<<<< @@ -24352,14 +24656,13 @@ static PyObject *__pyx_pw_3_sa_11decode_sentence(PyObject *__pyx_self, PyObject PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("decode_sentence (wrapper)", 0); - __pyx_self = __pyx_self; __pyx_r = __pyx_pf_3_sa_10decode_sentence(__pyx_self, ((PyObject *)__pyx_v_lattice)); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_3_sa_15decode_sentence_2generator10(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":119 +/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":119 * * def decode_sentence(lattice): * return tuple(sym_tostring(sym) for ((sym, _, _),) in lattice) # <<<<<<<<<<<<<< @@ -24441,10 +24744,18 @@ static PyObject *__pyx_gb_3_sa_15decode_sentence_2generator10(__pyx_GeneratorObj for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #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[10]; __pyx_lineno = 119; __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[10]; __pyx_lineno = 119; __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; - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #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[10]; __pyx_lineno = 119; __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[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { @@ -24458,24 +24769,29 @@ static PyObject *__pyx_gb_3_sa_15decode_sentence_2generator10(__pyx_GeneratorObj } if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { PyObject* sequence = __pyx_t_4; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 1)) { + if (size > 1) __Pyx_RaiseTooManyValuesError(1); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 1)) { - if (PyTuple_GET_SIZE(sequence) > 1) __Pyx_RaiseTooManyValuesError(1); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); } else { - if (unlikely(PyList_GET_SIZE(sequence) != 1)) { - if (PyList_GET_SIZE(sequence) > 1) __Pyx_RaiseTooManyValuesError(1); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } __pyx_t_5 = PyList_GET_ITEM(sequence, 0); } __Pyx_INCREF(__pyx_t_5); + #else + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } else { + } else + { Py_ssize_t index = -1; __pyx_t_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); @@ -24484,32 +24800,34 @@ static PyObject *__pyx_gb_3_sa_15decode_sentence_2generator10(__pyx_GeneratorObj index = 0; __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), 1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __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; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); + __pyx_t_7 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L7_unpacking_done:; } if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { PyObject* sequence = __pyx_t_5; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 3)) { + if (size > 3) __Pyx_RaiseTooManyValuesError(3); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 3)) { - if (PyTuple_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 2); } else { - if (unlikely(PyList_GET_SIZE(sequence) != 3)) { - if (PyList_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_8 = PyList_GET_ITEM(sequence, 1); __pyx_t_9 = PyList_GET_ITEM(sequence, 2); @@ -24517,8 +24835,14 @@ static PyObject *__pyx_gb_3_sa_15decode_sentence_2generator10(__pyx_GeneratorObj __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); + #else + __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } else { + } else + { Py_ssize_t index = -1; __pyx_t_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); @@ -24531,12 +24855,13 @@ static PyObject *__pyx_gb_3_sa_15decode_sentence_2generator10(__pyx_GeneratorObj index = 2; __pyx_t_9 = __pyx_t_7(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_10), 3) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); + __pyx_t_7 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L9_unpacking_done:; } @@ -24592,11 +24917,12 @@ static PyObject *__pyx_gb_3_sa_15decode_sentence_2generator10(__pyx_GeneratorObj __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_generator->resume_label = -1; + __Pyx_Generator_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return NULL; } -/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":118 +/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":118 * for arc in node for node in lattice) * * def decode_sentence(lattice): # <<<<<<<<<<<<<< @@ -24624,7 +24950,7 @@ static PyObject *__pyx_pf_3_sa_10decode_sentence(CYTHON_UNUSED PyObject *__pyx_s __Pyx_INCREF(__pyx_cur_scope->__pyx_v_lattice); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_lattice); - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":119 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":119 * * def decode_sentence(lattice): * return tuple(sym_tostring(sym) for ((sym, _, _),) in lattice) # <<<<<<<<<<<<<< @@ -24667,14 +24993,13 @@ static PyObject *__pyx_pw_3_sa_13encode_words(PyObject *__pyx_self, PyObject *__ PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("encode_words (wrapper)", 0); - __pyx_self = __pyx_self; __pyx_r = __pyx_pf_3_sa_12encode_words(__pyx_self, ((PyObject *)__pyx_v_words)); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_3_sa_12encode_words_2generator11(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":122 +/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":122 * * def encode_words(words): * return tuple(sym_fromstring(word, True) for word in words) # <<<<<<<<<<<<<< @@ -24750,10 +25075,18 @@ static PyObject *__pyx_gb_3_sa_12encode_words_2generator11(__pyx_GeneratorObject for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #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[10]; __pyx_lineno = 122; __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[10]; __pyx_lineno = 122; __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; - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #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[10]; __pyx_lineno = 122; __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[10]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { @@ -24802,11 +25135,12 @@ static PyObject *__pyx_gb_3_sa_12encode_words_2generator11(__pyx_GeneratorObject __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_generator->resume_label = -1; + __Pyx_Generator_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return NULL; } -/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":121 +/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":121 * return tuple(sym_tostring(sym) for ((sym, _, _),) in lattice) * * def encode_words(words): # <<<<<<<<<<<<<< @@ -24834,7 +25168,7 @@ static PyObject *__pyx_pf_3_sa_12encode_words(CYTHON_UNUSED PyObject *__pyx_self __Pyx_INCREF(__pyx_cur_scope->__pyx_v_words); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_words); - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":122 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":122 * * def encode_words(words): * return tuple(sym_fromstring(word, True) for word in words) # <<<<<<<<<<<<<< @@ -24877,14 +25211,13 @@ static PyObject *__pyx_pw_3_sa_15decode_words(PyObject *__pyx_self, PyObject *__ PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("decode_words (wrapper)", 0); - __pyx_self = __pyx_self; __pyx_r = __pyx_pf_3_sa_14decode_words(__pyx_self, ((PyObject *)__pyx_v_syms)); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_3_sa_12decode_words_2generator12(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":125 +/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":125 * * def decode_words(syms): * return tuple(sym_tostring(sym) for sym in syms) # <<<<<<<<<<<<<< @@ -24958,10 +25291,18 @@ static PyObject *__pyx_gb_3_sa_12decode_words_2generator12(__pyx_GeneratorObject for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #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[10]; __pyx_lineno = 125; __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[10]; __pyx_lineno = 125; __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; - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #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[10]; __pyx_lineno = 125; __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[10]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { @@ -25010,11 +25351,12 @@ static PyObject *__pyx_gb_3_sa_12decode_words_2generator12(__pyx_GeneratorObject __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_generator->resume_label = -1; + __Pyx_Generator_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return NULL; } -/* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":124 +/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":124 * return tuple(sym_fromstring(word, True) for word in words) * * def decode_words(syms): # <<<<<<<<<<<<<< @@ -25041,7 +25383,7 @@ static PyObject *__pyx_pf_3_sa_14decode_words(CYTHON_UNUSED PyObject *__pyx_self __Pyx_INCREF(__pyx_cur_scope->__pyx_v_syms); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_syms); - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":125 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":125 * * def decode_words(syms): * return tuple(sym_tostring(sym) for sym in syms) # <<<<<<<<<<<<<< @@ -25079,11 +25421,11 @@ static PyObject *__pyx_pf_3_sa_14decode_words(CYTHON_UNUSED PyObject *__pyx_self static int __pyx_pw_3_sa_6Phrase_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_3_sa_6Phrase_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_words = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__words,0}; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__words,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -25096,8 +25438,7 @@ static int __pyx_pw_3_sa_6Phrase_1__cinit__(PyObject *__pyx_v_self, PyObject *__ kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__words); - if (likely(values[0])) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__words)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { @@ -25123,7 +25464,7 @@ static int __pyx_pw_3_sa_6Phrase_1__cinit__(PyObject *__pyx_v_self, PyObject *__ return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":6 +/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":6 * cdef class Phrase: * * def __cinit__(self, words): # <<<<<<<<<<<<<< @@ -25147,7 +25488,7 @@ static int __pyx_pf_3_sa_6Phrase___cinit__(struct __pyx_obj_3_sa_Phrase *__pyx_v int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":8 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":8 * def __cinit__(self, words): * cdef int i, j, n, n_vars * n_vars = 0 # <<<<<<<<<<<<<< @@ -25156,7 +25497,7 @@ static int __pyx_pf_3_sa_6Phrase___cinit__(struct __pyx_obj_3_sa_Phrase *__pyx_v */ __pyx_v_n_vars = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":9 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":9 * cdef int i, j, n, n_vars * n_vars = 0 * n = len(words) # <<<<<<<<<<<<<< @@ -25166,7 +25507,7 @@ static int __pyx_pf_3_sa_6Phrase___cinit__(struct __pyx_obj_3_sa_Phrase *__pyx_v __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/paulb/workspace/cdec/python/src/sa/rule.pxi":10 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":10 * n_vars = 0 * n = len(words) * self.syms = malloc(n*sizeof(int)) # <<<<<<<<<<<<<< @@ -25175,7 +25516,7 @@ static int __pyx_pf_3_sa_6Phrase___cinit__(struct __pyx_obj_3_sa_Phrase *__pyx_v */ __pyx_v_self->syms = ((int *)malloc((__pyx_v_n * (sizeof(int))))); - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":11 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":11 * n = len(words) * self.syms = malloc(n*sizeof(int)) * for i from 0 <= i < n: # <<<<<<<<<<<<<< @@ -25185,7 +25526,7 @@ static int __pyx_pf_3_sa_6Phrase___cinit__(struct __pyx_obj_3_sa_Phrase *__pyx_v __pyx_t_2 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":12 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":12 * self.syms = malloc(n*sizeof(int)) * for i from 0 <= i < n: * self.syms[i] = words[i] # <<<<<<<<<<<<<< @@ -25198,7 +25539,7 @@ static int __pyx_pf_3_sa_6Phrase___cinit__(struct __pyx_obj_3_sa_Phrase *__pyx_v __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; (__pyx_v_self->syms[__pyx_v_i]) = __pyx_t_4; - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":13 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":13 * for i from 0 <= i < n: * self.syms[i] = words[i] * if sym_isvar(self.syms[i]): # <<<<<<<<<<<<<< @@ -25208,7 +25549,7 @@ static int __pyx_pf_3_sa_6Phrase___cinit__(struct __pyx_obj_3_sa_Phrase *__pyx_v __pyx_t_4 = __pyx_f_3_sa_sym_isvar((__pyx_v_self->syms[__pyx_v_i])); if (__pyx_t_4) { - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":14 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":14 * self.syms[i] = words[i] * if sym_isvar(self.syms[i]): * n_vars += 1 # <<<<<<<<<<<<<< @@ -25221,7 +25562,7 @@ static int __pyx_pf_3_sa_6Phrase___cinit__(struct __pyx_obj_3_sa_Phrase *__pyx_v __pyx_L5:; } - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":15 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":15 * if sym_isvar(self.syms[i]): * n_vars += 1 * self.n = n # <<<<<<<<<<<<<< @@ -25230,7 +25571,7 @@ static int __pyx_pf_3_sa_6Phrase___cinit__(struct __pyx_obj_3_sa_Phrase *__pyx_v */ __pyx_v_self->n = __pyx_v_n; - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":16 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":16 * n_vars += 1 * self.n = n * self.n_vars = n_vars # <<<<<<<<<<<<<< @@ -25239,7 +25580,7 @@ static int __pyx_pf_3_sa_6Phrase___cinit__(struct __pyx_obj_3_sa_Phrase *__pyx_v */ __pyx_v_self->n_vars = __pyx_v_n_vars; - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":17 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":17 * self.n = n * self.n_vars = n_vars * self.varpos = malloc(n_vars*sizeof(int)) # <<<<<<<<<<<<<< @@ -25248,7 +25589,7 @@ static int __pyx_pf_3_sa_6Phrase___cinit__(struct __pyx_obj_3_sa_Phrase *__pyx_v */ __pyx_v_self->varpos = ((int *)malloc((__pyx_v_n_vars * (sizeof(int))))); - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":18 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":18 * self.n_vars = n_vars * self.varpos = malloc(n_vars*sizeof(int)) * j = 0 # <<<<<<<<<<<<<< @@ -25257,7 +25598,7 @@ static int __pyx_pf_3_sa_6Phrase___cinit__(struct __pyx_obj_3_sa_Phrase *__pyx_v */ __pyx_v_j = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":19 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":19 * self.varpos = malloc(n_vars*sizeof(int)) * j = 0 * for i from 0 <= i < n: # <<<<<<<<<<<<<< @@ -25267,7 +25608,7 @@ static int __pyx_pf_3_sa_6Phrase___cinit__(struct __pyx_obj_3_sa_Phrase *__pyx_v __pyx_t_2 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":20 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":20 * j = 0 * for i from 0 <= i < n: * if sym_isvar(self.syms[i]): # <<<<<<<<<<<<<< @@ -25277,7 +25618,7 @@ static int __pyx_pf_3_sa_6Phrase___cinit__(struct __pyx_obj_3_sa_Phrase *__pyx_v __pyx_t_4 = __pyx_f_3_sa_sym_isvar((__pyx_v_self->syms[__pyx_v_i])); if (__pyx_t_4) { - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":21 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":21 * for i from 0 <= i < n: * if sym_isvar(self.syms[i]): * self.varpos[j] = i # <<<<<<<<<<<<<< @@ -25286,7 +25627,7 @@ static int __pyx_pf_3_sa_6Phrase___cinit__(struct __pyx_obj_3_sa_Phrase *__pyx_v */ (__pyx_v_self->varpos[__pyx_v_j]) = __pyx_v_i; - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":22 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":22 * if sym_isvar(self.syms[i]): * self.varpos[j] = i * j = j + 1 # <<<<<<<<<<<<<< @@ -25319,7 +25660,7 @@ static void __pyx_pw_3_sa_6Phrase_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyFinishContext(); } -/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":24 +/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":24 * j = j + 1 * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -25331,7 +25672,7 @@ static void __pyx_pf_3_sa_6Phrase_2__dealloc__(struct __pyx_obj_3_sa_Phrase *__p __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":25 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":25 * * def __dealloc__(self): * free(self.syms) # <<<<<<<<<<<<<< @@ -25340,7 +25681,7 @@ static void __pyx_pf_3_sa_6Phrase_2__dealloc__(struct __pyx_obj_3_sa_Phrase *__p */ free(__pyx_v_self->syms); - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":26 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":26 * def __dealloc__(self): * free(self.syms) * free(self.varpos) # <<<<<<<<<<<<<< @@ -25363,7 +25704,7 @@ static PyObject *__pyx_pw_3_sa_6Phrase_5__str__(PyObject *__pyx_v_self) { return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":28 +/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":28 * free(self.varpos) * * def __str__(self): # <<<<<<<<<<<<<< @@ -25387,7 +25728,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_4__str__(struct __pyx_obj_3_sa_Phrase *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__str__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":29 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":29 * * def __str__(self): * strs = [] # <<<<<<<<<<<<<< @@ -25399,7 +25740,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_4__str__(struct __pyx_obj_3_sa_Phrase *__ __pyx_v_strs = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":31 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":31 * strs = [] * cdef int i, s * for i from 0 <= i < self.n: # <<<<<<<<<<<<<< @@ -25409,7 +25750,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_4__str__(struct __pyx_obj_3_sa_Phrase *__ __pyx_t_2 = __pyx_v_self->n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":32 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":32 * cdef int i, s * for i from 0 <= i < self.n: * s = self.syms[i] # <<<<<<<<<<<<<< @@ -25418,7 +25759,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_4__str__(struct __pyx_obj_3_sa_Phrase *__ */ __pyx_v_s = (__pyx_v_self->syms[__pyx_v_i]); - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":33 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":33 * for i from 0 <= i < self.n: * s = self.syms[i] * strs.append(sym_tostring(s)) # <<<<<<<<<<<<<< @@ -25431,7 +25772,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_4__str__(struct __pyx_obj_3_sa_Phrase *__ __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; } - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":34 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":34 * s = self.syms[i] * strs.append(sym_tostring(s)) * return ' '.join(strs) # <<<<<<<<<<<<<< @@ -25481,7 +25822,7 @@ static PyObject *__pyx_pw_3_sa_6Phrase_7handle(PyObject *__pyx_v_self, CYTHON_UN return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":36 +/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":36 * return ' '.join(strs) * * def handle(self): # <<<<<<<<<<<<<< @@ -25505,7 +25846,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_6handle(struct __pyx_obj_3_sa_Phrase *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("handle", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":39 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":39 * """return a hashable representation that normalizes the ordering * of the nonterminal indices""" * norm = [] # <<<<<<<<<<<<<< @@ -25517,7 +25858,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_6handle(struct __pyx_obj_3_sa_Phrase *__p __pyx_v_norm = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":41 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":41 * norm = [] * cdef int i, j, s * i = 1 # <<<<<<<<<<<<<< @@ -25526,7 +25867,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_6handle(struct __pyx_obj_3_sa_Phrase *__p */ __pyx_v_i = 1; - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":42 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":42 * cdef int i, j, s * i = 1 * j = 0 # <<<<<<<<<<<<<< @@ -25535,7 +25876,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_6handle(struct __pyx_obj_3_sa_Phrase *__p */ __pyx_v_j = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":43 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":43 * i = 1 * j = 0 * for j from 0 <= j < self.n: # <<<<<<<<<<<<<< @@ -25545,7 +25886,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_6handle(struct __pyx_obj_3_sa_Phrase *__p __pyx_t_2 = __pyx_v_self->n; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_2; __pyx_v_j++) { - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":44 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":44 * j = 0 * for j from 0 <= j < self.n: * s = self.syms[j] # <<<<<<<<<<<<<< @@ -25554,7 +25895,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_6handle(struct __pyx_obj_3_sa_Phrase *__p */ __pyx_v_s = (__pyx_v_self->syms[__pyx_v_j]); - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":45 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":45 * for j from 0 <= j < self.n: * s = self.syms[j] * if sym_isvar(s): # <<<<<<<<<<<<<< @@ -25564,7 +25905,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_6handle(struct __pyx_obj_3_sa_Phrase *__p __pyx_t_3 = __pyx_f_3_sa_sym_isvar(__pyx_v_s); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":46 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":46 * s = self.syms[j] * if sym_isvar(s): * s = sym_setindex(s,i) # <<<<<<<<<<<<<< @@ -25573,7 +25914,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_6handle(struct __pyx_obj_3_sa_Phrase *__p */ __pyx_v_s = __pyx_f_3_sa_sym_setindex(__pyx_v_s, __pyx_v_i); - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":47 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":47 * if sym_isvar(s): * s = sym_setindex(s,i) * i = i + 1 # <<<<<<<<<<<<<< @@ -25585,7 +25926,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_6handle(struct __pyx_obj_3_sa_Phrase *__p } __pyx_L5:; - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":48 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":48 * s = sym_setindex(s,i) * i = i + 1 * norm.append(s) # <<<<<<<<<<<<<< @@ -25598,7 +25939,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_6handle(struct __pyx_obj_3_sa_Phrase *__p __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":49 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":49 * i = i + 1 * norm.append(s) * return tuple(norm) # <<<<<<<<<<<<<< @@ -25636,7 +25977,7 @@ static PyObject *__pyx_pw_3_sa_6Phrase_9strhandle(PyObject *__pyx_v_self, CYTHON return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":51 +/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":51 * return tuple(norm) * * def strhandle(self): # <<<<<<<<<<<<<< @@ -25663,7 +26004,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_8strhandle(struct __pyx_obj_3_sa_Phrase * int __pyx_clineno = 0; __Pyx_RefNannySetupContext("strhandle", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":52 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":52 * * def strhandle(self): * strs = [] # <<<<<<<<<<<<<< @@ -25675,7 +26016,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_8strhandle(struct __pyx_obj_3_sa_Phrase * __pyx_v_strs = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":53 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":53 * def strhandle(self): * strs = [] * norm = [] # <<<<<<<<<<<<<< @@ -25687,7 +26028,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_8strhandle(struct __pyx_obj_3_sa_Phrase * __pyx_v_norm = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":55 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":55 * norm = [] * cdef int i, j, s * i = 1 # <<<<<<<<<<<<<< @@ -25696,7 +26037,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_8strhandle(struct __pyx_obj_3_sa_Phrase * */ __pyx_v_i = 1; - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":56 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":56 * cdef int i, j, s * i = 1 * j = 0 # <<<<<<<<<<<<<< @@ -25705,7 +26046,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_8strhandle(struct __pyx_obj_3_sa_Phrase * */ __pyx_v_j = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":57 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":57 * i = 1 * j = 0 * for j from 0 <= j < self.n: # <<<<<<<<<<<<<< @@ -25715,7 +26056,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_8strhandle(struct __pyx_obj_3_sa_Phrase * __pyx_t_2 = __pyx_v_self->n; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_2; __pyx_v_j++) { - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":58 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":58 * j = 0 * for j from 0 <= j < self.n: * s = self.syms[j] # <<<<<<<<<<<<<< @@ -25724,7 +26065,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_8strhandle(struct __pyx_obj_3_sa_Phrase * */ __pyx_v_s = (__pyx_v_self->syms[__pyx_v_j]); - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":59 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":59 * for j from 0 <= j < self.n: * s = self.syms[j] * if sym_isvar(s): # <<<<<<<<<<<<<< @@ -25734,7 +26075,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_8strhandle(struct __pyx_obj_3_sa_Phrase * __pyx_t_3 = __pyx_f_3_sa_sym_isvar(__pyx_v_s); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":60 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":60 * s = self.syms[j] * if sym_isvar(s): * s = sym_setindex(s,i) # <<<<<<<<<<<<<< @@ -25743,7 +26084,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_8strhandle(struct __pyx_obj_3_sa_Phrase * */ __pyx_v_s = __pyx_f_3_sa_sym_setindex(__pyx_v_s, __pyx_v_i); - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":61 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":61 * if sym_isvar(s): * s = sym_setindex(s,i) * i = i + 1 # <<<<<<<<<<<<<< @@ -25755,7 +26096,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_8strhandle(struct __pyx_obj_3_sa_Phrase * } __pyx_L5:; - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":62 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":62 * s = sym_setindex(s,i) * i = i + 1 * norm.append(sym_tostring(s)) # <<<<<<<<<<<<<< @@ -25768,7 +26109,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_8strhandle(struct __pyx_obj_3_sa_Phrase * __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; } - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":63 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":63 * i = i + 1 * norm.append(sym_tostring(s)) * return ' '.join(norm) # <<<<<<<<<<<<<< @@ -25818,7 +26159,7 @@ static PyObject *__pyx_pw_3_sa_6Phrase_11arity(PyObject *__pyx_v_self, CYTHON_UN return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":65 +/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":65 * return ' '.join(norm) * * def arity(self): # <<<<<<<<<<<<<< @@ -25835,7 +26176,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_10arity(struct __pyx_obj_3_sa_Phrase *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("arity", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":66 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":66 * * def arity(self): * return self.n_vars # <<<<<<<<<<<<<< @@ -25872,7 +26213,7 @@ static PyObject *__pyx_pw_3_sa_6Phrase_13getvarpos(PyObject *__pyx_v_self, PyObj return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":68 +/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":68 * return self.n_vars * * def getvarpos(self, i): # <<<<<<<<<<<<<< @@ -25892,28 +26233,26 @@ static PyObject *__pyx_pf_3_sa_6Phrase_12getvarpos(struct __pyx_obj_3_sa_Phrase int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getvarpos", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":69 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":69 * * def getvarpos(self, i): * if 0 <= i < self.n_vars: # <<<<<<<<<<<<<< * return self.varpos[i] * else: */ - __pyx_t_1 = PyObject_RichCompare(__pyx_int_0, __pyx_v_i, Py_LE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __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 = 69; __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 = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_RichCompare(__pyx_v_i, __pyx_t_2, Py_LT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __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 = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":70 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":70 * def getvarpos(self, i): * if 0 <= i < self.n_vars: * return self.varpos[i] # <<<<<<<<<<<<<< @@ -25931,7 +26270,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_12getvarpos(struct __pyx_obj_3_sa_Phrase } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":72 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":72 * return self.varpos[i] * else: * raise IndexError # <<<<<<<<<<<<<< @@ -25967,7 +26306,7 @@ static PyObject *__pyx_pw_3_sa_6Phrase_15getvar(PyObject *__pyx_v_self, PyObject return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":74 +/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":74 * raise IndexError * * def getvar(self, i): # <<<<<<<<<<<<<< @@ -25987,28 +26326,26 @@ static PyObject *__pyx_pf_3_sa_6Phrase_14getvar(struct __pyx_obj_3_sa_Phrase *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getvar", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":75 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":75 * * def getvar(self, i): * if 0 <= i < self.n_vars: # <<<<<<<<<<<<<< * return self.syms[self.varpos[i]] * else: */ - __pyx_t_1 = PyObject_RichCompare(__pyx_int_0, __pyx_v_i, Py_LE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __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 = 75; __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 = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_RichCompare(__pyx_v_i, __pyx_t_2, Py_LT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __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 = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":76 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":76 * def getvar(self, i): * if 0 <= i < self.n_vars: * return self.syms[self.varpos[i]] # <<<<<<<<<<<<<< @@ -26026,7 +26363,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_14getvar(struct __pyx_obj_3_sa_Phrase *__ } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":78 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":78 * return self.syms[self.varpos[i]] * else: * raise IndexError # <<<<<<<<<<<<<< @@ -26051,7 +26388,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_14getvar(struct __pyx_obj_3_sa_Phrase *__ return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":80 +/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":80 * raise IndexError * * cdef int chunkpos(self, int k): # <<<<<<<<<<<<<< @@ -26065,7 +26402,7 @@ int __pyx_f_3_sa_6Phrase_chunkpos(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, in int __pyx_t_1; __Pyx_RefNannySetupContext("chunkpos", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":81 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":81 * * cdef int chunkpos(self, int k): * if k == 0: # <<<<<<<<<<<<<< @@ -26075,7 +26412,7 @@ int __pyx_f_3_sa_6Phrase_chunkpos(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, in __pyx_t_1 = (__pyx_v_k == 0); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":82 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":82 * cdef int chunkpos(self, int k): * if k == 0: * return 0 # <<<<<<<<<<<<<< @@ -26088,7 +26425,7 @@ int __pyx_f_3_sa_6Phrase_chunkpos(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, in } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":84 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":84 * return 0 * else: * return self.varpos[k-1]+1 # <<<<<<<<<<<<<< @@ -26106,7 +26443,7 @@ int __pyx_f_3_sa_6Phrase_chunkpos(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, in return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":86 +/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":86 * return self.varpos[k-1]+1 * * cdef int chunklen(self, int k): # <<<<<<<<<<<<<< @@ -26120,7 +26457,7 @@ int __pyx_f_3_sa_6Phrase_chunklen(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, in int __pyx_t_1; __Pyx_RefNannySetupContext("chunklen", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":87 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":87 * * cdef int chunklen(self, int k): * if self.n_vars == 0: # <<<<<<<<<<<<<< @@ -26130,7 +26467,7 @@ int __pyx_f_3_sa_6Phrase_chunklen(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, in __pyx_t_1 = (__pyx_v_self->n_vars == 0); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":88 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":88 * cdef int chunklen(self, int k): * if self.n_vars == 0: * return self.n # <<<<<<<<<<<<<< @@ -26142,7 +26479,7 @@ int __pyx_f_3_sa_6Phrase_chunklen(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, in goto __pyx_L3; } - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":89 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":89 * if self.n_vars == 0: * return self.n * elif k == 0: # <<<<<<<<<<<<<< @@ -26152,7 +26489,7 @@ int __pyx_f_3_sa_6Phrase_chunklen(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, in __pyx_t_1 = (__pyx_v_k == 0); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":90 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":90 * return self.n * elif k == 0: * return self.varpos[0] # <<<<<<<<<<<<<< @@ -26164,7 +26501,7 @@ int __pyx_f_3_sa_6Phrase_chunklen(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, in goto __pyx_L3; } - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":91 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":91 * elif k == 0: * return self.varpos[0] * elif k == self.n_vars: # <<<<<<<<<<<<<< @@ -26174,7 +26511,7 @@ int __pyx_f_3_sa_6Phrase_chunklen(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, in __pyx_t_1 = (__pyx_v_k == __pyx_v_self->n_vars); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":92 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":92 * return self.varpos[0] * elif k == self.n_vars: * return self.n-self.varpos[k-1]-1 # <<<<<<<<<<<<<< @@ -26187,7 +26524,7 @@ int __pyx_f_3_sa_6Phrase_chunklen(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, in } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":94 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":94 * return self.n-self.varpos[k-1]-1 * else: * return self.varpos[k]-self.varpos[k-1]-1 # <<<<<<<<<<<<<< @@ -26216,7 +26553,7 @@ static PyObject *__pyx_pw_3_sa_6Phrase_17clen(PyObject *__pyx_v_self, PyObject * return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":96 +/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":96 * return self.varpos[k]-self.varpos[k-1]-1 * * def clen(self, k): # <<<<<<<<<<<<<< @@ -26234,7 +26571,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_16clen(struct __pyx_obj_3_sa_Phrase *__py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clen", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":97 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":97 * * def clen(self, k): * return self.chunklen(k) # <<<<<<<<<<<<<< @@ -26272,7 +26609,7 @@ static PyObject *__pyx_pw_3_sa_6Phrase_19getchunk(PyObject *__pyx_v_self, PyObje return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":99 +/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":99 * return self.chunklen(k) * * def getchunk(self, ci): # <<<<<<<<<<<<<< @@ -26295,7 +26632,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_18getchunk(struct __pyx_obj_3_sa_Phrase * int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getchunk", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":101 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":101 * def getchunk(self, ci): * cdef int start, stop * start = self.chunkpos(ci) # <<<<<<<<<<<<<< @@ -26305,7 +26642,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_18getchunk(struct __pyx_obj_3_sa_Phrase * __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_ci); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_start = ((struct __pyx_vtabstruct_3_sa_Phrase *)__pyx_v_self->__pyx_vtab)->chunkpos(__pyx_v_self, __pyx_t_1); - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":102 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":102 * cdef int start, stop * start = self.chunkpos(ci) * stop = start+self.chunklen(ci) # <<<<<<<<<<<<<< @@ -26315,7 +26652,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_18getchunk(struct __pyx_obj_3_sa_Phrase * __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_ci); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_stop = (__pyx_v_start + ((struct __pyx_vtabstruct_3_sa_Phrase *)__pyx_v_self->__pyx_vtab)->chunklen(__pyx_v_self, __pyx_t_1)); - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":103 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":103 * start = self.chunkpos(ci) * stop = start+self.chunklen(ci) * chunk = [] # <<<<<<<<<<<<<< @@ -26327,7 +26664,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_18getchunk(struct __pyx_obj_3_sa_Phrase * __pyx_v_chunk = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":104 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":104 * stop = start+self.chunklen(ci) * chunk = [] * for i from start <= i < stop: # <<<<<<<<<<<<<< @@ -26337,7 +26674,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_18getchunk(struct __pyx_obj_3_sa_Phrase * __pyx_t_1 = __pyx_v_stop; for (__pyx_v_i = __pyx_v_start; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":105 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":105 * chunk = [] * for i from start <= i < stop: * chunk.append(self.syms[i]) # <<<<<<<<<<<<<< @@ -26350,7 +26687,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_18getchunk(struct __pyx_obj_3_sa_Phrase * __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":106 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":106 * for i from start <= i < stop: * chunk.append(self.syms[i]) * return chunk # <<<<<<<<<<<<<< @@ -26388,7 +26725,7 @@ static int __pyx_pw_3_sa_6Phrase_21__cmp__(PyObject *__pyx_v_self, PyObject *__p } #endif /*!(#if PY_MAJOR_VERSION < 3)*/ -/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":108 +/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":108 * return chunk * * def __cmp__(self, other): # <<<<<<<<<<<<<< @@ -26411,7 +26748,7 @@ static int __pyx_pf_3_sa_6Phrase_20__cmp__(struct __pyx_obj_3_sa_Phrase *__pyx_v int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cmp__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":111 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":111 * cdef Phrase otherp * cdef int i * otherp = other # <<<<<<<<<<<<<< @@ -26422,7 +26759,7 @@ static int __pyx_pf_3_sa_6Phrase_20__cmp__(struct __pyx_obj_3_sa_Phrase *__pyx_v __Pyx_INCREF(__pyx_v_other); __pyx_v_otherp = ((struct __pyx_obj_3_sa_Phrase *)__pyx_v_other); - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":112 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":112 * cdef int i * otherp = other * for i from 0 <= i < min(self.n, otherp.n): # <<<<<<<<<<<<<< @@ -26439,7 +26776,7 @@ static int __pyx_pf_3_sa_6Phrase_20__cmp__(struct __pyx_obj_3_sa_Phrase *__pyx_v __pyx_t_1 = __pyx_t_3; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":113 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":113 * otherp = other * for i from 0 <= i < min(self.n, otherp.n): * if self.syms[i] < otherp.syms[i]: # <<<<<<<<<<<<<< @@ -26449,7 +26786,7 @@ static int __pyx_pf_3_sa_6Phrase_20__cmp__(struct __pyx_obj_3_sa_Phrase *__pyx_v __pyx_t_4 = ((__pyx_v_self->syms[__pyx_v_i]) < (__pyx_v_otherp->syms[__pyx_v_i])); if (__pyx_t_4) { - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":114 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":114 * for i from 0 <= i < min(self.n, otherp.n): * if self.syms[i] < otherp.syms[i]: * return -1 # <<<<<<<<<<<<<< @@ -26461,7 +26798,7 @@ static int __pyx_pf_3_sa_6Phrase_20__cmp__(struct __pyx_obj_3_sa_Phrase *__pyx_v goto __pyx_L5; } - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":115 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":115 * if self.syms[i] < otherp.syms[i]: * return -1 * elif self.syms[i] > otherp.syms[i]: # <<<<<<<<<<<<<< @@ -26471,7 +26808,7 @@ static int __pyx_pf_3_sa_6Phrase_20__cmp__(struct __pyx_obj_3_sa_Phrase *__pyx_v __pyx_t_4 = ((__pyx_v_self->syms[__pyx_v_i]) > (__pyx_v_otherp->syms[__pyx_v_i])); if (__pyx_t_4) { - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":116 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":116 * return -1 * elif self.syms[i] > otherp.syms[i]: * return 1 # <<<<<<<<<<<<<< @@ -26485,7 +26822,7 @@ static int __pyx_pf_3_sa_6Phrase_20__cmp__(struct __pyx_obj_3_sa_Phrase *__pyx_v __pyx_L5:; } - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":117 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":117 * elif self.syms[i] > otherp.syms[i]: * return 1 * if self.n < otherp.n: # <<<<<<<<<<<<<< @@ -26495,7 +26832,7 @@ static int __pyx_pf_3_sa_6Phrase_20__cmp__(struct __pyx_obj_3_sa_Phrase *__pyx_v __pyx_t_4 = (__pyx_v_self->n < __pyx_v_otherp->n); if (__pyx_t_4) { - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":118 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":118 * return 1 * if self.n < otherp.n: * return -1 # <<<<<<<<<<<<<< @@ -26507,7 +26844,7 @@ static int __pyx_pf_3_sa_6Phrase_20__cmp__(struct __pyx_obj_3_sa_Phrase *__pyx_v goto __pyx_L6; } - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":119 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":119 * if self.n < otherp.n: * return -1 * elif self.n > otherp.n: # <<<<<<<<<<<<<< @@ -26517,7 +26854,7 @@ static int __pyx_pf_3_sa_6Phrase_20__cmp__(struct __pyx_obj_3_sa_Phrase *__pyx_v __pyx_t_4 = (__pyx_v_self->n > __pyx_v_otherp->n); if (__pyx_t_4) { - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":120 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":120 * return -1 * elif self.n > otherp.n: * return 1 # <<<<<<<<<<<<<< @@ -26530,7 +26867,7 @@ static int __pyx_pf_3_sa_6Phrase_20__cmp__(struct __pyx_obj_3_sa_Phrase *__pyx_v } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":122 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":122 * return 1 * else: * return 0 # <<<<<<<<<<<<<< @@ -26565,7 +26902,7 @@ static Py_hash_t __pyx_pw_3_sa_6Phrase_23__hash__(PyObject *__pyx_v_self) { return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":124 +/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":124 * return 0 * * def __hash__(self): # <<<<<<<<<<<<<< @@ -26582,7 +26919,7 @@ static Py_hash_t __pyx_pf_3_sa_6Phrase_22__hash__(struct __pyx_obj_3_sa_Phrase * int __pyx_t_2; __Pyx_RefNannySetupContext("__hash__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":127 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":127 * cdef int i * cdef unsigned h * h = 0 # <<<<<<<<<<<<<< @@ -26591,7 +26928,7 @@ static Py_hash_t __pyx_pf_3_sa_6Phrase_22__hash__(struct __pyx_obj_3_sa_Phrase * */ __pyx_v_h = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":128 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":128 * cdef unsigned h * h = 0 * for i from 0 <= i < self.n: # <<<<<<<<<<<<<< @@ -26601,7 +26938,7 @@ static Py_hash_t __pyx_pf_3_sa_6Phrase_22__hash__(struct __pyx_obj_3_sa_Phrase * __pyx_t_1 = __pyx_v_self->n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":129 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":129 * h = 0 * for i from 0 <= i < self.n: * if self.syms[i] > 0: # <<<<<<<<<<<<<< @@ -26611,7 +26948,7 @@ static Py_hash_t __pyx_pf_3_sa_6Phrase_22__hash__(struct __pyx_obj_3_sa_Phrase * __pyx_t_2 = ((__pyx_v_self->syms[__pyx_v_i]) > 0); if (__pyx_t_2) { - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":130 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":130 * for i from 0 <= i < self.n: * if self.syms[i] > 0: * h = (h << 1) + self.syms[i] # <<<<<<<<<<<<<< @@ -26623,7 +26960,7 @@ static Py_hash_t __pyx_pf_3_sa_6Phrase_22__hash__(struct __pyx_obj_3_sa_Phrase * } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":132 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":132 * h = (h << 1) + self.syms[i] * else: * h = (h << 1) + -self.syms[i] # <<<<<<<<<<<<<< @@ -26635,7 +26972,7 @@ static Py_hash_t __pyx_pf_3_sa_6Phrase_22__hash__(struct __pyx_obj_3_sa_Phrase * __pyx_L5:; } - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":133 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":133 * else: * h = (h << 1) + -self.syms[i] * return h # <<<<<<<<<<<<<< @@ -26663,7 +27000,7 @@ static Py_ssize_t __pyx_pw_3_sa_6Phrase_25__len__(PyObject *__pyx_v_self) { return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":135 +/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":135 * return h * * def __len__(self): # <<<<<<<<<<<<<< @@ -26676,7 +27013,7 @@ static Py_ssize_t __pyx_pf_3_sa_6Phrase_24__len__(struct __pyx_obj_3_sa_Phrase * __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":136 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":136 * * def __len__(self): * return self.n # <<<<<<<<<<<<<< @@ -26703,7 +27040,7 @@ static PyObject *__pyx_pw_3_sa_6Phrase_27__getitem__(PyObject *__pyx_v_self, PyO return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":138 +/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":138 * return self.n * * def __getitem__(self, i): # <<<<<<<<<<<<<< @@ -26721,7 +27058,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_26__getitem__(struct __pyx_obj_3_sa_Phras int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":139 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":139 * * def __getitem__(self, i): * return self.syms[i] # <<<<<<<<<<<<<< @@ -26760,7 +27097,7 @@ static PyObject *__pyx_pw_3_sa_6Phrase_29__iter__(PyObject *__pyx_v_self) { return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":141 +/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":141 * return self.syms[i] * * def __iter__(self): # <<<<<<<<<<<<<< @@ -26822,7 +27159,7 @@ static PyObject *__pyx_gb_3_sa_6Phrase_30generator2(__pyx_GeneratorObject *__pyx __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":143 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":143 * def __iter__(self): * cdef int i * for i from 0 <= i < self.n: # <<<<<<<<<<<<<< @@ -26832,7 +27169,7 @@ static PyObject *__pyx_gb_3_sa_6Phrase_30generator2(__pyx_GeneratorObject *__pyx __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/paulb/workspace/cdec/python/src/sa/rule.pxi":144 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":144 * cdef int i * for i from 0 <= i < self.n: * yield self.syms[i] # <<<<<<<<<<<<<< @@ -26861,6 +27198,7 @@ static PyObject *__pyx_gb_3_sa_6Phrase_30generator2(__pyx_GeneratorObject *__pyx __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_generator->resume_label = -1; + __Pyx_Generator_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return NULL; } @@ -26870,11 +27208,11 @@ static PyObject *__pyx_pw_3_sa_6Phrase_32subst(PyObject *__pyx_v_self, PyObject static PyObject *__pyx_pw_3_sa_6Phrase_32subst(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_start = 0; PyObject *__pyx_v_children = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__start,&__pyx_n_s__children,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("subst (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__start,&__pyx_n_s__children,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -26888,12 +27226,10 @@ static PyObject *__pyx_pw_3_sa_6Phrase_32subst(PyObject *__pyx_v_self, PyObject kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start); - if (likely(values[0])) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__children); - if (likely(values[1])) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__children)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("subst", 1, 2, 2, 1); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -26923,7 +27259,7 @@ static PyObject *__pyx_pw_3_sa_6Phrase_32subst(PyObject *__pyx_v_self, PyObject return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":146 +/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":146 * yield self.syms[i] * * def subst(self, start, children): # <<<<<<<<<<<<<< @@ -26946,7 +27282,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_31subst(struct __pyx_obj_3_sa_Phrase *__p __Pyx_RefNannySetupContext("subst", 0); __Pyx_INCREF(__pyx_v_start); - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":148 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":148 * def subst(self, start, children): * cdef int i * for i from 0 <= i < self.n: # <<<<<<<<<<<<<< @@ -26956,7 +27292,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_31subst(struct __pyx_obj_3_sa_Phrase *__p __pyx_t_1 = __pyx_v_self->n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":149 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":149 * cdef int i * for i from 0 <= i < self.n: * if sym_isvar(self.syms[i]): # <<<<<<<<<<<<<< @@ -26966,7 +27302,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_31subst(struct __pyx_obj_3_sa_Phrase *__p __pyx_t_2 = __pyx_f_3_sa_sym_isvar((__pyx_v_self->syms[__pyx_v_i])); if (__pyx_t_2) { - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":150 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":150 * for i from 0 <= i < self.n: * if sym_isvar(self.syms[i]): * start = start + children[sym_getindex(self.syms[i])-1] # <<<<<<<<<<<<<< @@ -26986,7 +27322,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_31subst(struct __pyx_obj_3_sa_Phrase *__p } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":152 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":152 * start = start + children[sym_getindex(self.syms[i])-1] * else: * start = start + (self.syms[i],) # <<<<<<<<<<<<<< @@ -27010,7 +27346,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_31subst(struct __pyx_obj_3_sa_Phrase *__p __pyx_L5:; } - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":153 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":153 * else: * start = start + (self.syms[i],) * return start # <<<<<<<<<<<<<< @@ -27047,7 +27383,7 @@ static PyObject *__pyx_pw_3_sa_6Phrase_5words_1__get__(PyObject *__pyx_v_self) { return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":156 +/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":156 * * property words: * def __get__(self): # <<<<<<<<<<<<<< @@ -27071,7 +27407,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_5words___get__(struct __pyx_obj_3_sa_Phra int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":157 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":157 * property words: * def __get__(self): * return [sym_tostring(w) for w in self if not sym_isvar(w)] # <<<<<<<<<<<<<< @@ -27092,10 +27428,18 @@ static PyObject *__pyx_pf_3_sa_6Phrase_5words___get__(struct __pyx_obj_3_sa_Phra for (;;) { if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else { __pyx_t_5 = __pyx_t_4(__pyx_t_2); if (unlikely(!__pyx_t_5)) { @@ -27116,7 +27460,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_5words___get__(struct __pyx_obj_3_sa_Phra __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_w); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = PyBytes_FromString(__pyx_f_3_sa_sym_tostring(__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - if (unlikely(PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; goto __pyx_L5; } @@ -27151,14 +27495,14 @@ static int __pyx_pw_3_sa_4Rule_1__cinit__(PyObject *__pyx_v_self, PyObject *__py struct __pyx_obj_3_sa_Phrase *__pyx_v_e = 0; PyObject *__pyx_v_scores = 0; PyObject *__pyx_v_word_alignments = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__lhs,&__pyx_n_s__f,&__pyx_n_s__e,&__pyx_n_s__scores,&__pyx_n_s__word_alignments,0}; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__lhs,&__pyx_n_s__f,&__pyx_n_s__e,&__pyx_n_s__scores,&__pyx_n_s__word_alignments,0}; PyObject* values[5] = {0,0,0,0,0}; - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":161 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":161 * cdef class Rule: * * def __cinit__(self, int lhs, Phrase f, Phrase e, scores=None, word_alignments=None): # <<<<<<<<<<<<<< @@ -27182,18 +27526,15 @@ static int __pyx_pw_3_sa_4Rule_1__cinit__(PyObject *__pyx_v_self, PyObject *__py kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lhs); - if (likely(values[0])) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lhs)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f); - if (likely(values[1])) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: - values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e); - if (likely(values[2])) kw_args--; + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -27258,7 +27599,7 @@ static int __pyx_pf_3_sa_4Rule___cinit__(struct __pyx_obj_3_sa_Rule *__pyx_v_sel int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":162 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -27287,7 +27628,7 @@ static int __pyx_pf_3_sa_4Rule___cinit__(struct __pyx_obj_3_sa_Rule *__pyx_v_sel } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":163 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":163 * 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 # <<<<<<<<<<<<<< @@ -27296,7 +27637,7 @@ static int __pyx_pf_3_sa_4Rule___cinit__(struct __pyx_obj_3_sa_Rule *__pyx_v_sel */ __pyx_v_self->lhs = __pyx_v_lhs; - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":164 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":164 * if not sym_isvar(lhs): raise Exception('Invalid LHS symbol: %d' % lhs) * self.lhs = lhs * self.f = f # <<<<<<<<<<<<<< @@ -27309,7 +27650,7 @@ static int __pyx_pf_3_sa_4Rule___cinit__(struct __pyx_obj_3_sa_Rule *__pyx_v_sel __Pyx_DECREF(((PyObject *)__pyx_v_self->f)); __pyx_v_self->f = __pyx_v_f; - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":165 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":165 * self.lhs = lhs * self.f = f * self.e = e # <<<<<<<<<<<<<< @@ -27322,7 +27663,7 @@ static int __pyx_pf_3_sa_4Rule___cinit__(struct __pyx_obj_3_sa_Rule *__pyx_v_sel __Pyx_DECREF(((PyObject *)__pyx_v_self->e)); __pyx_v_self->e = __pyx_v_e; - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":166 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":166 * self.f = f * self.e = e * self.word_alignments = word_alignments # <<<<<<<<<<<<<< @@ -27335,7 +27676,7 @@ static int __pyx_pf_3_sa_4Rule___cinit__(struct __pyx_obj_3_sa_Rule *__pyx_v_sel __Pyx_DECREF(__pyx_v_self->word_alignments); __pyx_v_self->word_alignments = __pyx_v_word_alignments; - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":167 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":167 * self.e = e * self.word_alignments = word_alignments * self.scores = scores # <<<<<<<<<<<<<< @@ -27372,7 +27713,7 @@ static Py_hash_t __pyx_pw_3_sa_4Rule_3__hash__(PyObject *__pyx_v_self) { return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":169 +/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":169 * self.scores = scores * * def __hash__(self): # <<<<<<<<<<<<<< @@ -27391,7 +27732,7 @@ static Py_hash_t __pyx_pf_3_sa_4Rule_2__hash__(struct __pyx_obj_3_sa_Rule *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__hash__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":170 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":170 * * def __hash__(self): * return hash((self.lhs, self.f, self.e)) # <<<<<<<<<<<<<< @@ -27447,7 +27788,7 @@ static int __pyx_pw_3_sa_4Rule_5__cmp__(PyObject *__pyx_v_self, PyObject *__pyx_ } #endif /*!(#if PY_MAJOR_VERSION < 3)*/ -/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":172 +/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":172 * return hash((self.lhs, self.f, self.e)) * * def __cmp__(self, Rule other): # <<<<<<<<<<<<<< @@ -27468,7 +27809,7 @@ static int __pyx_pf_3_sa_4Rule_4__cmp__(struct __pyx_obj_3_sa_Rule *__pyx_v_self int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cmp__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":173 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":173 * * def __cmp__(self, Rule other): * return cmp((self.lhs, self.f, self.e, self.word_alignments), # <<<<<<<<<<<<<< @@ -27492,7 +27833,7 @@ static int __pyx_pf_3_sa_4Rule_4__cmp__(struct __pyx_obj_3_sa_Rule *__pyx_v_self __Pyx_GIVEREF(__pyx_v_self->word_alignments); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":174 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":174 * 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)) # <<<<<<<<<<<<<< @@ -27561,7 +27902,7 @@ static PyObject *__pyx_pw_3_sa_4Rule_7fmerge(PyObject *__pyx_v_self, PyObject *_ return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":176 +/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":176 * (other.lhs, other.f, other.e, self.word_alignments)) * * def fmerge(self, Phrase f): # <<<<<<<<<<<<<< @@ -27579,20 +27920,19 @@ static PyObject *__pyx_pf_3_sa_4Rule_6fmerge(struct __pyx_obj_3_sa_Rule *__pyx_v int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fmerge", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":177 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":177 * * def fmerge(self, Phrase f): * if self.f == f: # <<<<<<<<<<<<<< * self.f = f * */ - __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_self->f), ((PyObject *)__pyx_v_f), Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_self->f), ((PyObject *)__pyx_v_f), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":178 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":178 * def fmerge(self, Phrase f): * if self.f == f: * self.f = f # <<<<<<<<<<<<<< @@ -27631,7 +27971,7 @@ static PyObject *__pyx_pw_3_sa_4Rule_9arity(PyObject *__pyx_v_self, CYTHON_UNUSE return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":180 +/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":180 * self.f = f * * def arity(self): # <<<<<<<<<<<<<< @@ -27649,7 +27989,7 @@ static PyObject *__pyx_pf_3_sa_4Rule_8arity(struct __pyx_obj_3_sa_Rule *__pyx_v_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("arity", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":181 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":181 * * def arity(self): * return self.f.arity() # <<<<<<<<<<<<<< @@ -27691,7 +28031,7 @@ static PyObject *__pyx_pw_3_sa_4Rule_11__str__(PyObject *__pyx_v_self) { } static PyObject *__pyx_gb_3_sa_4Rule_7__str___2generator13(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":187 +/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":187 * 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())) # <<<<<<<<<<<<<< @@ -27772,10 +28112,18 @@ static PyObject *__pyx_gb_3_sa_4Rule_7__str___2generator13(__pyx_GeneratorObject for (;;) { if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else { __pyx_t_2 = __pyx_t_4(__pyx_t_1); if (unlikely(!__pyx_t_2)) { @@ -27823,11 +28171,12 @@ static PyObject *__pyx_gb_3_sa_4Rule_7__str___2generator13(__pyx_GeneratorObject __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_generator->resume_label = -1; + __Pyx_Generator_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return NULL; } -/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":183 +/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":183 * return self.f.arity() * * def __str__(self): # <<<<<<<<<<<<<< @@ -27861,7 +28210,7 @@ static PyObject *__pyx_pf_3_sa_4Rule_10__str__(struct __pyx_obj_3_sa_Rule *__pyx __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self); - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":185 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":185 * def __str__(self): * cdef unsigned i * fields = [sym_tostring(self.lhs), str(self.f), str(self.e), str(self.scores)] # <<<<<<<<<<<<<< @@ -27911,7 +28260,7 @@ static PyObject *__pyx_pf_3_sa_4Rule_10__str__(struct __pyx_obj_3_sa_Rule *__pyx __pyx_v_fields = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":186 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":186 * cdef unsigned i * fields = [sym_tostring(self.lhs), str(self.f), str(self.e), str(self.scores)] * if self.word_alignments is not None: # <<<<<<<<<<<<<< @@ -27921,7 +28270,7 @@ static PyObject *__pyx_pf_3_sa_4Rule_10__str__(struct __pyx_obj_3_sa_Rule *__pyx __pyx_t_6 = (__pyx_cur_scope->__pyx_v_self->word_alignments != Py_None); if (__pyx_t_6) { - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":187 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":187 * 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())) # <<<<<<<<<<<<<< @@ -27947,7 +28296,7 @@ static PyObject *__pyx_pf_3_sa_4Rule_10__str__(struct __pyx_obj_3_sa_Rule *__pyx } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":188 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":188 * if self.word_alignments is not None: * fields.append(' '.join('%d-%d' % a for a in self.alignments())) * return ' ||| '.join(fields) # <<<<<<<<<<<<<< @@ -28000,7 +28349,7 @@ static PyObject *__pyx_pw_3_sa_4Rule_13alignments(PyObject *__pyx_v_self, CYTHON return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":190 +/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":190 * return ' ||| '.join(fields) * * def alignments(self): # <<<<<<<<<<<<<< @@ -28066,7 +28415,7 @@ static PyObject *__pyx_gb_3_sa_4Rule_14generator3(__pyx_GeneratorObject *__pyx_g __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":191 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":191 * * def alignments(self): * for point in self.word_alignments: # <<<<<<<<<<<<<< @@ -28083,10 +28432,18 @@ static PyObject *__pyx_gb_3_sa_4Rule_14generator3(__pyx_GeneratorObject *__pyx_g for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #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[7]; __pyx_lineno = 191; __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[7]; __pyx_lineno = 191; __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; - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #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[7]; __pyx_lineno = 191; __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[7]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { @@ -28104,7 +28461,7 @@ static PyObject *__pyx_gb_3_sa_4Rule_14generator3(__pyx_GeneratorObject *__pyx_g __pyx_cur_scope->__pyx_v_point = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rule.pxi":192 + /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":192 * def alignments(self): * for point in self.word_alignments: * yield point/65536, point%65536 # <<<<<<<<<<<<<< @@ -28152,6 +28509,7 @@ static PyObject *__pyx_gb_3_sa_4Rule_14generator3(__pyx_GeneratorObject *__pyx_g __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_generator->resume_label = -1; + __Pyx_Generator_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return NULL; } @@ -28218,7 +28576,7 @@ static PyObject *__pyx_pf_3_sa_4Rule_1e___get__(struct __pyx_obj_3_sa_Rule *__py return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":21 +/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":21 * int arr_len * * cdef _Trie_Node* new_trie_node(): # <<<<<<<<<<<<<< @@ -28232,7 +28590,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_new_trie_node(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("new_trie_node", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":23 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":23 * cdef _Trie_Node* new_trie_node(): * cdef _Trie_Node* node * node = <_Trie_Node*> malloc(sizeof(_Trie_Node)) # <<<<<<<<<<<<<< @@ -28241,7 +28599,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_new_trie_node(void) { */ __pyx_v_node = ((struct __pyx_t_3_sa__Trie_Node *)malloc((sizeof(struct __pyx_t_3_sa__Trie_Node)))); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":24 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":24 * cdef _Trie_Node* node * node = <_Trie_Node*> malloc(sizeof(_Trie_Node)) * node.root = NULL # <<<<<<<<<<<<<< @@ -28250,7 +28608,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_new_trie_node(void) { */ __pyx_v_node->root = NULL; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":25 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":25 * node = <_Trie_Node*> malloc(sizeof(_Trie_Node)) * node.root = NULL * node.arr_len = 0 # <<<<<<<<<<<<<< @@ -28259,7 +28617,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_new_trie_node(void) { */ __pyx_v_node->arr_len = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":26 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":26 * node.root = NULL * node.arr_len = 0 * node.arr = malloc(sizeof(0*sizeof(int))) # <<<<<<<<<<<<<< @@ -28268,7 +28626,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_new_trie_node(void) { */ __pyx_v_node->arr = ((int *)malloc((sizeof((0 * (sizeof(int))))))); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":27 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":27 * node.arr_len = 0 * node.arr = malloc(sizeof(0*sizeof(int))) * return node # <<<<<<<<<<<<<< @@ -28284,7 +28642,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_new_trie_node(void) { return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":29 +/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":29 * return node * * cdef _Trie_Edge* new_trie_edge(int val): # <<<<<<<<<<<<<< @@ -28298,7 +28656,7 @@ static struct __pyx_t_3_sa__Trie_Edge *__pyx_f_3_sa_new_trie_edge(int __pyx_v_va __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("new_trie_edge", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":31 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":31 * cdef _Trie_Edge* new_trie_edge(int val): * cdef _Trie_Edge* edge * edge = <_Trie_Edge*> malloc(sizeof(_Trie_Edge)) # <<<<<<<<<<<<<< @@ -28307,7 +28665,7 @@ static struct __pyx_t_3_sa__Trie_Edge *__pyx_f_3_sa_new_trie_edge(int __pyx_v_va */ __pyx_v_edge = ((struct __pyx_t_3_sa__Trie_Edge *)malloc((sizeof(struct __pyx_t_3_sa__Trie_Edge)))); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":32 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":32 * cdef _Trie_Edge* edge * edge = <_Trie_Edge*> malloc(sizeof(_Trie_Edge)) * edge.node = new_trie_node() # <<<<<<<<<<<<<< @@ -28316,7 +28674,7 @@ static struct __pyx_t_3_sa__Trie_Edge *__pyx_f_3_sa_new_trie_edge(int __pyx_v_va */ __pyx_v_edge->node = __pyx_f_3_sa_new_trie_node(); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":33 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":33 * edge = <_Trie_Edge*> malloc(sizeof(_Trie_Edge)) * edge.node = new_trie_node() * edge.bigger = NULL # <<<<<<<<<<<<<< @@ -28325,7 +28683,7 @@ static struct __pyx_t_3_sa__Trie_Edge *__pyx_f_3_sa_new_trie_edge(int __pyx_v_va */ __pyx_v_edge->bigger = NULL; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":34 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":34 * edge.node = new_trie_node() * edge.bigger = NULL * edge.smaller = NULL # <<<<<<<<<<<<<< @@ -28334,7 +28692,7 @@ static struct __pyx_t_3_sa__Trie_Edge *__pyx_f_3_sa_new_trie_edge(int __pyx_v_va */ __pyx_v_edge->smaller = NULL; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":35 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":35 * edge.bigger = NULL * edge.smaller = NULL * edge.val = val # <<<<<<<<<<<<<< @@ -28343,7 +28701,7 @@ static struct __pyx_t_3_sa__Trie_Edge *__pyx_f_3_sa_new_trie_edge(int __pyx_v_va */ __pyx_v_edge->val = __pyx_v_val; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":36 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":36 * edge.smaller = NULL * edge.val = val * return edge # <<<<<<<<<<<<<< @@ -28359,7 +28717,7 @@ static struct __pyx_t_3_sa__Trie_Edge *__pyx_f_3_sa_new_trie_edge(int __pyx_v_va return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":38 +/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":38 * return edge * * cdef free_trie_node(_Trie_Node* node): # <<<<<<<<<<<<<< @@ -28377,7 +28735,7 @@ static PyObject *__pyx_f_3_sa_free_trie_node(struct __pyx_t_3_sa__Trie_Node *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("free_trie_node", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":39 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":39 * * cdef free_trie_node(_Trie_Node* node): * if node != NULL: # <<<<<<<<<<<<<< @@ -28387,7 +28745,7 @@ static PyObject *__pyx_f_3_sa_free_trie_node(struct __pyx_t_3_sa__Trie_Node *__p __pyx_t_1 = (__pyx_v_node != NULL); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":40 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":40 * cdef free_trie_node(_Trie_Node* node): * if node != NULL: * free_trie_edge(node.root) # <<<<<<<<<<<<<< @@ -28398,7 +28756,7 @@ static PyObject *__pyx_f_3_sa_free_trie_node(struct __pyx_t_3_sa__Trie_Node *__p __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":41 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":41 * if node != NULL: * free_trie_edge(node.root) * free(node.arr) # <<<<<<<<<<<<<< @@ -28422,7 +28780,7 @@ static PyObject *__pyx_f_3_sa_free_trie_node(struct __pyx_t_3_sa__Trie_Node *__p return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":43 +/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":43 * free(node.arr) * * cdef free_trie_edge(_Trie_Edge* edge): # <<<<<<<<<<<<<< @@ -28440,7 +28798,7 @@ static PyObject *__pyx_f_3_sa_free_trie_edge(struct __pyx_t_3_sa__Trie_Edge *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("free_trie_edge", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":44 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":44 * * cdef free_trie_edge(_Trie_Edge* edge): * if edge != NULL: # <<<<<<<<<<<<<< @@ -28450,7 +28808,7 @@ static PyObject *__pyx_f_3_sa_free_trie_edge(struct __pyx_t_3_sa__Trie_Edge *__p __pyx_t_1 = (__pyx_v_edge != NULL); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":45 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":45 * cdef free_trie_edge(_Trie_Edge* edge): * if edge != NULL: * free_trie_node(edge.node) # <<<<<<<<<<<<<< @@ -28461,7 +28819,7 @@ static PyObject *__pyx_f_3_sa_free_trie_edge(struct __pyx_t_3_sa__Trie_Edge *__p __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":46 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":46 * if edge != NULL: * free_trie_node(edge.node) * free_trie_edge(edge.bigger) # <<<<<<<<<<<<<< @@ -28472,7 +28830,7 @@ static PyObject *__pyx_f_3_sa_free_trie_edge(struct __pyx_t_3_sa__Trie_Edge *__p __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":47 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":47 * free_trie_node(edge.node) * free_trie_edge(edge.bigger) * free_trie_edge(edge.smaller) # <<<<<<<<<<<<<< @@ -28498,7 +28856,7 @@ static PyObject *__pyx_f_3_sa_free_trie_edge(struct __pyx_t_3_sa__Trie_Edge *__p return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":49 +/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":49 * free_trie_edge(edge.smaller) * * cdef _Trie_Node* trie_find(_Trie_Node* node, int val): # <<<<<<<<<<<<<< @@ -28515,7 +28873,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_find(struct __pyx_t_3_s int __pyx_t_3; __Pyx_RefNannySetupContext("trie_find", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":51 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":51 * cdef _Trie_Node* trie_find(_Trie_Node* node, int val): * cdef _Trie_Edge* cur * cur = node.root # <<<<<<<<<<<<<< @@ -28524,7 +28882,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_find(struct __pyx_t_3_s */ __pyx_v_cur = __pyx_v_node->root; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":52 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":52 * cdef _Trie_Edge* cur * cur = node.root * while cur != NULL and cur.val != val: # <<<<<<<<<<<<<< @@ -28541,7 +28899,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_find(struct __pyx_t_3_s } if (!__pyx_t_3) break; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":53 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":53 * cur = node.root * while cur != NULL and cur.val != val: * if val > cur.val: # <<<<<<<<<<<<<< @@ -28551,7 +28909,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_find(struct __pyx_t_3_s __pyx_t_3 = (__pyx_v_val > __pyx_v_cur->val); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":54 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":54 * while cur != NULL and cur.val != val: * if val > cur.val: * cur = cur.bigger # <<<<<<<<<<<<<< @@ -28562,7 +28920,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_find(struct __pyx_t_3_s goto __pyx_L5; } - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":55 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":55 * if val > cur.val: * cur = cur.bigger * elif val < cur.val: # <<<<<<<<<<<<<< @@ -28572,7 +28930,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_find(struct __pyx_t_3_s __pyx_t_3 = (__pyx_v_val < __pyx_v_cur->val); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":56 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":56 * cur = cur.bigger * elif val < cur.val: * cur = cur.smaller # <<<<<<<<<<<<<< @@ -28585,7 +28943,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_find(struct __pyx_t_3_s __pyx_L5:; } - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":57 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":57 * elif val < cur.val: * cur = cur.smaller * if cur == NULL: # <<<<<<<<<<<<<< @@ -28595,7 +28953,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_find(struct __pyx_t_3_s __pyx_t_3 = (__pyx_v_cur == NULL); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":58 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":58 * cur = cur.smaller * if cur == NULL: * return NULL # <<<<<<<<<<<<<< @@ -28608,7 +28966,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_find(struct __pyx_t_3_s } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":60 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":60 * return NULL * else: * return cur.node # <<<<<<<<<<<<<< @@ -28626,7 +28984,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_find(struct __pyx_t_3_s return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":62 +/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":62 * return cur.node * * cdef trie_node_data_append(_Trie_Node* node, int val): # <<<<<<<<<<<<<< @@ -28640,7 +28998,7 @@ static PyObject *__pyx_f_3_sa_trie_node_data_append(struct __pyx_t_3_sa__Trie_No __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("trie_node_data_append", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":64 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":64 * cdef trie_node_data_append(_Trie_Node* node, int val): * cdef int new_len * new_len = node.arr_len + 1 # <<<<<<<<<<<<<< @@ -28649,7 +29007,7 @@ static PyObject *__pyx_f_3_sa_trie_node_data_append(struct __pyx_t_3_sa__Trie_No */ __pyx_v_new_len = (__pyx_v_node->arr_len + 1); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":65 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":65 * cdef int new_len * new_len = node.arr_len + 1 * node.arr = realloc(node.arr, new_len*sizeof(int)) # <<<<<<<<<<<<<< @@ -28658,7 +29016,7 @@ static PyObject *__pyx_f_3_sa_trie_node_data_append(struct __pyx_t_3_sa__Trie_No */ __pyx_v_node->arr = ((int *)realloc(__pyx_v_node->arr, (__pyx_v_new_len * (sizeof(int))))); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":66 + /* "/home/pauldb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -28667,7 +29025,7 @@ static PyObject *__pyx_f_3_sa_trie_node_data_append(struct __pyx_t_3_sa__Trie_No */ (__pyx_v_node->arr[__pyx_v_node->arr_len]) = __pyx_v_val; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":67 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":67 * node.arr = realloc(node.arr, new_len*sizeof(int)) * node.arr[node.arr_len] = val * node.arr_len = new_len # <<<<<<<<<<<<<< @@ -28682,7 +29040,7 @@ static PyObject *__pyx_f_3_sa_trie_node_data_append(struct __pyx_t_3_sa__Trie_No return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":69 +/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":69 * node.arr_len = new_len * * cdef trie_node_data_extend(_Trie_Node* node, int* vals, int num_vals): # <<<<<<<<<<<<<< @@ -28696,7 +29054,7 @@ static PyObject *__pyx_f_3_sa_trie_node_data_extend(struct __pyx_t_3_sa__Trie_No __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("trie_node_data_extend", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":71 + /* "/home/pauldb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -28705,7 +29063,7 @@ static PyObject *__pyx_f_3_sa_trie_node_data_extend(struct __pyx_t_3_sa__Trie_No */ __pyx_v_new_len = (__pyx_v_node->arr_len + __pyx_v_num_vals); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":72 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":72 * cdef int new_len * new_len = node.arr_len + num_vals * node.arr = realloc(node.arr, new_len*sizeof(int)) # <<<<<<<<<<<<<< @@ -28714,7 +29072,7 @@ static PyObject *__pyx_f_3_sa_trie_node_data_extend(struct __pyx_t_3_sa__Trie_No */ __pyx_v_node->arr = ((int *)realloc(__pyx_v_node->arr, (__pyx_v_new_len * (sizeof(int))))); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":73 + /* "/home/pauldb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -28723,7 +29081,7 @@ static PyObject *__pyx_f_3_sa_trie_node_data_extend(struct __pyx_t_3_sa__Trie_No */ memcpy((__pyx_v_node->arr + __pyx_v_node->arr_len), __pyx_v_vals, (__pyx_v_num_vals * (sizeof(int)))); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":74 + /* "/home/pauldb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -28738,7 +29096,7 @@ static PyObject *__pyx_f_3_sa_trie_node_data_extend(struct __pyx_t_3_sa__Trie_No return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":77 +/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":77 * * * cdef _Trie_Node* trie_insert(_Trie_Node* node, int val): # <<<<<<<<<<<<<< @@ -28755,7 +29113,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_insert(struct __pyx_t_3 int __pyx_t_3; __Pyx_RefNannySetupContext("trie_insert", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":79 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":79 * cdef _Trie_Node* trie_insert(_Trie_Node* node, int val): * cdef _Trie_Edge** cur * cur = &node.root # <<<<<<<<<<<<<< @@ -28764,7 +29122,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_insert(struct __pyx_t_3 */ __pyx_v_cur = (&__pyx_v_node->root); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":80 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":80 * cdef _Trie_Edge** cur * cur = &node.root * while cur[0] != NULL and cur[0].val != val: # <<<<<<<<<<<<<< @@ -28781,7 +29139,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_insert(struct __pyx_t_3 } if (!__pyx_t_3) break; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":81 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":81 * cur = &node.root * while cur[0] != NULL and cur[0].val != val: * if val > cur[0].val: # <<<<<<<<<<<<<< @@ -28791,7 +29149,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_insert(struct __pyx_t_3 __pyx_t_3 = (__pyx_v_val > (__pyx_v_cur[0])->val); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":82 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":82 * while cur[0] != NULL and cur[0].val != val: * if val > cur[0].val: * cur = &cur[0].bigger # <<<<<<<<<<<<<< @@ -28802,7 +29160,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_insert(struct __pyx_t_3 goto __pyx_L5; } - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":83 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":83 * if val > cur[0].val: * cur = &cur[0].bigger * elif val < cur[0].val: # <<<<<<<<<<<<<< @@ -28812,7 +29170,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_insert(struct __pyx_t_3 __pyx_t_3 = (__pyx_v_val < (__pyx_v_cur[0])->val); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":84 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":84 * cur = &cur[0].bigger * elif val < cur[0].val: * cur = &cur[0].smaller # <<<<<<<<<<<<<< @@ -28825,7 +29183,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_insert(struct __pyx_t_3 __pyx_L5:; } - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":85 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":85 * elif val < cur[0].val: * cur = &cur[0].smaller * if cur[0] == NULL: # <<<<<<<<<<<<<< @@ -28835,7 +29193,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_insert(struct __pyx_t_3 __pyx_t_3 = ((__pyx_v_cur[0]) == NULL); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":86 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":86 * cur = &cur[0].smaller * if cur[0] == NULL: * cur[0] = new_trie_edge(val) # <<<<<<<<<<<<<< @@ -28847,7 +29205,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_insert(struct __pyx_t_3 } __pyx_L6:; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":87 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":87 * if cur[0] == NULL: * cur[0] = new_trie_edge(val) * return cur[0].node # <<<<<<<<<<<<<< @@ -28863,7 +29221,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_insert(struct __pyx_t_3 return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":89 +/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":89 * return cur[0].node * * cdef trie_node_to_map(_Trie_Node* node, result, prefix, int include_zeros): # <<<<<<<<<<<<<< @@ -28883,7 +29241,7 @@ static PyObject *__pyx_f_3_sa_trie_node_to_map(struct __pyx_t_3_sa__Trie_Node *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("trie_node_to_map", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":92 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":92 * cdef IntList arr * * if include_zeros or node.arr_len > 0: # <<<<<<<<<<<<<< @@ -28898,7 +29256,7 @@ static PyObject *__pyx_f_3_sa_trie_node_to_map(struct __pyx_t_3_sa__Trie_Node *_ } if (__pyx_t_2) { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":93 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":93 * * if include_zeros or node.arr_len > 0: * arr = IntList() # <<<<<<<<<<<<<< @@ -28910,7 +29268,7 @@ static PyObject *__pyx_f_3_sa_trie_node_to_map(struct __pyx_t_3_sa__Trie_Node *_ __pyx_v_arr = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":94 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":94 * if include_zeros or node.arr_len > 0: * arr = IntList() * free(arr.arr) # <<<<<<<<<<<<<< @@ -28919,7 +29277,7 @@ static PyObject *__pyx_f_3_sa_trie_node_to_map(struct __pyx_t_3_sa__Trie_Node *_ */ free(__pyx_v_arr->arr); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":95 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":95 * arr = IntList() * free(arr.arr) * arr.arr = malloc(node.arr_len * sizeof(int)) # <<<<<<<<<<<<<< @@ -28928,7 +29286,7 @@ static PyObject *__pyx_f_3_sa_trie_node_to_map(struct __pyx_t_3_sa__Trie_Node *_ */ __pyx_v_arr->arr = ((int *)malloc((__pyx_v_node->arr_len * (sizeof(int))))); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":96 + /* "/home/pauldb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -28937,7 +29295,7 @@ static PyObject *__pyx_f_3_sa_trie_node_to_map(struct __pyx_t_3_sa__Trie_Node *_ */ memcpy(__pyx_v_arr->arr, __pyx_v_node->arr, (__pyx_v_node->arr_len * (sizeof(int)))); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":97 + /* "/home/pauldb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -28946,7 +29304,7 @@ static PyObject *__pyx_f_3_sa_trie_node_to_map(struct __pyx_t_3_sa__Trie_Node *_ */ __pyx_v_arr->len = __pyx_v_node->arr_len; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":98 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":98 * memcpy(arr.arr, node.arr, node.arr_len * sizeof(int)) * arr.len = node.arr_len * arr.size = node.arr_len # <<<<<<<<<<<<<< @@ -28955,7 +29313,7 @@ static PyObject *__pyx_f_3_sa_trie_node_to_map(struct __pyx_t_3_sa__Trie_Node *_ */ __pyx_v_arr->size = __pyx_v_node->arr_len; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":99 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":99 * arr.len = node.arr_len * arr.size = node.arr_len * result[prefix] = arr # <<<<<<<<<<<<<< @@ -28967,7 +29325,7 @@ static PyObject *__pyx_f_3_sa_trie_node_to_map(struct __pyx_t_3_sa__Trie_Node *_ } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":100 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":100 * arr.size = node.arr_len * result[prefix] = arr * trie_edge_to_map(node.root, result, prefix, include_zeros) # <<<<<<<<<<<<<< @@ -28991,7 +29349,7 @@ static PyObject *__pyx_f_3_sa_trie_node_to_map(struct __pyx_t_3_sa__Trie_Node *_ return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":102 +/* "/home/pauldb/workspace/cdec/python/src/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): # <<<<<<<<<<<<<< @@ -29011,7 +29369,7 @@ static PyObject *__pyx_f_3_sa_trie_edge_to_map(struct __pyx_t_3_sa__Trie_Edge *_ __Pyx_RefNannySetupContext("trie_edge_to_map", 0); __Pyx_INCREF(__pyx_v_prefix); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":103 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":103 * * cdef trie_edge_to_map(_Trie_Edge* edge, result, prefix, int include_zeros): * if edge != NULL: # <<<<<<<<<<<<<< @@ -29021,7 +29379,7 @@ static PyObject *__pyx_f_3_sa_trie_edge_to_map(struct __pyx_t_3_sa__Trie_Edge *_ __pyx_t_1 = (__pyx_v_edge != NULL); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":104 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -29032,7 +29390,7 @@ static PyObject *__pyx_f_3_sa_trie_edge_to_map(struct __pyx_t_3_sa__Trie_Edge *_ __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":105 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -29043,7 +29401,7 @@ static PyObject *__pyx_f_3_sa_trie_edge_to_map(struct __pyx_t_3_sa__Trie_Edge *_ __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":106 + /* "/home/pauldb/workspace/cdec/python/src/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,) # <<<<<<<<<<<<<< @@ -29064,7 +29422,7 @@ static PyObject *__pyx_f_3_sa_trie_edge_to_map(struct __pyx_t_3_sa__Trie_Edge *_ __pyx_v_prefix = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":107 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -29096,11 +29454,11 @@ static PyObject *__pyx_f_3_sa_trie_edge_to_map(struct __pyx_t_3_sa__Trie_Edge *_ static int __pyx_pw_3_sa_7TrieMap_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_3_sa_7TrieMap_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_v_alphabet_size; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__alphabet_size,0}; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__alphabet_size,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -29113,8 +29471,7 @@ static int __pyx_pw_3_sa_7TrieMap_1__cinit__(PyObject *__pyx_v_self, PyObject *_ kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__alphabet_size); - if (likely(values[0])) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__alphabet_size)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { @@ -29140,7 +29497,7 @@ static int __pyx_pw_3_sa_7TrieMap_1__cinit__(PyObject *__pyx_v_self, PyObject *_ return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":114 +/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":114 * cdef int V * * def __cinit__(self, int alphabet_size): # <<<<<<<<<<<<<< @@ -29153,7 +29510,7 @@ static int __pyx_pf_3_sa_7TrieMap___cinit__(struct __pyx_obj_3_sa_TrieMap *__pyx __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":115 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":115 * * def __cinit__(self, int alphabet_size): * self.V = alphabet_size # <<<<<<<<<<<<<< @@ -29162,7 +29519,7 @@ static int __pyx_pf_3_sa_7TrieMap___cinit__(struct __pyx_obj_3_sa_TrieMap *__pyx */ __pyx_v_self->V = __pyx_v_alphabet_size; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":116 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":116 * def __cinit__(self, int alphabet_size): * self.V = alphabet_size * self.root = <_Trie_Node**> malloc(self.V * sizeof(_Trie_Node*)) # <<<<<<<<<<<<<< @@ -29171,7 +29528,7 @@ static int __pyx_pf_3_sa_7TrieMap___cinit__(struct __pyx_obj_3_sa_TrieMap *__pyx */ __pyx_v_self->root = ((struct __pyx_t_3_sa__Trie_Node **)malloc((__pyx_v_self->V * (sizeof(struct __pyx_t_3_sa__Trie_Node *))))); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":117 + /* "/home/pauldb/workspace/cdec/python/src/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*)) # <<<<<<<<<<<<<< @@ -29194,7 +29551,7 @@ static void __pyx_pw_3_sa_7TrieMap_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyFinishContext(); } -/* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":120 +/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":120 * * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -29213,7 +29570,7 @@ static void __pyx_pf_3_sa_7TrieMap_2__dealloc__(struct __pyx_obj_3_sa_TrieMap *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":122 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":122 * def __dealloc__(self): * cdef int i * for i from 0 <= i < self.V: # <<<<<<<<<<<<<< @@ -29223,7 +29580,7 @@ static void __pyx_pf_3_sa_7TrieMap_2__dealloc__(struct __pyx_obj_3_sa_TrieMap *_ __pyx_t_1 = __pyx_v_self->V; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":123 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":123 * cdef int i * for i from 0 <= i < self.V: * if self.root[i] != NULL: # <<<<<<<<<<<<<< @@ -29233,7 +29590,7 @@ static void __pyx_pf_3_sa_7TrieMap_2__dealloc__(struct __pyx_obj_3_sa_TrieMap *_ __pyx_t_2 = ((__pyx_v_self->root[__pyx_v_i]) != NULL); if (__pyx_t_2) { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":124 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":124 * for i from 0 <= i < self.V: * if self.root[i] != NULL: * free_trie_node(self.root[i]) # <<<<<<<<<<<<<< @@ -29248,7 +29605,7 @@ static void __pyx_pf_3_sa_7TrieMap_2__dealloc__(struct __pyx_obj_3_sa_TrieMap *_ __pyx_L5:; } - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":125 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":125 * if self.root[i] != NULL: * free_trie_node(self.root[i]) * free(self.root) # <<<<<<<<<<<<<< @@ -29276,7 +29633,7 @@ static PyObject *__pyx_pw_3_sa_7TrieMap_5insert(PyObject *__pyx_v_self, PyObject return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":128 +/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":128 * * * def insert(self, pattern): # <<<<<<<<<<<<<< @@ -29299,7 +29656,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_4insert(struct __pyx_obj_3_sa_TrieMap *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("insert", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":131 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":131 * cdef int* p * cdef int i, l * l = len(pattern) # <<<<<<<<<<<<<< @@ -29309,7 +29666,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_4insert(struct __pyx_obj_3_sa_TrieMap *_ __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/paulb/workspace/cdec/python/src/sa/precomputation.pxi":132 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":132 * cdef int i, l * l = len(pattern) * p = malloc(l*sizeof(int)) # <<<<<<<<<<<<<< @@ -29318,7 +29675,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_4insert(struct __pyx_obj_3_sa_TrieMap *_ */ __pyx_v_p = ((int *)malloc((__pyx_v_l * (sizeof(int))))); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":133 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":133 * l = len(pattern) * p = malloc(l*sizeof(int)) * for i from 0 <= i < l: # <<<<<<<<<<<<<< @@ -29328,7 +29685,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_4insert(struct __pyx_obj_3_sa_TrieMap *_ __pyx_t_2 = __pyx_v_l; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":134 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":134 * p = malloc(l*sizeof(int)) * for i from 0 <= i < l: * p[i] = pattern[i] # <<<<<<<<<<<<<< @@ -29342,7 +29699,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_4insert(struct __pyx_obj_3_sa_TrieMap *_ (__pyx_v_p[__pyx_v_i]) = __pyx_t_4; } - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":135 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":135 * for i from 0 <= i < l: * p[i] = pattern[i] * self._insert(p,l) # <<<<<<<<<<<<<< @@ -29351,7 +29708,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_4insert(struct __pyx_obj_3_sa_TrieMap *_ */ ((struct __pyx_vtabstruct_3_sa_TrieMap *)__pyx_v_self->__pyx_vtab)->_insert(__pyx_v_self, __pyx_v_p, __pyx_v_l); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":136 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":136 * p[i] = pattern[i] * self._insert(p,l) * free(p) # <<<<<<<<<<<<<< @@ -29372,7 +29729,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_4insert(struct __pyx_obj_3_sa_TrieMap *_ return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":139 +/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":139 * * * cdef _Trie_Node* _insert(self, int* pattern, int pattern_len): # <<<<<<<<<<<<<< @@ -29389,7 +29746,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_7TrieMap__insert(struct __py int __pyx_t_2; __Pyx_RefNannySetupContext("_insert", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":142 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":142 * cdef int i * cdef _Trie_Node* node * if self.root[pattern[0]] == NULL: # <<<<<<<<<<<<<< @@ -29399,7 +29756,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_7TrieMap__insert(struct __py __pyx_t_1 = ((__pyx_v_self->root[(__pyx_v_pattern[0])]) == NULL); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":143 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":143 * cdef _Trie_Node* node * if self.root[pattern[0]] == NULL: * self.root[pattern[0]] = new_trie_node() # <<<<<<<<<<<<<< @@ -29411,7 +29768,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_7TrieMap__insert(struct __py } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":144 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":144 * if self.root[pattern[0]] == NULL: * self.root[pattern[0]] = new_trie_node() * node = self.root[pattern[0]] # <<<<<<<<<<<<<< @@ -29420,7 +29777,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_7TrieMap__insert(struct __py */ __pyx_v_node = (__pyx_v_self->root[(__pyx_v_pattern[0])]); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":145 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":145 * self.root[pattern[0]] = new_trie_node() * node = self.root[pattern[0]] * for i from 1 <= i < pattern_len: # <<<<<<<<<<<<<< @@ -29430,7 +29787,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_7TrieMap__insert(struct __py __pyx_t_2 = __pyx_v_pattern_len; for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":146 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":146 * node = self.root[pattern[0]] * for i from 1 <= i < pattern_len: * node = trie_insert(node, pattern[i]) # <<<<<<<<<<<<<< @@ -29440,7 +29797,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_7TrieMap__insert(struct __py __pyx_v_node = __pyx_f_3_sa_trie_insert(__pyx_v_node, (__pyx_v_pattern[__pyx_v_i])); } - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":147 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":147 * for i from 1 <= i < pattern_len: * node = trie_insert(node, pattern[i]) * return node # <<<<<<<<<<<<<< @@ -29467,7 +29824,7 @@ static PyObject *__pyx_pw_3_sa_7TrieMap_7contains(PyObject *__pyx_v_self, PyObje return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":149 +/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":149 * return node * * def contains(self, pattern): # <<<<<<<<<<<<<< @@ -29492,7 +29849,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_6contains(struct __pyx_obj_3_sa_TrieMap int __pyx_clineno = 0; __Pyx_RefNannySetupContext("contains", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":153 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":153 * cdef int i, l * cdef _Trie_Node* node * l = len(pattern) # <<<<<<<<<<<<<< @@ -29502,7 +29859,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_6contains(struct __pyx_obj_3_sa_TrieMap __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/paulb/workspace/cdec/python/src/sa/precomputation.pxi":154 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":154 * cdef _Trie_Node* node * l = len(pattern) * p = malloc(l*sizeof(int)) # <<<<<<<<<<<<<< @@ -29511,7 +29868,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_6contains(struct __pyx_obj_3_sa_TrieMap */ __pyx_v_p = ((int *)malloc((__pyx_v_l * (sizeof(int))))); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":155 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":155 * l = len(pattern) * p = malloc(l*sizeof(int)) * for i from 0 <= i < l: # <<<<<<<<<<<<<< @@ -29521,7 +29878,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_6contains(struct __pyx_obj_3_sa_TrieMap __pyx_t_2 = __pyx_v_l; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":156 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":156 * p = malloc(l*sizeof(int)) * for i from 0 <= i < l: * p[i] = pattern[i] # <<<<<<<<<<<<<< @@ -29535,7 +29892,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_6contains(struct __pyx_obj_3_sa_TrieMap (__pyx_v_p[__pyx_v_i]) = __pyx_t_4; } - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":157 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":157 * for i from 0 <= i < l: * p[i] = pattern[i] * node = self._contains(p,l) # <<<<<<<<<<<<<< @@ -29544,7 +29901,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_6contains(struct __pyx_obj_3_sa_TrieMap */ __pyx_v_node = ((struct __pyx_vtabstruct_3_sa_TrieMap *)__pyx_v_self->__pyx_vtab)->_contains(__pyx_v_self, __pyx_v_p, __pyx_v_l); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":158 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":158 * p[i] = pattern[i] * node = self._contains(p,l) * free(p) # <<<<<<<<<<<<<< @@ -29553,7 +29910,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_6contains(struct __pyx_obj_3_sa_TrieMap */ free(__pyx_v_p); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":159 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":159 * node = self._contains(p,l) * free(p) * if node == NULL: # <<<<<<<<<<<<<< @@ -29563,7 +29920,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_6contains(struct __pyx_obj_3_sa_TrieMap __pyx_t_5 = (__pyx_v_node == NULL); if (__pyx_t_5) { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":160 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":160 * free(p) * if node == NULL: * return False # <<<<<<<<<<<<<< @@ -29580,7 +29937,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_6contains(struct __pyx_obj_3_sa_TrieMap } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":162 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":162 * return False * else: * return True # <<<<<<<<<<<<<< @@ -29608,7 +29965,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_6contains(struct __pyx_obj_3_sa_TrieMap return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":164 +/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":164 * return True * * cdef _Trie_Node* _contains(self, int* pattern, int pattern_len): # <<<<<<<<<<<<<< @@ -29626,7 +29983,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_7TrieMap__contains(struct __ int __pyx_t_3; __Pyx_RefNannySetupContext("_contains", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":167 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":167 * cdef int i * cdef _Trie_Node* node * node = self.root[pattern[0]] # <<<<<<<<<<<<<< @@ -29635,7 +29992,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_7TrieMap__contains(struct __ */ __pyx_v_node = (__pyx_v_self->root[(__pyx_v_pattern[0])]); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":168 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":168 * cdef _Trie_Node* node * node = self.root[pattern[0]] * i = 1 # <<<<<<<<<<<<<< @@ -29644,7 +30001,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_7TrieMap__contains(struct __ */ __pyx_v_i = 1; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":169 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":169 * node = self.root[pattern[0]] * i = 1 * while node != NULL and i < pattern_len: # <<<<<<<<<<<<<< @@ -29661,7 +30018,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_7TrieMap__contains(struct __ } if (!__pyx_t_3) break; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":170 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":170 * i = 1 * while node != NULL and i < pattern_len: * node = trie_find(node, pattern[i]) # <<<<<<<<<<<<<< @@ -29670,7 +30027,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_7TrieMap__contains(struct __ */ __pyx_v_node = __pyx_f_3_sa_trie_find(__pyx_v_node, (__pyx_v_pattern[__pyx_v_i])); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":171 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":171 * while node != NULL and i < pattern_len: * node = trie_find(node, pattern[i]) * i = i+1 # <<<<<<<<<<<<<< @@ -29680,7 +30037,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_7TrieMap__contains(struct __ __pyx_v_i = (__pyx_v_i + 1); } - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":172 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":172 * node = trie_find(node, pattern[i]) * i = i+1 * return node # <<<<<<<<<<<<<< @@ -29707,7 +30064,7 @@ static PyObject *__pyx_pw_3_sa_7TrieMap_9toMap(PyObject *__pyx_v_self, PyObject return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":174 +/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":174 * return node * * def toMap(self, flag): # <<<<<<<<<<<<<< @@ -29730,7 +30087,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_8toMap(struct __pyx_obj_3_sa_TrieMap *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toMap", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":177 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":177 * cdef int i, include_zeros * * if flag: # <<<<<<<<<<<<<< @@ -29740,7 +30097,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_8toMap(struct __pyx_obj_3_sa_TrieMap *__ __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/paulb/workspace/cdec/python/src/sa/precomputation.pxi":178 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":178 * * if flag: * include_zeros=1 # <<<<<<<<<<<<<< @@ -29752,7 +30109,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_8toMap(struct __pyx_obj_3_sa_TrieMap *__ } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":180 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":180 * include_zeros=1 * else: * include_zeros=0 # <<<<<<<<<<<<<< @@ -29763,7 +30120,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_8toMap(struct __pyx_obj_3_sa_TrieMap *__ } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":181 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":181 * else: * include_zeros=0 * result = {} # <<<<<<<<<<<<<< @@ -29775,7 +30132,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_8toMap(struct __pyx_obj_3_sa_TrieMap *__ __pyx_v_result = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":182 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":182 * include_zeros=0 * result = {} * for i from 0 <= i < self.V: # <<<<<<<<<<<<<< @@ -29785,7 +30142,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_8toMap(struct __pyx_obj_3_sa_TrieMap *__ __pyx_t_3 = __pyx_v_self->V; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":183 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":183 * result = {} * for i from 0 <= i < self.V: * if self.root[i] != NULL: # <<<<<<<<<<<<<< @@ -29795,7 +30152,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_8toMap(struct __pyx_obj_3_sa_TrieMap *__ __pyx_t_1 = ((__pyx_v_self->root[__pyx_v_i]) != NULL); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":184 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -29818,7 +30175,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_8toMap(struct __pyx_obj_3_sa_TrieMap *__ __pyx_L6:; } - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":185 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":185 * if self.root[i] != NULL: * trie_node_to_map(self.root[i], result, (i,), include_zeros) * return result # <<<<<<<<<<<<<< @@ -29856,14 +30213,14 @@ static int __pyx_pw_3_sa_14Precomputation_1__cinit__(PyObject *__pyx_v_self, PyO PyObject *__pyx_v_max_nonterminals = 0; PyObject *__pyx_v_train_max_initial_size = 0; PyObject *__pyx_v_train_min_gap_size = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fsarray,&__pyx_n_s__from_stats,&__pyx_n_s__from_binary,&__pyx_n_s__precompute_rank,&__pyx_n_s_70,&__pyx_n_s__max_length,&__pyx_n_s__max_nonterminals,&__pyx_n_s_71,&__pyx_n_s__train_min_gap_size,0}; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fsarray,&__pyx_n_s__from_stats,&__pyx_n_s__from_binary,&__pyx_n_s__precompute_rank,&__pyx_n_s_70,&__pyx_n_s__max_length,&__pyx_n_s__max_nonterminals,&__pyx_n_s_71,&__pyx_n_s__train_min_gap_size,0}; PyObject* values[9] = {0,0,0,0,0,0,0,0,0}; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":200 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":200 * cdef write_map(self, m, FILE* f) * * def __cinit__(self, fsarray=None, from_stats=None, from_binary=None, # <<<<<<<<<<<<<< @@ -29997,7 +30354,7 @@ static int __pyx_pf_3_sa_14Precomputation___cinit__(struct __pyx_obj_3_sa_Precom int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":204 + /* "/home/pauldb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -30007,7 +30364,7 @@ static int __pyx_pf_3_sa_14Precomputation___cinit__(struct __pyx_obj_3_sa_Precom __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_v_self->precompute_rank = __pyx_t_1; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":205 + /* "/home/pauldb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -30017,7 +30374,7 @@ static int __pyx_pf_3_sa_14Precomputation___cinit__(struct __pyx_obj_3_sa_Precom __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_v_self->precompute_secondary_rank = __pyx_t_1; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":206 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":206 * self.precompute_rank = precompute_rank * self.precompute_secondary_rank = precompute_secondary_rank * self.max_length = max_length # <<<<<<<<<<<<<< @@ -30027,7 +30384,7 @@ static int __pyx_pf_3_sa_14Precomputation___cinit__(struct __pyx_obj_3_sa_Precom __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_v_self->max_length = __pyx_t_1; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":207 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":207 * self.precompute_secondary_rank = precompute_secondary_rank * self.max_length = max_length * self.max_nonterminals = max_nonterminals # <<<<<<<<<<<<<< @@ -30037,7 +30394,7 @@ static int __pyx_pf_3_sa_14Precomputation___cinit__(struct __pyx_obj_3_sa_Precom __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_v_self->max_nonterminals = __pyx_t_1; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":208 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":208 * self.max_length = max_length * self.max_nonterminals = max_nonterminals * self.train_max_initial_size = train_max_initial_size # <<<<<<<<<<<<<< @@ -30047,7 +30404,7 @@ static int __pyx_pf_3_sa_14Precomputation___cinit__(struct __pyx_obj_3_sa_Precom __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_v_self->train_max_initial_size = __pyx_t_1; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":209 + /* "/home/pauldb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -30057,7 +30414,7 @@ static int __pyx_pf_3_sa_14Precomputation___cinit__(struct __pyx_obj_3_sa_Precom __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_v_self->train_min_gap_size = __pyx_t_1; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":210 + /* "/home/pauldb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -30067,7 +30424,7 @@ static int __pyx_pf_3_sa_14Precomputation___cinit__(struct __pyx_obj_3_sa_Precom __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/paulb/workspace/cdec/python/src/sa/precomputation.pxi":211 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":211 * self.train_min_gap_size = train_min_gap_size * if from_binary: * self.read_binary(from_binary) # <<<<<<<<<<<<<< @@ -30089,7 +30446,7 @@ static int __pyx_pf_3_sa_14Precomputation___cinit__(struct __pyx_obj_3_sa_Precom goto __pyx_L3; } - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":212 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":212 * if from_binary: * self.read_binary(from_binary) * elif from_stats: # <<<<<<<<<<<<<< @@ -30099,7 +30456,7 @@ static int __pyx_pf_3_sa_14Precomputation___cinit__(struct __pyx_obj_3_sa_Precom __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/paulb/workspace/cdec/python/src/sa/precomputation.pxi":213 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":213 * self.read_binary(from_binary) * elif from_stats: * self.precompute(from_stats, fsarray) # <<<<<<<<<<<<<< @@ -30159,7 +30516,7 @@ static PyObject *__pyx_pw_3_sa_14Precomputation_3read_binary(PyObject *__pyx_v_s return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":216 +/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":216 * * * def read_binary(self, char* filename): # <<<<<<<<<<<<<< @@ -30177,7 +30534,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_2read_binary(struct __pyx_obj_3_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("read_binary", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":218 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":218 * def read_binary(self, char* filename): * cdef FILE* f * f = fopen(filename, "r") # <<<<<<<<<<<<<< @@ -30186,7 +30543,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_2read_binary(struct __pyx_obj_3_ */ __pyx_v_f = fopen(__pyx_v_filename, __pyx_k__r); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":219 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":219 * cdef FILE* f * f = fopen(filename, "r") * fread(&(self.precompute_rank), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -30195,7 +30552,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_2read_binary(struct __pyx_obj_3_ */ fread((&__pyx_v_self->precompute_rank), (sizeof(int)), 1, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":220 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -30204,7 +30561,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_2read_binary(struct __pyx_obj_3_ */ fread((&__pyx_v_self->precompute_secondary_rank), (sizeof(int)), 1, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":221 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -30213,7 +30570,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_2read_binary(struct __pyx_obj_3_ */ fread((&__pyx_v_self->max_length), (sizeof(int)), 1, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":222 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -30222,7 +30579,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_2read_binary(struct __pyx_obj_3_ */ fread((&__pyx_v_self->max_nonterminals), (sizeof(int)), 1, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":223 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -30231,7 +30588,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_2read_binary(struct __pyx_obj_3_ */ fread((&__pyx_v_self->train_max_initial_size), (sizeof(int)), 1, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":224 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -30240,7 +30597,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_2read_binary(struct __pyx_obj_3_ */ fread((&__pyx_v_self->train_min_gap_size), (sizeof(int)), 1, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":225 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -30255,7 +30612,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_2read_binary(struct __pyx_obj_3_ __pyx_v_self->precomputed_index = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":226 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -30270,7 +30627,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_2read_binary(struct __pyx_obj_3_ __pyx_v_self->precomputed_collocations = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":227 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":227 * self.precomputed_index = self.read_map(f) * self.precomputed_collocations = self.read_map(f) * fclose(f) # <<<<<<<<<<<<<< @@ -30312,7 +30669,7 @@ static PyObject *__pyx_pw_3_sa_14Precomputation_5write_binary(PyObject *__pyx_v_ return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":230 +/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":230 * * * def write_binary(self, char* filename): # <<<<<<<<<<<<<< @@ -30331,7 +30688,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_4write_binary(struct __pyx_obj_3 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_binary", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":232 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":232 * def write_binary(self, char* filename): * cdef FILE* f * f = fopen(filename, "w") # <<<<<<<<<<<<<< @@ -30340,7 +30697,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_4write_binary(struct __pyx_obj_3 */ __pyx_v_f = fopen(__pyx_v_filename, __pyx_k__w); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":233 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":233 * cdef FILE* f * f = fopen(filename, "w") * fwrite(&(self.precompute_rank), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -30349,7 +30706,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_4write_binary(struct __pyx_obj_3 */ fwrite((&__pyx_v_self->precompute_rank), (sizeof(int)), 1, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":234 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -30358,7 +30715,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_4write_binary(struct __pyx_obj_3 */ fwrite((&__pyx_v_self->precompute_secondary_rank), (sizeof(int)), 1, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":235 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -30367,7 +30724,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_4write_binary(struct __pyx_obj_3 */ fwrite((&__pyx_v_self->max_length), (sizeof(int)), 1, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":236 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -30376,7 +30733,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_4write_binary(struct __pyx_obj_3 */ fwrite((&__pyx_v_self->max_nonterminals), (sizeof(int)), 1, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":237 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -30385,7 +30742,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_4write_binary(struct __pyx_obj_3 */ fwrite((&__pyx_v_self->train_max_initial_size), (sizeof(int)), 1, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":238 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -30394,7 +30751,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_4write_binary(struct __pyx_obj_3 */ fwrite((&__pyx_v_self->train_min_gap_size), (sizeof(int)), 1, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":239 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -30408,7 +30765,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_4write_binary(struct __pyx_obj_3 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":240 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -30422,7 +30779,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_4write_binary(struct __pyx_obj_3 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":241 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":241 * self.write_map(self.precomputed_index, f) * self.write_map(self.precomputed_collocations, f) * fclose(f) # <<<<<<<<<<<<<< @@ -30444,7 +30801,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_4write_binary(struct __pyx_obj_3 return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":244 +/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":244 * * * cdef write_map(self, m, FILE* f): # <<<<<<<<<<<<<< @@ -30463,21 +30820,19 @@ static PyObject *__pyx_f_3_sa_14Precomputation_write_map(CYTHON_UNUSED struct __ __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *(*__pyx_t_4)(PyObject *); + Py_ssize_t __pyx_t_3; + int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *(*__pyx_t_8)(PyObject *); - Py_ssize_t __pyx_t_9; - PyObject *(*__pyx_t_10)(PyObject *); - int __pyx_t_11; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + PyObject *(*__pyx_t_9)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_map", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":248 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":248 * cdef IntList arr * * N = len(m) # <<<<<<<<<<<<<< @@ -30487,7 +30842,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_write_map(CYTHON_UNUSED struct __ __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/paulb/workspace/cdec/python/src/sa/precomputation.pxi":249 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":249 * * N = len(m) * fwrite(&(N), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -30496,87 +30851,29 @@ static PyObject *__pyx_f_3_sa_14Precomputation_write_map(CYTHON_UNUSED struct __ */ fwrite((&__pyx_v_N), (sizeof(int)), 1, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":250 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":250 * N = len(m) * fwrite(&(N), sizeof(int), 1, f) * for pattern, val in m.iteritems(): # <<<<<<<<<<<<<< * N = len(pattern) * fwrite(&(N), sizeof(int), 1, f) */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_m, __pyx_n_s__iteritems); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) { - __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = 0; - __pyx_t_4 = NULL; - } else { - __pyx_t_1 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; + __pyx_t_1 = 0; + if (unlikely(__pyx_v_m == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems"); + {__pyx_filename = __pyx_f[11]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - for (;;) { - if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) { - if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_2)) break; - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; - } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) { - if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; - } else { - __pyx_t_3 = __pyx_t_4(__pyx_t_2); - if (unlikely(!__pyx_t_3)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[11]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - break; - } - __Pyx_GOTREF(__pyx_t_3); - } - if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { - PyObject* sequence = __pyx_t_3; - if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { - if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[11]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); - } else { - if (unlikely(PyList_GET_SIZE(sequence) != 2)) { - if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[11]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_5 = PyList_GET_ITEM(sequence, 0); - __pyx_t_6 = PyList_GET_ITEM(sequence, 1); - } - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; - index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; - __Pyx_GOTREF(__pyx_t_5); - index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; - __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - goto __pyx_L6_unpacking_done; - __pyx_L5_unpacking_failed:; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[11]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_L6_unpacking_done:; - } + __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_m, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[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; + __pyx_t_5 = 0; + while (1) { + __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_3, &__pyx_t_1, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4); + if (unlikely(__pyx_t_7 == 0)) break; + if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF(__pyx_v_pattern); __pyx_v_pattern = __pyx_t_5; __pyx_t_5 = 0; @@ -30584,17 +30881,17 @@ static PyObject *__pyx_f_3_sa_14Precomputation_write_map(CYTHON_UNUSED struct __ __pyx_v_val = __pyx_t_6; __pyx_t_6 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":251 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":251 * fwrite(&(N), sizeof(int), 1, f) * for pattern, val in m.iteritems(): * N = len(pattern) # <<<<<<<<<<<<<< * fwrite(&(N), sizeof(int), 1, f) * for word_id in pattern: */ - __pyx_t_9 = PyObject_Length(__pyx_v_pattern); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_N = __pyx_t_9; + __pyx_t_8 = PyObject_Length(__pyx_v_pattern); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_N = __pyx_t_8; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":252 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":252 * for pattern, val in m.iteritems(): * N = len(pattern) * fwrite(&(N), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -30603,7 +30900,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_write_map(CYTHON_UNUSED struct __ */ fwrite((&__pyx_v_N), (sizeof(int)), 1, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":253 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":253 * N = len(pattern) * fwrite(&(N), sizeof(int), 1, f) * for word_id in pattern: # <<<<<<<<<<<<<< @@ -30611,46 +30908,54 @@ static PyObject *__pyx_f_3_sa_14Precomputation_write_map(CYTHON_UNUSED struct __ * fwrite(&(i), sizeof(int), 1, f) */ if (PyList_CheckExact(__pyx_v_pattern) || PyTuple_CheckExact(__pyx_v_pattern)) { - __pyx_t_3 = __pyx_v_pattern; __Pyx_INCREF(__pyx_t_3); __pyx_t_9 = 0; - __pyx_t_10 = NULL; + __pyx_t_6 = __pyx_v_pattern; __Pyx_INCREF(__pyx_t_6); __pyx_t_8 = 0; + __pyx_t_9 = NULL; } else { - __pyx_t_9 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_pattern); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = Py_TYPE(__pyx_t_3)->tp_iternext; + __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_pattern); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_9 = Py_TYPE(__pyx_t_6)->tp_iternext; } for (;;) { - if (!__pyx_t_10 && PyList_CheckExact(__pyx_t_3)) { - if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_3)) break; - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++; - } else if (!__pyx_t_10 && PyTuple_CheckExact(__pyx_t_3)) { - if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_3)) break; - __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++; + if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_6)) { + if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_6)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_6)) { + if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_6)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else { - __pyx_t_6 = __pyx_t_10(__pyx_t_3); - if (unlikely(!__pyx_t_6)) { + __pyx_t_5 = __pyx_t_9(__pyx_t_6); + if (unlikely(!__pyx_t_5)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[11]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } - __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); } __Pyx_XDECREF(__pyx_v_word_id); - __pyx_v_word_id = __pyx_t_6; - __pyx_t_6 = 0; + __pyx_v_word_id = __pyx_t_5; + __pyx_t_5 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":254 + /* "/home/pauldb/workspace/cdec/python/src/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_11 = __Pyx_PyInt_AsInt(__pyx_v_word_id); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_i = __pyx_t_11; + __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_v_word_id); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_i = __pyx_t_7; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":255 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":255 * for word_id in pattern: * i = word_id * fwrite(&(i), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -30659,9 +30964,9 @@ static PyObject *__pyx_f_3_sa_14Precomputation_write_map(CYTHON_UNUSED struct __ */ fwrite((&__pyx_v_i), (sizeof(int)), 1, __pyx_v_f); } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":256 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":256 * i = word_id * fwrite(&(i), sizeof(int), 1, f) * arr = val # <<<<<<<<<<<<<< @@ -30673,7 +30978,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_write_map(CYTHON_UNUSED struct __ __Pyx_XDECREF(((PyObject *)__pyx_v_arr)); __pyx_v_arr = ((struct __pyx_obj_3_sa_IntList *)__pyx_v_val); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":257 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":257 * fwrite(&(i), sizeof(int), 1, f) * arr = val * arr.write_handle(f) # <<<<<<<<<<<<<< @@ -30688,10 +30993,8 @@ static PyObject *__pyx_f_3_sa_14Precomputation_write_map(CYTHON_UNUSED struct __ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("_sa.Precomputation.write_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; @@ -30704,7 +31007,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_write_map(CYTHON_UNUSED struct __ return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":260 +/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":260 * * * cdef read_map(self, FILE* f): # <<<<<<<<<<<<<< @@ -30732,7 +31035,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_read_map(CYTHON_UNUSED struct __p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("read_map", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":264 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":264 * cdef IntList arr * * m = {} # <<<<<<<<<<<<<< @@ -30744,7 +31047,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_read_map(CYTHON_UNUSED struct __p __pyx_v_m = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":265 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":265 * * m = {} * fread(&(N), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -30753,7 +31056,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_read_map(CYTHON_UNUSED struct __p */ fread((&__pyx_v_N), (sizeof(int)), 1, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":266 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":266 * m = {} * fread(&(N), sizeof(int), 1, f) * for j from 0 <= j < N: # <<<<<<<<<<<<<< @@ -30763,7 +31066,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_read_map(CYTHON_UNUSED struct __p __pyx_t_2 = __pyx_v_N; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_2; __pyx_v_j++) { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":267 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":267 * fread(&(N), sizeof(int), 1, f) * for j from 0 <= j < N: * fread(&(i), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -30772,7 +31075,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_read_map(CYTHON_UNUSED struct __p */ fread((&__pyx_v_i), (sizeof(int)), 1, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":268 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":268 * for j from 0 <= j < N: * fread(&(i), sizeof(int), 1, f) * key = () # <<<<<<<<<<<<<< @@ -30783,7 +31086,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_read_map(CYTHON_UNUSED struct __p __Pyx_XDECREF(((PyObject *)__pyx_v_key)); __pyx_v_key = __pyx_empty_tuple; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":269 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":269 * fread(&(i), sizeof(int), 1, f) * key = () * for k from 0 <= k < i: # <<<<<<<<<<<<<< @@ -30793,7 +31096,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_read_map(CYTHON_UNUSED struct __p __pyx_t_3 = __pyx_v_i; for (__pyx_v_k = 0; __pyx_v_k < __pyx_t_3; __pyx_v_k++) { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":270 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":270 * key = () * for k from 0 <= k < i: * fread(&(word_id), sizeof(int), 1, f) # <<<<<<<<<<<<<< @@ -30802,7 +31105,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_read_map(CYTHON_UNUSED struct __p */ fread((&__pyx_v_word_id), (sizeof(int)), 1, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":271 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":271 * for k from 0 <= k < i: * fread(&(word_id), sizeof(int), 1, f) * key = key + (word_id,) # <<<<<<<<<<<<<< @@ -30824,7 +31127,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_read_map(CYTHON_UNUSED struct __p __pyx_t_1 = 0; } - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":272 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":272 * fread(&(word_id), sizeof(int), 1, f) * key = key + (word_id,) * arr = IntList() # <<<<<<<<<<<<<< @@ -30837,7 +31140,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_read_map(CYTHON_UNUSED struct __p __pyx_v_arr = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":273 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":273 * key = key + (word_id,) * arr = IntList() * arr.read_handle(f) # <<<<<<<<<<<<<< @@ -30846,7 +31149,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_read_map(CYTHON_UNUSED struct __p */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_arr->__pyx_vtab)->read_handle(__pyx_v_arr, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":274 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":274 * arr = IntList() * arr.read_handle(f) * m[key] = arr # <<<<<<<<<<<<<< @@ -30856,7 +31159,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_read_map(CYTHON_UNUSED struct __p 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;} } - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":275 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":275 * arr.read_handle(f) * m[key] = arr * return m # <<<<<<<<<<<<<< @@ -30889,11 +31192,11 @@ static PyObject *__pyx_pw_3_sa_14Precomputation_7precompute(PyObject *__pyx_v_se static PyObject *__pyx_pw_3_sa_14Precomputation_7precompute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_stats = 0; struct __pyx_obj_3_sa_SuffixArray *__pyx_v_sarray = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__stats,&__pyx_n_s__sarray,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("precompute (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__stats,&__pyx_n_s__sarray,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -30907,12 +31210,10 @@ static PyObject *__pyx_pw_3_sa_14Precomputation_7precompute(PyObject *__pyx_v_se kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__stats); - if (likely(values[0])) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__stats)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sarray); - if (likely(values[1])) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sarray)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("precompute", 1, 2, 2, 1); {__pyx_filename = __pyx_f[11]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -30947,7 +31248,7 @@ static PyObject *__pyx_pw_3_sa_14Precomputation_7precompute(PyObject *__pyx_v_se return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":278 +/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":278 * * * def precompute(self, stats, SuffixArray sarray): # <<<<<<<<<<<<<< @@ -31033,7 +31334,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("precompute", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":280 + /* "/home/pauldb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -31043,7 +31344,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __Pyx_INCREF(((PyObject *)__pyx_v_sarray->darray)); __pyx_v_darray = __pyx_v_sarray->darray; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":285 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":285 * cdef _Trie_Node* node * * data = darray.data # <<<<<<<<<<<<<< @@ -31053,7 +31354,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __Pyx_INCREF(((PyObject *)__pyx_v_darray->data)); __pyx_v_data = __pyx_v_darray->data; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":287 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":287 * data = darray.data * * frequent_patterns = TrieMap(len(darray.id2word)) # <<<<<<<<<<<<<< @@ -31077,7 +31378,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_frequent_patterns = ((struct __pyx_obj_3_sa_TrieMap *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":288 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":288 * * frequent_patterns = TrieMap(len(darray.id2word)) * super_frequent_patterns = TrieMap(len(darray.id2word)) # <<<<<<<<<<<<<< @@ -31101,7 +31402,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_super_frequent_patterns = ((struct __pyx_obj_3_sa_TrieMap *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":289 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":289 * frequent_patterns = TrieMap(len(darray.id2word)) * super_frequent_patterns = TrieMap(len(darray.id2word)) * collocations = TrieMap(len(darray.id2word)) # <<<<<<<<<<<<<< @@ -31125,7 +31426,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_collocations = ((struct __pyx_obj_3_sa_TrieMap *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":291 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":291 * collocations = TrieMap(len(darray.id2word)) * * I_set = set() # <<<<<<<<<<<<<< @@ -31137,7 +31438,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_I_set = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":292 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":292 * * I_set = set() * J_set = set() # <<<<<<<<<<<<<< @@ -31149,7 +31450,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_J_set = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":293 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":293 * I_set = set() * J_set = set() * J2_set = set() # <<<<<<<<<<<<<< @@ -31161,7 +31462,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_J2_set = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":294 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":294 * J_set = set() * J2_set = set() * IJ_set = set() # <<<<<<<<<<<<<< @@ -31173,7 +31474,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_IJ_set = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":295 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":295 * J2_set = set() * IJ_set = set() * pattern_rank = {} # <<<<<<<<<<<<<< @@ -31185,7 +31486,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_pattern_rank = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":297 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":297 * pattern_rank = {} * * logger.info("Precomputing frequent intersections") # <<<<<<<<<<<<<< @@ -31202,7 +31503,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":298 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":298 * * logger.info("Precomputing frequent intersections") * cdef float start_time = monitor_cpu() # <<<<<<<<<<<<<< @@ -31218,7 +31519,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_start_time = __pyx_t_4; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":300 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":300 * cdef float start_time = monitor_cpu() * * max_pattern_len = 0 # <<<<<<<<<<<<<< @@ -31227,7 +31528,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ __pyx_v_max_pattern_len = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":301 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":301 * * max_pattern_len = 0 * for rank, (_, _, phrase) in enumerate(stats): # <<<<<<<<<<<<<< @@ -31247,10 +31548,18 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s for (;;) { if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __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; - __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else { __pyx_t_6 = __pyx_t_5(__pyx_t_1); if (unlikely(!__pyx_t_6)) { @@ -31264,21 +31573,22 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s } if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { PyObject* sequence = __pyx_t_6; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 3)) { + if (size > 3) __Pyx_RaiseTooManyValuesError(3); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 3)) { - if (PyTuple_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 2); } else { - if (unlikely(PyList_GET_SIZE(sequence) != 3)) { - if (PyList_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } __pyx_t_7 = PyList_GET_ITEM(sequence, 0); __pyx_t_8 = PyList_GET_ITEM(sequence, 1); __pyx_t_9 = PyList_GET_ITEM(sequence, 2); @@ -31286,8 +31596,14 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); + #else + __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } else { + } else + { Py_ssize_t index = -1; __pyx_t_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); @@ -31300,12 +31616,13 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s index = 2; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 3) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); + __pyx_t_11 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L6_unpacking_done:; } @@ -31327,7 +31644,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_t_3 = __pyx_t_6; __pyx_t_6 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":302 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":302 * max_pattern_len = 0 * for rank, (_, _, phrase) in enumerate(stats): * if rank >= self.precompute_rank: # <<<<<<<<<<<<<< @@ -31336,14 +31653,13 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ __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_GOTREF(__pyx_t_6); - __pyx_t_9 = PyObject_RichCompare(__pyx_v_rank, __pyx_t_6, Py_GE); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); + __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; __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_12) { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":303 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":303 * for rank, (_, _, phrase) in enumerate(stats): * if rank >= self.precompute_rank: * break # <<<<<<<<<<<<<< @@ -31355,7 +31671,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s } __pyx_L7:; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":304 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":304 * if rank >= self.precompute_rank: * break * max_pattern_len = max(max_pattern_len, len(phrase)) # <<<<<<<<<<<<<< @@ -31371,7 +31687,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s } __pyx_v_max_pattern_len = __pyx_t_15; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":305 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":305 * break * max_pattern_len = max(max_pattern_len, len(phrase)) * frequent_patterns.insert(phrase) # <<<<<<<<<<<<<< @@ -31391,7 +31707,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":306 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":306 * max_pattern_len = max(max_pattern_len, len(phrase)) * frequent_patterns.insert(phrase) * I_set.add(phrase) # <<<<<<<<<<<<<< @@ -31400,7 +31716,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ __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/paulb/workspace/cdec/python/src/sa/precomputation.pxi":307 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":307 * frequent_patterns.insert(phrase) * I_set.add(phrase) * pattern_rank[phrase] = rank # <<<<<<<<<<<<<< @@ -31409,7 +31725,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ 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;} - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":308 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":308 * I_set.add(phrase) * pattern_rank[phrase] = rank * if rank < self.precompute_secondary_rank: # <<<<<<<<<<<<<< @@ -31418,14 +31734,13 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ __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_GOTREF(__pyx_t_8); - __pyx_t_6 = PyObject_RichCompare(__pyx_v_rank, __pyx_t_8, Py_LT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); + __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; __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_12) { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":309 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":309 * pattern_rank[phrase] = rank * if rank < self.precompute_secondary_rank: * super_frequent_patterns.insert(phrase) # <<<<<<<<<<<<<< @@ -31445,7 +31760,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":310 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":310 * if rank < self.precompute_secondary_rank: * super_frequent_patterns.insert(phrase) * J_set.add(phrase) # <<<<<<<<<<<<<< @@ -31461,7 +31776,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":312 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":312 * J_set.add(phrase) * * queue = IntList(increment=1000) # <<<<<<<<<<<<<< @@ -31477,7 +31792,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_queue = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":314 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":314 * queue = IntList(increment=1000) * * logger.info(" Computing inverted indexes...") # <<<<<<<<<<<<<< @@ -31494,7 +31809,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":315 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":315 * * logger.info(" Computing inverted indexes...") * N = len(data) # <<<<<<<<<<<<<< @@ -31504,7 +31819,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __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/paulb/workspace/cdec/python/src/sa/precomputation.pxi":316 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":316 * logger.info(" Computing inverted indexes...") * N = len(data) * for i from 0 <= i < N: # <<<<<<<<<<<<<< @@ -31514,7 +31829,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_t_14 = __pyx_v_N; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_14; __pyx_v_i++) { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":317 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":317 * N = len(data) * for i from 0 <= i < N: * sa_word_id = data.arr[i] # <<<<<<<<<<<<<< @@ -31523,7 +31838,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ __pyx_v_sa_word_id = (__pyx_v_data->arr[__pyx_v_i]); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":318 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":318 * for i from 0 <= i < N: * sa_word_id = data.arr[i] * if sa_word_id == 1: # <<<<<<<<<<<<<< @@ -31533,7 +31848,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_t_12 = (__pyx_v_sa_word_id == 1); if (__pyx_t_12) { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":319 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":319 * sa_word_id = data.arr[i] * if sa_word_id == 1: * queue._append(-1) # <<<<<<<<<<<<<< @@ -31545,7 +31860,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":321 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":321 * queue._append(-1) * else: * for l from 1 <= l <= max_pattern_len: # <<<<<<<<<<<<<< @@ -31555,7 +31870,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_t_17 = __pyx_v_max_pattern_len; for (__pyx_v_l = 1; __pyx_v_l <= __pyx_t_17; __pyx_v_l++) { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":322 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":322 * else: * for l from 1 <= l <= max_pattern_len: * node = frequent_patterns._contains(data.arr+i, l) # <<<<<<<<<<<<<< @@ -31564,7 +31879,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ __pyx_v_node = ((struct __pyx_vtabstruct_3_sa_TrieMap *)__pyx_v_frequent_patterns->__pyx_vtab)->_contains(__pyx_v_frequent_patterns, (__pyx_v_data->arr + __pyx_v_i), __pyx_v_l); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":323 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":323 * for l from 1 <= l <= max_pattern_len: * node = frequent_patterns._contains(data.arr+i, l) * if node == NULL: # <<<<<<<<<<<<<< @@ -31574,7 +31889,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_t_12 = (__pyx_v_node == NULL); if (__pyx_t_12) { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":324 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":324 * node = frequent_patterns._contains(data.arr+i, l) * if node == NULL: * break # <<<<<<<<<<<<<< @@ -31586,7 +31901,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s } __pyx_L14:; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":325 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":325 * if node == NULL: * break * queue._append(i) # <<<<<<<<<<<<<< @@ -31595,7 +31910,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_queue->__pyx_vtab)->_append(__pyx_v_queue, __pyx_v_i); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":326 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":326 * break * queue._append(i) * queue._append(l) # <<<<<<<<<<<<<< @@ -31604,7 +31919,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_queue->__pyx_vtab)->_append(__pyx_v_queue, __pyx_v_l); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":327 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":327 * queue._append(i) * queue._append(l) * trie_node_data_append(node, i) # <<<<<<<<<<<<<< @@ -31620,7 +31935,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_L11:; } - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":329 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":329 * trie_node_data_append(node, i) * * logger.info(" Computing collocations...") # <<<<<<<<<<<<<< @@ -31637,7 +31952,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":330 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":330 * * logger.info(" Computing collocations...") * N = len(queue) # <<<<<<<<<<<<<< @@ -31647,7 +31962,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __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/paulb/workspace/cdec/python/src/sa/precomputation.pxi":331 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":331 * logger.info(" Computing collocations...") * N = len(queue) * ptr1 = 0 # <<<<<<<<<<<<<< @@ -31656,7 +31971,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ __pyx_v_ptr1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":332 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":332 * N = len(queue) * ptr1 = 0 * sent_count = 0 # <<<<<<<<<<<<<< @@ -31665,7 +31980,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ __pyx_v_sent_count = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":333 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":333 * ptr1 = 0 * sent_count = 0 * while ptr1 < N: # main loop # <<<<<<<<<<<<<< @@ -31676,7 +31991,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_t_12 = (__pyx_v_ptr1 < __pyx_v_N); if (!__pyx_t_12) break; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":334 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":334 * sent_count = 0 * while ptr1 < N: # main loop * i1 = queue.arr[ptr1] # <<<<<<<<<<<<<< @@ -31685,7 +32000,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ __pyx_v_i1 = (__pyx_v_queue->arr[__pyx_v_ptr1]); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":335 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":335 * while ptr1 < N: # main loop * i1 = queue.arr[ptr1] * if i1 > -1: # <<<<<<<<<<<<<< @@ -31695,7 +32010,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_t_12 = (__pyx_v_i1 > -1); if (__pyx_t_12) { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":336 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":336 * i1 = queue.arr[ptr1] * if i1 > -1: * l1 = queue.arr[ptr1+1] # <<<<<<<<<<<<<< @@ -31704,7 +32019,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ __pyx_v_l1 = (__pyx_v_queue->arr[(__pyx_v_ptr1 + 1)]); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":337 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":337 * if i1 > -1: * l1 = queue.arr[ptr1+1] * ptr2 = ptr1 + 2 # <<<<<<<<<<<<<< @@ -31713,7 +32028,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ __pyx_v_ptr2 = (__pyx_v_ptr1 + 2); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":338 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":338 * l1 = queue.arr[ptr1+1] * ptr2 = ptr1 + 2 * while ptr2 < N: # <<<<<<<<<<<<<< @@ -31724,7 +32039,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_t_12 = (__pyx_v_ptr2 < __pyx_v_N); if (!__pyx_t_12) break; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":339 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":339 * ptr2 = ptr1 + 2 * while ptr2 < N: * i2 = queue.arr[ptr2] # <<<<<<<<<<<<<< @@ -31733,7 +32048,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ __pyx_v_i2 = (__pyx_v_queue->arr[__pyx_v_ptr2]); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":340 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":340 * while ptr2 < N: * i2 = queue.arr[ptr2] * if i2 == -1 or i2 - i1 >= self.train_max_initial_size: # <<<<<<<<<<<<<< @@ -31749,7 +32064,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s } if (__pyx_t_19) { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":341 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":341 * i2 = queue.arr[ptr2] * if i2 == -1 or i2 - i1 >= self.train_max_initial_size: * break # <<<<<<<<<<<<<< @@ -31761,7 +32076,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s } __pyx_L20:; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":342 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":342 * if i2 == -1 or i2 - i1 >= self.train_max_initial_size: * break * l2 = queue.arr[ptr2+1] # <<<<<<<<<<<<<< @@ -31770,7 +32085,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ __pyx_v_l2 = (__pyx_v_queue->arr[(__pyx_v_ptr2 + 1)]); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":343 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":343 * break * l2 = queue.arr[ptr2+1] * if (i2 - i1 - l1 >= self.train_min_gap_size and # <<<<<<<<<<<<<< @@ -31780,7 +32095,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_t_19 = (((__pyx_v_i2 - __pyx_v_i1) - __pyx_v_l1) >= __pyx_v_self->train_min_gap_size); if (__pyx_t_19) { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":344 + /* "/home/pauldb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -31790,7 +32105,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_t_12 = (((__pyx_v_i2 + __pyx_v_l2) - __pyx_v_i1) <= __pyx_v_self->train_max_initial_size); if (__pyx_t_12) { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":345 + /* "/home/pauldb/workspace/cdec/python/src/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): # <<<<<<<<<<<<<< @@ -31808,7 +32123,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s } if (__pyx_t_12) { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":346 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -31817,7 +32132,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ __pyx_v_node = ((struct __pyx_vtabstruct_3_sa_TrieMap *)__pyx_v_collocations->__pyx_vtab)->_insert(__pyx_v_collocations, (__pyx_v_data->arr + __pyx_v_i1), __pyx_v_l1); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":347 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":347 * l1+l2+1 <= self.max_length): * node = collocations._insert(data.arr+i1, l1) * node = trie_insert(node, -1) # <<<<<<<<<<<<<< @@ -31826,7 +32141,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ __pyx_v_node = __pyx_f_3_sa_trie_insert(__pyx_v_node, -1); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":348 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":348 * node = collocations._insert(data.arr+i1, l1) * node = trie_insert(node, -1) * for i from i2 <= i < i2+l2: # <<<<<<<<<<<<<< @@ -31836,7 +32151,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __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/paulb/workspace/cdec/python/src/sa/precomputation.pxi":349 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":349 * node = trie_insert(node, -1) * for i from i2 <= i < i2+l2: * node = trie_insert(node, data.arr[i]) # <<<<<<<<<<<<<< @@ -31846,7 +32161,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_node = __pyx_f_3_sa_trie_insert(__pyx_v_node, (__pyx_v_data->arr[__pyx_v_i])); } - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":350 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":350 * for i from i2 <= i < i2+l2: * node = trie_insert(node, data.arr[i]) * trie_node_data_append(node, i1) # <<<<<<<<<<<<<< @@ -31857,7 +32172,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":351 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":351 * node = trie_insert(node, data.arr[i]) * trie_node_data_append(node, i1) * trie_node_data_append(node, i2) # <<<<<<<<<<<<<< @@ -31868,7 +32183,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":352 + /* "/home/pauldb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -31878,7 +32193,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_t_12 = (((struct __pyx_vtabstruct_3_sa_TrieMap *)__pyx_v_super_frequent_patterns->__pyx_vtab)->_contains(__pyx_v_super_frequent_patterns, (__pyx_v_data->arr + __pyx_v_i2), __pyx_v_l2) != NULL); if (__pyx_t_12) { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":353 + /* "/home/pauldb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -31888,7 +32203,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_t_12 = (((struct __pyx_vtabstruct_3_sa_TrieMap *)__pyx_v_super_frequent_patterns->__pyx_vtab)->_contains(__pyx_v_super_frequent_patterns, (__pyx_v_data->arr + __pyx_v_i1), __pyx_v_l1) != NULL); if (__pyx_t_12) { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":354 + /* "/home/pauldb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -31900,7 +32215,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":356 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":356 * is_super = 1 * else: * is_super = 0 # <<<<<<<<<<<<<< @@ -31911,7 +32226,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s } __pyx_L25:; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":357 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":357 * else: * is_super = 0 * ptr3 = ptr2 + 2 # <<<<<<<<<<<<<< @@ -31920,7 +32235,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ __pyx_v_ptr3 = (__pyx_v_ptr2 + 2); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":358 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":358 * is_super = 0 * ptr3 = ptr2 + 2 * while ptr3 < N: # <<<<<<<<<<<<<< @@ -31931,7 +32246,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_t_12 = (__pyx_v_ptr3 < __pyx_v_N); if (!__pyx_t_12) break; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":359 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":359 * ptr3 = ptr2 + 2 * while ptr3 < N: * i3 = queue.arr[ptr3] # <<<<<<<<<<<<<< @@ -31940,7 +32255,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ __pyx_v_i3 = (__pyx_v_queue->arr[__pyx_v_ptr3]); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":360 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":360 * while ptr3 < N: * i3 = queue.arr[ptr3] * if i3 == -1 or i3 - i1 >= self.train_max_initial_size: # <<<<<<<<<<<<<< @@ -31956,7 +32271,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s } if (__pyx_t_20) { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":361 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":361 * i3 = queue.arr[ptr3] * if i3 == -1 or i3 - i1 >= self.train_max_initial_size: * break # <<<<<<<<<<<<<< @@ -31968,7 +32283,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s } __pyx_L28:; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":362 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":362 * if i3 == -1 or i3 - i1 >= self.train_max_initial_size: * break * l3 = queue.arr[ptr3+1] # <<<<<<<<<<<<<< @@ -31977,7 +32292,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ __pyx_v_l3 = (__pyx_v_queue->arr[(__pyx_v_ptr3 + 1)]); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":363 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":363 * break * l3 = queue.arr[ptr3+1] * if (i3 - i2 - l2 >= self.train_min_gap_size and # <<<<<<<<<<<<<< @@ -31987,7 +32302,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_t_20 = (((__pyx_v_i3 - __pyx_v_i2) - __pyx_v_l2) >= __pyx_v_self->train_min_gap_size); if (__pyx_t_20) { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":364 + /* "/home/pauldb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -31997,7 +32312,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_t_12 = (((__pyx_v_i3 + __pyx_v_l3) - __pyx_v_i1) <= __pyx_v_self->train_max_initial_size); if (__pyx_t_12) { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":365 + /* "/home/pauldb/workspace/cdec/python/src/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): # <<<<<<<<<<<<<< @@ -32015,7 +32330,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s } if (__pyx_t_12) { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":366 + /* "/home/pauldb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -32030,7 +32345,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s } if (__pyx_t_20) { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":367 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -32039,7 +32354,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ __pyx_v_node = ((struct __pyx_vtabstruct_3_sa_TrieMap *)__pyx_v_collocations->__pyx_vtab)->_insert(__pyx_v_collocations, (__pyx_v_data->arr + __pyx_v_i1), __pyx_v_l1); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":368 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -32048,7 +32363,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ __pyx_v_node = __pyx_f_3_sa_trie_insert(__pyx_v_node, -1); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":369 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":369 * node = collocations._insert(data.arr+i1, l1) * node = trie_insert(node, -1) * for i from i2 <= i < i2+l2: # <<<<<<<<<<<<<< @@ -32058,7 +32373,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __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/paulb/workspace/cdec/python/src/sa/precomputation.pxi":370 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":370 * node = trie_insert(node, -1) * for i from i2 <= i < i2+l2: * node = trie_insert(node, data.arr[i]) # <<<<<<<<<<<<<< @@ -32068,7 +32383,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_node = __pyx_f_3_sa_trie_insert(__pyx_v_node, (__pyx_v_data->arr[__pyx_v_i])); } - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":371 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":371 * for i from i2 <= i < i2+l2: * node = trie_insert(node, data.arr[i]) * node = trie_insert(node, -1) # <<<<<<<<<<<<<< @@ -32077,7 +32392,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ __pyx_v_node = __pyx_f_3_sa_trie_insert(__pyx_v_node, -1); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":372 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":372 * node = trie_insert(node, data.arr[i]) * node = trie_insert(node, -1) * for i from i3 <= i < i3+l3: # <<<<<<<<<<<<<< @@ -32087,7 +32402,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __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/paulb/workspace/cdec/python/src/sa/precomputation.pxi":373 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":373 * node = trie_insert(node, -1) * for i from i3 <= i < i3+l3: * node = trie_insert(node, data.arr[i]) # <<<<<<<<<<<<<< @@ -32097,7 +32412,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_node = __pyx_f_3_sa_trie_insert(__pyx_v_node, (__pyx_v_data->arr[__pyx_v_i])); } - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":374 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":374 * for i from i3 <= i < i3+l3: * node = trie_insert(node, data.arr[i]) * trie_node_data_append(node, i1) # <<<<<<<<<<<<<< @@ -32108,7 +32423,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":375 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":375 * node = trie_insert(node, data.arr[i]) * trie_node_data_append(node, i1) * trie_node_data_append(node, i2) # <<<<<<<<<<<<<< @@ -32119,7 +32434,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":376 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":376 * trie_node_data_append(node, i1) * trie_node_data_append(node, i2) * trie_node_data_append(node, i3) # <<<<<<<<<<<<<< @@ -32136,7 +32451,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s } __pyx_L29:; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":377 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":377 * trie_node_data_append(node, i2) * trie_node_data_append(node, i3) * ptr3 = ptr3 + 2 # <<<<<<<<<<<<<< @@ -32153,7 +32468,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s } __pyx_L21:; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":378 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":378 * trie_node_data_append(node, i3) * ptr3 = ptr3 + 2 * ptr2 = ptr2 + 2 # <<<<<<<<<<<<<< @@ -32164,7 +32479,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s } __pyx_L19_break:; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":379 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":379 * ptr3 = ptr3 + 2 * ptr2 = ptr2 + 2 * ptr1 = ptr1 + 2 # <<<<<<<<<<<<<< @@ -32176,7 +32491,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":381 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":381 * ptr1 = ptr1 + 2 * else: * sent_count = sent_count + 1 # <<<<<<<<<<<<<< @@ -32185,7 +32500,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ __pyx_v_sent_count = (__pyx_v_sent_count + 1); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":382 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":382 * else: * sent_count = sent_count + 1 * if sent_count % 10000 == 0: # <<<<<<<<<<<<<< @@ -32195,7 +32510,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_t_20 = (__Pyx_mod_long(__pyx_v_sent_count, 10000) == 0); if (__pyx_t_20) { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":383 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":383 * sent_count = sent_count + 1 * if sent_count % 10000 == 0: * logger.debug(" %d sentences", sent_count) # <<<<<<<<<<<<<< @@ -32226,7 +32541,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s } __pyx_L35:; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":384 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":384 * if sent_count % 10000 == 0: * logger.debug(" %d sentences", sent_count) * ptr1 = ptr1 + 1 # <<<<<<<<<<<<<< @@ -32238,7 +32553,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_L17:; } - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":386 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":386 * ptr1 = ptr1 + 1 * * self.precomputed_collocations = collocations.toMap(False) # <<<<<<<<<<<<<< @@ -32264,7 +32579,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_self->precomputed_collocations = __pyx_t_9; __pyx_t_9 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":387 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":387 * * self.precomputed_collocations = collocations.toMap(False) * self.precomputed_index = frequent_patterns.toMap(True) # <<<<<<<<<<<<<< @@ -32290,7 +32605,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_self->precomputed_index = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":389 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":389 * self.precomputed_index = frequent_patterns.toMap(True) * * x = 0 # <<<<<<<<<<<<<< @@ -32300,7 +32615,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __Pyx_INCREF(__pyx_int_0); __pyx_v_x = __pyx_int_0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":390 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":390 * * x = 0 * for pattern1 in J_set: # <<<<<<<<<<<<<< @@ -32326,7 +32641,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_pattern1 = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":391 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":391 * x = 0 * for pattern1 in J_set: * for pattern2 in J_set: # <<<<<<<<<<<<<< @@ -32352,7 +32667,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_pattern2 = __pyx_t_9; __pyx_t_9 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":392 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":392 * for pattern1 in J_set: * for pattern2 in J_set: * if len(pattern1) + len(pattern2) + 1 < self.max_length: # <<<<<<<<<<<<<< @@ -32364,7 +32679,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_t_20 = (((__pyx_t_2 + __pyx_t_15) + 1) < __pyx_v_self->max_length); if (__pyx_t_20) { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":393 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":393 * for pattern2 in J_set: * if len(pattern1) + len(pattern2) + 1 < self.max_length: * combined_pattern = pattern1 + (-1,) + pattern2 # <<<<<<<<<<<<<< @@ -32380,7 +32695,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_combined_pattern = __pyx_t_8; __pyx_t_8 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":394 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":394 * if len(pattern1) + len(pattern2) + 1 < self.max_length: * combined_pattern = pattern1 + (-1,) + pattern2 * J2_set.add(combined_pattern) # <<<<<<<<<<<<<< @@ -32396,7 +32711,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":396 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":396 * J2_set.add(combined_pattern) * * for pattern1 in I_set: # <<<<<<<<<<<<<< @@ -32422,7 +32737,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_pattern1 = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":397 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":397 * * for pattern1 in I_set: * for pattern2 in I_set: # <<<<<<<<<<<<<< @@ -32448,7 +32763,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_pattern2 = __pyx_t_8; __pyx_t_8 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":398 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":398 * for pattern1 in I_set: * for pattern2 in I_set: * x = x+1 # <<<<<<<<<<<<<< @@ -32461,7 +32776,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_x = __pyx_t_8; __pyx_t_8 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":399 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":399 * for pattern2 in I_set: * x = x+1 * if len(pattern1) + len(pattern2) + 1 <= self.max_length: # <<<<<<<<<<<<<< @@ -32473,7 +32788,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_t_20 = (((__pyx_t_15 + __pyx_t_2) + 1) <= __pyx_v_self->max_length); if (__pyx_t_20) { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":400 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":400 * x = x+1 * if len(pattern1) + len(pattern2) + 1 <= self.max_length: * combined_pattern = pattern1 + (-1,) + pattern2 # <<<<<<<<<<<<<< @@ -32489,7 +32804,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_combined_pattern = __pyx_t_9; __pyx_t_9 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":401 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":401 * if len(pattern1) + len(pattern2) + 1 <= self.max_length: * combined_pattern = pattern1 + (-1,) + pattern2 * IJ_set.add(combined_pattern) # <<<<<<<<<<<<<< @@ -32505,7 +32820,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":403 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":403 * IJ_set.add(combined_pattern) * * for pattern1 in I_set: # <<<<<<<<<<<<<< @@ -32531,7 +32846,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_pattern1 = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":404 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":404 * * for pattern1 in I_set: * for pattern2 in J2_set: # <<<<<<<<<<<<<< @@ -32557,7 +32872,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_pattern2 = __pyx_t_9; __pyx_t_9 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":405 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":405 * for pattern1 in I_set: * for pattern2 in J2_set: * x = x+2 # <<<<<<<<<<<<<< @@ -32570,7 +32885,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_x = __pyx_t_9; __pyx_t_9 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":406 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":406 * for pattern2 in J2_set: * x = x+2 * if len(pattern1) + len(pattern2) + 1<= self.max_length: # <<<<<<<<<<<<<< @@ -32582,7 +32897,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_t_20 = (((__pyx_t_2 + __pyx_t_15) + 1) <= __pyx_v_self->max_length); if (__pyx_t_20) { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":407 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":407 * x = x+2 * if len(pattern1) + len(pattern2) + 1<= self.max_length: * combined_pattern = pattern1 + (-1,) + pattern2 # <<<<<<<<<<<<<< @@ -32598,7 +32913,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_combined_pattern = __pyx_t_8; __pyx_t_8 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":408 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":408 * if len(pattern1) + len(pattern2) + 1<= self.max_length: * combined_pattern = pattern1 + (-1,) + pattern2 * IJ_set.add(combined_pattern) # <<<<<<<<<<<<<< @@ -32607,7 +32922,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ __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/paulb/workspace/cdec/python/src/sa/precomputation.pxi":409 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":409 * combined_pattern = pattern1 + (-1,) + pattern2 * IJ_set.add(combined_pattern) * combined_pattern = pattern2 + (-1,) + pattern1 # <<<<<<<<<<<<<< @@ -32623,7 +32938,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_combined_pattern = __pyx_t_9; __pyx_t_9 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":410 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":410 * IJ_set.add(combined_pattern) * combined_pattern = pattern2 + (-1,) + pattern1 * IJ_set.add(combined_pattern) # <<<<<<<<<<<<<< @@ -32639,17 +32954,17 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":412 + /* "/home/pauldb/workspace/cdec/python/src/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)); + __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_v_N = __pyx_t_15; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":413 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":413 * * N = len(pattern_rank) * cost_by_rank = IntList(initial_len=N) # <<<<<<<<<<<<<< @@ -32668,7 +32983,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_cost_by_rank = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":414 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":414 * N = len(pattern_rank) * cost_by_rank = IntList(initial_len=N) * count_by_rank = IntList(initial_len=N) # <<<<<<<<<<<<<< @@ -32687,105 +33002,47 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_count_by_rank = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":415 + /* "/home/pauldb/workspace/cdec/python/src/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(): # <<<<<<<<<<<<<< * if pattern not in IJ_set: * s = "" */ - __pyx_t_3 = PyObject_GetAttr(__pyx_v_self->precomputed_collocations, __pyx_n_s__iteritems); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); 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_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_15 = 0; - __pyx_t_5 = NULL; - } else { - __pyx_t_15 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; + __pyx_t_15 = 0; + if (unlikely(__pyx_v_self->precomputed_collocations == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems"); + {__pyx_filename = __pyx_f[11]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - for (;;) { - if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) { - if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_3)) break; - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; - } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) { - if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_3)) break; - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; - } else { - __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(); - else {__pyx_filename = __pyx_f[11]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - break; - } - __Pyx_GOTREF(__pyx_t_1); - } - if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { - PyObject* sequence = __pyx_t_1; - if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { - if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[11]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); - } else { - if (unlikely(PyList_GET_SIZE(sequence) != 2)) { - if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[11]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_9 = PyList_GET_ITEM(sequence, 0); - __pyx_t_8 = PyList_GET_ITEM(sequence, 1); - } - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_11 = Py_TYPE(__pyx_t_6)->tp_iternext; - index = 0; __pyx_t_9 = __pyx_t_11(__pyx_t_6); if (unlikely(!__pyx_t_9)) goto __pyx_L53_unpacking_failed; - __Pyx_GOTREF(__pyx_t_9); - index = 1; __pyx_t_8 = __pyx_t_11(__pyx_t_6); if (unlikely(!__pyx_t_8)) goto __pyx_L53_unpacking_failed; - __Pyx_GOTREF(__pyx_t_8); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_6), 2) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - goto __pyx_L54_unpacking_done; - __pyx_L53_unpacking_failed:; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[11]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_L54_unpacking_done:; - } + __pyx_t_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; + 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); + 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(__pyx_v_pattern); - __pyx_v_pattern = __pyx_t_9; - __pyx_t_9 = 0; + __pyx_v_pattern = __pyx_t_1; + __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_v_arr); - __pyx_v_arr = __pyx_t_8; - __pyx_t_8 = 0; + __pyx_v_arr = __pyx_t_9; + __pyx_t_9 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":416 + /* "/home/pauldb/workspace/cdec/python/src/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_NegateNonNeg(PySequence_Contains(((PyObject *)__pyx_v_IJ_set), __pyx_v_pattern))); 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, ((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;} if (__pyx_t_20) { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":417 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":417 * for pattern, arr in self.precomputed_collocations.iteritems(): * if pattern not in IJ_set: * s = "" # <<<<<<<<<<<<<< @@ -32796,7 +33053,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __Pyx_XDECREF(__pyx_v_s); __pyx_v_s = ((PyObject *)__pyx_kp_s_45); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":418 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":418 * if pattern not in IJ_set: * s = "" * for word_id in pattern: # <<<<<<<<<<<<<< @@ -32804,117 +33061,124 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s * s = s + "X " */ if (PyList_CheckExact(__pyx_v_pattern) || PyTuple_CheckExact(__pyx_v_pattern)) { - __pyx_t_1 = __pyx_v_pattern; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; - __pyx_t_21 = NULL; + __pyx_t_9 = __pyx_v_pattern; __Pyx_INCREF(__pyx_t_9); __pyx_t_13 = 0; + __pyx_t_5 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_pattern); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_21 = Py_TYPE(__pyx_t_1)->tp_iternext; + __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; } for (;;) { - if (!__pyx_t_21 && PyList_CheckExact(__pyx_t_1)) { - if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_8); __pyx_t_2++; - } else if (!__pyx_t_21 && PyTuple_CheckExact(__pyx_t_1)) { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_8); __pyx_t_2++; + if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_9)) { + if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_9)) 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;} + #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;} + #endif + } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_9)) { + if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_9)) 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;} + #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;} + #endif } else { - __pyx_t_8 = __pyx_t_21(__pyx_t_1); - if (unlikely(!__pyx_t_8)) { + __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(); else {__pyx_filename = __pyx_f[11]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } - __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF(__pyx_v_word_id); - __pyx_v_word_id = __pyx_t_8; - __pyx_t_8 = 0; + __pyx_v_word_id = __pyx_t_1; + __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":419 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":419 * s = "" * for word_id in pattern: * if word_id == -1: # <<<<<<<<<<<<<< * s = s + "X " * else: */ - __pyx_t_8 = PyObject_RichCompare(__pyx_v_word_id, __pyx_int_neg_1, Py_EQ); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_20 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __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_20 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_20 < 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; if (__pyx_t_20) { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":420 + /* "/home/pauldb/workspace/cdec/python/src/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_8 = PyNumber_Add(__pyx_v_s, ((PyObject *)__pyx_kp_s_83)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = PyNumber_Add(__pyx_v_s, ((PyObject *)__pyx_kp_s_83)); 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(__pyx_v_s); - __pyx_v_s = __pyx_t_8; - __pyx_t_8 = 0; - goto __pyx_L58; + __pyx_v_s = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L56; } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":422 + /* "/home/pauldb/workspace/cdec/python/src/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_8 = PyObject_GetItem(__pyx_v_darray->id2word, __pyx_v_word_id); if (!__pyx_t_8) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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_GOTREF(__pyx_t_8); - __pyx_t_9 = PyNumber_Add(__pyx_v_s, __pyx_t_8); 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_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Add(__pyx_t_8, ((PyObject *)__pyx_kp_s_67)); 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_8); __pyx_t_8 = 0; - __pyx_t_8 = PyNumber_Add(__pyx_t_9, ((PyObject *)__pyx_kp_s_67)); 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_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_v_s); - __pyx_v_s = __pyx_t_8; - __pyx_t_8 = 0; + __pyx_v_s = __pyx_t_1; + __pyx_t_1 = 0; } - __pyx_L58:; + __pyx_L56:; } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":423 + /* "/home/pauldb/workspace/cdec/python/src/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_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); 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_t_8 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__warn); 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_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_GetName(__pyx_m, __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 = PyObject_GetAttr(__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_GOTREF(__pyx_t_9); __Pyx_INCREF(((PyObject *)__pyx_kp_s_84)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_84)); + PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_kp_s_84)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_84)); __Pyx_INCREF(__pyx_v_s); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_s); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_s); __Pyx_GIVEREF(__pyx_v_s); - __pyx_t_9 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_1), NULL); 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_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_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_8); __pyx_t_8 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - goto __pyx_L55; + goto __pyx_L53; } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":425 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":425 * logger.warn("ERROR: unexpected pattern %s in set of precomputed collocations", s) * else: * chunk = () # <<<<<<<<<<<<<< @@ -32925,7 +33189,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __Pyx_XDECREF(((PyObject *)__pyx_v_chunk)); __pyx_v_chunk = __pyx_empty_tuple; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":426 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":426 * else: * chunk = () * max_rank = 0 # <<<<<<<<<<<<<< @@ -32934,7 +33198,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s */ __pyx_v_max_rank = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":427 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":427 * chunk = () * max_rank = 0 * arity = 0 # <<<<<<<<<<<<<< @@ -32945,7 +33209,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __Pyx_XDECREF(__pyx_v_arity); __pyx_v_arity = __pyx_int_0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":428 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":428 * max_rank = 0 * arity = 0 * for word_id in pattern: # <<<<<<<<<<<<<< @@ -32953,93 +33217,99 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s * max_rank = max(max_rank, pattern_rank[chunk]) */ if (PyList_CheckExact(__pyx_v_pattern) || PyTuple_CheckExact(__pyx_v_pattern)) { - __pyx_t_9 = __pyx_v_pattern; __Pyx_INCREF(__pyx_t_9); __pyx_t_2 = 0; - __pyx_t_21 = NULL; + __pyx_t_8 = __pyx_v_pattern; __Pyx_INCREF(__pyx_t_8); __pyx_t_13 = 0; + __pyx_t_5 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_pattern); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_21 = Py_TYPE(__pyx_t_9)->tp_iternext; + __pyx_t_13 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_pattern); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_5 = Py_TYPE(__pyx_t_8)->tp_iternext; } for (;;) { - if (!__pyx_t_21 && PyList_CheckExact(__pyx_t_9)) { - if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_9)) break; - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; - } else if (!__pyx_t_21 && PyTuple_CheckExact(__pyx_t_9)) { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_9)) break; - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; + 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;} + #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;} + #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;} + #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;} + #endif } else { - __pyx_t_1 = __pyx_t_21(__pyx_t_9); - if (unlikely(!__pyx_t_1)) { + __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(); else {__pyx_filename = __pyx_f[11]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } - __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_9); } __Pyx_XDECREF(__pyx_v_word_id); - __pyx_v_word_id = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_v_word_id = __pyx_t_9; + __pyx_t_9 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":429 + /* "/home/pauldb/workspace/cdec/python/src/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_1 = PyObject_RichCompare(__pyx_v_word_id, __pyx_int_neg_1, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_20 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 429; __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 = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_20 < 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; if (__pyx_t_20) { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":430 + /* "/home/pauldb/workspace/cdec/python/src/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_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_pattern_rank), ((PyObject *)__pyx_v_chunk)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_14 = __pyx_v_max_rank; - __pyx_t_6 = PyInt_FromLong(__pyx_t_14); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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_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_GOTREF(__pyx_t_6); - __pyx_t_7 = PyObject_RichCompare(__pyx_t_1, __pyx_t_6, Py_GT); 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_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_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_20 < 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_20) { - __Pyx_INCREF(__pyx_t_1); - __pyx_t_8 = __pyx_t_1; + __Pyx_INCREF(__pyx_t_9); + __pyx_t_1 = __pyx_t_9; } else { - __pyx_t_7 = PyInt_FromLong(__pyx_t_14); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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_GOTREF(__pyx_t_7); - __pyx_t_8 = __pyx_t_7; + __pyx_t_1 = __pyx_t_7; __pyx_t_7 = 0; } + __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_t_14 = __Pyx_PyInt_AsInt(__pyx_t_8); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_v_max_rank = __pyx_t_14; + __pyx_v_max_rank = __pyx_t_17; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":431 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":431 * if word_id == -1: * max_rank = max(max_rank, pattern_rank[chunk]) * arity = arity + 1 # <<<<<<<<<<<<<< * chunk = () * else: */ - __pyx_t_8 = PyNumber_Add(__pyx_v_arity, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); + __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(__pyx_v_arity); - __pyx_v_arity = __pyx_t_8; - __pyx_t_8 = 0; + __pyx_v_arity = __pyx_t_1; + __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":432 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":432 * max_rank = max(max_rank, pattern_rank[chunk]) * arity = arity + 1 * chunk = () # <<<<<<<<<<<<<< @@ -33049,105 +33319,104 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __Pyx_INCREF(((PyObject *)__pyx_empty_tuple)); __Pyx_DECREF(((PyObject *)__pyx_v_chunk)); __pyx_v_chunk = __pyx_empty_tuple; - goto __pyx_L61; + goto __pyx_L59; } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":434 + /* "/home/pauldb/workspace/cdec/python/src/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_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_word_id); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_word_id); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_word_id); __Pyx_GIVEREF(__pyx_v_word_id); - __pyx_t_1 = PyNumber_Add(((PyObject *)__pyx_v_chunk), ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; + __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(((PyObject *)__pyx_v_chunk)); - __pyx_v_chunk = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_v_chunk = __pyx_t_9; + __pyx_t_9 = 0; } - __pyx_L61:; + __pyx_L59:; } - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":435 + /* "/home/pauldb/workspace/cdec/python/src/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_9 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_pattern_rank), ((PyObject *)__pyx_v_chunk)); if (!__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_14 = __pyx_v_max_rank; - __pyx_t_8 = PyInt_FromLong(__pyx_t_14); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_pattern_rank), ((PyObject *)__pyx_v_chunk)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = PyObject_RichCompare(__pyx_t_9, __pyx_t_8, Py_GT); 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_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __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_20 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_20 < 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_20) { - __Pyx_INCREF(__pyx_t_9); - __pyx_t_1 = __pyx_t_9; + __Pyx_INCREF(__pyx_t_8); + __pyx_t_9 = __pyx_t_8; } else { - __pyx_t_7 = PyInt_FromLong(__pyx_t_14); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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_GOTREF(__pyx_t_7); - __pyx_t_1 = __pyx_t_7; + __pyx_t_9 = __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_14 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__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_v_max_rank = __pyx_t_14; + __pyx_v_max_rank = __pyx_t_17; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":436 + /* "/home/pauldb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< * count_by_rank.arr[max_rank] = count_by_rank.arr[max_rank] + (len(arr)/(arity+1)) * */ - __pyx_t_2 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - (__pyx_v_cost_by_rank->arr[__pyx_v_max_rank]) = ((__pyx_v_cost_by_rank->arr[__pyx_v_max_rank]) + (4 * __pyx_t_2)); + __pyx_t_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/paulb/workspace/cdec/python/src/sa/precomputation.pxi":437 + /* "/home/pauldb/workspace/cdec/python/src/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_1 = PyInt_FromLong((__pyx_v_count_by_rank->arr[__pyx_v_max_rank])); 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_2 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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_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_8 = __Pyx_PyNumber_Divide(__pyx_t_9, __pyx_t_7); 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_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __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_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_Add(__pyx_t_1, __pyx_t_8); 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_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_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_14 = __Pyx_PyInt_AsInt(__pyx_t_7); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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_DECREF(__pyx_t_7); __pyx_t_7 = 0; - (__pyx_v_count_by_rank->arr[__pyx_v_max_rank]) = __pyx_t_14; + (__pyx_v_count_by_rank->arr[__pyx_v_max_rank]) = __pyx_t_17; } - __pyx_L55:; + __pyx_L53:; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":439 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":439 * count_by_rank.arr[max_rank] = count_by_rank.arr[max_rank] + (len(arr)/(arity+1)) * * cumul_cost = 0 # <<<<<<<<<<<<<< @@ -33157,7 +33426,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __Pyx_INCREF(__pyx_int_0); __pyx_v_cumul_cost = __pyx_int_0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":440 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":440 * * cumul_cost = 0 * cumul_count = 0 # <<<<<<<<<<<<<< @@ -33167,7 +33436,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __Pyx_INCREF(__pyx_int_0); __pyx_v_cumul_count = __pyx_int_0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":441 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":441 * cumul_cost = 0 * cumul_count = 0 * for i from 0 <= i < N: # <<<<<<<<<<<<<< @@ -33177,7 +33446,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_t_14 = __pyx_v_N; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_14; __pyx_v_i++) { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":442 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":442 * cumul_count = 0 * for i from 0 <= i < N: * cumul_cost = cumul_cost + cost_by_rank.arr[i] # <<<<<<<<<<<<<< @@ -33193,7 +33462,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_cumul_cost = __pyx_t_7; __pyx_t_7 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":443 + /* "/home/pauldb/workspace/cdec/python/src/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] # <<<<<<<<<<<<<< @@ -33209,7 +33478,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __pyx_v_cumul_count = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":444 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -33223,140 +33492,140 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __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_8 = PyInt_FromLong((__pyx_v_count_by_rank->arr[__pyx_v_i])); 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_t_1 = PyInt_FromLong((__pyx_v_cost_by_rank->arr[__pyx_v_i])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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_GOTREF(__pyx_t_1); - __pyx_t_9 = PyTuple_New(6); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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_GOTREF(__pyx_t_9); + __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_85)); - PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_kp_s_85)); + PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_kp_s_85)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_85)); - PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_8); - __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_cumul_count); - PyTuple_SET_ITEM(__pyx_t_9, 4, __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_9, 5, __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_8 = 0; __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_9), NULL); 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 = 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_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":446 + /* "/home/pauldb/workspace/cdec/python/src/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_1 = __pyx_v_self->precomputed_collocations; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_15 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_15); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_num_found_patterns = __pyx_t_1; - __pyx_t_1 = 0; + __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; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":447 + /* "/home/pauldb/workspace/cdec/python/src/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_1 = PyObject_GetIter(((PyObject *)__pyx_v_IJ_set)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; + __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; for (;;) { { - __pyx_t_9 = __pyx_t_5(__pyx_t_1); - if (unlikely(!__pyx_t_9)) { + __pyx_t_8 = __pyx_t_5(__pyx_t_9); + if (unlikely(!__pyx_t_8)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[11]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } - __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_8); } __Pyx_XDECREF(__pyx_v_pattern); - __pyx_v_pattern = __pyx_t_9; - __pyx_t_9 = 0; + __pyx_v_pattern = __pyx_t_8; + __pyx_t_8 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":448 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":448 * 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_20 = (__Pyx_NegateNonNeg(PySequence_Contains(__pyx_v_self->precomputed_collocations, __pyx_v_pattern))); if (unlikely(__pyx_t_20 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_20 = (__Pyx_PySequence_Contains(__pyx_v_pattern, __pyx_v_self->precomputed_collocations, Py_NE)); if (unlikely(__pyx_t_20 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_20) { - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":449 + /* "/home/pauldb/workspace/cdec/python/src/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_9 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - if (PyObject_SetItem(__pyx_v_self->precomputed_collocations, __pyx_v_pattern, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - goto __pyx_L66; + __pyx_t_8 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_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_GOTREF(__pyx_t_8); + if (PyObject_SetItem(__pyx_v_self->precomputed_collocations, __pyx_v_pattern, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L64; } - __pyx_L66:; + __pyx_L64:; } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":451 + /* "/home/pauldb/workspace/cdec/python/src/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_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_GetName(__pyx_m, __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_9); 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_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_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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/paulb/workspace/cdec/python/src/sa/precomputation.pxi":452 + /* "/home/pauldb/workspace/cdec/python/src/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_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); 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_t_1 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __pyx_v_self->precomputed_collocations; - __Pyx_INCREF(__pyx_t_9); - __pyx_t_15 = PyObject_Length(__pyx_t_9); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_15); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyObject_GetAttr(__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_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_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_GOTREF(__pyx_t_7); __Pyx_INCREF(((PyObject *)__pyx_kp_s_86)); @@ -33365,74 +33634,74 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s __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_9); - __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_x); PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_v_x); __Pyx_GIVEREF(__pyx_v_x); - __pyx_t_9 = 0; - __pyx_t_9 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_7), NULL); 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_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; + __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_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; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":453 + /* "/home/pauldb/workspace/cdec/python/src/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_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); 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_t_7 = PyObject_GetAttr(__pyx_t_9, __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_8 = __Pyx_GetName(__pyx_m, __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 = PyObject_GetAttr(__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_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __pyx_v_self->precomputed_index; - __Pyx_INCREF(__pyx_t_9); - __pyx_t_15 = PyObject_Length(__pyx_t_9); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_15); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __pyx_v_self->precomputed_index; + __Pyx_INCREF(__pyx_t_8); + __pyx_t_2 = PyObject_Length(__pyx_t_8); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[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_GOTREF(__pyx_t_9); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_kp_s_87)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_87)); + PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_kp_s_87)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_87)); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_9); - __Pyx_GIVEREF(__pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_9 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_1), NULL); 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); + 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_1)); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":454 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":454 * logger.info("Precomputed collocations for %d patterns out of %d possible (upper bound %d)", num_found_patterns, len(self.precomputed_collocations), x) * logger.info("Precomputed inverted index for %d patterns ", len(self.precomputed_index)) * logger.info("Precomputation took %f seconds", (stop_time - start_time)) # <<<<<<<<<<<<<< */ - __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); 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_t_1 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyFloat_FromDouble((__pyx_v_stop_time - __pyx_v_start_time)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyObject_GetAttr(__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_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_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)); - PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_9); - __Pyx_GIVEREF(__pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_9 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_7), NULL); 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_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; + 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_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_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; @@ -33487,14 +33756,14 @@ static int __pyx_pw_3_sa_11SuffixArray_1__cinit__(PyObject *__pyx_v_self, PyObje PyObject *__pyx_v_from_binary = 0; PyObject *__pyx_v_from_text = 0; PyObject *__pyx_v_side = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__from_binary,&__pyx_n_s__from_text,&__pyx_n_s__side,0}; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__from_binary,&__pyx_n_s__from_text,&__pyx_n_s__side,0}; PyObject* values[3] = {0,0,0}; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":11 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":11 * cdef IntList ha * * def __cinit__(self, from_binary=None, from_text=None, side=None): # <<<<<<<<<<<<<< @@ -33573,7 +33842,7 @@ static int __pyx_pf_3_sa_11SuffixArray___cinit__(struct __pyx_obj_3_sa_SuffixArr int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":12 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":12 * * def __cinit__(self, from_binary=None, from_text=None, side=None): * self.darray = DataArray() # <<<<<<<<<<<<<< @@ -33588,7 +33857,7 @@ static int __pyx_pf_3_sa_11SuffixArray___cinit__(struct __pyx_obj_3_sa_SuffixArr __pyx_v_self->darray = ((struct __pyx_obj_3_sa_DataArray *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":13 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":13 * def __cinit__(self, from_binary=None, from_text=None, side=None): * self.darray = DataArray() * self.sa = IntList() # <<<<<<<<<<<<<< @@ -33603,7 +33872,7 @@ static int __pyx_pf_3_sa_11SuffixArray___cinit__(struct __pyx_obj_3_sa_SuffixArr __pyx_v_self->sa = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":14 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":14 * self.darray = DataArray() * self.sa = IntList() * self.ha = IntList() # <<<<<<<<<<<<<< @@ -33618,7 +33887,7 @@ static int __pyx_pf_3_sa_11SuffixArray___cinit__(struct __pyx_obj_3_sa_SuffixArr __pyx_v_self->ha = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":15 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":15 * self.sa = IntList() * self.ha = IntList() * if from_binary: # <<<<<<<<<<<<<< @@ -33628,7 +33897,7 @@ static int __pyx_pf_3_sa_11SuffixArray___cinit__(struct __pyx_obj_3_sa_SuffixArr __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/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":16 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":16 * self.ha = IntList() * if from_binary: * self.read_binary(from_binary) # <<<<<<<<<<<<<< @@ -33650,7 +33919,7 @@ static int __pyx_pf_3_sa_11SuffixArray___cinit__(struct __pyx_obj_3_sa_SuffixArr goto __pyx_L3; } - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":17 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":17 * if from_binary: * self.read_binary(from_binary) * elif from_text: # <<<<<<<<<<<<<< @@ -33660,7 +33929,7 @@ static int __pyx_pf_3_sa_11SuffixArray___cinit__(struct __pyx_obj_3_sa_SuffixArr __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/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":18 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":18 * self.read_binary(from_binary) * elif from_text: * self.read_text(from_text, side) # <<<<<<<<<<<<<< @@ -33710,7 +33979,7 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_3__getitem__(PyObject *__pyx_v_self return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":20 +/* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":20 * self.read_text(from_text, side) * * def __getitem__(self, i): # <<<<<<<<<<<<<< @@ -33728,7 +33997,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_2__getitem__(struct __pyx_obj_3_sa_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":21 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":21 * * def __getitem__(self, i): * return self.sa.arr[i] # <<<<<<<<<<<<<< @@ -33761,11 +34030,11 @@ static char __pyx_doc_3_sa_11SuffixArray_4read_text[] = "Constructs suffix array static PyObject *__pyx_pw_3_sa_11SuffixArray_5read_text(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_filename = 0; PyObject *__pyx_v_side = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__filename,&__pyx_n_s__side,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("read_text (wrapper)", 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; @@ -33779,12 +34048,10 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_5read_text(PyObject *__pyx_v_self, kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__filename); - if (likely(values[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: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__side); - if (likely(values[1])) 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;} } @@ -33814,7 +34081,7 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_5read_text(PyObject *__pyx_v_self, return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":23 +/* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":23 * return self.sa.arr[i] * * def read_text(self, filename, side): # <<<<<<<<<<<<<< @@ -33855,7 +34122,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su int __pyx_clineno = 0; __Pyx_RefNannySetupContext("read_text", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":29 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":29 * cdef IntList isa, word_count * * self.darray = DataArray(from_text=filename, side=side, use_sent_id=True) # <<<<<<<<<<<<<< @@ -33879,7 +34146,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __pyx_v_self->darray = ((struct __pyx_obj_3_sa_DataArray *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":30 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":30 * * self.darray = DataArray(from_text=filename, side=side, use_sent_id=True) * N = len(self.darray) # <<<<<<<<<<<<<< @@ -33892,7 +34159,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_N = __pyx_t_3; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":31 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -33905,7 +34172,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_V = __pyx_t_3; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":33 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":33 * V = len(self.darray.id2word) * * self.sa = IntList(initial_len=N) # <<<<<<<<<<<<<< @@ -33927,7 +34194,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __pyx_v_self->sa = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":34 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":34 * * self.sa = IntList(initial_len=N) * self.ha = IntList(initial_len=V+1) # <<<<<<<<<<<<<< @@ -33949,7 +34216,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __pyx_v_self->ha = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":36 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":36 * self.ha = IntList(initial_len=V+1) * * isa = IntList(initial_len=N) # <<<<<<<<<<<<<< @@ -33968,7 +34235,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __pyx_v_isa = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":37 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":37 * * isa = IntList(initial_len=N) * word_count = IntList(initial_len=V+1) # <<<<<<<<<<<<<< @@ -33987,7 +34254,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __pyx_v_word_count = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":40 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":40 * * '''Step 1: bucket sort data''' * cdef float sort_start_time = monitor_cpu() # <<<<<<<<<<<<<< @@ -34003,7 +34270,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_sort_start_time = __pyx_t_4; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":41 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":41 * '''Step 1: bucket sort data''' * cdef float sort_start_time = monitor_cpu() * cdef float start_time = sort_start_time # <<<<<<<<<<<<<< @@ -34012,7 +34279,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su */ __pyx_v_start_time = __pyx_v_sort_start_time; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":42 + /* "/home/pauldb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -34022,7 +34289,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __pyx_t_5 = __pyx_v_N; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":43 + /* "/home/pauldb/workspace/cdec/python/src/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] # <<<<<<<<<<<<<< @@ -34031,7 +34298,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su */ __pyx_v_a_i = (__pyx_v_self->darray->data->arr[__pyx_v_i]); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":44 + /* "/home/pauldb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -34041,7 +34308,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su (__pyx_v_word_count->arr[__pyx_v_a_i]) = ((__pyx_v_word_count->arr[__pyx_v_a_i]) + 1); } - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":46 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":46 * word_count.arr[a_i] = word_count.arr[a_i] + 1 * * n = 0 # <<<<<<<<<<<<<< @@ -34050,7 +34317,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su */ __pyx_v_n = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":47 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":47 * * n = 0 * for i from 0 <= i < V+1: # <<<<<<<<<<<<<< @@ -34060,7 +34327,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __pyx_t_6 = (__pyx_v_V + 1); for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) { - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":48 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":48 * n = 0 * for i from 0 <= i < V+1: * self.ha.arr[i] = n # <<<<<<<<<<<<<< @@ -34069,7 +34336,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su */ (__pyx_v_self->ha->arr[__pyx_v_i]) = __pyx_v_n; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":49 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":49 * for i from 0 <= i < V+1: * self.ha.arr[i] = n * n = n + word_count.arr[i] # <<<<<<<<<<<<<< @@ -34078,7 +34345,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su */ __pyx_v_n = (__pyx_v_n + (__pyx_v_word_count->arr[__pyx_v_i])); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":50 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":50 * self.ha.arr[i] = n * n = n + word_count.arr[i] * word_count.arr[i] = 0 # <<<<<<<<<<<<<< @@ -34088,7 +34355,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su (__pyx_v_word_count->arr[__pyx_v_i]) = 0; } - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":52 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":52 * word_count.arr[i] = 0 * * for i from 0 <= i < N: # <<<<<<<<<<<<<< @@ -34098,7 +34365,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __pyx_t_5 = __pyx_v_N; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":53 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":53 * * for i from 0 <= i < N: * a_i = self.darray.data.arr[i] # <<<<<<<<<<<<<< @@ -34107,7 +34374,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su */ __pyx_v_a_i = (__pyx_v_self->darray->data->arr[__pyx_v_i]); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":54 + /* "/home/pauldb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -34116,7 +34383,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su */ (__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/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":55 + /* "/home/pauldb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -34125,7 +34392,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su */ (__pyx_v_isa->arr[__pyx_v_i]) = ((__pyx_v_self->ha->arr[(__pyx_v_a_i + 1)]) - 1); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":56 + /* "/home/pauldb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -34135,7 +34402,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su (__pyx_v_word_count->arr[__pyx_v_a_i]) = ((__pyx_v_word_count->arr[__pyx_v_a_i]) + 1); } - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":59 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":59 * * '''Determine size of initial runs''' * current_run = 0 # <<<<<<<<<<<<<< @@ -34144,7 +34411,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su */ __pyx_v_current_run = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":60 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":60 * '''Determine size of initial runs''' * current_run = 0 * for i from 0 <= i < V+1: # <<<<<<<<<<<<<< @@ -34154,7 +34421,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __pyx_t_6 = (__pyx_v_V + 1); for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) { - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":61 + /* "/home/pauldb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -34170,7 +34437,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su } if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":62 + /* "/home/pauldb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -34182,7 +34449,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":64 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":64 * current_run = current_run + 1 * else: * if current_run > 0: # <<<<<<<<<<<<<< @@ -34192,7 +34459,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __pyx_t_9 = (__pyx_v_current_run > 0); if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":65 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":65 * else: * if current_run > 0: * self.sa.arr[self.ha.arr[i] - current_run] = -current_run # <<<<<<<<<<<<<< @@ -34201,7 +34468,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su */ (__pyx_v_self->sa->arr[((__pyx_v_self->ha->arr[__pyx_v_i]) - __pyx_v_current_run)]) = (-__pyx_v_current_run); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":66 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":66 * if current_run > 0: * self.sa.arr[self.ha.arr[i] - current_run] = -current_run * current_run = 0 # <<<<<<<<<<<<<< @@ -34216,7 +34483,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __pyx_L11:; } - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":68 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":68 * current_run = 0 * * logger.info(" Bucket sort took %f seconds", (monitor_cpu() - sort_start_time)) # <<<<<<<<<<<<<< @@ -34253,7 +34520,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":71 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":71 * * '''Step 2: prefix-doubling sort''' * h = 1 # <<<<<<<<<<<<<< @@ -34262,7 +34529,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su */ __pyx_v_h = 1; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":72 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":72 * '''Step 2: prefix-doubling sort''' * h = 1 * while self.sa.arr[0] != -N: # <<<<<<<<<<<<<< @@ -34273,7 +34540,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __pyx_t_9 = ((__pyx_v_self->sa->arr[0]) != (-__pyx_v_N)); if (!__pyx_t_9) break; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":73 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":73 * h = 1 * while self.sa.arr[0] != -N: * sort_start_time = monitor_cpu() # <<<<<<<<<<<<<< @@ -34289,7 +34556,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_sort_start_time = __pyx_t_4; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":74 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":74 * while self.sa.arr[0] != -N: * sort_start_time = monitor_cpu() * logger.debug(" Refining, sort depth = %d", h) # <<<<<<<<<<<<<< @@ -34317,7 +34584,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":75 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":75 * sort_start_time = monitor_cpu() * logger.debug(" Refining, sort depth = %d", h) * i = 0 # <<<<<<<<<<<<<< @@ -34326,7 +34593,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su */ __pyx_v_i = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":76 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":76 * logger.debug(" Refining, sort depth = %d", h) * i = 0 * skip = 0 # <<<<<<<<<<<<<< @@ -34335,7 +34602,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su */ __pyx_v_skip = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":77 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":77 * i = 0 * skip = 0 * while i < N: # <<<<<<<<<<<<<< @@ -34346,7 +34613,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __pyx_t_9 = (__pyx_v_i < __pyx_v_N); if (!__pyx_t_9) break; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":78 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":78 * skip = 0 * while i < N: * if self.sa.arr[i] < 0: # <<<<<<<<<<<<<< @@ -34356,7 +34623,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __pyx_t_9 = ((__pyx_v_self->sa->arr[__pyx_v_i]) < 0); if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":79 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":79 * while i < N: * if self.sa.arr[i] < 0: * skip = skip + self.sa.arr[i] # <<<<<<<<<<<<<< @@ -34365,7 +34632,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su */ __pyx_v_skip = (__pyx_v_skip + (__pyx_v_self->sa->arr[__pyx_v_i])); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":80 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":80 * if self.sa.arr[i] < 0: * skip = skip + self.sa.arr[i] * i = i - self.sa.arr[i] # <<<<<<<<<<<<<< @@ -34377,7 +34644,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":82 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":82 * i = i - self.sa.arr[i] * else: * if skip < 0: # <<<<<<<<<<<<<< @@ -34387,7 +34654,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __pyx_t_9 = (__pyx_v_skip < 0); if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":83 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":83 * else: * if skip < 0: * self.sa.arr[i+skip] = skip # <<<<<<<<<<<<<< @@ -34396,7 +34663,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su */ (__pyx_v_self->sa->arr[(__pyx_v_i + __pyx_v_skip)]) = __pyx_v_skip; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":84 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":84 * if skip < 0: * self.sa.arr[i+skip] = skip * skip = 0 # <<<<<<<<<<<<<< @@ -34408,7 +34675,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su } __pyx_L18:; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":85 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":85 * self.sa.arr[i+skip] = skip * skip = 0 * j = isa.arr[self.sa.arr[i]] # <<<<<<<<<<<<<< @@ -34417,7 +34684,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su */ __pyx_v_j = (__pyx_v_isa->arr[(__pyx_v_self->sa->arr[__pyx_v_i])]); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":86 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":86 * skip = 0 * j = isa.arr[self.sa.arr[i]] * self.q3sort(i, j, h, isa) # <<<<<<<<<<<<<< @@ -34452,7 +34719,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":87 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":87 * j = isa.arr[self.sa.arr[i]] * self.q3sort(i, j, h, isa) * i = j+1 # <<<<<<<<<<<<<< @@ -34464,7 +34731,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __pyx_L17:; } - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":88 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":88 * self.q3sort(i, j, h, isa) * i = j+1 * if skip < 0: # <<<<<<<<<<<<<< @@ -34474,7 +34741,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __pyx_t_9 = (__pyx_v_skip < 0); if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":89 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":89 * i = j+1 * if skip < 0: * self.sa.arr[i+skip] = skip # <<<<<<<<<<<<<< @@ -34486,7 +34753,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su } __pyx_L19:; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":90 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":90 * if skip < 0: * self.sa.arr[i+skip] = skip * h = h * 2 # <<<<<<<<<<<<<< @@ -34495,7 +34762,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su */ __pyx_v_h = (__pyx_v_h * 2); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":91 + /* "/home/pauldb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -34533,7 +34800,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":94 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":94 * * '''Step 3: read off suffix array from inverse suffix array''' * logger.info(" Finalizing sort...") # <<<<<<<<<<<<<< @@ -34550,7 +34817,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":95 + /* "/home/pauldb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -34560,7 +34827,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su __pyx_t_5 = __pyx_v_N; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":96 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":96 * logger.info(" Finalizing sort...") * for i from 0 <= i < N: * j = isa.arr[i] # <<<<<<<<<<<<<< @@ -34569,7 +34836,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su */ __pyx_v_j = (__pyx_v_isa->arr[__pyx_v_i]); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":97 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":97 * for i from 0 <= i < N: * j = isa.arr[i] * self.sa.arr[j] = i # <<<<<<<<<<<<<< @@ -34579,7 +34846,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su (__pyx_v_self->sa->arr[__pyx_v_j]) = __pyx_v_i; } - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":98 + /* "/home/pauldb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -34643,11 +34910,11 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_7q3sort(PyObject *__pyx_v_self, PyO int __pyx_v_h; struct __pyx_obj_3_sa_IntList *__pyx_v_isa = 0; PyObject *__pyx_v_pad = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__i,&__pyx_n_s__j,&__pyx_n_s__h,&__pyx_n_s__isa,&__pyx_n_s__pad,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("q3sort (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__i,&__pyx_n_s__j,&__pyx_n_s__h,&__pyx_n_s__isa,&__pyx_n_s__pad,0}; PyObject* values[5] = {0,0,0,0,0}; values[4] = ((PyObject *)__pyx_kp_s_45); if (unlikely(__pyx_kwds)) { @@ -34665,24 +34932,20 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_7q3sort(PyObject *__pyx_v_self, PyO kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__i); - if (likely(values[0])) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__i)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__j); - if (likely(values[1])) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__j)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("q3sort", 0, 4, 5, 1); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: - values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__h); - if (likely(values[2])) kw_args--; + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__h)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("q3sort", 0, 4, 5, 2); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: - values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__isa); - if (likely(values[3])) kw_args--; + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__isa)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("q3sort", 0, 4, 5, 3); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -34730,7 +34993,7 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_7q3sort(PyObject *__pyx_v_self, PyO return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":100 +/* "/home/pauldb/workspace/cdec/python/src/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=""): # <<<<<<<<<<<<<< @@ -34760,7 +35023,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi int __pyx_clineno = 0; __Pyx_RefNannySetupContext("q3sort", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":107 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":107 * cdef int k, midpoint, pval, phead, ptail, tmp * * if j-i < -1: # <<<<<<<<<<<<<< @@ -34770,7 +35033,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi __pyx_t_1 = ((__pyx_v_j - __pyx_v_i) < -1); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":108 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":108 * * if j-i < -1: * raise Exception("Unexpected condition found in q3sort: sort from %d to %d" % (i,j)) # <<<<<<<<<<<<<< @@ -34807,7 +35070,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":109 + /* "/home/pauldb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -34817,7 +35080,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi __pyx_t_1 = ((__pyx_v_j - __pyx_v_i) == -1); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":110 + /* "/home/pauldb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -34831,7 +35094,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi } __pyx_L4:; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":111 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":111 * if j-i == -1: # recursive base case -- empty interval * return * if (j-i == 0): # recursive base case -- singleton interval # <<<<<<<<<<<<<< @@ -34841,7 +35104,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi __pyx_t_1 = ((__pyx_v_j - __pyx_v_i) == 0); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":112 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":112 * return * if (j-i == 0): # recursive base case -- singleton interval * isa.arr[self.sa.arr[i]] = i # <<<<<<<<<<<<<< @@ -34850,7 +35113,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi */ (__pyx_v_isa->arr[(__pyx_v_self->sa->arr[__pyx_v_i])]) = __pyx_v_i; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":113 + /* "/home/pauldb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -34859,7 +35122,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi */ (__pyx_v_self->sa->arr[__pyx_v_i]) = -1; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":114 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":114 * isa.arr[self.sa.arr[i]] = i * self.sa.arr[i] = -1 * return # <<<<<<<<<<<<<< @@ -34873,7 +35136,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi } __pyx_L5:; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":123 + /* "/home/pauldb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -34882,7 +35145,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi */ __pyx_v_midpoint = __Pyx_div_long((__pyx_v_i + __pyx_v_j), 2); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":124 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":124 * # may need to be reconsidered as well. * midpoint = (i+j)/2 * pval = isa.arr[self.sa.arr[midpoint] + h] # <<<<<<<<<<<<<< @@ -34891,7 +35154,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi */ __pyx_v_pval = (__pyx_v_isa->arr[((__pyx_v_self->sa->arr[__pyx_v_midpoint]) + __pyx_v_h)]); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":125 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":125 * midpoint = (i+j)/2 * pval = isa.arr[self.sa.arr[midpoint] + h] * if i != midpoint: # <<<<<<<<<<<<<< @@ -34901,7 +35164,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi __pyx_t_1 = (__pyx_v_i != __pyx_v_midpoint); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":126 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":126 * pval = isa.arr[self.sa.arr[midpoint] + h] * if i != midpoint: * tmp = self.sa.arr[midpoint] # <<<<<<<<<<<<<< @@ -34910,7 +35173,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi */ __pyx_v_tmp = (__pyx_v_self->sa->arr[__pyx_v_midpoint]); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":127 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":127 * if i != midpoint: * tmp = self.sa.arr[midpoint] * self.sa.arr[midpoint] = self.sa.arr[i] # <<<<<<<<<<<<<< @@ -34919,7 +35182,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi */ (__pyx_v_self->sa->arr[__pyx_v_midpoint]) = (__pyx_v_self->sa->arr[__pyx_v_i]); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":128 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":128 * tmp = self.sa.arr[midpoint] * self.sa.arr[midpoint] = self.sa.arr[i] * self.sa.arr[i] = tmp # <<<<<<<<<<<<<< @@ -34931,7 +35194,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi } __pyx_L6:; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":129 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":129 * self.sa.arr[midpoint] = self.sa.arr[i] * self.sa.arr[i] = tmp * phead = i # <<<<<<<<<<<<<< @@ -34940,7 +35203,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi */ __pyx_v_phead = __pyx_v_i; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":130 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":130 * self.sa.arr[i] = tmp * phead = i * ptail = i # <<<<<<<<<<<<<< @@ -34949,7 +35212,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi */ __pyx_v_ptail = __pyx_v_i; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":134 + /* "/home/pauldb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -34959,7 +35222,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi __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/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":135 + /* "/home/pauldb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -34969,7 +35232,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi __pyx_t_1 = ((__pyx_v_isa->arr[((__pyx_v_self->sa->arr[__pyx_v_k]) + __pyx_v_h)]) < __pyx_v_pval); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":136 + /* "/home/pauldb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -34979,7 +35242,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi __pyx_t_1 = (__pyx_v_k > (__pyx_v_ptail + 1)); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":137 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":137 * if isa.arr[self.sa.arr[k] + h] < pval: * if k > ptail+1: * tmp = self.sa.arr[phead] # <<<<<<<<<<<<<< @@ -34988,7 +35251,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi */ __pyx_v_tmp = (__pyx_v_self->sa->arr[__pyx_v_phead]); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":138 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":138 * if k > ptail+1: * tmp = self.sa.arr[phead] * self.sa.arr[phead] = self.sa.arr[k] # <<<<<<<<<<<<<< @@ -34997,7 +35260,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi */ (__pyx_v_self->sa->arr[__pyx_v_phead]) = (__pyx_v_self->sa->arr[__pyx_v_k]); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":139 + /* "/home/pauldb/workspace/cdec/python/src/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] # <<<<<<<<<<<<<< @@ -35006,7 +35269,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi */ (__pyx_v_self->sa->arr[__pyx_v_k]) = (__pyx_v_self->sa->arr[(__pyx_v_ptail + 1)]); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":140 + /* "/home/pauldb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -35018,7 +35281,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":142 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":142 * self.sa.arr[ptail+1] = tmp * else: # k == ptail+1 * tmp = self.sa.arr[phead] # <<<<<<<<<<<<<< @@ -35027,7 +35290,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi */ __pyx_v_tmp = (__pyx_v_self->sa->arr[__pyx_v_phead]); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":143 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":143 * else: # k == ptail+1 * tmp = self.sa.arr[phead] * self.sa.arr[phead] = self.sa.arr[k] # <<<<<<<<<<<<<< @@ -35036,7 +35299,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi */ (__pyx_v_self->sa->arr[__pyx_v_phead]) = (__pyx_v_self->sa->arr[__pyx_v_k]); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":144 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":144 * tmp = self.sa.arr[phead] * self.sa.arr[phead] = self.sa.arr[k] * self.sa.arr[k] = tmp # <<<<<<<<<<<<<< @@ -35047,7 +35310,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi } __pyx_L10:; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":145 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":145 * self.sa.arr[phead] = self.sa.arr[k] * self.sa.arr[k] = tmp * phead = phead + 1 # <<<<<<<<<<<<<< @@ -35056,7 +35319,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi */ __pyx_v_phead = (__pyx_v_phead + 1); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":146 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":146 * self.sa.arr[k] = tmp * phead = phead + 1 * ptail = ptail + 1 # <<<<<<<<<<<<<< @@ -35068,7 +35331,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":148 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":148 * ptail = ptail + 1 * else: * if isa.arr[self.sa.arr[k] + h] == pval: # <<<<<<<<<<<<<< @@ -35078,7 +35341,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi __pyx_t_1 = ((__pyx_v_isa->arr[((__pyx_v_self->sa->arr[__pyx_v_k]) + __pyx_v_h)]) == __pyx_v_pval); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":149 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":149 * else: * if isa.arr[self.sa.arr[k] + h] == pval: * if k > ptail+1: # <<<<<<<<<<<<<< @@ -35088,7 +35351,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi __pyx_t_1 = (__pyx_v_k > (__pyx_v_ptail + 1)); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":150 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":150 * if isa.arr[self.sa.arr[k] + h] == pval: * if k > ptail+1: * tmp = self.sa.arr[ptail+1] # <<<<<<<<<<<<<< @@ -35097,7 +35360,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi */ __pyx_v_tmp = (__pyx_v_self->sa->arr[(__pyx_v_ptail + 1)]); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":151 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":151 * if k > ptail+1: * tmp = self.sa.arr[ptail+1] * self.sa.arr[ptail+1] = self.sa.arr[k] # <<<<<<<<<<<<<< @@ -35106,7 +35369,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi */ (__pyx_v_self->sa->arr[(__pyx_v_ptail + 1)]) = (__pyx_v_self->sa->arr[__pyx_v_k]); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":152 + /* "/home/pauldb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -35118,7 +35381,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi } __pyx_L12:; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":153 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":153 * self.sa.arr[ptail+1] = self.sa.arr[k] * self.sa.arr[k] = tmp * ptail = ptail + 1 # <<<<<<<<<<<<<< @@ -35133,7 +35396,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi __pyx_L9:; } - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":156 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":156 * * # recursively sort smaller suffixes * self.q3sort(i, phead-1, h, isa, pad+" ") # <<<<<<<<<<<<<< @@ -35173,7 +35436,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":160 + /* "/home/pauldb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -35183,7 +35446,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi __pyx_t_5 = (__pyx_v_ptail + 1); for (__pyx_v_k = __pyx_v_phead; __pyx_v_k < __pyx_t_5; __pyx_v_k++) { - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":161 + /* "/home/pauldb/workspace/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -35193,7 +35456,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi (__pyx_v_isa->arr[(__pyx_v_self->sa->arr[__pyx_v_k])]) = __pyx_v_ptail; } - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":162 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":162 * for k from phead <= k < ptail+1: * isa.arr[self.sa.arr[k]] = ptail * if phead == ptail: # <<<<<<<<<<<<<< @@ -35203,7 +35466,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi __pyx_t_1 = (__pyx_v_phead == __pyx_v_ptail); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":163 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":163 * isa.arr[self.sa.arr[k]] = ptail * if phead == ptail: * self.sa.arr[phead] = -1 # <<<<<<<<<<<<<< @@ -35215,7 +35478,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi } __pyx_L15:; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":166 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":166 * * # recursively sort larger suffixes * self.q3sort(ptail+1, j, h, isa, pad+" ") # <<<<<<<<<<<<<< @@ -35293,7 +35556,7 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_9write_text(PyObject *__pyx_v_self, return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":169 +/* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":169 * * * def write_text(self, char* filename): # <<<<<<<<<<<<<< @@ -35312,7 +35575,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_8write_text(struct __pyx_obj_3_sa_S int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_text", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":170 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":170 * * def write_text(self, char* filename): * self.darray.write_text(filename) # <<<<<<<<<<<<<< @@ -35369,7 +35632,7 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_11read_binary(PyObject *__pyx_v_sel return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":172 +/* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":172 * self.darray.write_text(filename) * * def read_binary(self, char* filename): # <<<<<<<<<<<<<< @@ -35383,7 +35646,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_binary(struct __pyx_obj_3_sa __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("read_binary", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":174 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":174 * def read_binary(self, char* filename): * cdef FILE *f * f = fopen(filename, "r") # <<<<<<<<<<<<<< @@ -35392,7 +35655,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_binary(struct __pyx_obj_3_sa */ __pyx_v_f = fopen(__pyx_v_filename, __pyx_k__r); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":175 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":175 * cdef FILE *f * f = fopen(filename, "r") * self.darray.read_handle(f) # <<<<<<<<<<<<<< @@ -35401,7 +35664,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_binary(struct __pyx_obj_3_sa */ ((struct __pyx_vtabstruct_3_sa_DataArray *)__pyx_v_self->darray->__pyx_vtab)->read_handle(__pyx_v_self->darray, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":176 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":176 * f = fopen(filename, "r") * self.darray.read_handle(f) * self.sa.read_handle(f) # <<<<<<<<<<<<<< @@ -35410,7 +35673,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_binary(struct __pyx_obj_3_sa */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->sa->__pyx_vtab)->read_handle(__pyx_v_self->sa, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":177 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":177 * self.darray.read_handle(f) * self.sa.read_handle(f) * self.ha.read_handle(f) # <<<<<<<<<<<<<< @@ -35419,7 +35682,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_binary(struct __pyx_obj_3_sa */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->ha->__pyx_vtab)->read_handle(__pyx_v_self->ha, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":178 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":178 * self.sa.read_handle(f) * self.ha.read_handle(f) * fclose(f) # <<<<<<<<<<<<<< @@ -35455,7 +35718,7 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_13write_binary(PyObject *__pyx_v_se return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":180 +/* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":180 * fclose(f) * * def write_binary(self, char* filename): # <<<<<<<<<<<<<< @@ -35469,7 +35732,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12write_binary(struct __pyx_obj_3_s __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("write_binary", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":182 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":182 * def write_binary(self, char* filename): * cdef FILE* f * f = fopen(filename, "w") # <<<<<<<<<<<<<< @@ -35478,7 +35741,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12write_binary(struct __pyx_obj_3_s */ __pyx_v_f = fopen(__pyx_v_filename, __pyx_k__w); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":183 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":183 * cdef FILE* f * f = fopen(filename, "w") * self.darray.write_handle(f) # <<<<<<<<<<<<<< @@ -35487,7 +35750,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12write_binary(struct __pyx_obj_3_s */ ((struct __pyx_vtabstruct_3_sa_DataArray *)__pyx_v_self->darray->__pyx_vtab)->write_handle(__pyx_v_self->darray, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":184 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":184 * f = fopen(filename, "w") * self.darray.write_handle(f) * self.sa.write_handle(f) # <<<<<<<<<<<<<< @@ -35496,7 +35759,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12write_binary(struct __pyx_obj_3_s */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->sa->__pyx_vtab)->write_handle(__pyx_v_self->sa, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":185 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":185 * self.darray.write_handle(f) * self.sa.write_handle(f) * self.ha.write_handle(f) # <<<<<<<<<<<<<< @@ -35505,7 +35768,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12write_binary(struct __pyx_obj_3_s */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->ha->__pyx_vtab)->write_handle(__pyx_v_self->ha, __pyx_v_f); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":186 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":186 * self.sa.write_handle(f) * self.ha.write_handle(f) * fclose(f) # <<<<<<<<<<<<<< @@ -35541,7 +35804,7 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_15write_enhanced(PyObject *__pyx_v_ return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":188 +/* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":188 * fclose(f) * * def write_enhanced(self, char* filename): # <<<<<<<<<<<<<< @@ -35573,7 +35836,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_14write_enhanced(struct __pyx_obj_3 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_enhanced", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":189 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":189 * * def write_enhanced(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -35613,7 +35876,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_14write_enhanced(struct __pyx_obj_3 __pyx_v_f = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":190 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":190 * def write_enhanced(self, char* filename): * with open(filename, "w") as f: * self.darray.write_enhanced_handle(f) # <<<<<<<<<<<<<< @@ -35633,7 +35896,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_14write_enhanced(struct __pyx_obj_3 __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":191 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":191 * with open(filename, "w") as f: * self.darray.write_enhanced_handle(f) * for a_i in self.sa: # <<<<<<<<<<<<<< @@ -35651,10 +35914,18 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_14write_enhanced(struct __pyx_obj_3 for (;;) { if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_2)) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_2)) break; - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #endif } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_2)) { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #endif } else { __pyx_t_1 = __pyx_t_9(__pyx_t_2); if (unlikely(!__pyx_t_1)) { @@ -35670,7 +35941,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_14write_enhanced(struct __pyx_obj_3 __pyx_v_a_i = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":192 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":192 * self.darray.write_enhanced_handle(f) * for a_i in self.sa: * f.write("%d " % a_i) # <<<<<<<<<<<<<< @@ -35694,7 +35965,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_14write_enhanced(struct __pyx_obj_3 } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":193 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":193 * for a_i in self.sa: * f.write("%d " % a_i) * f.write("\n") # <<<<<<<<<<<<<< @@ -35708,7 +35979,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_14write_enhanced(struct __pyx_obj_3 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":194 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":194 * f.write("%d " % a_i) * f.write("\n") * for w_i in self.ha: # <<<<<<<<<<<<<< @@ -35726,10 +35997,18 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_14write_enhanced(struct __pyx_obj_3 for (;;) { if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_4)) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_4)) break; - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #endif } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_4)) { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_4)) break; - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #endif } else { __pyx_t_2 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_2)) { @@ -35745,7 +36024,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_14write_enhanced(struct __pyx_obj_3 __pyx_v_w_i = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":195 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":195 * f.write("\n") * for w_i in self.ha: * f.write("%d " % w_i) # <<<<<<<<<<<<<< @@ -35769,7 +36048,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_14write_enhanced(struct __pyx_obj_3 } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":196 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":196 * for w_i in self.ha: * f.write("%d " % w_i) * f.write("\n") # <<<<<<<<<<<<<< @@ -35793,7 +36072,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_14write_enhanced(struct __pyx_obj_3 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":189 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":189 * * def write_enhanced(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -35891,7 +36170,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_14write_enhanced(struct __pyx_obj_3 return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":198 +/* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":198 * f.write("\n") * * cdef int __search_high(self, int word_id, int offset, int low, int high): # <<<<<<<<<<<<<< @@ -35906,7 +36185,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_high(struct __pyx_obj_3_sa_Suffix int __pyx_t_1; __Pyx_RefNannySetupContext("__search_high", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":201 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":201 * cdef int midpoint * * if low >= high: # <<<<<<<<<<<<<< @@ -35916,7 +36195,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_high(struct __pyx_obj_3_sa_Suffix __pyx_t_1 = (__pyx_v_low >= __pyx_v_high); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":202 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":202 * * if low >= high: * return high # <<<<<<<<<<<<<< @@ -35929,7 +36208,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_high(struct __pyx_obj_3_sa_Suffix } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":203 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":203 * if low >= high: * return high * midpoint = (high + low) / 2 # <<<<<<<<<<<<<< @@ -35938,7 +36217,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_high(struct __pyx_obj_3_sa_Suffix */ __pyx_v_midpoint = __Pyx_div_long((__pyx_v_high + __pyx_v_low), 2); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":204 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":204 * return high * midpoint = (high + low) / 2 * if self.darray.data.arr[self.sa.arr[midpoint] + offset] == word_id: # <<<<<<<<<<<<<< @@ -35948,7 +36227,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_high(struct __pyx_obj_3_sa_Suffix __pyx_t_1 = ((__pyx_v_self->darray->data->arr[((__pyx_v_self->sa->arr[__pyx_v_midpoint]) + __pyx_v_offset)]) == __pyx_v_word_id); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":205 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -35961,7 +36240,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_high(struct __pyx_obj_3_sa_Suffix } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":207 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -35979,7 +36258,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_high(struct __pyx_obj_3_sa_Suffix return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":209 +/* "/home/pauldb/workspace/cdec/python/src/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): # <<<<<<<<<<<<<< @@ -35994,7 +36273,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_low(struct __pyx_obj_3_sa_SuffixA int __pyx_t_1; __Pyx_RefNannySetupContext("__search_low", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":212 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":212 * cdef int midpoint * * if low >= high: # <<<<<<<<<<<<<< @@ -36004,7 +36283,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_low(struct __pyx_obj_3_sa_SuffixA __pyx_t_1 = (__pyx_v_low >= __pyx_v_high); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":213 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":213 * * if low >= high: * return high # <<<<<<<<<<<<<< @@ -36017,7 +36296,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_low(struct __pyx_obj_3_sa_SuffixA } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":214 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":214 * if low >= high: * return high * midpoint = (high + low) / 2 # <<<<<<<<<<<<<< @@ -36026,7 +36305,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_low(struct __pyx_obj_3_sa_SuffixA */ __pyx_v_midpoint = __Pyx_div_long((__pyx_v_high + __pyx_v_low), 2); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":215 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":215 * return high * midpoint = (high + low) / 2 * if self.darray.data.arr[self.sa.arr[midpoint] + offset] == word_id: # <<<<<<<<<<<<<< @@ -36036,7 +36315,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_low(struct __pyx_obj_3_sa_SuffixA __pyx_t_1 = ((__pyx_v_self->darray->data->arr[((__pyx_v_self->sa->arr[__pyx_v_midpoint]) + __pyx_v_offset)]) == __pyx_v_word_id); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":216 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -36049,7 +36328,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_low(struct __pyx_obj_3_sa_SuffixA } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":218 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -36067,7 +36346,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_low(struct __pyx_obj_3_sa_SuffixA return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":220 +/* "/home/pauldb/workspace/cdec/python/src/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): # <<<<<<<<<<<<<< @@ -36086,7 +36365,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___get_range(struct __pyx_obj_3_sa_Su int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get_range", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":221 + /* "/home/pauldb/workspace/cdec/python/src/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), # <<<<<<<<<<<<<< @@ -36097,7 +36376,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___get_range(struct __pyx_obj_3_sa_Su __pyx_t_1 = PyInt_FromLong(((struct __pyx_vtabstruct_3_sa_SuffixArray *)__pyx_v_self->__pyx_vtab)->__pyx___search_low(__pyx_v_self, __pyx_v_word_id, __pyx_v_offset, __pyx_v_low, __pyx_v_midpoint)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":222 + /* "/home/pauldb/workspace/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -36132,7 +36411,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___get_range(struct __pyx_obj_3_sa_Su return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":224 +/* "/home/pauldb/workspace/cdec/python/src/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): # <<<<<<<<<<<<<< @@ -36153,7 +36432,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___lookup_helper(struct __pyx_obj_3_s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__lookup_helper", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":227 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":227 * cdef int midpoint * * if offset == 0: # <<<<<<<<<<<<<< @@ -36163,7 +36442,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___lookup_helper(struct __pyx_obj_3_s __pyx_t_1 = (__pyx_v_offset == 0); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":228 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":228 * * if offset == 0: * return (self.ha.arr[word_id], self.ha.arr[word_id+1]) # <<<<<<<<<<<<<< @@ -36190,7 +36469,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___lookup_helper(struct __pyx_obj_3_s } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":229 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":229 * if offset == 0: * return (self.ha.arr[word_id], self.ha.arr[word_id+1]) * if low >= high: # <<<<<<<<<<<<<< @@ -36200,7 +36479,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___lookup_helper(struct __pyx_obj_3_s __pyx_t_1 = (__pyx_v_low >= __pyx_v_high); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":230 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":230 * return (self.ha.arr[word_id], self.ha.arr[word_id+1]) * if low >= high: * return None # <<<<<<<<<<<<<< @@ -36215,7 +36494,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___lookup_helper(struct __pyx_obj_3_s } __pyx_L4:; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":232 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":232 * return None * * midpoint = (high + low) / 2 # <<<<<<<<<<<<<< @@ -36224,7 +36503,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___lookup_helper(struct __pyx_obj_3_s */ __pyx_v_midpoint = __Pyx_div_long((__pyx_v_high + __pyx_v_low), 2); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":233 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":233 * * midpoint = (high + low) / 2 * if self.darray.data.arr[self.sa.arr[midpoint] + offset] == word_id: # <<<<<<<<<<<<<< @@ -36234,7 +36513,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___lookup_helper(struct __pyx_obj_3_s __pyx_t_1 = ((__pyx_v_self->darray->data->arr[((__pyx_v_self->sa->arr[__pyx_v_midpoint]) + __pyx_v_offset)]) == __pyx_v_word_id); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":234 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -36251,7 +36530,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___lookup_helper(struct __pyx_obj_3_s } __pyx_L5:; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":235 + /* "/home/pauldb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -36261,7 +36540,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___lookup_helper(struct __pyx_obj_3_s __pyx_t_1 = ((__pyx_v_self->darray->data->arr[((__pyx_v_self->sa->arr[__pyx_v_midpoint]) + __pyx_v_offset)]) > __pyx_v_word_id); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":236 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -36278,7 +36557,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___lookup_helper(struct __pyx_obj_3_s } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":238 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -36315,11 +36594,11 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_17lookup(PyObject *__pyx_v_self, Py int __pyx_v_offset; int __pyx_v_low; int __pyx_v_high; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__word,&__pyx_n_s__offset,&__pyx_n_s__low,&__pyx_n_s__high,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lookup (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__word,&__pyx_n_s__offset,&__pyx_n_s__low,&__pyx_n_s__high,0}; PyObject* values[4] = {0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -36335,24 +36614,20 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_17lookup(PyObject *__pyx_v_self, Py kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__word); - if (likely(values[0])) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__word)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__offset); - if (likely(values[1])) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__offset)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("lookup", 1, 4, 4, 1); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: - values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__low); - if (likely(values[2])) kw_args--; + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__low)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("lookup", 1, 4, 4, 2); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: - values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__high); - if (likely(values[3])) kw_args--; + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__high)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("lookup", 1, 4, 4, 3); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -36386,7 +36661,7 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_17lookup(PyObject *__pyx_v_self, Py return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":240 +/* "/home/pauldb/workspace/cdec/python/src/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): # <<<<<<<<<<<<<< @@ -36407,7 +36682,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_16lookup(struct __pyx_obj_3_sa_Suff int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lookup", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":242 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":242 * def lookup(self, word, int offset, int low, int high): * cdef int wordid * if low == -1: # <<<<<<<<<<<<<< @@ -36417,7 +36692,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_16lookup(struct __pyx_obj_3_sa_Suff __pyx_t_1 = (__pyx_v_low == -1); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":243 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":243 * cdef int wordid * if low == -1: * low = 0 # <<<<<<<<<<<<<< @@ -36429,7 +36704,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_16lookup(struct __pyx_obj_3_sa_Suff } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":244 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":244 * if low == -1: * low = 0 * if high == -1: # <<<<<<<<<<<<<< @@ -36439,7 +36714,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_16lookup(struct __pyx_obj_3_sa_Suff __pyx_t_1 = (__pyx_v_high == -1); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":245 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":245 * low = 0 * if high == -1: * high = len(self.sa) # <<<<<<<<<<<<<< @@ -36455,17 +36730,17 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_16lookup(struct __pyx_obj_3_sa_Suff } __pyx_L4:; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":246 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":246 * if high == -1: * 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) */ - __pyx_t_1 = ((PySequence_Contains(__pyx_v_self->darray->word2id, __pyx_v_word))); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_word, __pyx_v_self->darray->word2id, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":247 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":247 * high = len(self.sa) * if word in self.darray.word2id: * word_id = self.darray.word2id[word] # <<<<<<<<<<<<<< @@ -36477,7 +36752,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_16lookup(struct __pyx_obj_3_sa_Suff __pyx_v_word_id = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":248 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -36495,7 +36770,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_16lookup(struct __pyx_obj_3_sa_Suff } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":250 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":250 * return self.__lookup_helper(word_id, offset, low, high) * else: * return None # <<<<<<<<<<<<<< @@ -36534,7 +36809,7 @@ static int __pyx_pw_3_sa_8TrieNode_1__cinit__(PyObject *__pyx_v_self, PyObject * return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":49 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":50 * cdef public children * * def __cinit__(self): # <<<<<<<<<<<<<< @@ -36551,14 +36826,14 @@ static int __pyx_pf_3_sa_8TrieNode___cinit__(struct __pyx_obj_3_sa_TrieNode *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":50 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":51 * * 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 = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 51; __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); @@ -36588,7 +36863,7 @@ static PyObject *__pyx_pw_3_sa_8TrieNode_8children_1__get__(PyObject *__pyx_v_se return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":47 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":48 * * cdef class TrieNode: * cdef public children # <<<<<<<<<<<<<< @@ -36670,14 +36945,14 @@ static int __pyx_pw_3_sa_16ExtendedTrieNode_1__cinit__(PyObject *__pyx_v_self, P PyObject *__pyx_v_phrase = 0; PyObject *__pyx_v_phrase_location = 0; PyObject *__pyx_v_suffix_link = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__phrase,&__pyx_n_s__phrase_location,&__pyx_n_s__suffix_link,0}; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__phrase,&__pyx_n_s__phrase_location,&__pyx_n_s__suffix_link,0}; PyObject* values[3] = {0,0,0}; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":57 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":58 * cdef public suffix_link * * def __cinit__(self, phrase=None, phrase_location=None, suffix_link=None): # <<<<<<<<<<<<<< @@ -36716,7 +36991,7 @@ static int __pyx_pw_3_sa_16ExtendedTrieNode_1__cinit__(PyObject *__pyx_v_self, P } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 57; __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 = 58; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -36733,7 +37008,7 @@ static int __pyx_pw_3_sa_16ExtendedTrieNode_1__cinit__(PyObject *__pyx_v_self, P } 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 = 57; __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 = 58; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("_sa.ExtendedTrieNode.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -36749,7 +37024,7 @@ static int __pyx_pf_3_sa_16ExtendedTrieNode___cinit__(struct __pyx_obj_3_sa_Exte __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":58 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":59 * * def __cinit__(self, phrase=None, phrase_location=None, suffix_link=None): * self.phrase = phrase # <<<<<<<<<<<<<< @@ -36762,7 +37037,7 @@ static int __pyx_pf_3_sa_16ExtendedTrieNode___cinit__(struct __pyx_obj_3_sa_Exte __Pyx_DECREF(__pyx_v_self->phrase); __pyx_v_self->phrase = __pyx_v_phrase; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":59 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":60 * def __cinit__(self, phrase=None, phrase_location=None, suffix_link=None): * self.phrase = phrase * self.phrase_location = phrase_location # <<<<<<<<<<<<<< @@ -36775,7 +37050,7 @@ static int __pyx_pf_3_sa_16ExtendedTrieNode___cinit__(struct __pyx_obj_3_sa_Exte __Pyx_DECREF(__pyx_v_self->phrase_location); __pyx_v_self->phrase_location = __pyx_v_phrase_location; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":60 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":61 * self.phrase = phrase * self.phrase_location = phrase_location * self.suffix_link = suffix_link # <<<<<<<<<<<<<< @@ -36804,7 +37079,7 @@ static PyObject *__pyx_pw_3_sa_16ExtendedTrieNode_6phrase_1__get__(PyObject *__p return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":53 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":54 * * cdef class ExtendedTrieNode(TrieNode): * cdef public phrase # <<<<<<<<<<<<<< @@ -36891,7 +37166,7 @@ static PyObject *__pyx_pw_3_sa_16ExtendedTrieNode_15phrase_location_1__get__(PyO return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":54 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":55 * cdef class ExtendedTrieNode(TrieNode): * cdef public phrase * cdef public phrase_location # <<<<<<<<<<<<<< @@ -36978,7 +37253,7 @@ static PyObject *__pyx_pw_3_sa_16ExtendedTrieNode_11suffix_link_1__get__(PyObjec return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":55 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":56 * cdef public phrase * cdef public phrase_location * cdef public suffix_link # <<<<<<<<<<<<<< @@ -37058,11 +37333,11 @@ static int __pyx_pf_3_sa_16ExtendedTrieNode_11suffix_link_4__del__(struct __pyx_ static int __pyx_pw_3_sa_9TrieTable_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_3_sa_9TrieTable_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_extended = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__extended,0}; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__extended,0}; PyObject* values[1] = {0}; values[0] = __pyx_k_99; if (unlikely(__pyx_kwds)) { @@ -37082,7 +37357,7 @@ static int __pyx_pw_3_sa_9TrieTable_1__cinit__(PyObject *__pyx_v_self, PyObject } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 67; __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 = 68; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -37095,7 +37370,7 @@ static int __pyx_pw_3_sa_9TrieTable_1__cinit__(PyObject *__pyx_v_self, PyObject } 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 = 67; __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 = 68; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("_sa.TrieTable.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -37106,7 +37381,7 @@ static int __pyx_pw_3_sa_9TrieTable_1__cinit__(PyObject *__pyx_v_self, PyObject return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":67 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":68 * cdef public int count * cdef public root * def __cinit__(self, extended=False): # <<<<<<<<<<<<<< @@ -37125,7 +37400,7 @@ static int __pyx_pf_3_sa_9TrieTable___cinit__(struct __pyx_obj_3_sa_TrieTable *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":68 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":69 * cdef public root * def __cinit__(self, extended=False): * self.count = 0 # <<<<<<<<<<<<<< @@ -37134,34 +37409,34 @@ static int __pyx_pf_3_sa_9TrieTable___cinit__(struct __pyx_obj_3_sa_TrieTable *_ */ __pyx_v_self->count = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":69 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":70 * 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 = 69; __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 = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->extended = __pyx_t_1; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":70 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":71 * 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 = 70; __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 = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":71 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":72 * self.extended = extended * if extended: * self.root = ExtendedTrieNode() # <<<<<<<<<<<<<< * else: * self.root = TrieNode() */ - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->root); @@ -37172,14 +37447,14 @@ static int __pyx_pf_3_sa_9TrieTable___cinit__(struct __pyx_obj_3_sa_TrieTable *_ } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":73 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":74 * self.root = ExtendedTrieNode() * else: * self.root = TrieNode() # <<<<<<<<<<<<<< * * # linked list structure for storing matches in BaselineRuleFactory */ - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_TrieNode)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_TrieNode)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->root); @@ -37211,7 +37486,7 @@ static PyObject *__pyx_pw_3_sa_9TrieTable_8extended_1__get__(PyObject *__pyx_v_s return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":64 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":65 * * cdef class TrieTable: * cdef public int extended # <<<<<<<<<<<<<< @@ -37228,7 +37503,7 @@ static PyObject *__pyx_pf_3_sa_9TrieTable_8extended___get__(struct __pyx_obj_3_s 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 = 64; __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 = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -37265,7 +37540,7 @@ static int __pyx_pf_3_sa_9TrieTable_8extended_2__set__(struct __pyx_obj_3_sa_Tri 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 = 64; __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 = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->extended = __pyx_t_1; __pyx_r = 0; @@ -37289,7 +37564,7 @@ static PyObject *__pyx_pw_3_sa_9TrieTable_5count_1__get__(PyObject *__pyx_v_self return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":65 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":66 * cdef class TrieTable: * cdef public int extended * cdef public int count # <<<<<<<<<<<<<< @@ -37306,7 +37581,7 @@ static PyObject *__pyx_pf_3_sa_9TrieTable_5count___get__(struct __pyx_obj_3_sa_T 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 = 65; __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 = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -37343,7 +37618,7 @@ static int __pyx_pf_3_sa_9TrieTable_5count_2__set__(struct __pyx_obj_3_sa_TrieTa 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 = 65; __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 = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->count = __pyx_t_1; __pyx_r = 0; @@ -37367,7 +37642,7 @@ static PyObject *__pyx_pw_3_sa_9TrieTable_4root_1__get__(PyObject *__pyx_v_self) return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":66 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":67 * cdef public int extended * cdef public int count * cdef public root # <<<<<<<<<<<<<< @@ -37443,7 +37718,7 @@ static int __pyx_pf_3_sa_9TrieTable_4root_4__del__(struct __pyx_obj_3_sa_TrieTab return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":93 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":94 * * # returns true if sent_id is contained * cdef int contains(self, int sent_id): # <<<<<<<<<<<<<< @@ -37456,7 +37731,7 @@ static int __pyx_f_3_sa_14PhraseLocation_contains(CYTHON_UNUSED struct __pyx_obj __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("contains", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":94 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":95 * # returns true if sent_id is contained * cdef int contains(self, int sent_id): * return 1 # <<<<<<<<<<<<<< @@ -37481,14 +37756,14 @@ static int __pyx_pw_3_sa_14PhraseLocation_1__cinit__(PyObject *__pyx_v_self, PyO int __pyx_v_arr_high; PyObject *__pyx_v_arr = 0; int __pyx_v_num_subpatterns; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__sa_low,&__pyx_n_s__sa_high,&__pyx_n_s__arr_low,&__pyx_n_s__arr_high,&__pyx_n_s__arr,&__pyx_n_s__num_subpatterns,0}; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__sa_low,&__pyx_n_s__sa_high,&__pyx_n_s__arr_low,&__pyx_n_s__arr_high,&__pyx_n_s__arr,&__pyx_n_s__num_subpatterns,0}; PyObject* values[6] = {0,0,0,0,0,0}; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":97 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":98 * * 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): # <<<<<<<<<<<<<< @@ -37543,27 +37818,7 @@ static int __pyx_pw_3_sa_14PhraseLocation_1__cinit__(PyObject *__pyx_v_self, PyO } } 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 = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - if (values[0]) { - } else { - __pyx_v_sa_low = ((int)-1); - } - if (values[1]) { - } else { - __pyx_v_sa_high = ((int)-1); - } - if (values[2]) { - } else { - __pyx_v_arr_low = ((int)-1); - } - if (values[3]) { - } else { - __pyx_v_arr_high = ((int)-1); - } - if (values[5]) { - } else { - __pyx_v_num_subpatterns = ((int)1); + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -37578,35 +37833,35 @@ static int __pyx_pw_3_sa_14PhraseLocation_1__cinit__(PyObject *__pyx_v_self, PyO } } 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 = 96; __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 = 97; __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 = 96; __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 = 97; __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 = 96; __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 = 97; __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 = 96; __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 = 97; __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 = 97; __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 = 98; __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 = 96; __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 = 97; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("_sa.PhraseLocation.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -37617,7 +37872,7 @@ static int __pyx_pw_3_sa_14PhraseLocation_1__cinit__(PyObject *__pyx_v_self, PyO return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":96 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":97 * return 1 * * def __cinit__(self, int sa_low=-1, int sa_high=-1, int arr_low=-1, int arr_high=-1, # <<<<<<<<<<<<<< @@ -37633,7 +37888,7 @@ static int __pyx_pf_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_3_sa_Phrase int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":98 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":99 * 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 # <<<<<<<<<<<<<< @@ -37642,7 +37897,7 @@ static int __pyx_pf_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_3_sa_Phrase */ __pyx_v_self->sa_low = __pyx_v_sa_low; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":99 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":100 * arr=None, int num_subpatterns=1): * self.sa_low = sa_low * self.sa_high = sa_high # <<<<<<<<<<<<<< @@ -37651,7 +37906,7 @@ static int __pyx_pf_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_3_sa_Phrase */ __pyx_v_self->sa_high = __pyx_v_sa_high; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":100 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":101 * self.sa_low = sa_low * self.sa_high = sa_high * self.arr_low = arr_low # <<<<<<<<<<<<<< @@ -37660,7 +37915,7 @@ static int __pyx_pf_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_3_sa_Phrase */ __pyx_v_self->arr_low = __pyx_v_arr_low; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":101 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":102 * self.sa_high = sa_high * self.arr_low = arr_low * self.arr_high = arr_high # <<<<<<<<<<<<<< @@ -37669,21 +37924,21 @@ static int __pyx_pf_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_3_sa_Phrase */ __pyx_v_self->arr_high = __pyx_v_arr_high; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":102 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":103 * 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_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_v_arr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_arr, __pyx_ptype_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 103; __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_3_sa_IntList *)__pyx_v_arr); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":103 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":104 * self.arr_high = arr_high * self.arr = arr * self.num_subpatterns = num_subpatterns # <<<<<<<<<<<<<< @@ -37707,11 +37962,11 @@ static int __pyx_pw_3_sa_7Sampler_1__cinit__(PyObject *__pyx_v_self, PyObject *_ static int __pyx_pw_3_sa_7Sampler_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_v_sample_size; struct __pyx_obj_3_sa_SuffixArray *__pyx_v_fsarray = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__sample_size,&__pyx_n_s__fsarray,0}; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__sample_size,&__pyx_n_s__fsarray,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -37725,18 +37980,16 @@ static int __pyx_pw_3_sa_7Sampler_1__cinit__(PyObject *__pyx_v_self, PyObject *_ kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sample_size); - if (likely(values[0])) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sample_size)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fsarray); - if (likely(values[1])) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fsarray)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 114; __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 = 113; __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 = 114; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -37744,18 +37997,18 @@ static int __pyx_pw_3_sa_7Sampler_1__cinit__(PyObject *__pyx_v_self, PyObject *_ 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 = 113; __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 = 114; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_fsarray = ((struct __pyx_obj_3_sa_SuffixArray *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 113; __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 = 114; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("_sa.Sampler.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fsarray), __pyx_ptype_3_sa_SuffixArray, 1, "fsarray", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fsarray), __pyx_ptype_3_sa_SuffixArray, 1, "fsarray", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_3_sa_7Sampler___cinit__(((struct __pyx_obj_3_sa_Sampler *)__pyx_v_self), __pyx_v_sample_size, __pyx_v_fsarray); goto __pyx_L0; __pyx_L1_error:; @@ -37765,7 +38018,7 @@ static int __pyx_pw_3_sa_7Sampler_1__cinit__(PyObject *__pyx_v_self, PyObject *_ return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":113 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":114 * cdef IntList sa * * def __cinit__(self, int sample_size, SuffixArray fsarray): # <<<<<<<<<<<<<< @@ -37785,7 +38038,7 @@ static int __pyx_pf_3_sa_7Sampler___cinit__(struct __pyx_obj_3_sa_Sampler *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":114 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":115 * * def __cinit__(self, int sample_size, SuffixArray fsarray): * self.sample_size = sample_size # <<<<<<<<<<<<<< @@ -37794,7 +38047,7 @@ static int __pyx_pf_3_sa_7Sampler___cinit__(struct __pyx_obj_3_sa_Sampler *__pyx */ __pyx_v_self->sample_size = __pyx_v_sample_size; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":115 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":116 * def __cinit__(self, int sample_size, SuffixArray fsarray): * self.sample_size = sample_size * self.sa = fsarray.sa # <<<<<<<<<<<<<< @@ -37807,7 +38060,7 @@ static int __pyx_pf_3_sa_7Sampler___cinit__(struct __pyx_obj_3_sa_Sampler *__pyx __Pyx_DECREF(((PyObject *)__pyx_v_self->sa)); __pyx_v_self->sa = __pyx_v_fsarray->sa; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":116 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":117 * self.sample_size = sample_size * self.sa = fsarray.sa * if sample_size > 0: # <<<<<<<<<<<<<< @@ -37817,21 +38070,21 @@ static int __pyx_pf_3_sa_7Sampler___cinit__(struct __pyx_obj_3_sa_Sampler *__pyx __pyx_t_1 = (__pyx_v_sample_size > 0); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":117 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":118 * 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_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__info); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__info); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 118; __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_sample_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong(__pyx_v_sample_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_kp_s_100)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_100)); @@ -37839,7 +38092,7 @@ static int __pyx_pf_3_sa_7Sampler___cinit__(struct __pyx_obj_3_sa_Sampler *__pyx PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 118; __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_4)); __pyx_t_4 = 0; @@ -37848,19 +38101,19 @@ static int __pyx_pf_3_sa_7Sampler___cinit__(struct __pyx_obj_3_sa_Sampler *__pyx } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":119 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":120 * 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_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__info); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__info); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 120; __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_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_102), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_102), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 120; __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; @@ -37887,7 +38140,7 @@ static PyObject *__pyx_pw_3_sa_7Sampler_3sample(PyObject *__pyx_v_self, PyObject PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sample (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_phrase_location), __pyx_ptype_3_sa_PhraseLocation, 1, "phrase_location", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_phrase_location), __pyx_ptype_3_sa_PhraseLocation, 1, "phrase_location", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_3_sa_7Sampler_2sample(((struct __pyx_obj_3_sa_Sampler *)__pyx_v_self), ((struct __pyx_obj_3_sa_PhraseLocation *)__pyx_v_phrase_location)); goto __pyx_L0; __pyx_L1_error:; @@ -37897,7 +38150,7 @@ static PyObject *__pyx_pw_3_sa_7Sampler_3sample(PyObject *__pyx_v_self, PyObject return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":121 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":122 * logger.info("Sampling strategy: no sampling") * * def sample(self, PhraseLocation phrase_location): # <<<<<<<<<<<<<< @@ -37924,19 +38177,19 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sample", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":134 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":135 * 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_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_sample = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":135 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":136 * * sample = IntList() * if phrase_location.arr is None: # <<<<<<<<<<<<<< @@ -37946,7 +38199,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_ __pyx_t_2 = (((PyObject *)__pyx_v_phrase_location->arr) == Py_None); if (__pyx_t_2) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":136 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":137 * sample = IntList() * if phrase_location.arr is None: * num_locations = phrase_location.sa_high - phrase_location.sa_low # <<<<<<<<<<<<<< @@ -37955,7 +38208,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_ */ __pyx_v_num_locations = (__pyx_v_phrase_location->sa_high - __pyx_v_phrase_location->sa_low); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":137 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":138 * 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: # <<<<<<<<<<<<<< @@ -37971,7 +38224,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_ } if (__pyx_t_4) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":138 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":139 * 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) # <<<<<<<<<<<<<< @@ -37983,7 +38236,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_ } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":140 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":141 * sample._extend_arr(self.sa.arr + phrase_location.sa_low, num_locations) * else: * stepsize = float(num_locations)/float(self.sample_size) # <<<<<<<<<<<<<< @@ -37992,11 +38245,11 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_ */ if (unlikely(((double)__pyx_v_self->sample_size) == 0)) { PyErr_Format(PyExc_ZeroDivisionError, "float division"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_v_stepsize = (((double)__pyx_v_num_locations) / ((double)__pyx_v_self->sample_size)); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":141 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":142 * else: * stepsize = float(num_locations)/float(self.sample_size) * i = phrase_location.sa_low # <<<<<<<<<<<<<< @@ -38005,7 +38258,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_ */ __pyx_v_i = __pyx_v_phrase_location->sa_low; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":142 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":143 * 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: # <<<<<<<<<<<<<< @@ -38022,50 +38275,26 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_ } if (!__pyx_t_3) break; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":145 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":146 * '''Note: int(i) not guaranteed to have the desired * effect, according to the python documentation''' - * if fmod(i,1.0) > 0.5: # <<<<<<<<<<<<<< - * val = int(ceil(i)) - * else: - */ - __pyx_t_3 = (fmod(__pyx_v_i, 1.0) > 0.5); - if (__pyx_t_3) { - - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":146 - * effect, according to the python documentation''' - * if fmod(i,1.0) > 0.5: - * val = int(ceil(i)) # <<<<<<<<<<<<<< - * else: - * val = int(floor(i)) - */ - __pyx_v_val = ((int)ceil(__pyx_v_i)); - goto __pyx_L7; - } - /*else*/ { - - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":148 - * val = int(ceil(i)) - * else: - * val = int(floor(i)) # <<<<<<<<<<<<<< + * val = int(i + 0.5 + 1e-8) # <<<<<<<<<<<<<< * sample._append(self.sa.arr[val]) * i = i + stepsize */ - __pyx_v_val = ((int)floor(__pyx_v_i)); - } - __pyx_L7:; + __pyx_v_val = ((int)((__pyx_v_i + 0.5) + 1e-8)); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":149 - * else: - * val = int(floor(i)) + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":147 + * effect, according to the python documentation''' + * val = int(i + 0.5 + 1e-8) * sample._append(self.sa.arr[val]) # <<<<<<<<<<<<<< * i = i + stepsize * else: */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_sample->__pyx_vtab)->_append(__pyx_v_sample, (__pyx_v_self->sa->arr[__pyx_v_val])); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":150 - * val = int(floor(i)) + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":148 + * val = int(i + 0.5 + 1e-8) * sample._append(self.sa.arr[val]) * i = i + stepsize # <<<<<<<<<<<<<< * else: @@ -38079,7 +38308,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_ } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":152 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":150 * i = i + stepsize * else: * num_locations = (phrase_location.arr_high - phrase_location.arr_low) / phrase_location.num_subpatterns # <<<<<<<<<<<<<< @@ -38089,15 +38318,15 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_ __pyx_t_5 = (__pyx_v_phrase_location->arr_high - __pyx_v_phrase_location->arr_low); if (unlikely(__pyx_v_phrase_location->num_subpatterns == 0)) { PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 150; __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))) { PyErr_Format(PyExc_OverflowError, "value too large to perform division"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_v_num_locations = __Pyx_div_int(__pyx_t_5, __pyx_v_phrase_location->num_subpatterns); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":153 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":151 * 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: # <<<<<<<<<<<<<< @@ -38113,7 +38342,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_ } if (__pyx_t_2) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":154 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":152 * 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 # <<<<<<<<<<<<<< @@ -38123,11 +38352,11 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_ __Pyx_INCREF(((PyObject *)__pyx_v_phrase_location->arr)); __Pyx_DECREF(((PyObject *)__pyx_v_sample)); __pyx_v_sample = __pyx_v_phrase_location->arr; - goto __pyx_L8; + goto __pyx_L7; } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":156 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":154 * sample = phrase_location.arr * else: * stepsize = float(num_locations)/float(self.sample_size) # <<<<<<<<<<<<<< @@ -38136,11 +38365,11 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_ */ if (unlikely(((double)__pyx_v_self->sample_size) == 0)) { PyErr_Format(PyExc_ZeroDivisionError, "float division"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 156; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":157 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":155 * else: * stepsize = float(num_locations)/float(self.sample_size) * i = phrase_location.arr_low # <<<<<<<<<<<<<< @@ -38149,7 +38378,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_ */ __pyx_v_i = __pyx_v_phrase_location->arr_low; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":158 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":156 * 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: # <<<<<<<<<<<<<< @@ -38166,50 +38395,26 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_ } if (!__pyx_t_4) break; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":161 + /* "/home/pauldb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< - * val = int(ceil(i)) - * else: - */ - __pyx_t_4 = (fmod(__pyx_v_i, 1.0) > 0.5); - if (__pyx_t_4) { - - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":162 - * effect, according to the python documentation''' - * if fmod(i,1.0) > 0.5: - * val = int(ceil(i)) # <<<<<<<<<<<<<< - * else: - * val = int(floor(i)) - */ - __pyx_v_val = ((int)ceil(__pyx_v_i)); - goto __pyx_L11; - } - /*else*/ { - - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":164 - * val = int(ceil(i)) - * else: - * val = int(floor(i)) # <<<<<<<<<<<<<< + * val = int(i + 0.5 + 1e-8) # <<<<<<<<<<<<<< * j = phrase_location.arr_low + (val*phrase_location.num_subpatterns) * sample._extend_arr(phrase_location.arr.arr + j, phrase_location.num_subpatterns) */ - __pyx_v_val = ((int)floor(__pyx_v_i)); - } - __pyx_L11:; + __pyx_v_val = ((int)((__pyx_v_i + 0.5) + 1e-8)); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":165 - * else: - * val = int(floor(i)) + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":160 + * effect, according to the python documentation''' + * val = int(i + 0.5 + 1e-8) * 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 */ __pyx_v_j = (__pyx_v_phrase_location->arr_low + (__pyx_v_val * __pyx_v_phrase_location->num_subpatterns)); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":166 - * val = int(floor(i)) + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":161 + * val = int(i + 0.5 + 1e-8) * 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 @@ -38217,7 +38422,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_ */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_sample->__pyx_vtab)->_extend_arr(__pyx_v_sample, (__pyx_v_phrase_location->arr->arr + __pyx_v_j), __pyx_v_phrase_location->num_subpatterns); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":167 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":162 * 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 # <<<<<<<<<<<<<< @@ -38227,11 +38432,11 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_ __pyx_v_i = (__pyx_v_i + __pyx_v_stepsize); } } - __pyx_L8:; + __pyx_L7:; } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":168 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":163 * sample._extend_arr(phrase_location.arr.arr + j, phrase_location.num_subpatterns) * i = i + stepsize * return sample # <<<<<<<<<<<<<< @@ -38256,7 +38461,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_ return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":180 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":175 * * * cdef void assign_matching(Matching* m, int* arr, int start, int step, int* sent_id_arr): # <<<<<<<<<<<<<< @@ -38268,7 +38473,7 @@ static void __pyx_f_3_sa_assign_matching(struct __pyx_t_3_sa_Matching *__pyx_v_m __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("assign_matching", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":181 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":176 * * cdef void assign_matching(Matching* m, int* arr, int start, int step, int* sent_id_arr): * m.arr = arr # <<<<<<<<<<<<<< @@ -38277,7 +38482,7 @@ static void __pyx_f_3_sa_assign_matching(struct __pyx_t_3_sa_Matching *__pyx_v_m */ __pyx_v_m->arr = __pyx_v_arr; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":182 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":177 * cdef void assign_matching(Matching* m, int* arr, int start, int step, int* sent_id_arr): * m.arr = arr * m.start = start # <<<<<<<<<<<<<< @@ -38286,7 +38491,7 @@ static void __pyx_f_3_sa_assign_matching(struct __pyx_t_3_sa_Matching *__pyx_v_m */ __pyx_v_m->start = __pyx_v_start; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":183 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":178 * m.arr = arr * m.start = start * m.end = start + step # <<<<<<<<<<<<<< @@ -38295,7 +38500,7 @@ static void __pyx_f_3_sa_assign_matching(struct __pyx_t_3_sa_Matching *__pyx_v_m */ __pyx_v_m->end = (__pyx_v_start + __pyx_v_step); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":184 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":179 * m.start = start * m.end = start + step * m.sent_id = sent_id_arr[arr[start]] # <<<<<<<<<<<<<< @@ -38304,7 +38509,7 @@ static void __pyx_f_3_sa_assign_matching(struct __pyx_t_3_sa_Matching *__pyx_v_m */ __pyx_v_m->sent_id = (__pyx_v_sent_id_arr[(__pyx_v_arr[__pyx_v_start])]); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":185 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":180 * m.end = start + step * m.sent_id = sent_id_arr[arr[start]] * m.size = step # <<<<<<<<<<<<<< @@ -38316,7 +38521,7 @@ static void __pyx_f_3_sa_assign_matching(struct __pyx_t_3_sa_Matching *__pyx_v_m __Pyx_RefNannyFinishContext(); } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":188 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":183 * * * cdef int* append_combined_matching(int* arr, Matching* loc1, Matching* loc2, # <<<<<<<<<<<<<< @@ -38333,7 +38538,7 @@ static int *__pyx_f_3_sa_append_combined_matching(int *__pyx_v_arr, struct __pyx int __pyx_t_2; __Pyx_RefNannySetupContext("append_combined_matching", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":192 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":187 * cdef int i, new_len * * new_len = result_len[0] + num_subpatterns # <<<<<<<<<<<<<< @@ -38342,7 +38547,7 @@ static int *__pyx_f_3_sa_append_combined_matching(int *__pyx_v_arr, struct __pyx */ __pyx_v_new_len = ((__pyx_v_result_len[0]) + __pyx_v_num_subpatterns); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":193 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":188 * * new_len = result_len[0] + num_subpatterns * arr = realloc(arr, new_len*sizeof(int)) # <<<<<<<<<<<<<< @@ -38351,7 +38556,7 @@ static int *__pyx_f_3_sa_append_combined_matching(int *__pyx_v_arr, struct __pyx */ __pyx_v_arr = ((int *)realloc(__pyx_v_arr, (__pyx_v_new_len * (sizeof(int))))); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":195 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":190 * arr = realloc(arr, new_len*sizeof(int)) * * for i from 0 <= i < loc1.size: # <<<<<<<<<<<<<< @@ -38361,7 +38566,7 @@ static int *__pyx_f_3_sa_append_combined_matching(int *__pyx_v_arr, struct __pyx __pyx_t_1 = __pyx_v_loc1->size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":196 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":191 * * for i from 0 <= i < loc1.size: * arr[result_len[0]+i] = loc1.arr[loc1.start+i] # <<<<<<<<<<<<<< @@ -38371,7 +38576,7 @@ static int *__pyx_f_3_sa_append_combined_matching(int *__pyx_v_arr, struct __pyx (__pyx_v_arr[((__pyx_v_result_len[0]) + __pyx_v_i)]) = (__pyx_v_loc1->arr[(__pyx_v_loc1->start + __pyx_v_i)]); } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":197 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":192 * for i from 0 <= i < loc1.size: * arr[result_len[0]+i] = loc1.arr[loc1.start+i] * if num_subpatterns > loc1.size: # <<<<<<<<<<<<<< @@ -38381,7 +38586,7 @@ static int *__pyx_f_3_sa_append_combined_matching(int *__pyx_v_arr, struct __pyx __pyx_t_2 = (__pyx_v_num_subpatterns > __pyx_v_loc1->size); if (__pyx_t_2) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":198 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":193 * arr[result_len[0]+i] = loc1.arr[loc1.start+i] * if num_subpatterns > loc1.size: * arr[new_len-1] = loc2.arr[loc2.end-1] # <<<<<<<<<<<<<< @@ -38393,7 +38598,7 @@ static int *__pyx_f_3_sa_append_combined_matching(int *__pyx_v_arr, struct __pyx } __pyx_L5:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":199 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":194 * if num_subpatterns > loc1.size: * arr[new_len-1] = loc2.arr[loc2.end-1] * result_len[0] = new_len # <<<<<<<<<<<<<< @@ -38402,7 +38607,7 @@ static int *__pyx_f_3_sa_append_combined_matching(int *__pyx_v_arr, struct __pyx */ (__pyx_v_result_len[0]) = __pyx_v_new_len; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":200 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":195 * arr[new_len-1] = loc2.arr[loc2.end-1] * result_len[0] = new_len * return arr # <<<<<<<<<<<<<< @@ -38418,7 +38623,7 @@ static int *__pyx_f_3_sa_append_combined_matching(int *__pyx_v_arr, struct __pyx return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":203 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":198 * * * cdef int* extend_arr(int* arr, int* arr_len, int* appendix, int appendix_len): # <<<<<<<<<<<<<< @@ -38432,7 +38637,7 @@ static int *__pyx_f_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr_len, int __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("extend_arr", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":206 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":201 * cdef int new_len * * new_len = arr_len[0] + appendix_len # <<<<<<<<<<<<<< @@ -38441,7 +38646,7 @@ static int *__pyx_f_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr_len, int */ __pyx_v_new_len = ((__pyx_v_arr_len[0]) + __pyx_v_appendix_len); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":207 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":202 * * new_len = arr_len[0] + appendix_len * arr = realloc(arr, new_len*sizeof(int)) # <<<<<<<<<<<<<< @@ -38450,7 +38655,7 @@ static int *__pyx_f_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr_len, int */ __pyx_v_arr = ((int *)realloc(__pyx_v_arr, (__pyx_v_new_len * (sizeof(int))))); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":208 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":203 * new_len = arr_len[0] + appendix_len * arr = realloc(arr, new_len*sizeof(int)) * memcpy(arr+arr_len[0], appendix, appendix_len*sizeof(int)) # <<<<<<<<<<<<<< @@ -38459,7 +38664,7 @@ static int *__pyx_f_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr_len, int */ memcpy((__pyx_v_arr + (__pyx_v_arr_len[0])), __pyx_v_appendix, (__pyx_v_appendix_len * (sizeof(int)))); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":209 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":204 * arr = realloc(arr, new_len*sizeof(int)) * memcpy(arr+arr_len[0], appendix, appendix_len*sizeof(int)) * arr_len[0] = new_len # <<<<<<<<<<<<<< @@ -38468,7 +38673,7 @@ static int *__pyx_f_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr_len, int */ (__pyx_v_arr_len[0]) = __pyx_v_new_len; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":210 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":205 * memcpy(arr+arr_len[0], appendix, appendix_len*sizeof(int)) * arr_len[0] = new_len * return arr # <<<<<<<<<<<<<< @@ -38484,7 +38689,7 @@ static int *__pyx_f_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr_len, int return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":212 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":207 * return arr * * cdef int median(int low, int high, int step): # <<<<<<<<<<<<<< @@ -38501,7 +38706,7 @@ static int __pyx_f_3_sa_median(int __pyx_v_low, int __pyx_v_high, int __pyx_v_st int __pyx_clineno = 0; __Pyx_RefNannySetupContext("median", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":213 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":208 * * cdef int median(int low, int high, int step): * return low + (((high - low)/step)/2)*step # <<<<<<<<<<<<<< @@ -38511,11 +38716,11 @@ static int __pyx_f_3_sa_median(int __pyx_v_low, int __pyx_v_high, int __pyx_v_st __pyx_t_1 = (__pyx_v_high - __pyx_v_low); if (unlikely(__pyx_v_step == 0)) { PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 208; __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))) { PyErr_Format(PyExc_OverflowError, "value too large to perform division"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 208; __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; @@ -38530,7 +38735,7 @@ static int __pyx_f_3_sa_median(int __pyx_v_low, int __pyx_v_high, int __pyx_v_st return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":216 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":211 * * * cdef void find_comparable_matchings(int low, int high, int* arr, int step, int loc, int* loc_minus, int* loc_plus): # <<<<<<<<<<<<<< @@ -38545,7 +38750,7 @@ static void __pyx_f_3_sa_find_comparable_matchings(int __pyx_v_low, int __pyx_v_ int __pyx_t_3; __Pyx_RefNannySetupContext("find_comparable_matchings", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":220 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":215 * # in which all matchings have the same first index as the one * # starting at loc * loc_plus[0] = loc + step # <<<<<<<<<<<<<< @@ -38554,7 +38759,7 @@ static void __pyx_f_3_sa_find_comparable_matchings(int __pyx_v_low, int __pyx_v_ */ (__pyx_v_loc_plus[0]) = (__pyx_v_loc + __pyx_v_step); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":221 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":216 * # starting at loc * loc_plus[0] = loc + step * while loc_plus[0] < high and arr[loc_plus[0]] == arr[loc]: # <<<<<<<<<<<<<< @@ -38571,7 +38776,7 @@ static void __pyx_f_3_sa_find_comparable_matchings(int __pyx_v_low, int __pyx_v_ } if (!__pyx_t_3) break; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":222 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":217 * loc_plus[0] = loc + step * while loc_plus[0] < high and arr[loc_plus[0]] == arr[loc]: * loc_plus[0] = loc_plus[0] + step # <<<<<<<<<<<<<< @@ -38581,7 +38786,7 @@ static void __pyx_f_3_sa_find_comparable_matchings(int __pyx_v_low, int __pyx_v_ (__pyx_v_loc_plus[0]) = ((__pyx_v_loc_plus[0]) + __pyx_v_step); } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":223 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":218 * while loc_plus[0] < high and arr[loc_plus[0]] == arr[loc]: * loc_plus[0] = loc_plus[0] + step * loc_minus[0] = loc # <<<<<<<<<<<<<< @@ -38590,7 +38795,7 @@ static void __pyx_f_3_sa_find_comparable_matchings(int __pyx_v_low, int __pyx_v_ */ (__pyx_v_loc_minus[0]) = __pyx_v_loc; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":224 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":219 * 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]: # <<<<<<<<<<<<<< @@ -38607,7 +38812,7 @@ static void __pyx_f_3_sa_find_comparable_matchings(int __pyx_v_low, int __pyx_v_ } if (!__pyx_t_2) break; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":225 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":220 * 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 # <<<<<<<<<<<<<< @@ -38644,14 +38849,14 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_ int __pyx_v_use_baeza_yates; int __pyx_v_use_collocations; int __pyx_v_use_index; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__alignment,&__pyx_n_s__by_slack_factor,&__pyx_n_s__category,&__pyx_n_s__max_chunks,&__pyx_n_s__max_initial_size,&__pyx_n_s__max_length,&__pyx_n_s__max_nonterminals,&__pyx_n_s__max_target_chunks,&__pyx_n_s__max_target_length,&__pyx_n_s__min_gap_size,&__pyx_n_s__precompute_file,&__pyx_n_s_70,&__pyx_n_s__precompute_rank,&__pyx_n_s_103,&__pyx_n_s_104,&__pyx_n_s_71,&__pyx_n_s__train_min_gap_size,&__pyx_n_s__tight_phrases,&__pyx_n_s__use_baeza_yates,&__pyx_n_s__use_collocations,&__pyx_n_s__use_index,0}; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__alignment,&__pyx_n_s__by_slack_factor,&__pyx_n_s__category,&__pyx_n_s__max_chunks,&__pyx_n_s__max_initial_size,&__pyx_n_s__max_length,&__pyx_n_s__max_nonterminals,&__pyx_n_s__max_target_chunks,&__pyx_n_s__max_target_length,&__pyx_n_s__min_gap_size,&__pyx_n_s__precompute_file,&__pyx_n_s_70,&__pyx_n_s__precompute_rank,&__pyx_n_s_103,&__pyx_n_s_104,&__pyx_n_s_71,&__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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":296 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":291 * 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, # <<<<<<<<<<<<<< @@ -38660,7 +38865,7 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_ */ values[3] = ((PyObject *)Py_None); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":304 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":299 * 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, # <<<<<<<<<<<<<< @@ -38669,7 +38874,7 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_ */ values[7] = ((PyObject *)Py_None); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":306 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":301 * 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, # <<<<<<<<<<<<<< @@ -38678,7 +38883,7 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_ */ values[8] = ((PyObject *)Py_None); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":310 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":305 * unsigned min_gap_size=2, * # filename of file containing precomputed collocations * precompute_file=None, # <<<<<<<<<<<<<< @@ -38717,8 +38922,7 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_ kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__alignment); - if (likely(values[0])) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__alignment)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 0) { @@ -38822,127 +39026,7 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_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 = 288; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - if (values[1]) { - } else { - - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":292 - * Alignment alignment, - * # parameter for double-binary search; doesn't seem to matter much - * float by_slack_factor=1.0, # <<<<<<<<<<<<<< - * # name of generic nonterminal used by Hiero - * char* category="[X]", - */ - __pyx_v_by_slack_factor = ((float)1.0); - } - if (values[2]) { - } else { - __pyx_v_category = ((char *)__pyx_k_105); - } - if (values[4]) { - } else { - __pyx_v_max_initial_size = ((unsigned int)10); - } - if (values[5]) { - } else { - __pyx_v_max_length = ((unsigned int)5); - } - if (values[6]) { - } else { - __pyx_v_max_nonterminals = ((unsigned int)2); - } - if (values[9]) { - } else { - __pyx_v_min_gap_size = ((unsigned int)2); - } - if (values[11]) { - } else { - __pyx_v_precompute_secondary_rank = ((unsigned int)20); - } - if (values[12]) { - } else { - __pyx_v_precompute_rank = ((unsigned int)100); - } - if (values[13]) { - } else { - - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":316 - * unsigned precompute_rank=100, - * # require extracted rules to have at least one aligned word - * bint require_aligned_terminal=True, # <<<<<<<<<<<<<< - * # require each contiguous chunk of extracted rules to have at least one aligned word - * bint require_aligned_chunks=False, - */ - __pyx_v_require_aligned_terminal = ((int)1); - } - if (values[14]) { - } else { - - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":318 - * bint require_aligned_terminal=True, - * # require each contiguous chunk of extracted rules to have at least one aligned word - * bint require_aligned_chunks=False, # <<<<<<<<<<<<<< - * # maximum span of a grammar rule extracted from TRAINING DATA - * unsigned train_max_initial_size=10, - */ - __pyx_v_require_aligned_chunks = ((int)0); - } - if (values[15]) { - } else { - __pyx_v_train_max_initial_size = ((unsigned int)10); - } - if (values[16]) { - } else { - __pyx_v_train_min_gap_size = ((unsigned int)2); - } - if (values[17]) { - } else { - - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":324 - * unsigned train_min_gap_size=2, - * # False if phrases should be loose (better but slower), True otherwise - * bint tight_phrases=True, # <<<<<<<<<<<<<< - * # True to require use of double-binary alg, false otherwise - * bint use_baeza_yates=True, - */ - __pyx_v_tight_phrases = ((int)1); - } - if (values[18]) { - } else { - - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":326 - * bint tight_phrases=True, - * # True to require use of double-binary alg, false otherwise - * bint use_baeza_yates=True, # <<<<<<<<<<<<<< - * # True to enable used of precomputed collocations - * bint use_collocations=True, - */ - __pyx_v_use_baeza_yates = ((int)1); - } - if (values[19]) { - } else { - - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":328 - * bint use_baeza_yates=True, - * # True to enable used of precomputed collocations - * bint use_collocations=True, # <<<<<<<<<<<<<< - * # True to enable use of precomputed inverted indices - * bint use_index=True): - */ - __pyx_v_use_collocations = ((int)1); - } - if (values[20]) { - } else { - - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":330 - * bint use_collocations=True, - * # True to enable use of precomputed inverted indices - * bint use_index=True): # <<<<<<<<<<<<<< - * '''Note: we make a distinction between the min_gap_size - * and max_initial_size used in test and train. The latter - */ - __pyx_v_use_index = ((int)1); + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -38973,10 +39057,10 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_ } __pyx_v_alignment = ((struct __pyx_obj_3_sa_Alignment *)values[0]); if (values[1]) { - __pyx_v_by_slack_factor = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_by_slack_factor == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 292; __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 = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":292 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":287 * Alignment alignment, * # parameter for double-binary search; doesn't seem to matter much * float by_slack_factor=1.0, # <<<<<<<<<<<<<< @@ -38986,49 +39070,49 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_ __pyx_v_by_slack_factor = ((float)1.0); } if (values[2]) { - __pyx_v_category = PyBytes_AsString(values[2]); if (unlikely((!__pyx_v_category) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_category = PyBytes_AsString(values[2]); if (unlikely((!__pyx_v_category) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_category = ((char *)__pyx_k_105); } __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 = 298; __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 = 293; __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 = 300; __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 = 295; __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 = 302; __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 = 297; __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 = 308; __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 = 303; __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 = 312; __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 = 307; __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 = 314; __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 = 309; __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 = 316; __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 = 311; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":316 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":311 * unsigned precompute_rank=100, * # require extracted rules to have at least one aligned word * bint require_aligned_terminal=True, # <<<<<<<<<<<<<< @@ -39038,10 +39122,10 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_ __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 = 318; __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 = 313; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":318 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":313 * bint require_aligned_terminal=True, * # require each contiguous chunk of extracted rules to have at least one aligned word * bint require_aligned_chunks=False, # <<<<<<<<<<<<<< @@ -39051,20 +39135,20 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_ __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 = 320; __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 = 315; __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 = 322; __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 = 317; __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 = 324; __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 = 319; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":324 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":319 * unsigned train_min_gap_size=2, * # False if phrases should be loose (better but slower), True otherwise * bint tight_phrases=True, # <<<<<<<<<<<<<< @@ -39074,10 +39158,10 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_ __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 = 326; __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 = 321; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":326 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":321 * bint tight_phrases=True, * # True to require use of double-binary alg, false otherwise * bint use_baeza_yates=True, # <<<<<<<<<<<<<< @@ -39087,10 +39171,10 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_ __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 = 328; __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":328 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":323 * bint use_baeza_yates=True, * # True to enable used of precomputed collocations * bint use_collocations=True, # <<<<<<<<<<<<<< @@ -39100,10 +39184,10 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_ __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 = 330; __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 = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":330 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":325 * bint use_collocations=True, * # True to enable use of precomputed inverted indices * bint use_index=True): # <<<<<<<<<<<<<< @@ -39115,13 +39199,13 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_ } 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 = 288; __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 = 283; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_alignment), __pyx_ptype_3_sa_Alignment, 1, "alignment", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_alignment), __pyx_ptype_3_sa_Alignment, 1, "alignment", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(((struct __pyx_obj_3_sa_HieroCachingRuleFactory *)__pyx_v_self), __pyx_v_alignment, __pyx_v_by_slack_factor, __pyx_v_category, __pyx_v_max_chunks, __pyx_v_max_initial_size, __pyx_v_max_length, __pyx_v_max_nonterminals, __pyx_v_max_target_chunks, __pyx_v_max_target_length, __pyx_v_min_gap_size, __pyx_v_precompute_file, __pyx_v_precompute_secondary_rank, __pyx_v_precompute_rank, __pyx_v_require_aligned_terminal, __pyx_v_require_aligned_chunks, __pyx_v_train_max_initial_size, __pyx_v_train_min_gap_size, __pyx_v_tight_phrases, __pyx_v_use_baeza_yates, __pyx_v_use_collocations, __pyx_v_use_index); goto __pyx_L0; __pyx_L1_error:; @@ -39138,13 +39222,12 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_9__cinit___lambda1(PyOb PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda1 (wrapper)", 0); - __pyx_self = __pyx_self; __pyx_r = __pyx_lambda_funcdef_lambda1(__pyx_self); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":406 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":401 * self.phrases_f = defaultdict(int) * self.phrases_e = defaultdict(int) * self.phrases_fe = defaultdict(lambda: defaultdict(int)) # <<<<<<<<<<<<<< @@ -39163,14 +39246,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_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 401; __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 = 406; __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 = 401; __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 = 406; __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 = 401; __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; @@ -39199,13 +39282,12 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_9__cinit___1lambda2(PyO PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda2 (wrapper)", 0); - __pyx_self = __pyx_self; __pyx_r = __pyx_lambda_funcdef_lambda2(__pyx_self); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":407 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":402 * self.phrases_e = defaultdict(int) * self.phrases_fe = defaultdict(lambda: defaultdict(int)) * self.phrases_al = defaultdict(lambda: defaultdict(tuple)) # <<<<<<<<<<<<<< @@ -39224,14 +39306,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_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); 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_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 407; __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 = 402; __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 = 407; __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 = 402; __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; @@ -39260,13 +39342,12 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_9__cinit___2lambda3(PyO PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda3 (wrapper)", 0); - __pyx_self = __pyx_self; __pyx_r = __pyx_lambda_funcdef_lambda3(__pyx_self); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":412 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":407 * self.bilex_f = defaultdict(int) * self.bilex_e = defaultdict(int) * self.bilex_fe = defaultdict(lambda: defaultdict(int)) # <<<<<<<<<<<<<< @@ -39285,14 +39366,14 @@ 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_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 407; __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 = 412; __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 = 407; __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 = 412; __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 = 407; __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; @@ -39314,7 +39395,7 @@ static PyObject *__pyx_lambda_funcdef_lambda3(CYTHON_UNUSED PyObject *__pyx_self return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":288 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":283 * cdef bilex_fe * * def __cinit__(self, # <<<<<<<<<<<<<< @@ -39335,21 +39416,21 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":336 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":331 * 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 = 336; __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 = 331; __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 = 336; __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 = 331; __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_3_sa_TrieTable)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_TrieTable)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 331; __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); @@ -39358,20 +39439,20 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ __pyx_v_self->rules = ((struct __pyx_obj_3_sa_TrieTable *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":337 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":332 * 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 = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 332; __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 = 337; __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 = 332; __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_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 332; __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); @@ -39380,7 +39461,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ __pyx_v_self->rules->root = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":338 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":333 * self.rules = TrieTable(True) # cache * self.rules.root = ExtendedTrieNode(phrase_location=PhraseLocation()) * if alignment is None: # <<<<<<<<<<<<<< @@ -39390,23 +39471,23 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ __pyx_t_3 = (((PyObject *)__pyx_v_alignment) == Py_None); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":339 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":334 * 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_107), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_k_tuple_107), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 334; __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 = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L3; } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":340 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":335 * if alignment is None: * raise Exception("Must specify an alignment object") * self.alignment = alignment # <<<<<<<<<<<<<< @@ -39419,7 +39500,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ __Pyx_DECREF(((PyObject *)__pyx_v_self->alignment)); __pyx_v_self->alignment = __pyx_v_alignment; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":344 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":339 * # grammar parameters and settings * # NOTE: setting max_nonterminals > 2 is not currently supported in Hiero * self.max_length = max_length # <<<<<<<<<<<<<< @@ -39428,7 +39509,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ */ __pyx_v_self->max_length = __pyx_v_max_length; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":345 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":340 * # NOTE: setting max_nonterminals > 2 is not currently supported in Hiero * self.max_length = max_length * self.max_nonterminals = max_nonterminals # <<<<<<<<<<<<<< @@ -39437,7 +39518,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ */ __pyx_v_self->max_nonterminals = __pyx_v_max_nonterminals; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":346 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":341 * self.max_length = max_length * self.max_nonterminals = max_nonterminals * self.max_initial_size = max_initial_size # <<<<<<<<<<<<<< @@ -39446,7 +39527,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ */ __pyx_v_self->max_initial_size = __pyx_v_max_initial_size; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":347 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":342 * self.max_nonterminals = max_nonterminals * self.max_initial_size = max_initial_size * self.train_max_initial_size = train_max_initial_size # <<<<<<<<<<<<<< @@ -39455,7 +39536,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ */ __pyx_v_self->train_max_initial_size = __pyx_v_train_max_initial_size; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":348 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":343 * self.max_initial_size = max_initial_size * self.train_max_initial_size = train_max_initial_size * self.min_gap_size = min_gap_size # <<<<<<<<<<<<<< @@ -39464,7 +39545,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ */ __pyx_v_self->min_gap_size = __pyx_v_min_gap_size; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":349 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":344 * 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 # <<<<<<<<<<<<<< @@ -39473,7 +39554,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ */ __pyx_v_self->train_min_gap_size = __pyx_v_train_min_gap_size; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":350 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":345 * self.min_gap_size = min_gap_size * self.train_min_gap_size = train_min_gap_size * self.category = sym_fromstring(category, False) # <<<<<<<<<<<<<< @@ -39482,7 +39563,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ */ __pyx_v_self->category = __pyx_f_3_sa_sym_fromstring(__pyx_v_category, 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":352 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":347 * self.category = sym_fromstring(category, False) * * if max_chunks is None: # <<<<<<<<<<<<<< @@ -39492,7 +39573,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ __pyx_t_3 = (__pyx_v_max_chunks == Py_None); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":353 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":348 * * if max_chunks is None: * self.max_chunks = self.max_nonterminals + 1 # <<<<<<<<<<<<<< @@ -39504,19 +39585,19 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":355 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":350 * self.max_chunks = self.max_nonterminals + 1 * else: * self.max_chunks = max_chunks # <<<<<<<<<<<<<< * * if max_target_chunks is None: */ - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_v_max_chunks); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_v_max_chunks); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->max_chunks = __pyx_t_4; } __pyx_L4:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":357 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":352 * self.max_chunks = max_chunks * * if max_target_chunks is None: # <<<<<<<<<<<<<< @@ -39526,7 +39607,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ __pyx_t_3 = (__pyx_v_max_target_chunks == Py_None); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":358 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":353 * * if max_target_chunks is None: * self.max_target_chunks = self.max_nonterminals + 1 # <<<<<<<<<<<<<< @@ -39538,19 +39619,19 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":360 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":355 * self.max_target_chunks = self.max_nonterminals + 1 * else: * self.max_target_chunks = max_target_chunks # <<<<<<<<<<<<<< * * if max_target_length is None: */ - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_v_max_target_chunks); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_v_max_target_chunks); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->max_target_chunks = __pyx_t_4; } __pyx_L5:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":362 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":357 * self.max_target_chunks = max_target_chunks * * if max_target_length is None: # <<<<<<<<<<<<<< @@ -39560,7 +39641,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ __pyx_t_3 = (__pyx_v_max_target_length == Py_None); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":363 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":358 * * if max_target_length is None: * self.max_target_length = max_initial_size # <<<<<<<<<<<<<< @@ -39572,26 +39653,26 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":365 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":360 * self.max_target_length = max_initial_size * else: * self.max_target_length = max_target_length # <<<<<<<<<<<<<< * * # algorithmic parameters and settings */ - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_v_max_target_length); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_v_max_target_length); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->max_target_length = __pyx_t_4; } __pyx_L6:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":368 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":363 * * # 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 = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 363; __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); @@ -39599,14 +39680,14 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ __pyx_v_self->precomputed_collocations = ((PyObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":369 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":364 * # 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 = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 364; __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); @@ -39614,7 +39695,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ __pyx_v_self->precomputed_index = ((PyObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":370 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":365 * self.precomputed_collocations = {} * self.precomputed_index = {} * self.use_index = use_index # <<<<<<<<<<<<<< @@ -39623,7 +39704,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ */ __pyx_v_self->use_index = __pyx_v_use_index; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":371 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":366 * self.precomputed_index = {} * self.use_index = use_index * self.use_collocations = use_collocations # <<<<<<<<<<<<<< @@ -39632,14 +39713,14 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ */ __pyx_v_self->use_collocations = __pyx_v_use_collocations; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":372 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":367 * 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 = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 367; __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); @@ -39647,7 +39728,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ __pyx_v_self->max_rank = ((PyObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":373 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":368 * self.use_collocations = use_collocations * self.max_rank = {} * self.precompute_file = precompute_file # <<<<<<<<<<<<<< @@ -39660,7 +39741,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ __Pyx_DECREF(__pyx_v_self->precompute_file); __pyx_v_self->precompute_file = __pyx_v_precompute_file; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":374 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":369 * self.max_rank = {} * self.precompute_file = precompute_file * self.precompute_rank = precompute_rank # <<<<<<<<<<<<<< @@ -39669,7 +39750,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ */ __pyx_v_self->precompute_rank = __pyx_v_precompute_rank; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":375 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":370 * self.precompute_file = precompute_file * self.precompute_rank = precompute_rank * self.precompute_secondary_rank = precompute_secondary_rank # <<<<<<<<<<<<<< @@ -39678,7 +39759,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ */ __pyx_v_self->precompute_secondary_rank = __pyx_v_precompute_secondary_rank; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":376 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":371 * self.precompute_rank = precompute_rank * self.precompute_secondary_rank = precompute_secondary_rank * self.use_baeza_yates = use_baeza_yates # <<<<<<<<<<<<<< @@ -39687,7 +39768,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ */ __pyx_v_self->use_baeza_yates = __pyx_v_use_baeza_yates; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":377 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":372 * self.precompute_secondary_rank = precompute_secondary_rank * self.use_baeza_yates = use_baeza_yates * self.by_slack_factor = by_slack_factor # <<<<<<<<<<<<<< @@ -39696,7 +39777,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ */ __pyx_v_self->by_slack_factor = __pyx_v_by_slack_factor; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":378 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":373 * self.use_baeza_yates = use_baeza_yates * self.by_slack_factor = by_slack_factor * self.tight_phrases = tight_phrases # <<<<<<<<<<<<<< @@ -39705,7 +39786,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ */ __pyx_v_self->tight_phrases = __pyx_v_tight_phrases; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":380 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":375 * self.tight_phrases = tight_phrases * * if require_aligned_chunks: # <<<<<<<<<<<<<< @@ -39714,7 +39795,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ */ if (__pyx_v_require_aligned_chunks) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":382 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":377 * if require_aligned_chunks: * # one condition is a stronger version of the other. * self.require_aligned_chunks = self.require_aligned_terminal = True # <<<<<<<<<<<<<< @@ -39726,7 +39807,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ goto __pyx_L7; } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":383 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":378 * # one condition is a stronger version of the other. * self.require_aligned_chunks = self.require_aligned_terminal = True * elif require_aligned_terminal: # <<<<<<<<<<<<<< @@ -39735,7 +39816,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ */ if (__pyx_v_require_aligned_terminal) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":384 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":379 * self.require_aligned_chunks = self.require_aligned_terminal = True * elif require_aligned_terminal: * self.require_aligned_chunks = False # <<<<<<<<<<<<<< @@ -39744,7 +39825,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ */ __pyx_v_self->require_aligned_chunks = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":385 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":380 * elif require_aligned_terminal: * self.require_aligned_chunks = False * self.require_aligned_terminal = True # <<<<<<<<<<<<<< @@ -39756,7 +39837,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":387 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":382 * self.require_aligned_terminal = True * else: * self.require_aligned_chunks = self.require_aligned_terminal = False # <<<<<<<<<<<<<< @@ -39768,7 +39849,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ } __pyx_L7:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":390 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":385 * * # diagnostics * self.prev_norm_prefix = () # <<<<<<<<<<<<<< @@ -39781,17 +39862,17 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ __Pyx_DECREF(__pyx_v_self->prev_norm_prefix); __pyx_v_self->prev_norm_prefix = ((PyObject *)__pyx_empty_tuple); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":392 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":387 * 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 = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 387; __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 = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 392; __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 = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 387; __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); @@ -39800,17 +39881,17 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ __pyx_v_self->findexes = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":393 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":388 * * 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 = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 388; __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 = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 393; __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 = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 388; __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); @@ -39819,7 +39900,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ __pyx_v_self->findexes1 = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":398 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":393 * * # True after data is added * self.online = False # <<<<<<<<<<<<<< @@ -39828,21 +39909,21 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ */ __pyx_v_self->online = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":401 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":396 * * # Keep track of everything that can be sampled: * self.samples_f = defaultdict(int) # <<<<<<<<<<<<<< * * # Phrase counts */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 396; __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 = 401; __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 = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type)))); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)(&PyInt_Type)))); __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type)))); - __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 396; __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_1)); __pyx_t_1 = 0; @@ -39852,21 +39933,21 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ __pyx_v_self->samples_f = __pyx_t_5; __pyx_t_5 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":404 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":399 * * # Phrase counts * self.phrases_f = defaultdict(int) # <<<<<<<<<<<<<< * self.phrases_e = defaultdict(int) * self.phrases_fe = defaultdict(lambda: defaultdict(int)) */ - __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 404; __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 = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type)))); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)(&PyInt_Type)))); __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type)))); - __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 399; __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_1)); __pyx_t_1 = 0; @@ -39876,21 +39957,21 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ __pyx_v_self->phrases_f = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":405 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":400 * # 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_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); 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_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 405; __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 = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type)))); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)(&PyInt_Type)))); __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type)))); - __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 400; __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_1)); __pyx_t_1 = 0; @@ -39900,23 +39981,23 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ __pyx_v_self->phrases_e = __pyx_t_5; __pyx_t_5 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":406 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":401 * 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_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_9__cinit___lambda1, 0, NULL, __pyx_n_s___sa, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_9__cinit___lambda1, 0, NULL, __pyx_n_s___sa, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 401; __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 = 406; __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 = 401; __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(__pyx_t_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 401; __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_2)); __pyx_t_2 = 0; @@ -39926,23 +40007,23 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ __pyx_v_self->phrases_fe = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":407 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":402 * self.phrases_e = defaultdict(int) * self.phrases_fe = defaultdict(lambda: defaultdict(int)) * self.phrases_al = defaultdict(lambda: defaultdict(tuple)) # <<<<<<<<<<<<<< * * # Bilexical counts */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); 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_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_9__cinit___1lambda2, 0, NULL, __pyx_n_s___sa, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_9__cinit___1lambda2, 0, NULL, __pyx_n_s___sa, NULL); 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); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 407; __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 = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; @@ -39952,21 +40033,21 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ __pyx_v_self->phrases_al = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":410 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":405 * * # Bilexical counts * self.bilex_f = defaultdict(int) # <<<<<<<<<<<<<< * self.bilex_e = defaultdict(int) * self.bilex_fe = defaultdict(lambda: defaultdict(int)) */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 410; __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 = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type)))); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)((PyObject*)(&PyInt_Type)))); __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type)))); - __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 405; __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_5)); __pyx_t_5 = 0; @@ -39976,21 +40057,21 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ __pyx_v_self->bilex_f = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":411 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":406 * # Bilexical counts * self.bilex_f = defaultdict(int) * self.bilex_e = defaultdict(int) # <<<<<<<<<<<<<< * self.bilex_fe = defaultdict(lambda: defaultdict(int)) * */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); 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_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 411; __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 = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type)))); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)((PyObject*)(&PyInt_Type)))); __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type)))); - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; @@ -40000,23 +40081,23 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_ __pyx_v_self->bilex_e = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":412 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":407 * self.bilex_f = defaultdict(int) * self.bilex_e = defaultdict(int) * self.bilex_fe = defaultdict(lambda: defaultdict(int)) # <<<<<<<<<<<<<< * * def configure(self, SuffixArray fsarray, DataArray edarray, */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __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_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_9__cinit___2lambda3, 0, NULL, __pyx_n_s___sa, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_9__cinit___2lambda3, 0, NULL, __pyx_n_s___sa, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __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_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 407; __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_1)); __pyx_t_1 = 0; @@ -40047,11 +40128,11 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_3configure(PyObject *__ struct __pyx_obj_3_sa_DataArray *__pyx_v_edarray = 0; struct __pyx_obj_3_sa_Sampler *__pyx_v_sampler = 0; struct __pyx_obj_3_sa_Scorer *__pyx_v_scorer = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fsarray,&__pyx_n_s__edarray,&__pyx_n_s__sampler,&__pyx_n_s__scorer,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("configure (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fsarray,&__pyx_n_s__edarray,&__pyx_n_s__sampler,&__pyx_n_s__scorer,0}; PyObject* values[4] = {0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -40067,30 +40148,26 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_3configure(PyObject *__ kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fsarray); - if (likely(values[0])) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fsarray)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__edarray); - if (likely(values[1])) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__edarray)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("configure", 1, 4, 4, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("configure", 1, 4, 4, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: - values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sampler); - if (likely(values[2])) kw_args--; + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sampler)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("configure", 1, 4, 4, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("configure", 1, 4, 4, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: - values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__scorer); - if (likely(values[3])) 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 = 414; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("configure", 1, 4, 4, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 409; __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 = 414; __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 = 409; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -40107,16 +40184,16 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_3configure(PyObject *__ } 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 = 414; __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 = 409; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.configure", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fsarray), __pyx_ptype_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_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_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_3_sa_Scorer, 1, "scorer", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fsarray), __pyx_ptype_3_sa_SuffixArray, 1, "fsarray", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_edarray), __pyx_ptype_3_sa_DataArray, 1, "edarray", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sampler), __pyx_ptype_3_sa_Sampler, 1, "sampler", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_scorer), __pyx_ptype_3_sa_Scorer, 1, "scorer", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_3_sa_23HieroCachingRuleFactory_2configure(((struct __pyx_obj_3_sa_HieroCachingRuleFactory *)__pyx_v_self), __pyx_v_fsarray, __pyx_v_edarray, __pyx_v_sampler, __pyx_v_scorer); goto __pyx_L0; __pyx_L1_error:; @@ -40126,7 +40203,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_3configure(PyObject *__ return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":414 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":409 * self.bilex_fe = defaultdict(lambda: defaultdict(int)) * * def configure(self, SuffixArray fsarray, DataArray edarray, # <<<<<<<<<<<<<< @@ -40144,7 +40221,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_2configure(struct __pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("configure", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":419 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":414 * Here we also use it to precompute the most expensive intersections * in the corpus quickly.''' * self.fsa = fsarray # <<<<<<<<<<<<<< @@ -40157,7 +40234,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_2configure(struct __pyx __Pyx_DECREF(((PyObject *)__pyx_v_self->fsa)); __pyx_v_self->fsa = __pyx_v_fsarray; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":420 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":415 * in the corpus quickly.''' * self.fsa = fsarray * self.fda = fsarray.darray # <<<<<<<<<<<<<< @@ -40170,7 +40247,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_2configure(struct __pyx __Pyx_DECREF(((PyObject *)__pyx_v_self->fda)); __pyx_v_self->fda = __pyx_v_fsarray->darray; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":421 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":416 * self.fsa = fsarray * self.fda = fsarray.darray * self.eda = edarray # <<<<<<<<<<<<<< @@ -40183,7 +40260,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_2configure(struct __pyx __Pyx_DECREF(((PyObject *)__pyx_v_self->eda)); __pyx_v_self->eda = __pyx_v_edarray; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":422 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":417 * self.fda = fsarray.darray * self.eda = edarray * self.fid2symid = self.set_idmap(self.fda) # <<<<<<<<<<<<<< @@ -40192,17 +40269,17 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_2configure(struct __pyx */ __pyx_t_1 = ((PyObject *)__pyx_v_self->fda); __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->set_idmap(__pyx_v_self, ((struct __pyx_obj_3_sa_DataArray *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->set_idmap(__pyx_v_self, ((struct __pyx_obj_3_sa_DataArray *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 417; __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_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 417; __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_3_sa_IntList *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":423 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":418 * self.eda = edarray * self.fid2symid = self.set_idmap(self.fda) * self.eid2symid = self.set_idmap(self.eda) # <<<<<<<<<<<<<< @@ -40211,31 +40288,31 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_2configure(struct __pyx */ __pyx_t_2 = ((PyObject *)__pyx_v_self->eda); __Pyx_INCREF(__pyx_t_2); - __pyx_t_1 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->set_idmap(__pyx_v_self, ((struct __pyx_obj_3_sa_DataArray *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->set_idmap(__pyx_v_self, ((struct __pyx_obj_3_sa_DataArray *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 418; __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_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 418; __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_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":424 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":419 * 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 = PyObject_GetAttr(((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_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__precompute); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 419; __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 = 424; __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 = 419; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":425 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":420 * self.eid2symid = self.set_idmap(self.eda) * self.precompute() * self.sampler = sampler # <<<<<<<<<<<<<< @@ -40248,7 +40325,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_2configure(struct __pyx __Pyx_DECREF(((PyObject *)__pyx_v_self->sampler)); __pyx_v_self->sampler = __pyx_v_sampler; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":426 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":421 * self.precompute() * self.sampler = sampler * self.scorer = scorer # <<<<<<<<<<<<<< @@ -40274,7 +40351,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_2configure(struct __pyx return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":428 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":423 * self.scorer = scorer * * cdef set_idmap(self, DataArray darray): # <<<<<<<<<<<<<< @@ -40299,7 +40376,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_set_idmap(CYTHON_UNUSED int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_idmap", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":432 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":427 * cdef IntList idmap * * N = len(darray.id2word) # <<<<<<<<<<<<<< @@ -40308,30 +40385,30 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_set_idmap(CYTHON_UNUSED */ __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 = 432; __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 = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_N = __pyx_t_2; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":433 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":428 * * 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 = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 428; __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 = 433; __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 = 428; __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 = 433; __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 = 428; __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_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 428; __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_3_sa_IntList *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":434 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":429 * N = len(darray.id2word) * idmap = IntList(initial_len=N) * for word_id from 0 <= word_id < N: # <<<<<<<<<<<<<< @@ -40341,20 +40418,20 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_set_idmap(CYTHON_UNUSED __pyx_t_4 = __pyx_v_N; for (__pyx_v_word_id = 0; __pyx_v_word_id < __pyx_t_4; __pyx_v_word_id++) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":435 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":430 * 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); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_darray->id2word, __pyx_v_word_id, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyBytes_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_t_5 = PyBytes_AsString(__pyx_t_3); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_new_word_id = __pyx_f_3_sa_sym_fromstring(__pyx_t_5, 1); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":436 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":431 * 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 # <<<<<<<<<<<<<< @@ -40364,7 +40441,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_set_idmap(CYTHON_UNUSED (__pyx_v_idmap->arr[__pyx_v_word_id]) = __pyx_v_new_word_id; } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":437 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":432 * new_word_id = sym_fromstring(darray.id2word[word_id], True) * idmap.arr[word_id] = new_word_id * return idmap # <<<<<<<<<<<<<< @@ -40401,7 +40478,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_5pattern2phrase(PyObjec return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":440 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":435 * * * def pattern2phrase(self, pattern): # <<<<<<<<<<<<<< @@ -40429,7 +40506,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_4pattern2phrase(struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pattern2phrase", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":442 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":437 * def pattern2phrase(self, pattern): * # pattern is a tuple, which we must convert to a hiero Phrase * result = () # <<<<<<<<<<<<<< @@ -40439,7 +40516,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_4pattern2phrase(struct __Pyx_INCREF(((PyObject *)__pyx_empty_tuple)); __pyx_v_result = __pyx_empty_tuple; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":443 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":438 * # pattern is a tuple, which we must convert to a hiero Phrase * result = () * arity = 0 # <<<<<<<<<<<<<< @@ -40449,7 +40526,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_4pattern2phrase(struct __Pyx_INCREF(__pyx_int_0); __pyx_v_arity = __pyx_int_0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":444 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":439 * result = () * arity = 0 * for word_id in pattern: # <<<<<<<<<<<<<< @@ -40460,23 +40537,31 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_4pattern2phrase(struct __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 = 444; __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 = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; } for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #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 = 439; __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 = 439; __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; - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #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 = 439; __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 = 439; __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 = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -40486,75 +40571,74 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_4pattern2phrase(struct __pyx_v_word_id = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":445 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":440 * 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); 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_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_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 = 440; __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 = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":446 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":441 * 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 = 446; __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 = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_v_arity); __pyx_v_arity = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":447 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":442 * 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 = 447; __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 = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_new_id = __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_t_6); goto __pyx_L5; } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":449 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":444 * 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 = 449; __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 = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyBytes_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_t_7 = PyBytes_AsString(__pyx_t_4); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_new_id = __pyx_f_3_sa_sym_fromstring(__pyx_t_7, 1); } __pyx_L5:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":450 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":445 * 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 = 450; __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 = 445; __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 = 450; __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 = 445; __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 = 450; __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 = 445; __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(((PyObject *)__pyx_v_result)); @@ -40563,7 +40647,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_4pattern2phrase(struct } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":451 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":446 * new_id = sym_fromstring(self.fda.id2word[word_id], True) * result = result + (new_id,) * return Phrase(result) # <<<<<<<<<<<<<< @@ -40571,12 +40655,12 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_4pattern2phrase(struct * 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 = 451; __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 = 446; __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_3_sa_Phrase)), ((PyObject *)__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_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); 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(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __pyx_r = __pyx_t_4; @@ -40611,7 +40695,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_7pattern2phrase_plus(Py return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":453 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":448 * return Phrase(result) * * def pattern2phrase_plus(self, pattern): # <<<<<<<<<<<<<< @@ -40641,19 +40725,19 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_6pattern2phrase_plus(st int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pattern2phrase_plus", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":456 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":451 * # 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 = 456; __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 = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_patterns = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":457 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":452 * # suffixed/prefixed with the NT category. * patterns = [] * result = () # <<<<<<<<<<<<<< @@ -40663,7 +40747,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_6pattern2phrase_plus(st __Pyx_INCREF(((PyObject *)__pyx_empty_tuple)); __pyx_v_result = __pyx_empty_tuple; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":458 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":453 * patterns = [] * result = () * arity = 0 # <<<<<<<<<<<<<< @@ -40673,7 +40757,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_6pattern2phrase_plus(st __Pyx_INCREF(__pyx_int_0); __pyx_v_arity = __pyx_int_0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":459 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":454 * result = () * arity = 0 * for word_id in pattern: # <<<<<<<<<<<<<< @@ -40684,23 +40768,31 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_6pattern2phrase_plus(st __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 = 459; __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 = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; } for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #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 = 454; __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 = 454; __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; - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #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 = 454; __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 = 454; __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 = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -40710,75 +40802,74 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_6pattern2phrase_plus(st __pyx_v_word_id = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":460 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":455 * 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); 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_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_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 = 455; __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 = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":461 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":456 * 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 = 461; __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 = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_v_arity); __pyx_v_arity = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":462 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":457 * 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 = 462; __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 = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_new_id = __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_t_6); goto __pyx_L5; } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":464 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":459 * 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 = 464; __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 = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyBytes_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_t_7 = PyBytes_AsString(__pyx_t_4); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_new_id = __pyx_f_3_sa_sym_fromstring(__pyx_t_7, 1); } __pyx_L5:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":465 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":460 * 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 = 465; __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 = 460; __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 = 465; __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 = 460; __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 = 465; __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 = 460; __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(((PyObject *)__pyx_v_result)); @@ -40787,81 +40878,81 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_6pattern2phrase_plus(st } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":466 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":461 * 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 = 466; __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); __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_3_sa_Phrase)), ((PyObject *)__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_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_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 = 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_t_9 = 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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":467 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":462 * 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_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_t_4 = PyInt_FromLong(__pyx_f_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 = 467; __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_v_result), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 467; __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 = 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 = 467; __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_3_sa_Phrase)), ((PyObject *)__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_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_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 = 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_t_9 = 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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":468 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":463 * 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_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_t_4 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 463; __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 = 468; __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 = 463; __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 = 468; __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 = 463; __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 = 468; __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 = 463; __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_3_sa_Phrase)), ((PyObject *)__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_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 463; __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 = 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_t_9 = PyList_Append(__pyx_v_patterns, __pyx_t_4); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":469 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":464 * patterns.append(Phrase(result + (sym_setindex(self.category, 1),))) * patterns.append(Phrase((sym_setindex(self.category, 1),) + result)) * return patterns # <<<<<<<<<<<<<< @@ -40902,7 +40993,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_9precompute(PyObject *_ return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":471 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":466 * return patterns * * def precompute(self): # <<<<<<<<<<<<<< @@ -40926,9 +41017,9 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; Py_ssize_t __pyx_t_6; - PyObject *(*__pyx_t_7)(PyObject *); - PyObject *__pyx_t_8 = NULL; - PyObject *(*__pyx_t_9)(PyObject *); + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; Py_ssize_t __pyx_t_10; PyObject *(*__pyx_t_11)(PyObject *); int __pyx_lineno = 0; @@ -40936,7 +41027,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("precompute", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":474 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":469 * cdef Precomputation pre * * if self.precompute_file is not None: # <<<<<<<<<<<<<< @@ -40946,34 +41037,34 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py __pyx_t_1 = (__pyx_v_self->precompute_file != Py_None); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":475 + /* "/home/pauldb/workspace/cdec/python/src/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) */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); 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_2); __pyx_t_2 = 0; __pyx_v_start_time = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":476 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":471 * 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_3 = __Pyx_GetName(__pyx_m, __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_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 476; __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 = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_kp_s_108)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_108)); @@ -40981,29 +41072,29 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py __Pyx_INCREF(__pyx_v_self->precompute_file); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->precompute_file); __Pyx_GIVEREF(__pyx_v_self->precompute_file); - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 471; __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_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":477 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":472 * 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_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__from_binary), __pyx_v_self->precompute_file) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Precomputation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__from_binary), __pyx_v_self->precompute_file) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Precomputation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_v_pre = ((struct __pyx_obj_3_sa_Precomputation *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":479 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":474 * 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: # <<<<<<<<<<<<<< @@ -41013,23 +41104,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py __pyx_t_1 = (__pyx_v_pre->max_nonterminals != __pyx_v_self->max_nonterminals); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":480 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":475 * # 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_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__warn); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__warn); 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_t_3 = PyInt_FromLong(__pyx_v_pre->max_nonterminals); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(__pyx_v_pre->max_nonterminals); 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_2 = PyInt_FromLong(__pyx_v_self->max_nonterminals); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong(__pyx_v_self->max_nonterminals); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 475; __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 = 480; __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 = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_kp_s_109)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_109)); @@ -41040,7 +41131,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py __Pyx_GIVEREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 475; __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_5)); __pyx_t_5 = 0; @@ -41049,7 +41140,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py } __pyx_L4:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":481 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":476 * 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: # <<<<<<<<<<<<<< @@ -41059,23 +41150,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py __pyx_t_1 = (__pyx_v_pre->max_length != __pyx_v_self->max_length); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":482 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":477 * 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_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__warn); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__warn); 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); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyInt_FromLong(__pyx_v_pre->max_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong(__pyx_v_pre->max_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyInt_FromLong(__pyx_v_self->max_length); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(__pyx_v_self->max_length); 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_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 482; __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 = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_kp_s_110)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_110)); @@ -41086,7 +41177,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py __Pyx_GIVEREF(__pyx_t_4); __pyx_t_2 = 0; __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), NULL); 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(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; @@ -41095,7 +41186,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py } __pyx_L5:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":483 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":478 * 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: # <<<<<<<<<<<<<< @@ -41105,18 +41196,18 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py __pyx_t_1 = (__pyx_v_pre->train_max_initial_size != __pyx_v_self->train_max_initial_size); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":484 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":479 * 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_4 = PyInt_FromLong(__pyx_v_pre->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_t_4 = PyInt_FromLong(__pyx_v_pre->train_max_initial_size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyInt_FromLong(__pyx_v_self->train_max_initial_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(__pyx_v_self->train_max_initial_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 484; __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 = 479; __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); @@ -41124,25 +41215,25 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py __Pyx_GIVEREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_111), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_111), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __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 = 484; __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 = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_3)); __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":485 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":480 * 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: # <<<<<<<<<<<<<< @@ -41152,18 +41243,18 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py __pyx_t_1 = (__pyx_v_pre->train_min_gap_size != __pyx_v_self->train_min_gap_size); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":486 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":481 * 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_3 = PyInt_FromLong(__pyx_v_pre->train_min_gap_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(__pyx_v_pre->train_min_gap_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyInt_FromLong(__pyx_v_self->train_min_gap_size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(__pyx_v_self->train_min_gap_size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 481; __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 = 486; __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 = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); @@ -41171,25 +41262,25 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py __Pyx_GIVEREF(__pyx_t_5); __pyx_t_3 = 0; __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_112), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_112), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_5)); __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 486; __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 = 481; __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)); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(((PyObject *)__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[8]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L7; } __pyx_L7:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":487 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":482 * 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: # <<<<<<<<<<<<<< @@ -41198,25 +41289,25 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py */ if (__pyx_v_self->use_index) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":488 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":483 * 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_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__info); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__info); 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_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __pyx_v_pre->precomputed_index; __Pyx_INCREF(__pyx_t_5); - __pyx_t_6 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __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 = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __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 = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_kp_s_113)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_113)); @@ -41224,123 +41315,65 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":489 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":484 * 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) * for phrase in phrases: */ - __pyx_t_5 = PyObject_GetAttr(__pyx_v_pre->precomputed_index, __pyx_n_s__iteritems); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) { - __pyx_t_5 = __pyx_t_3; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0; - __pyx_t_7 = NULL; - } else { - __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; + __pyx_t_6 = 0; + if (unlikely(__pyx_v_pre->precomputed_index == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems"); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - for (;;) { - if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_5)) { - if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break; - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; - } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_5)) { - if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break; - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; - } else { - __pyx_t_3 = __pyx_t_7(__pyx_t_5); - if (unlikely(!__pyx_t_3)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - break; - } - __Pyx_GOTREF(__pyx_t_3); - } - if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { - PyObject* sequence = __pyx_t_3; - if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { - if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); - } else { - if (unlikely(PyList_GET_SIZE(sequence) != 2)) { - if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_4 = PyList_GET_ITEM(sequence, 0); - __pyx_t_2 = PyList_GET_ITEM(sequence, 1); - } - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext; - index = 0; __pyx_t_4 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_4)) goto __pyx_L11_unpacking_failed; - __Pyx_GOTREF(__pyx_t_4); - index = 1; __pyx_t_2 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L11_unpacking_failed; - __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - goto __pyx_L12_unpacking_done; - __pyx_L11_unpacking_failed:; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_L12_unpacking_done:; - } + __pyx_t_3 = __Pyx_dict_iterator(__pyx_v_pre->precomputed_index, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_7), (&__pyx_t_8)); 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_XDECREF(__pyx_t_5); + __pyx_t_5 = __pyx_t_3; + __pyx_t_3 = 0; + while (1) { + __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_5, __pyx_t_7, &__pyx_t_6, &__pyx_t_3, &__pyx_t_4, NULL, __pyx_t_8); + if (unlikely(__pyx_t_9 == 0)) break; + if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF(__pyx_v_pattern); - __pyx_v_pattern = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_v_pattern = __pyx_t_3; + __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_v_arr); - __pyx_v_arr = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_v_arr = __pyx_t_4; + __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":490 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":485 * 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_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__pattern2phrase_plus); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__pattern2phrase_plus); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 485; __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 = 485; __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 = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_pattern); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_pattern); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_pattern); __Pyx_GIVEREF(__pyx_v_pattern); - __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 = 490; __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_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 485; __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_XDECREF(__pyx_v_phrases); - __pyx_v_phrases = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_v_phrases = __pyx_t_2; + __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":491 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":486 * for pattern, arr in pre.precomputed_index.iteritems(): * phrases = self.pattern2phrase_plus(pattern) * for phrase in phrases: # <<<<<<<<<<<<<< @@ -41348,52 +41381,60 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py * if self.use_collocations: */ if (PyList_CheckExact(__pyx_v_phrases) || PyTuple_CheckExact(__pyx_v_phrases)) { - __pyx_t_4 = __pyx_v_phrases; __Pyx_INCREF(__pyx_t_4); __pyx_t_10 = 0; + __pyx_t_2 = __pyx_v_phrases; __Pyx_INCREF(__pyx_t_2); __pyx_t_10 = 0; __pyx_t_11 = NULL; } else { - __pyx_t_10 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_phrases); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_11 = Py_TYPE(__pyx_t_4)->tp_iternext; + __pyx_t_10 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_phrases); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_11 = Py_TYPE(__pyx_t_2)->tp_iternext; } for (;;) { - if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_4)) { - if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_4)) break; - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; - } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_4)) { - if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_4)) break; - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; + if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_2)) { + if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_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[8]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_2)) { + if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_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[8]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else { - __pyx_t_2 = __pyx_t_11(__pyx_t_4); - if (unlikely(!__pyx_t_2)) { + __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(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } - __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF(__pyx_v_phrase); - __pyx_v_phrase = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_v_phrase = __pyx_t_3; + __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":492 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":487 * 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 = 492; __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 = 487; __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_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L8; } __pyx_L8:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":493 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":488 * for phrase in phrases: * self.precomputed_index[phrase] = arr * if self.use_collocations: # <<<<<<<<<<<<<< @@ -41402,141 +41443,83 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py */ if (__pyx_v_self->use_collocations) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":494 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":489 * 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_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__info); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __pyx_v_pre->precomputed_collocations; __Pyx_INCREF(__pyx_t_5); - __pyx_t_6 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 494; __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 = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_kp_s_114)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_114)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_114)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_114)); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":495 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":490 * 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) * self.precomputed_collocations[phrase] = arr */ - __pyx_t_5 = PyObject_GetAttr(__pyx_v_pre->precomputed_collocations, __pyx_n_s__iteritems); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { - __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0; - __pyx_t_7 = NULL; - } else { - __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; + __pyx_t_7 = 0; + if (unlikely(__pyx_v_pre->precomputed_collocations == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems"); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - for (;;) { - if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_5)) { - if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break; - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; - } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_5)) { - if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break; - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; - } else { - __pyx_t_2 = __pyx_t_7(__pyx_t_5); - if (unlikely(!__pyx_t_2)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - break; - } - __Pyx_GOTREF(__pyx_t_2); - } - if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { - PyObject* sequence = __pyx_t_2; - if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { - if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); - } else { - if (unlikely(PyList_GET_SIZE(sequence) != 2)) { - if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_4 = PyList_GET_ITEM(sequence, 0); - __pyx_t_3 = PyList_GET_ITEM(sequence, 1); - } - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext; - index = 0; __pyx_t_4 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_4)) goto __pyx_L18_unpacking_failed; - __Pyx_GOTREF(__pyx_t_4); - index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L18_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - goto __pyx_L19_unpacking_done; - __pyx_L18_unpacking_failed:; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_L19_unpacking_done:; - } + __pyx_t_3 = __Pyx_dict_iterator(__pyx_v_pre->precomputed_collocations, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_6), (&__pyx_t_8)); 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_XDECREF(__pyx_t_5); + __pyx_t_5 = __pyx_t_3; + __pyx_t_3 = 0; + while (1) { + __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_5, __pyx_t_6, &__pyx_t_7, &__pyx_t_3, &__pyx_t_2, NULL, __pyx_t_8); + if (unlikely(__pyx_t_9 == 0)) break; + if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF(__pyx_v_pattern); - __pyx_v_pattern = __pyx_t_4; - __pyx_t_4 = 0; - __Pyx_XDECREF(__pyx_v_arr); - __pyx_v_arr = __pyx_t_3; + __pyx_v_pattern = __pyx_t_3; __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_v_arr); + __pyx_v_arr = __pyx_t_2; + __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":496 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":491 * 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_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__pattern2phrase); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__pattern2phrase); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 491; __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 = 496; __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 = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_pattern); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_pattern); __Pyx_GIVEREF(__pyx_v_pattern); - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 491; __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; @@ -41544,50 +41527,50 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py __pyx_v_phrase = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":497 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":492 * 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 = 497; __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 = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L15; + goto __pyx_L13; } - __pyx_L15:; + __pyx_L13:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":498 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":493 * 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_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__monitor_cpu); 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 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 498; __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 = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_stop_time = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":499 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":494 * self.precomputed_collocations[phrase] = arr * stop_time = monitor_cpu() * logger.info("Processing precomputations took %f seconds", stop_time - start_time) # <<<<<<<<<<<<<< * * */ - __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); 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_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__info); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__info); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Subtract(__pyx_v_stop_time, __pyx_v_start_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Subtract(__pyx_v_stop_time, __pyx_v_start_time); 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_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __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 = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_kp_s_115)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_115)); @@ -41595,7 +41578,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), NULL); 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_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; @@ -41611,7 +41594,6 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.precompute", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -41638,7 +41620,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_11get_precomputed_collo return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":502 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":497 * * * def get_precomputed_collocation(self, phrase): # <<<<<<<<<<<<<< @@ -41660,29 +41642,29 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_10get_precomputed_collo int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_precomputed_collocation", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":503 + /* "/home/pauldb/workspace/cdec/python/src/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) */ - __pyx_t_1 = ((PySequence_Contains(__pyx_v_self->precomputed_collocations, __pyx_v_phrase))); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 503; __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 = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":504 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":499 * 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_2 = PyObject_GetItem(__pyx_v_self->precomputed_collocations, __pyx_v_phrase); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetItem(__pyx_v_self->precomputed_collocations, __pyx_v_phrase); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_v_arr = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":505 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":500 * 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) # <<<<<<<<<<<<<< @@ -41690,26 +41672,26 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_10get_precomputed_collo * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__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_2, ((PyObject *)__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_3 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__arr), __pyx_v_arr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__arr_low), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__arr_high), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__arr_high), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_GetAttr(__pyx_v_phrase, __pyx_n_s__arity); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_v_phrase, __pyx_n_s__arity); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 500; __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 = 505; __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 = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__num_subpatterns), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__num_subpatterns), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __pyx_r = __pyx_t_4; @@ -41719,7 +41701,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_10get_precomputed_collo } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":506 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":501 * arr = self.precomputed_collocations[phrase] * return PhraseLocation(arr=arr, arr_low=0, arr_high=len(arr), num_subpatterns=phrase.arity()+1) * return None # <<<<<<<<<<<<<< @@ -41746,7 +41728,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_10get_precomputed_collo return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":509 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":504 * * * cdef int* baeza_yates_helper(self, int low1, int high1, int* arr1, int step1, # <<<<<<<<<<<<<< @@ -41792,7 +41774,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("baeza_yates_helper", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":522 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":517 * cdef Matching loc1, loc2 * * result = malloc(0*sizeof(int*)) # <<<<<<<<<<<<<< @@ -41801,7 +41783,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_result = ((int *)malloc((0 * (sizeof(int *))))); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":524 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":519 * result = malloc(0*sizeof(int*)) * * d_first = 0 # <<<<<<<<<<<<<< @@ -41810,7 +41792,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_d_first = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":525 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":520 * * d_first = 0 * if high1 - low1 > high2 - low2: # <<<<<<<<<<<<<< @@ -41820,7 +41802,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p __pyx_t_1 = ((__pyx_v_high1 - __pyx_v_low1) > (__pyx_v_high2 - __pyx_v_low2)); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":526 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":521 * d_first = 0 * if high1 - low1 > high2 - low2: * d_first = 1 # <<<<<<<<<<<<<< @@ -41832,7 +41814,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":530 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":525 * # 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: # <<<<<<<<<<<<<< @@ -41848,7 +41830,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p } if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":531 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":526 * # Case 1: one of the sets is empty * if low1 >= high1 or low2 >= high2: * return result # <<<<<<<<<<<<<< @@ -41861,7 +41843,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p } __pyx_L4:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":534 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":529 * * # Case 2: sets are non-overlapping * assign_matching(&loc1, arr1, high1-step1, step1, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -41870,7 +41852,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_f_3_sa_assign_matching((&__pyx_v_loc1), __pyx_v_arr1, (__pyx_v_high1 - __pyx_v_step1), __pyx_v_step1, __pyx_v_self->fda->sent_id->arr); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":535 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":530 * # 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) # <<<<<<<<<<<<<< @@ -41879,7 +41861,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_f_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_low2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":536 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":531 * 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: # <<<<<<<<<<<<<< @@ -41889,7 +41871,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p __pyx_t_3 = (((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last) == -1); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":537 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":532 * 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 # <<<<<<<<<<<<<< @@ -41902,7 +41884,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p } __pyx_L5:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":539 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":534 * return result * * assign_matching(&loc1, arr1, low1, step1, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -41911,7 +41893,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_f_3_sa_assign_matching((&__pyx_v_loc1), __pyx_v_arr1, __pyx_v_low1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":540 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -41920,7 +41902,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_f_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, (__pyx_v_high2 - __pyx_v_step2), __pyx_v_step2, __pyx_v_self->fda->sent_id->arr); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":541 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":536 * 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: # <<<<<<<<<<<<<< @@ -41930,7 +41912,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p __pyx_t_3 = (((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last) == 1); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":542 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":537 * 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 # <<<<<<<<<<<<<< @@ -41943,7 +41925,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p } __pyx_L6:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":546 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":541 * # Case 3: query set and data set do not meet size mismatch constraints; * # We use mergesort instead in this case * qsetsize = (high1-low1) / step1 # <<<<<<<<<<<<<< @@ -41953,15 +41935,15 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p __pyx_t_4 = (__pyx_v_high1 - __pyx_v_low1); if (unlikely(__pyx_v_step1 == 0)) { PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 546; __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_step1 == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_t_4))) { PyErr_Format(PyExc_OverflowError, "value too large to perform division"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_v_qsetsize = __Pyx_div_int(__pyx_t_4, __pyx_v_step1); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":547 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":542 * # We use mergesort instead in this case * qsetsize = (high1-low1) / step1 * dsetsize = (high2-low2) / step2 # <<<<<<<<<<<<<< @@ -41971,15 +41953,15 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p __pyx_t_4 = (__pyx_v_high2 - __pyx_v_low2); if (unlikely(__pyx_v_step2 == 0)) { PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 542; __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))) { PyErr_Format(PyExc_OverflowError, "value too large to perform division"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_v_dsetsize = __Pyx_div_int(__pyx_t_4, __pyx_v_step2); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":548 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":543 * qsetsize = (high1-low1) / step1 * dsetsize = (high2-low2) / step2 * if d_first: # <<<<<<<<<<<<<< @@ -41988,7 +41970,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ if (__pyx_v_d_first) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":549 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":544 * dsetsize = (high2-low2) / step2 * if d_first: * tmp = qsetsize # <<<<<<<<<<<<<< @@ -41997,7 +41979,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_tmp = __pyx_v_qsetsize; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":550 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":545 * if d_first: * tmp = qsetsize * qsetsize = dsetsize # <<<<<<<<<<<<<< @@ -42006,7 +41988,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_qsetsize = __pyx_v_dsetsize; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":551 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":546 * tmp = qsetsize * qsetsize = dsetsize * dsetsize = tmp # <<<<<<<<<<<<<< @@ -42018,7 +42000,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p } __pyx_L7:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":553 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":548 * dsetsize = tmp * * if self.by_slack_factor * qsetsize * log(dsetsize) / log(2) > dsetsize: # <<<<<<<<<<<<<< @@ -42029,12 +42011,12 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p __pyx_t_6 = log(2.0); if (unlikely(__pyx_t_6 == 0)) { PyErr_Format(PyExc_ZeroDivisionError, "float division"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_3 = ((__pyx_t_5 / __pyx_t_6) > __pyx_v_dsetsize); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":554 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":549 * * if self.by_slack_factor * qsetsize * log(dsetsize) / log(2) > dsetsize: * free(result) # <<<<<<<<<<<<<< @@ -42043,7 +42025,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ free(__pyx_v_result); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":555 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":550 * 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) # <<<<<<<<<<<<<< @@ -42056,7 +42038,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p } __pyx_L8:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":559 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":554 * # binary search. There are two flavors, depending on * # whether the queryset or dataset is first * if d_first: # <<<<<<<<<<<<<< @@ -42065,7 +42047,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ if (__pyx_v_d_first) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":560 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":555 * # whether the queryset or dataset is first * if d_first: * med2 = median(low2, high2, step2) # <<<<<<<<<<<<<< @@ -42074,7 +42056,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_med2 = __pyx_f_3_sa_median(__pyx_v_low2, __pyx_v_high2, __pyx_v_step2); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":561 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":556 * if d_first: * med2 = median(low2, high2, step2) * assign_matching(&loc2, arr2, med2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -42083,7 +42065,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_f_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_med2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":563 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":558 * assign_matching(&loc2, arr2, med2, step2, self.fda.sent_id.arr) * * search_low = low1 # <<<<<<<<<<<<<< @@ -42092,7 +42074,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_search_low = __pyx_v_low1; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":564 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":559 * * search_low = low1 * search_high = high1 # <<<<<<<<<<<<<< @@ -42101,7 +42083,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_search_high = __pyx_v_high1; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":565 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":560 * search_low = low1 * search_high = high1 * while search_low < search_high: # <<<<<<<<<<<<<< @@ -42112,7 +42094,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p __pyx_t_3 = (__pyx_v_search_low < __pyx_v_search_high); if (!__pyx_t_3) break; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":566 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":561 * search_high = high1 * while search_low < search_high: * med1 = median(search_low, search_high, step1) # <<<<<<<<<<<<<< @@ -42121,7 +42103,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_med1 = __pyx_f_3_sa_median(__pyx_v_search_low, __pyx_v_search_high, __pyx_v_step1); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":567 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":562 * while search_low < search_high: * med1 = median(search_low, search_high, step1) * find_comparable_matchings(low1, high1, arr1, step1, med1, &med1_minus, &med1_plus) # <<<<<<<<<<<<<< @@ -42130,7 +42112,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_f_3_sa_find_comparable_matchings(__pyx_v_low1, __pyx_v_high1, __pyx_v_arr1, __pyx_v_step1, __pyx_v_med1, (&__pyx_v_med1_minus), (&__pyx_v_med1_plus)); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":568 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":563 * 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) # <<<<<<<<<<<<<< @@ -42139,7 +42121,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_comparison = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings_set(__pyx_v_self, __pyx_v_med1_minus, __pyx_v_med1_plus, __pyx_v_arr1, __pyx_v_step1, (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":571 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":566 * if comparison == -1: * search_low = med1_plus * elif comparison == 1: # <<<<<<<<<<<<<< @@ -42148,7 +42130,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ switch (__pyx_v_comparison) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":569 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":564 * 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: # <<<<<<<<<<<<<< @@ -42157,7 +42139,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ case -1: - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":570 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":565 * comparison = self.compare_matchings_set(med1_minus, med1_plus, arr1, step1, &loc2, offset_by_one, len_last) * if comparison == -1: * search_low = med1_plus # <<<<<<<<<<<<<< @@ -42167,7 +42149,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p __pyx_v_search_low = __pyx_v_med1_plus; break; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":571 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":566 * if comparison == -1: * search_low = med1_plus * elif comparison == 1: # <<<<<<<<<<<<<< @@ -42176,7 +42158,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ case 1: - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":572 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":567 * search_low = med1_plus * elif comparison == 1: * search_high = med1_minus # <<<<<<<<<<<<<< @@ -42187,7 +42169,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p break; default: - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":574 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":569 * search_high = med1_minus * else: * break # <<<<<<<<<<<<<< @@ -42203,7 +42185,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":576 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":571 * break * else: * med1 = median(low1, high1, step1) # <<<<<<<<<<<<<< @@ -42212,7 +42194,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_med1 = __pyx_f_3_sa_median(__pyx_v_low1, __pyx_v_high1, __pyx_v_step1); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":577 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":572 * else: * med1 = median(low1, high1, step1) * find_comparable_matchings(low1, high1, arr1, step1, med1, &med1_minus, &med1_plus) # <<<<<<<<<<<<<< @@ -42221,7 +42203,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_f_3_sa_find_comparable_matchings(__pyx_v_low1, __pyx_v_high1, __pyx_v_arr1, __pyx_v_step1, __pyx_v_med1, (&__pyx_v_med1_minus), (&__pyx_v_med1_plus)); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":579 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":574 * find_comparable_matchings(low1, high1, arr1, step1, med1, &med1_minus, &med1_plus) * * search_low = low2 # <<<<<<<<<<<<<< @@ -42230,7 +42212,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_search_low = __pyx_v_low2; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":580 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":575 * * search_low = low2 * search_high = high2 # <<<<<<<<<<<<<< @@ -42239,7 +42221,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_search_high = __pyx_v_high2; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":581 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":576 * search_low = low2 * search_high = high2 * while search_low < search_high: # <<<<<<<<<<<<<< @@ -42250,7 +42232,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p __pyx_t_3 = (__pyx_v_search_low < __pyx_v_search_high); if (!__pyx_t_3) break; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":582 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":577 * search_high = high2 * while search_low < search_high: * med2 = median(search_low, search_high, step2) # <<<<<<<<<<<<<< @@ -42259,7 +42241,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_med2 = __pyx_f_3_sa_median(__pyx_v_search_low, __pyx_v_search_high, __pyx_v_step2); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":583 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":578 * while search_low < search_high: * med2 = median(search_low, search_high, step2) * assign_matching(&loc2, arr2, med2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -42268,7 +42250,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_f_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_med2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":584 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":579 * 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) # <<<<<<<<<<<<<< @@ -42277,7 +42259,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_comparison = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings_set(__pyx_v_self, __pyx_v_med1_minus, __pyx_v_med1_plus, __pyx_v_arr1, __pyx_v_step1, (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":587 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":582 * if comparison == -1: * search_high = med2 * elif comparison == 1: # <<<<<<<<<<<<<< @@ -42286,7 +42268,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ switch (__pyx_v_comparison) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":585 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":580 * 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: # <<<<<<<<<<<<<< @@ -42295,7 +42277,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ case -1: - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":586 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":581 * comparison = self.compare_matchings_set(med1_minus, med1_plus, arr1, step1, &loc2, offset_by_one, len_last) * if comparison == -1: * search_high = med2 # <<<<<<<<<<<<<< @@ -42305,7 +42287,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p __pyx_v_search_high = __pyx_v_med2; break; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":587 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":582 * if comparison == -1: * search_high = med2 * elif comparison == 1: # <<<<<<<<<<<<<< @@ -42314,7 +42296,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ case 1: - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":588 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":583 * search_high = med2 * elif comparison == 1: * search_low = med2 + step2 # <<<<<<<<<<<<<< @@ -42325,7 +42307,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p break; default: - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":590 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":585 * search_low = med2 + step2 * else: * break # <<<<<<<<<<<<<< @@ -42340,7 +42322,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p } __pyx_L9:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":592 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":587 * break * * med_result_len = 0 # <<<<<<<<<<<<<< @@ -42349,7 +42331,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_med_result_len = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":593 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":588 * * med_result_len = 0 * med_result = malloc(0*sizeof(int*)) # <<<<<<<<<<<<<< @@ -42358,7 +42340,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_med_result = ((int *)malloc((0 * (sizeof(int *))))); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":594 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":589 * med_result_len = 0 * med_result = malloc(0*sizeof(int*)) * if search_high > search_low: # <<<<<<<<<<<<<< @@ -42368,7 +42350,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p __pyx_t_3 = (__pyx_v_search_high > __pyx_v_search_low); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":600 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":595 * # want to store the bindings for all of those elements. We can * # subsequently throw all of them away. * med2_minus = med2 # <<<<<<<<<<<<<< @@ -42377,7 +42359,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_med2_minus = __pyx_v_med2; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":601 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":596 * # subsequently throw all of them away. * med2_minus = med2 * med2_plus = med2 + step2 # <<<<<<<<<<<<<< @@ -42386,7 +42368,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_med2_plus = (__pyx_v_med2 + __pyx_v_step2); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":602 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":597 * med2_minus = med2 * med2_plus = med2 + step2 * i1 = med1_minus # <<<<<<<<<<<<<< @@ -42395,7 +42377,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_i1 = __pyx_v_med1_minus; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":603 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":598 * med2_plus = med2 + step2 * i1 = med1_minus * while i1 < med1_plus: # <<<<<<<<<<<<<< @@ -42406,7 +42388,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p __pyx_t_3 = (__pyx_v_i1 < __pyx_v_med1_plus); if (!__pyx_t_3) break; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":604 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":599 * i1 = med1_minus * while i1 < med1_plus: * assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -42415,7 +42397,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_f_3_sa_assign_matching((&__pyx_v_loc1), __pyx_v_arr1, __pyx_v_i1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":605 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":600 * while i1 < med1_plus: * assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr) * while med2_minus-step2 >= low2: # <<<<<<<<<<<<<< @@ -42426,7 +42408,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p __pyx_t_3 = ((__pyx_v_med2_minus - __pyx_v_step2) >= __pyx_v_low2); if (!__pyx_t_3) break; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":606 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":601 * 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) # <<<<<<<<<<<<<< @@ -42435,7 +42417,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_f_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, (__pyx_v_med2_minus - __pyx_v_step2), __pyx_v_step2, __pyx_v_self->fda->sent_id->arr); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":607 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":602 * 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: # <<<<<<<<<<<<<< @@ -42445,7 +42427,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p __pyx_t_3 = (((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last) < 1); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":608 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":603 * 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 # <<<<<<<<<<<<<< @@ -42457,7 +42439,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":610 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":605 * med2_minus = med2_minus - step2 * else: * break # <<<<<<<<<<<<<< @@ -42470,7 +42452,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p } __pyx_L18_break:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":611 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":606 * else: * break * i2 = med2_minus # <<<<<<<<<<<<<< @@ -42479,7 +42461,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_i2 = __pyx_v_med2_minus; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":612 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":607 * break * i2 = med2_minus * while i2 < high2: # <<<<<<<<<<<<<< @@ -42490,7 +42472,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p __pyx_t_3 = (__pyx_v_i2 < __pyx_v_high2); if (!__pyx_t_3) break; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":613 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":608 * i2 = med2_minus * while i2 < high2: * assign_matching(&loc2, arr2, i2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -42499,7 +42481,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_f_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_i2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":614 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":609 * 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) # <<<<<<<<<<<<<< @@ -42508,7 +42490,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_comparison = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":615 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":610 * 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: # <<<<<<<<<<<<<< @@ -42518,7 +42500,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p __pyx_t_3 = (__pyx_v_comparison == 0); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":617 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":612 * if comparison == 0: * pass * med_result = append_combined_matching(med_result, &loc1, &loc2, offset_by_one, num_subpatterns, &med_result_len) # <<<<<<<<<<<<<< @@ -42530,7 +42512,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p } __pyx_L22:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":618 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":613 * pass * med_result = append_combined_matching(med_result, &loc1, &loc2, offset_by_one, num_subpatterns, &med_result_len) * if comparison == -1: # <<<<<<<<<<<<<< @@ -42540,7 +42522,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p __pyx_t_3 = (__pyx_v_comparison == -1); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":619 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":614 * med_result = append_combined_matching(med_result, &loc1, &loc2, offset_by_one, num_subpatterns, &med_result_len) * if comparison == -1: * break # <<<<<<<<<<<<<< @@ -42552,7 +42534,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p } __pyx_L23:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":620 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":615 * if comparison == -1: * break * i2 = i2 + step2 # <<<<<<<<<<<<<< @@ -42563,7 +42545,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p } __pyx_L21_break:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":621 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":616 * break * i2 = i2 + step2 * if i2 > med2_plus: # <<<<<<<<<<<<<< @@ -42573,7 +42555,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p __pyx_t_3 = (__pyx_v_i2 > __pyx_v_med2_plus); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":622 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":617 * i2 = i2 + step2 * if i2 > med2_plus: * med2_plus = i2 # <<<<<<<<<<<<<< @@ -42585,7 +42567,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p } __pyx_L24:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":623 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":618 * if i2 > med2_plus: * med2_plus = i2 * i1 = i1 + step1 # <<<<<<<<<<<<<< @@ -42595,7 +42577,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p __pyx_v_i1 = (__pyx_v_i1 + __pyx_v_step1); } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":625 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":620 * i1 = i1 + step1 * * tmp = med1_minus # <<<<<<<<<<<<<< @@ -42604,7 +42586,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_tmp = __pyx_v_med1_minus; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":626 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":621 * * tmp = med1_minus * med1_minus = med1_plus # <<<<<<<<<<<<<< @@ -42613,7 +42595,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_med1_minus = __pyx_v_med1_plus; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":627 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":622 * tmp = med1_minus * med1_minus = med1_plus * med1_plus = tmp # <<<<<<<<<<<<<< @@ -42625,7 +42607,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":630 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":625 * else: * # No match; need to figure out the point of division in D and Q * med2_minus = med2 # <<<<<<<<<<<<<< @@ -42634,7 +42616,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_med2_minus = __pyx_v_med2; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":631 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":626 * # No match; need to figure out the point of division in D and Q * med2_minus = med2 * med2_plus = med2 # <<<<<<<<<<<<<< @@ -42643,7 +42625,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_med2_plus = __pyx_v_med2; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":632 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":627 * med2_minus = med2 * med2_plus = med2 * if d_first: # <<<<<<<<<<<<<< @@ -42652,7 +42634,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ if (__pyx_v_d_first) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":633 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":628 * med2_plus = med2 * if d_first: * med2_minus = med2_minus + step2 # <<<<<<<<<<<<<< @@ -42661,7 +42643,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_med2_minus = (__pyx_v_med2_minus + __pyx_v_step2); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":634 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":629 * if d_first: * med2_minus = med2_minus + step2 * if comparison == -1: # <<<<<<<<<<<<<< @@ -42671,7 +42653,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p __pyx_t_3 = (__pyx_v_comparison == -1); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":635 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":630 * med2_minus = med2_minus + step2 * if comparison == -1: * med1_minus = med1_plus # <<<<<<<<<<<<<< @@ -42683,7 +42665,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p } __pyx_L26:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":636 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":631 * if comparison == -1: * med1_minus = med1_plus * if comparison == 1: # <<<<<<<<<<<<<< @@ -42693,7 +42675,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p __pyx_t_3 = (__pyx_v_comparison == 1); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":637 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":632 * med1_minus = med1_plus * if comparison == 1: * med1_plus = med1_minus # <<<<<<<<<<<<<< @@ -42708,7 +42690,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":639 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":634 * med1_plus = med1_minus * else: * tmp = med1_minus # <<<<<<<<<<<<<< @@ -42717,7 +42699,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_tmp = __pyx_v_med1_minus; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":640 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":635 * else: * tmp = med1_minus * med1_minus = med1_plus # <<<<<<<<<<<<<< @@ -42726,7 +42708,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_med1_minus = __pyx_v_med1_plus; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":641 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":636 * tmp = med1_minus * med1_minus = med1_plus * med1_plus = tmp # <<<<<<<<<<<<<< @@ -42735,7 +42717,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_med1_plus = __pyx_v_tmp; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":642 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":637 * med1_minus = med1_plus * med1_plus = tmp * if comparison == 1: # <<<<<<<<<<<<<< @@ -42745,7 +42727,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p __pyx_t_3 = (__pyx_v_comparison == 1); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":643 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":638 * med1_plus = tmp * if comparison == 1: * med2_minus = med2_minus + step2 # <<<<<<<<<<<<<< @@ -42754,7 +42736,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_med2_minus = (__pyx_v_med2_minus + __pyx_v_step2); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":644 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":639 * if comparison == 1: * med2_minus = med2_minus + step2 * med2_plus = med2_plus + step2 # <<<<<<<<<<<<<< @@ -42770,7 +42752,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p } __pyx_L14:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":646 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":641 * med2_plus = med2_plus + step2 * * low_result_len = 0 # <<<<<<<<<<<<<< @@ -42779,7 +42761,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_low_result_len = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":647 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -42788,7 +42770,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_low_result = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->baeza_yates_helper(__pyx_v_self, __pyx_v_low1, __pyx_v_med1_plus, __pyx_v_arr1, __pyx_v_step1, __pyx_v_low2, __pyx_v_med2_plus, __pyx_v_arr2, __pyx_v_step2, __pyx_v_offset_by_one, __pyx_v_len_last, __pyx_v_num_subpatterns, (&__pyx_v_low_result_len)); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":648 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":643 * 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 # <<<<<<<<<<<<<< @@ -42797,7 +42779,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_high_result_len = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":649 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":644 * 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) # <<<<<<<<<<<<<< @@ -42806,7 +42788,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_high_result = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->baeza_yates_helper(__pyx_v_self, __pyx_v_med1_minus, __pyx_v_high1, __pyx_v_arr1, __pyx_v_step1, __pyx_v_med2_minus, __pyx_v_high2, __pyx_v_arr2, __pyx_v_step2, __pyx_v_offset_by_one, __pyx_v_len_last, __pyx_v_num_subpatterns, (&__pyx_v_high_result_len)); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":651 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":646 * 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) # <<<<<<<<<<<<<< @@ -42815,7 +42797,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_result = __pyx_f_3_sa_extend_arr(__pyx_v_result, __pyx_v_result_len, __pyx_v_low_result, __pyx_v_low_result_len); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":652 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -42824,7 +42806,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_result = __pyx_f_3_sa_extend_arr(__pyx_v_result, __pyx_v_result_len, __pyx_v_med_result, __pyx_v_med_result_len); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":653 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":648 * 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) # <<<<<<<<<<<<<< @@ -42833,7 +42815,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ __pyx_v_result = __pyx_f_3_sa_extend_arr(__pyx_v_result, __pyx_v_result_len, __pyx_v_high_result, __pyx_v_high_result_len); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":654 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":649 * 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) # <<<<<<<<<<<<<< @@ -42842,7 +42824,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ free(__pyx_v_low_result); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":655 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":650 * result = extend_arr(result, result_len, high_result, high_result_len) * free(low_result) * free(med_result) # <<<<<<<<<<<<<< @@ -42851,7 +42833,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ free(__pyx_v_med_result); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":656 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":651 * free(low_result) * free(med_result) * free(high_result) # <<<<<<<<<<<<<< @@ -42860,7 +42842,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p */ free(__pyx_v_high_result); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":658 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":653 * free(high_result) * * return result # <<<<<<<<<<<<<< @@ -42880,7 +42862,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":662 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":657 * * * cdef long compare_matchings_set(self, int i1_minus, int i1_plus, int* arr1, int step1, # <<<<<<<<<<<<<< @@ -42899,7 +42881,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct int __pyx_t_1; __Pyx_RefNannySetupContext("compare_matchings_set", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":673 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":668 * cdef Matching* loc1 * * loc1 = &l1_stack # <<<<<<<<<<<<<< @@ -42908,7 +42890,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct */ __pyx_v_loc1 = (&__pyx_v_l1_stack); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":675 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":670 * loc1 = &l1_stack * * i1 = i1_minus # <<<<<<<<<<<<<< @@ -42917,7 +42899,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct */ __pyx_v_i1 = __pyx_v_i1_minus; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":676 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":671 * * i1 = i1_minus * while i1 < i1_plus: # <<<<<<<<<<<<<< @@ -42928,7 +42910,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct __pyx_t_1 = (__pyx_v_i1 < __pyx_v_i1_plus); if (!__pyx_t_1) break; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":677 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":672 * i1 = i1_minus * while i1 < i1_plus: * assign_matching(loc1, arr1, i1, step1, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -42937,7 +42919,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct */ __pyx_f_3_sa_assign_matching(__pyx_v_loc1, __pyx_v_arr1, __pyx_v_i1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":678 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":673 * 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) # <<<<<<<<<<<<<< @@ -42946,7 +42928,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct */ __pyx_v_comparison = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, __pyx_v_loc1, __pyx_v_loc2, __pyx_v_offset_by_one, __pyx_v_len_last); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":679 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":674 * 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: # <<<<<<<<<<<<<< @@ -42956,7 +42938,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct __pyx_t_1 = (__pyx_v_comparison == 0); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":680 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":675 * comparison = self.compare_matchings(loc1, loc2, offset_by_one, len_last) * if comparison == 0: * prev_comparison = 0 # <<<<<<<<<<<<<< @@ -42965,7 +42947,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct */ __pyx_v_prev_comparison = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":681 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":676 * if comparison == 0: * prev_comparison = 0 * break # <<<<<<<<<<<<<< @@ -42976,7 +42958,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct goto __pyx_L5; } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":682 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":677 * prev_comparison = 0 * break * elif i1 == i1_minus: # <<<<<<<<<<<<<< @@ -42986,7 +42968,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct __pyx_t_1 = (__pyx_v_i1 == __pyx_v_i1_minus); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":683 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":678 * break * elif i1 == i1_minus: * prev_comparison = comparison # <<<<<<<<<<<<<< @@ -42998,7 +42980,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":685 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":680 * prev_comparison = comparison * else: * if comparison != prev_comparison: # <<<<<<<<<<<<<< @@ -43008,7 +42990,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct __pyx_t_1 = (__pyx_v_comparison != __pyx_v_prev_comparison); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":686 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":681 * else: * if comparison != prev_comparison: * prev_comparison = 0 # <<<<<<<<<<<<<< @@ -43017,7 +42999,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct */ __pyx_v_prev_comparison = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":687 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":682 * if comparison != prev_comparison: * prev_comparison = 0 * break # <<<<<<<<<<<<<< @@ -43031,7 +43013,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct } __pyx_L5:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":688 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":683 * prev_comparison = 0 * break * i1 = i1 + step1 # <<<<<<<<<<<<<< @@ -43042,7 +43024,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct } __pyx_L4_break:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":689 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":684 * break * i1 = i1 + step1 * return prev_comparison # <<<<<<<<<<<<<< @@ -43058,7 +43040,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":692 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":687 * * * cdef long compare_matchings(self, Matching* loc1, Matching* loc2, int offset_by_one, int len_last): # <<<<<<<<<<<<<< @@ -43076,7 +43058,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py int __pyx_t_4; __Pyx_RefNannySetupContext("compare_matchings", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":695 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":690 * cdef int i * * if loc1.sent_id > loc2.sent_id: # <<<<<<<<<<<<<< @@ -43086,7 +43068,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py __pyx_t_1 = (__pyx_v_loc1->sent_id > __pyx_v_loc2->sent_id); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":696 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":691 * * if loc1.sent_id > loc2.sent_id: * return 1 # <<<<<<<<<<<<<< @@ -43099,7 +43081,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":697 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":692 * if loc1.sent_id > loc2.sent_id: * return 1 * if loc2.sent_id > loc1.sent_id: # <<<<<<<<<<<<<< @@ -43109,7 +43091,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py __pyx_t_1 = (__pyx_v_loc2->sent_id > __pyx_v_loc1->sent_id); if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":698 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":693 * return 1 * if loc2.sent_id > loc1.sent_id: * return -1 # <<<<<<<<<<<<<< @@ -43122,7 +43104,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py } __pyx_L4:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":700 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":695 * return -1 * * if loc1.size == 1 and loc2.size == 1: # <<<<<<<<<<<<<< @@ -43138,7 +43120,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py } if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":701 + /* "/home/pauldb/workspace/cdec/python/src/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: # <<<<<<<<<<<<<< @@ -43148,7 +43130,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py __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); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":702 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":697 * if loc1.size == 1 and loc2.size == 1: * if loc2.arr[loc2.start] - loc1.arr[loc1.start] <= self.train_min_gap_size: * return 1 # <<<<<<<<<<<<<< @@ -43163,7 +43145,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py goto __pyx_L5; } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":704 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":699 * return 1 * * elif offset_by_one: # <<<<<<<<<<<<<< @@ -43172,7 +43154,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py */ if (__pyx_v_offset_by_one) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":705 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":700 * * elif offset_by_one: * for i from 1 <= i < loc1.size: # <<<<<<<<<<<<<< @@ -43182,7 +43164,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py __pyx_t_4 = __pyx_v_loc1->size; for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":706 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":701 * elif offset_by_one: * for i from 1 <= i < loc1.size: * if loc1.arr[loc1.start+i] > loc2.arr[loc2.start+i-1]: # <<<<<<<<<<<<<< @@ -43192,7 +43174,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py __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)])); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":707 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":702 * for i from 1 <= i < loc1.size: * if loc1.arr[loc1.start+i] > loc2.arr[loc2.start+i-1]: * return 1 # <<<<<<<<<<<<<< @@ -43205,7 +43187,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py } __pyx_L9:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":708 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":703 * 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]: # <<<<<<<<<<<<<< @@ -43215,7 +43197,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py __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)])); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":709 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":704 * return 1 * if loc1.arr[loc1.start+i] < loc2.arr[loc2.start+i-1]: * return -1 # <<<<<<<<<<<<<< @@ -43232,7 +43214,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":712 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":707 * * else: * if loc1.arr[loc1.start]+1 > loc2.arr[loc2.start]: # <<<<<<<<<<<<<< @@ -43242,7 +43224,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py __pyx_t_3 = (((__pyx_v_loc1->arr[__pyx_v_loc1->start]) + 1) > (__pyx_v_loc2->arr[__pyx_v_loc2->start])); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":713 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":708 * else: * if loc1.arr[loc1.start]+1 > loc2.arr[loc2.start]: * return 1 # <<<<<<<<<<<<<< @@ -43255,7 +43237,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py } __pyx_L11:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":714 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":709 * if loc1.arr[loc1.start]+1 > loc2.arr[loc2.start]: * return 1 * if loc1.arr[loc1.start]+1 < loc2.arr[loc2.start]: # <<<<<<<<<<<<<< @@ -43265,7 +43247,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py __pyx_t_3 = (((__pyx_v_loc1->arr[__pyx_v_loc1->start]) + 1) < (__pyx_v_loc2->arr[__pyx_v_loc2->start])); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":715 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":710 * return 1 * if loc1.arr[loc1.start]+1 < loc2.arr[loc2.start]: * return -1 # <<<<<<<<<<<<<< @@ -43278,7 +43260,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py } __pyx_L12:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":717 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":712 * return -1 * * for i from 1 <= i < loc1.size: # <<<<<<<<<<<<<< @@ -43288,7 +43270,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py __pyx_t_4 = __pyx_v_loc1->size; for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":718 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":713 * * for i from 1 <= i < loc1.size: * if loc1.arr[loc1.start+i] > loc2.arr[loc2.start+i]: # <<<<<<<<<<<<<< @@ -43298,7 +43280,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py __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)])); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":719 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":714 * for i from 1 <= i < loc1.size: * if loc1.arr[loc1.start+i] > loc2.arr[loc2.start+i]: * return 1 # <<<<<<<<<<<<<< @@ -43311,7 +43293,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py } __pyx_L15:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":720 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":715 * if loc1.arr[loc1.start+i] > loc2.arr[loc2.start+i]: * return 1 * if loc1.arr[loc1.start+i] < loc2.arr[loc2.start+i]: # <<<<<<<<<<<<<< @@ -43321,7 +43303,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py __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)])); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":721 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":716 * return 1 * if loc1.arr[loc1.start+i] < loc2.arr[loc2.start+i]: * return -1 # <<<<<<<<<<<<<< @@ -43337,7 +43319,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py } __pyx_L5:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":723 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":718 * return -1 * * if loc2.arr[loc2.end-1] + len_last - loc1.arr[loc1.start] > self.train_max_initial_size: # <<<<<<<<<<<<<< @@ -43347,7 +43329,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py __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); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":724 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":719 * * if loc2.arr[loc2.end-1] + len_last - loc1.arr[loc1.start] > self.train_max_initial_size: * return -1 # <<<<<<<<<<<<<< @@ -43360,7 +43342,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py } __pyx_L17:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":725 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":720 * if loc2.arr[loc2.end-1] + len_last - loc1.arr[loc1.start] > self.train_max_initial_size: * return -1 * return 0 # <<<<<<<<<<<<<< @@ -43376,7 +43358,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":728 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":723 * * * cdef int* merge_helper(self, int low1, int high1, int* arr1, int step1, # <<<<<<<<<<<<<< @@ -43400,7 +43382,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj int __pyx_t_3; __Pyx_RefNannySetupContext("merge_helper", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":736 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":731 * cdef Matching loc1, loc2 * * result_len[0] = 0 # <<<<<<<<<<<<<< @@ -43409,7 +43391,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj */ (__pyx_v_result_len[0]) = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":737 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":732 * * result_len[0] = 0 * result = malloc(0*sizeof(int)) # <<<<<<<<<<<<<< @@ -43418,7 +43400,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj */ __pyx_v_result = ((int *)malloc((0 * (sizeof(int))))); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":739 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":734 * result = malloc(0*sizeof(int)) * * i1 = low1 # <<<<<<<<<<<<<< @@ -43427,7 +43409,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj */ __pyx_v_i1 = __pyx_v_low1; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":740 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":735 * * i1 = low1 * i2 = low2 # <<<<<<<<<<<<<< @@ -43436,7 +43418,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj */ __pyx_v_i2 = __pyx_v_low2; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":741 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":736 * i1 = low1 * i2 = low2 * while i1 < high1 and i2 < high2: # <<<<<<<<<<<<<< @@ -43453,7 +43435,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj } if (!__pyx_t_3) break; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":744 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":739 * * # First, pop all unneeded loc2's off the stack * assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -43462,7 +43444,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj */ __pyx_f_3_sa_assign_matching((&__pyx_v_loc1), __pyx_v_arr1, __pyx_v_i1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":745 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":740 * # First, pop all unneeded loc2's off the stack * assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr) * while i2 < high2: # <<<<<<<<<<<<<< @@ -43473,7 +43455,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj __pyx_t_3 = (__pyx_v_i2 < __pyx_v_high2); if (!__pyx_t_3) break; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":746 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":741 * 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) # <<<<<<<<<<<<<< @@ -43482,7 +43464,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj */ __pyx_f_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_i2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":747 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":742 * 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: # <<<<<<<<<<<<<< @@ -43492,7 +43474,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj __pyx_t_3 = (((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last) == 1); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":748 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":743 * 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 # <<<<<<<<<<<<<< @@ -43504,7 +43486,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":750 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":745 * i2 = i2 + step2 * else: * break # <<<<<<<<<<<<<< @@ -43517,7 +43499,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj } __pyx_L6_break:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":753 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":748 * * # Next: process all loc1's with the same starting val * j1 = i1 # <<<<<<<<<<<<<< @@ -43526,7 +43508,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj */ __pyx_v_j1 = __pyx_v_i1; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":754 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":749 * # Next: process all loc1's with the same starting val * j1 = i1 * while i1 < high1 and arr1[j1] == arr1[i1]: # <<<<<<<<<<<<<< @@ -43543,7 +43525,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj } if (!__pyx_t_2) break; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":755 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":750 * j1 = i1 * while i1 < high1 and arr1[j1] == arr1[i1]: * assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -43552,7 +43534,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj */ __pyx_f_3_sa_assign_matching((&__pyx_v_loc1), __pyx_v_arr1, __pyx_v_i1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":756 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":751 * while i1 < high1 and arr1[j1] == arr1[i1]: * assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr) * j2 = i2 # <<<<<<<<<<<<<< @@ -43561,7 +43543,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj */ __pyx_v_j2 = __pyx_v_i2; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":757 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":752 * assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr) * j2 = i2 * while j2 < high2: # <<<<<<<<<<<<<< @@ -43572,7 +43554,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj __pyx_t_2 = (__pyx_v_j2 < __pyx_v_high2); if (!__pyx_t_2) break; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":758 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":753 * j2 = i2 * while j2 < high2: * assign_matching(&loc2, arr2, j2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -43581,7 +43563,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj */ __pyx_f_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_j2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":759 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":754 * 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) # <<<<<<<<<<<<<< @@ -43590,7 +43572,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj */ __pyx_v_comparison = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":760 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":755 * 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: # <<<<<<<<<<<<<< @@ -43600,7 +43582,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj __pyx_t_2 = (__pyx_v_comparison == 0); if (__pyx_t_2) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":761 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":756 * 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) # <<<<<<<<<<<<<< @@ -43612,7 +43594,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj } __pyx_L12:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":762 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":757 * if comparison == 0: * result = append_combined_matching(result, &loc1, &loc2, offset_by_one, num_subpatterns, result_len) * if comparison == 1: # <<<<<<<<<<<<<< @@ -43625,7 +43607,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj } __pyx_L13:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":764 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":759 * if comparison == 1: * pass * if comparison == -1: # <<<<<<<<<<<<<< @@ -43635,7 +43617,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj __pyx_t_2 = (__pyx_v_comparison == -1); if (__pyx_t_2) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":765 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":760 * pass * if comparison == -1: * break # <<<<<<<<<<<<<< @@ -43647,7 +43629,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":767 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":762 * break * else: * j2 = j2 + step2 # <<<<<<<<<<<<<< @@ -43660,7 +43642,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj } __pyx_L11_break:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":768 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":763 * else: * j2 = j2 + step2 * i1 = i1 + step1 # <<<<<<<<<<<<<< @@ -43671,7 +43653,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj } } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":769 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":764 * j2 = j2 + step2 * i1 = i1 + step1 * return result # <<<<<<<<<<<<<< @@ -43687,7 +43669,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":772 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":767 * * * cdef void sort_phrase_loc(self, IntList arr, PhraseLocation loc, Phrase phrase): # <<<<<<<<<<<<<< @@ -43709,26 +43691,26 @@ static void __pyx_f_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct __pyx_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sort_phrase_loc", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":777 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":772 * cdef IntList result * * if phrase in self.precomputed_index: # <<<<<<<<<<<<<< * loc.arr = self.precomputed_index[phrase] * else: */ - __pyx_t_1 = ((PySequence_Contains(__pyx_v_self->precomputed_index, ((PyObject *)__pyx_v_phrase)))); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 777; __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 = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":778 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":773 * * 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_2 = PyObject_GetItem(__pyx_v_self->precomputed_index, ((PyObject *)__pyx_v_phrase)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetItem(__pyx_v_self->precomputed_index, ((PyObject *)__pyx_v_phrase)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 773; __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_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_loc->arr); __Pyx_DECREF(((PyObject *)__pyx_v_loc->arr)); @@ -43738,20 +43720,20 @@ static void __pyx_f_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct __pyx_ } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":780 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":775 * 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_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __pyx_t_3 = PyInt_FromLong((__pyx_v_loc->sa_high - __pyx_v_loc->sa_low)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong((__pyx_v_loc->sa_high - __pyx_v_loc->sa_low)); 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); - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 775; __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_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_3); @@ -43760,27 +43742,27 @@ static void __pyx_f_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct __pyx_ __pyx_v_loc->arr = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":781 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":776 * 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_3 = PyInt_FromLong(__pyx_v_arr->len); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(__pyx_v_arr->len); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 776; __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 = 781; __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 = 776; __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*)__pyx_ptype_3_sa_VEB)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_VEB)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __pyx_v_veb = ((struct __pyx_obj_3_sa_VEB *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":782 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":777 * 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: # <<<<<<<<<<<<<< @@ -43790,7 +43772,7 @@ static void __pyx_f_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct __pyx_ __pyx_t_4 = __pyx_v_loc->sa_high; for (__pyx_v_i = __pyx_v_loc->sa_low; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":783 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":778 * veb = VEB(arr.len) * for i from loc.sa_low <= i < loc.sa_high: * veb._insert(arr.arr[i]) # <<<<<<<<<<<<<< @@ -43800,7 +43782,7 @@ static void __pyx_f_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct __pyx_ ((struct __pyx_vtabstruct_3_sa_VEB *)__pyx_v_veb->__pyx_vtab)->_insert(__pyx_v_veb, (__pyx_v_arr->arr[__pyx_v_i])); } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":784 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":779 * for i from loc.sa_low <= i < loc.sa_high: * veb._insert(arr.arr[i]) * i = veb.veb.min_val # <<<<<<<<<<<<<< @@ -43809,7 +43791,7 @@ static void __pyx_f_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct __pyx_ */ __pyx_v_i = __pyx_v_veb->veb->min_val; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":785 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":780 * veb._insert(arr.arr[i]) * i = veb.veb.min_val * for j from 0 <= j < loc.sa_high-loc.sa_low: # <<<<<<<<<<<<<< @@ -43819,7 +43801,7 @@ static void __pyx_f_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct __pyx_ __pyx_t_4 = (__pyx_v_loc->sa_high - __pyx_v_loc->sa_low); for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_4; __pyx_v_j++) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":786 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":781 * i = veb.veb.min_val * for j from 0 <= j < loc.sa_high-loc.sa_low: * loc.arr.arr[j] = i # <<<<<<<<<<<<<< @@ -43828,7 +43810,7 @@ static void __pyx_f_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct __pyx_ */ (__pyx_v_loc->arr->arr[__pyx_v_j]) = __pyx_v_i; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":787 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":782 * for j from 0 <= j < loc.sa_high-loc.sa_low: * loc.arr.arr[j] = i * i = veb._findsucc(i) # <<<<<<<<<<<<<< @@ -43840,7 +43822,7 @@ static void __pyx_f_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct __pyx_ } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":788 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":783 * loc.arr.arr[j] = i * i = veb._findsucc(i) * loc.arr_low = 0 # <<<<<<<<<<<<<< @@ -43849,7 +43831,7 @@ static void __pyx_f_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct __pyx_ */ __pyx_v_loc->arr_low = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":789 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":784 * i = veb._findsucc(i) * loc.arr_low = 0 * loc.arr_high = loc.arr.len # <<<<<<<<<<<<<< @@ -43868,7 +43850,7 @@ static void __pyx_f_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct __pyx_ __Pyx_RefNannyFinishContext(); } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":792 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":787 * * * cdef intersect_helper(self, Phrase prefix, Phrase suffix, # <<<<<<<<<<<<<< @@ -43905,7 +43887,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("intersect_helper", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":799 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":794 * cdef int* result_ptr * * result_len = 0 # <<<<<<<<<<<<<< @@ -43914,21 +43896,21 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct */ __pyx_v_result_len = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":801 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":796 * 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); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_suffix), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 796; __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 = 801; __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 = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __pyx_f_3_sa_sym_isvar(__pyx_t_2); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":802 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":797 * * if sym_isvar(suffix[0]): * offset_by_one = 1 # <<<<<<<<<<<<<< @@ -43940,7 +43922,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":804 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":799 * offset_by_one = 1 * else: * offset_by_one = 0 # <<<<<<<<<<<<<< @@ -43951,34 +43933,34 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":806 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":801 * offset_by_one = 0 * * len_last = len(suffix.getchunk(suffix.arity())) # <<<<<<<<<<<<<< * * if prefix_loc.arr is None: */ - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_suffix), __pyx_n_s__getchunk); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_suffix), __pyx_n_s__getchunk); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_suffix), __pyx_n_s__arity); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_suffix), __pyx_n_s__arity); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 801; __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 = 806; __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 = 801; __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 = 806; __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 = 801; __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 = 806; __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 = 801; __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 = 806; __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 = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_len_last = __pyx_t_6; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":808 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":803 * len_last = len(suffix.getchunk(suffix.arity())) * * if prefix_loc.arr is None: # <<<<<<<<<<<<<< @@ -43988,7 +43970,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct __pyx_t_7 = (((PyObject *)__pyx_v_prefix_loc->arr) == Py_None); if (__pyx_t_7) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":809 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":804 * * if prefix_loc.arr is None: * self.sort_phrase_loc(self.fsa.sa, prefix_loc, prefix) # <<<<<<<<<<<<<< @@ -44003,7 +43985,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct } __pyx_L4:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":810 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":805 * if prefix_loc.arr is None: * self.sort_phrase_loc(self.fsa.sa, prefix_loc, prefix) * arr1 = prefix_loc.arr # <<<<<<<<<<<<<< @@ -44013,7 +43995,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct __Pyx_INCREF(((PyObject *)__pyx_v_prefix_loc->arr)); __pyx_v_arr1 = __pyx_v_prefix_loc->arr; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":811 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":806 * self.sort_phrase_loc(self.fsa.sa, prefix_loc, prefix) * arr1 = prefix_loc.arr * low1 = prefix_loc.arr_low # <<<<<<<<<<<<<< @@ -44022,7 +44004,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct */ __pyx_v_low1 = __pyx_v_prefix_loc->arr_low; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":812 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":807 * arr1 = prefix_loc.arr * low1 = prefix_loc.arr_low * high1 = prefix_loc.arr_high # <<<<<<<<<<<<<< @@ -44031,7 +44013,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct */ __pyx_v_high1 = __pyx_v_prefix_loc->arr_high; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":813 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":808 * low1 = prefix_loc.arr_low * high1 = prefix_loc.arr_high * step1 = prefix_loc.num_subpatterns # <<<<<<<<<<<<<< @@ -44040,7 +44022,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct */ __pyx_v_step1 = __pyx_v_prefix_loc->num_subpatterns; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":815 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":810 * step1 = prefix_loc.num_subpatterns * * if suffix_loc.arr is None: # <<<<<<<<<<<<<< @@ -44050,7 +44032,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct __pyx_t_7 = (((PyObject *)__pyx_v_suffix_loc->arr) == Py_None); if (__pyx_t_7) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":816 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":811 * * if suffix_loc.arr is None: * self.sort_phrase_loc(self.fsa.sa, suffix_loc, suffix) # <<<<<<<<<<<<<< @@ -44065,7 +44047,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct } __pyx_L5:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":817 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":812 * if suffix_loc.arr is None: * self.sort_phrase_loc(self.fsa.sa, suffix_loc, suffix) * arr2 = suffix_loc.arr # <<<<<<<<<<<<<< @@ -44075,7 +44057,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct __Pyx_INCREF(((PyObject *)__pyx_v_suffix_loc->arr)); __pyx_v_arr2 = __pyx_v_suffix_loc->arr; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":818 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":813 * self.sort_phrase_loc(self.fsa.sa, suffix_loc, suffix) * arr2 = suffix_loc.arr * low2 = suffix_loc.arr_low # <<<<<<<<<<<<<< @@ -44084,7 +44066,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct */ __pyx_v_low2 = __pyx_v_suffix_loc->arr_low; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":819 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":814 * arr2 = suffix_loc.arr * low2 = suffix_loc.arr_low * high2 = suffix_loc.arr_high # <<<<<<<<<<<<<< @@ -44093,7 +44075,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct */ __pyx_v_high2 = __pyx_v_suffix_loc->arr_high; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":820 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":815 * low2 = suffix_loc.arr_low * high2 = suffix_loc.arr_high * step2 = suffix_loc.num_subpatterns # <<<<<<<<<<<<<< @@ -44102,26 +44084,26 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct */ __pyx_v_step2 = __pyx_v_suffix_loc->num_subpatterns; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":822 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":817 * step2 = suffix_loc.num_subpatterns * * num_subpatterns = prefix.arity()+1 # <<<<<<<<<<<<<< * * if algorithm == MERGE: */ - __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_prefix), __pyx_n_s__arity); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_prefix), __pyx_n_s__arity); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 817; __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 = 822; __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 = 817; __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 = 822; __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 = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_5); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_5); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_num_subpatterns = __pyx_t_3; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":824 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":819 * num_subpatterns = prefix.arity()+1 * * if algorithm == MERGE: # <<<<<<<<<<<<<< @@ -44131,7 +44113,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct __pyx_t_7 = (__pyx_v_algorithm == __pyx_v_3_sa_MERGE); if (__pyx_t_7) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":827 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":822 * result_ptr = self.merge_helper(low1, high1, arr1.arr, step1, * low2, high2, arr2.arr, step2, * offset_by_one, len_last, num_subpatterns, &result_len) # <<<<<<<<<<<<<< @@ -44143,7 +44125,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":831 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":826 * 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) # <<<<<<<<<<<<<< @@ -44154,7 +44136,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct } __pyx_L6:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":833 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":828 * offset_by_one, len_last, num_subpatterns, &result_len) * * if result_len == 0: # <<<<<<<<<<<<<< @@ -44164,7 +44146,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct __pyx_t_7 = (__pyx_v_result_len == 0); if (__pyx_t_7) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":834 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":829 * * if result_len == 0: * free(result_ptr) # <<<<<<<<<<<<<< @@ -44173,7 +44155,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct */ free(__pyx_v_result_ptr); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":835 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":830 * if result_len == 0: * free(result_ptr) * return None # <<<<<<<<<<<<<< @@ -44188,19 +44170,19 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":837 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":832 * return None * else: * result = IntList() # <<<<<<<<<<<<<< * free(result.arr) * result.arr = result_ptr */ - __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_v_result = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_5); __pyx_t_5 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":838 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":833 * else: * result = IntList() * free(result.arr) # <<<<<<<<<<<<<< @@ -44209,7 +44191,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct */ free(__pyx_v_result->arr); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":839 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":834 * result = IntList() * free(result.arr) * result.arr = result_ptr # <<<<<<<<<<<<<< @@ -44218,7 +44200,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct */ __pyx_v_result->arr = __pyx_v_result_ptr; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":840 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":835 * free(result.arr) * result.arr = result_ptr * result.len = result_len # <<<<<<<<<<<<<< @@ -44227,7 +44209,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct */ __pyx_v_result->len = __pyx_v_result_len; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":841 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":836 * result.arr = result_ptr * result.len = result_len * result.size = result_len # <<<<<<<<<<<<<< @@ -44236,7 +44218,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct */ __pyx_v_result->size = __pyx_v_result_len; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":842 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":837 * result.len = result_len * result.size = result_len * return PhraseLocation(arr_low=0, arr_high=result_len, arr=result, num_subpatterns=num_subpatterns) # <<<<<<<<<<<<<< @@ -44244,19 +44226,19 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct * 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 = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 837; __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 = 842; __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 = 842; __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 = 837; __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 = 837; __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 = 842; __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 = 837; __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 = 842; __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 = 842; __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 = 837; __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 = 837; __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 = 842; __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 = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 837; __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; @@ -44282,7 +44264,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":844 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":839 * return PhraseLocation(arr_low=0, arr_high=result_len, arr=result, num_subpatterns=num_subpatterns) * * cdef loc2str(self, PhraseLocation loc): # <<<<<<<<<<<<<< @@ -44305,7 +44287,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON_UNUSED st int __pyx_clineno = 0; __Pyx_RefNannySetupContext("loc2str", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":846 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":841 * cdef loc2str(self, PhraseLocation loc): * cdef int i, j * result = "{" # <<<<<<<<<<<<<< @@ -44315,7 +44297,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON_UNUSED st __Pyx_INCREF(((PyObject *)__pyx_kp_s_116)); __pyx_v_result = ((PyObject *)__pyx_kp_s_116); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":847 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":842 * cdef int i, j * result = "{" * i = 0 # <<<<<<<<<<<<<< @@ -44324,7 +44306,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON_UNUSED st */ __pyx_v_i = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":848 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":843 * result = "{" * i = 0 * while i < loc.arr_high: # <<<<<<<<<<<<<< @@ -44335,20 +44317,20 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON_UNUSED st __pyx_t_1 = (__pyx_v_i < __pyx_v_loc->arr_high); if (!__pyx_t_1) break; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":849 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":844 * 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_117)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_kp_s_117)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_v_result); __pyx_v_result = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":850 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":845 * while i < loc.arr_high: * result = result + "(" * for j from i <= j < i + loc.num_subpatterns: # <<<<<<<<<<<<<< @@ -44358,19 +44340,19 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON_UNUSED st __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":851 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":846 * 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); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_loc->arr), __pyx_v_j, sizeof(int), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_21), __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_21), __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 846; __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 = 851; __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 = 846; __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_v_result); @@ -44378,20 +44360,20 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON_UNUSED st __pyx_t_2 = 0; } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":852 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":847 * 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_59)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_kp_s_59)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_v_result); __pyx_v_result = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":853 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":848 * result = result + ("%d " %loc.arr[j]) * result = result + ")" * i = i + loc.num_subpatterns # <<<<<<<<<<<<<< @@ -44401,20 +44383,20 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON_UNUSED st __pyx_v_i = (__pyx_v_i + __pyx_v_loc->num_subpatterns); } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":854 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":849 * result = result + ")" * i = i + loc.num_subpatterns * result = result + "}" # <<<<<<<<<<<<<< * return result * */ - __pyx_t_2 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_kp_s_118)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 854; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_kp_s_118)); 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(__pyx_v_result); __pyx_v_result = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":855 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":850 * i = i + loc.num_subpatterns * result = result + "}" * return result # <<<<<<<<<<<<<< @@ -44440,7 +44422,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON_UNUSED st return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":857 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":852 * return result * * cdef PhraseLocation intersect(self, prefix_node, suffix_node, Phrase phrase): # <<<<<<<<<<<<<< @@ -44466,81 +44448,81 @@ static struct __pyx_obj_3_sa_PhraseLocation *__pyx_f_3_sa_23HieroCachingRuleFact int __pyx_clineno = 0; __Pyx_RefNannySetupContext("intersect", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":861 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":856 * cdef PhraseLocation prefix_loc, suffix_loc, result * * prefix = prefix_node.phrase # <<<<<<<<<<<<<< * suffix = suffix_node.phrase * prefix_loc = prefix_node.phrase_location */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_prefix_node, __pyx_n_s__phrase); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_prefix_node, __pyx_n_s__phrase); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 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_3_sa_Phrase))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3_sa_Phrase))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_prefix = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":862 + /* "/home/pauldb/workspace/cdec/python/src/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 = PyObject_GetAttr(__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_t_1 = PyObject_GetAttr(__pyx_v_suffix_node, __pyx_n_s__phrase); 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_3_sa_Phrase))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3_sa_Phrase))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_suffix = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":863 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":858 * prefix = prefix_node.phrase * suffix = suffix_node.phrase * prefix_loc = prefix_node.phrase_location # <<<<<<<<<<<<<< * suffix_loc = suffix_node.phrase_location * */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_prefix_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_prefix_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 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_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_prefix_loc = ((struct __pyx_obj_3_sa_PhraseLocation *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":864 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":859 * 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 = PyObject_GetAttr(__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_t_1 = PyObject_GetAttr(__pyx_v_suffix_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 859; __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_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_suffix_loc = ((struct __pyx_obj_3_sa_PhraseLocation *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":866 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":861 * suffix_loc = suffix_node.phrase_location * * result = self.get_precomputed_collocation(phrase) # <<<<<<<<<<<<<< * if result is not None: * intersect_method = "precomputed" */ - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_119); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_119); 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); - __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_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 861; __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 = 866; __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 = 861; __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_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_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_result = ((struct __pyx_obj_3_sa_PhraseLocation *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":867 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":862 * * result = self.get_precomputed_collocation(phrase) * if result is not None: # <<<<<<<<<<<<<< @@ -44550,7 +44532,7 @@ static struct __pyx_obj_3_sa_PhraseLocation *__pyx_f_3_sa_23HieroCachingRuleFact __pyx_t_4 = (((PyObject *)__pyx_v_result) != Py_None); if (__pyx_t_4) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":868 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":863 * result = self.get_precomputed_collocation(phrase) * if result is not None: * intersect_method = "precomputed" # <<<<<<<<<<<<<< @@ -44563,7 +44545,7 @@ static struct __pyx_obj_3_sa_PhraseLocation *__pyx_f_3_sa_23HieroCachingRuleFact } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":870 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":865 * intersect_method = "precomputed" * * if result is None: # <<<<<<<<<<<<<< @@ -44573,7 +44555,7 @@ static struct __pyx_obj_3_sa_PhraseLocation *__pyx_f_3_sa_23HieroCachingRuleFact __pyx_t_4 = (((PyObject *)__pyx_v_result) == Py_None); if (__pyx_t_4) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":871 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":866 * * if result is None: * if self.use_baeza_yates: # <<<<<<<<<<<<<< @@ -44582,21 +44564,21 @@ static struct __pyx_obj_3_sa_PhraseLocation *__pyx_f_3_sa_23HieroCachingRuleFact */ if (__pyx_v_self->use_baeza_yates) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":872 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":867 * 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_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->intersect_helper(__pyx_v_self, __pyx_v_prefix, __pyx_v_suffix, __pyx_v_prefix_loc, __pyx_v_suffix_loc, __pyx_v_3_sa_BAEZA_YATES); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->intersect_helper(__pyx_v_self, __pyx_v_prefix, __pyx_v_suffix, __pyx_v_prefix_loc, __pyx_v_suffix_loc, __pyx_v_3_sa_BAEZA_YATES); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 867; __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_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_result)); __pyx_v_result = ((struct __pyx_obj_3_sa_PhraseLocation *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":873 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":868 * if self.use_baeza_yates: * result = self.intersect_helper(prefix, suffix, prefix_loc, suffix_loc, BAEZA_YATES) * intersect_method="double binary" # <<<<<<<<<<<<<< @@ -44610,21 +44592,21 @@ static struct __pyx_obj_3_sa_PhraseLocation *__pyx_f_3_sa_23HieroCachingRuleFact } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":875 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":870 * 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_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->intersect_helper(__pyx_v_self, __pyx_v_prefix, __pyx_v_suffix, __pyx_v_prefix_loc, __pyx_v_suffix_loc, __pyx_v_3_sa_MERGE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->intersect_helper(__pyx_v_self, __pyx_v_prefix, __pyx_v_suffix, __pyx_v_prefix_loc, __pyx_v_suffix_loc, __pyx_v_3_sa_MERGE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 870; __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_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_result)); __pyx_v_result = ((struct __pyx_obj_3_sa_PhraseLocation *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":876 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":871 * else: * result = self.intersect_helper(prefix, suffix, prefix_loc, suffix_loc, MERGE) * intersect_method="merge" # <<<<<<<<<<<<<< @@ -44640,7 +44622,7 @@ static struct __pyx_obj_3_sa_PhraseLocation *__pyx_f_3_sa_23HieroCachingRuleFact } __pyx_L4:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":877 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":872 * result = self.intersect_helper(prefix, suffix, prefix_loc, suffix_loc, MERGE) * intersect_method="merge" * return result # <<<<<<<<<<<<<< @@ -44678,11 +44660,11 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_13advance(PyObject *__p PyObject *__pyx_v_frontier = 0; PyObject *__pyx_v_res = 0; PyObject *__pyx_v_fwords = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__frontier,&__pyx_n_s__res,&__pyx_n_s__fwords,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("advance (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__frontier,&__pyx_n_s__res,&__pyx_n_s__fwords,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -44697,24 +44679,21 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_13advance(PyObject *__p kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__frontier); - if (likely(values[0])) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__frontier)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__res); - if (likely(values[1])) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__res)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("advance", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("advance", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: - values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fwords); - if (likely(values[2])) kw_args--; + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fwords)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("advance", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("advance", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 874; __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 = 879; __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 = 874; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -44729,7 +44708,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_13advance(PyObject *__p } 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 = 879; __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 = 874; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.advance", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -44740,7 +44719,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_13advance(PyObject *__p return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":879 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":874 * return result * * def advance(self, frontier, res, fwords): # <<<<<<<<<<<<<< @@ -44781,19 +44760,19 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("advance", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":881 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":876 * 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 = 881; __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 = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_nf = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":882 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":877 * cdef unsigned na * nf = [] * for (toskip, (i, alt, pathlen)) in frontier: # <<<<<<<<<<<<<< @@ -44804,23 +44783,31 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_ __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 = 882; __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 = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; } for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #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 = 877; __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 = 877; __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; - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #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 = 877; __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 = 877; __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 = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -44828,29 +44815,35 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_ } if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { PyObject* sequence = __pyx_t_4; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { - if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { - if (unlikely(PyList_GET_SIZE(sequence) != 2)) { - if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); + #else + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 877; __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 = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } else { + } else + { Py_ssize_t index = -1; - __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __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 = 877; __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; @@ -44858,14 +44851,15 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_ __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 = 882; __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 = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L6_unpacking_done:; } __Pyx_XDECREF(__pyx_v_toskip); @@ -44873,21 +44867,22 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_ __pyx_t_5 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { PyObject* sequence = __pyx_t_6; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 3)) { + if (size > 3) __Pyx_RaiseTooManyValuesError(3); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 3)) { - if (PyTuple_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_10 = PyTuple_GET_ITEM(sequence, 2); } else { - if (unlikely(PyList_GET_SIZE(sequence) != 3)) { - if (PyList_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } __pyx_t_7 = PyList_GET_ITEM(sequence, 0); __pyx_t_9 = PyList_GET_ITEM(sequence, 1); __pyx_t_10 = PyList_GET_ITEM(sequence, 2); @@ -44895,10 +44890,16 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_ __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_10); + #else + __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 877; __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 = 877; __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 = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } else { + } else + { Py_ssize_t index = -1; - __pyx_t_11 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __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 = 877; __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; @@ -44908,14 +44909,15 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_ __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 = 882; __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 = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L8_unpacking_done; __pyx_L7_unpacking_failed:; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L8_unpacking_done:; } __Pyx_XDECREF(__pyx_v_i); @@ -44928,46 +44930,45 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_ __pyx_v_pathlen = __pyx_t_10; __pyx_t_10 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":883 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":878 * 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 = 883; __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 = 878; __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 = 883; __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 = 878; __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); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_v_spanlen); __pyx_v_spanlen = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":884 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":879 * 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); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __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_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 = 879; __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 = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_12) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":885 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":880 * 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 = 885; __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 = 880; __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); @@ -44978,7 +44979,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_ __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 = 885; __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 = 880; __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; @@ -44986,44 +44987,42 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_ } __pyx_L9:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":886 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":881 * 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 = 886; __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 = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF(__pyx_v_ni); __pyx_v_ni = __pyx_t_6; __pyx_t_6 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":887 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":882 * 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 = 887; __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 = 887; __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 = 882; __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 = 882; __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); 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_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 = 882; __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 = 887; __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 = 882; __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 = 887; __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 = 882; __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 = 887; __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 = 882; __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); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); + __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 = 882; __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 = 887; __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 = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_15 = __pyx_t_14; } else { @@ -45031,34 +45030,34 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_ } if (__pyx_t_15) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":888 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":883 * 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 = 888; __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 = 883; __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 = 888; __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 = 883; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":889 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":884 * 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 = 889; __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 = 884; __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 = 889; __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 = 884; __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 = 889; __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 = 884; __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 = 889; __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 = 884; __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); @@ -45069,7 +45068,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_ __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 = 889; __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 = 884; __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); @@ -45077,7 +45076,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_ __Pyx_GIVEREF(((PyObject *)__pyx_t_10)); __pyx_t_5 = 0; __pyx_t_10 = 0; - __pyx_t_17 = PyList_Append(__pyx_v_nf, ((PyObject *)__pyx_t_4)); if (unlikely(__pyx_t_17 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PyList_Append(__pyx_v_nf, ((PyObject *)__pyx_t_4)); if (unlikely(__pyx_t_17 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; } goto __pyx_L10; @@ -45086,18 +45085,18 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":890 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":885 * 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)); + __pyx_t_2 = PyList_GET_SIZE(((PyObject *)__pyx_v_nf)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_15 = (__pyx_t_2 > 0); if (__pyx_t_15) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":891 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":886 * nf.append((toskip - 1, (ni, na, pathlen + 1))) * if (len(nf) > 0): * return self.advance(nf, res, fwords) # <<<<<<<<<<<<<< @@ -45105,9 +45104,9 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_ * return res */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyObject_GetAttr(((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_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__advance); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 886; __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 = 891; __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 = 886; __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)); @@ -45118,7 +45117,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_ __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 = 891; __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 = 886; __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; @@ -45129,7 +45128,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_ } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":893 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":888 * return self.advance(nf, res, fwords) * else: * return res # <<<<<<<<<<<<<< @@ -45179,11 +45178,11 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_15get_all_nodes_isteps_ PyObject *__pyx_v_fwords = 0; PyObject *__pyx_v_next_states = 0; PyObject *__pyx_v_reachable_buffer = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__skip,&__pyx_n_s__i,&__pyx_n_s__spanlen,&__pyx_n_s__pathlen,&__pyx_n_s__fwords,&__pyx_n_s__next_states,&__pyx_n_s__reachable_buffer,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_all_nodes_isteps_away (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__skip,&__pyx_n_s__i,&__pyx_n_s__spanlen,&__pyx_n_s__pathlen,&__pyx_n_s__fwords,&__pyx_n_s__next_states,&__pyx_n_s__reachable_buffer,0}; PyObject* values[7] = {0,0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -45202,48 +45201,41 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_15get_all_nodes_isteps_ kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__skip); - if (likely(values[0])) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__skip)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__i); - if (likely(values[1])) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__i)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __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 = 890; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: - values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__spanlen); - if (likely(values[2])) kw_args--; + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__spanlen)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __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 = 890; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: - values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pathlen); - if (likely(values[3])) kw_args--; + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pathlen)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __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 = 890; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: - values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fwords); - if (likely(values[4])) kw_args--; + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fwords)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, 4); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __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 = 890; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: - values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__next_states); - if (likely(values[5])) kw_args--; + if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__next_states)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, 5); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __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 = 890; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 6: - values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__reachable_buffer); - if (likely(values[6])) kw_args--; + if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__reachable_buffer)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, 6); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __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 = 890; __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 = 895; __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 = 890; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 7) { goto __pyx_L5_argtuple_error; @@ -45266,7 +45258,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_15get_all_nodes_isteps_ } 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 = 895; __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 = 890; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.get_all_nodes_isteps_away", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -45277,7 +45269,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_15get_all_nodes_isteps_ return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":895 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":890 * return res * * def get_all_nodes_isteps_away(self, skip, i, spanlen, pathlen, fwords, next_states, reachable_buffer): # <<<<<<<<<<<<<< @@ -45315,42 +45307,41 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_all_nodes_isteps_away", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":897 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":892 * 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 = 897; __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 = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_frontier = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":898 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":893 * 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 = 898; __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 = 893; __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 = 898; __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 = 893; __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 = 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_t_3 = PyObject_Length(__pyx_v_next_states); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 893; __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 = 893; __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); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __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 = 893; __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 = 898; __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 = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":899 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":894 * frontier = [] * if (i+spanlen+skip >= len(next_states)): * return frontier # <<<<<<<<<<<<<< @@ -45365,14 +45356,14 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_ } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":900 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":895 * 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 = 900; __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 = 895; __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); @@ -45380,42 +45371,42 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_ __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(__pyx_t_4)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)PyList_AsTuple(__pyx_t_4)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __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 = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":901 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":896 * 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 = 901; __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 = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_reachable = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":902 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":897 * key = tuple([i,spanlen]) * reachable = [] * if (key in reachable_buffer): # <<<<<<<<<<<<<< * reachable = reachable_buffer[key] * else: */ - __pyx_t_5 = ((PySequence_Contains(__pyx_v_reachable_buffer, ((PyObject *)__pyx_v_key)))); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 902; __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 = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_5) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":903 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":898 * 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 = 903; __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 = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_v_reachable); __pyx_v_reachable = __pyx_t_1; @@ -45424,16 +45415,16 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_ } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":905 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":900 * reachable = reachable_buffer[key] * else: * reachable = self.reachable(fwords, i, spanlen) # <<<<<<<<<<<<<< * reachable_buffer[key] = reachable * for nextreachable in reachable: */ - __pyx_t_1 = PyObject_GetAttr(((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_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__reachable); 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_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_t_4 = PyTuple_New(3); 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_fwords); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_fwords); @@ -45444,7 +45435,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_ __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 = 905; __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 = 900; __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; @@ -45452,18 +45443,18 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_ __pyx_v_reachable = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":906 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":901 * 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 = 906; __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 = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L4:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":907 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":902 * reachable = self.reachable(fwords, i, spanlen) * reachable_buffer[key] = reachable * for nextreachable in reachable: # <<<<<<<<<<<<<< @@ -45474,23 +45465,31 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_ __pyx_t_2 = __pyx_v_reachable; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_6 = 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 = 907; __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 = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext; } for (;;) { if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_2)) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; + #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 = 902; __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 = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_2)) { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; + #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 = 902; __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 = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else { __pyx_t_4 = __pyx_t_6(__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 = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -45500,20 +45499,20 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_ __pyx_v_nextreachable = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":908 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":903 * 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 = 908; __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 = 903; __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_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -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_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = Py_TYPE(__pyx_t_1)->tp_iternext; } @@ -45521,16 +45520,24 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_ for (;;) { if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else { __pyx_t_4 = __pyx_t_8(__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 = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -45540,16 +45547,16 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_ __pyx_v_next_id = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":909 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":904 * 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 = PyObject_GetAttr(((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_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__shortest); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_fwords); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_fwords); @@ -45560,7 +45567,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_ __Pyx_INCREF(__pyx_v_next_id); PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_v_next_id); __Pyx_GIVEREF(__pyx_v_next_id); - __pyx_t_10 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; @@ -45568,20 +45575,19 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_ __pyx_v_jump = __pyx_t_10; __pyx_t_10 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":910 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":905 * 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_10 = PyObject_RichCompare(__pyx_v_jump, __pyx_v_skip, Py_LT); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_RichCompare(__pyx_v_jump, __pyx_v_skip, Py_LT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_5) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":911 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":906 * jump = self.shortest(fwords,i,next_id) * if jump < skip: * continue # <<<<<<<<<<<<<< @@ -45593,51 +45599,50 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_ } __pyx_L9:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":912 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":907 * 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_10 = PyNumber_Add(__pyx_v_pathlen, __pyx_v_jump); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyNumber_Add(__pyx_v_pathlen, __pyx_v_jump); 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_9 = PyInt_FromLong(__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyInt_FromLong(__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_10, __pyx_t_9, Py_LE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_10, __pyx_t_9, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 912; __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 = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":913 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":908 * 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 = 913; __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_Length(__pyx_t_4); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_11 == -1)) {__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_t_4 = PyInt_FromSsize_t(__pyx_t_11); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_11); if (unlikely(!__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_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__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(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) { __pyx_t_9 = __pyx_t_4; __Pyx_INCREF(__pyx_t_9); __pyx_t_11 = 0; __pyx_t_12 = NULL; } else { - __pyx_t_11 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_12 = Py_TYPE(__pyx_t_9)->tp_iternext; } @@ -45645,16 +45650,24 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_ for (;;) { if (!__pyx_t_12 && PyList_CheckExact(__pyx_t_9)) { if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_9)) break; - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_11); __Pyx_INCREF(__pyx_t_4); __pyx_t_11++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_11); __Pyx_INCREF(__pyx_t_4); __pyx_t_11++; 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_9, __pyx_t_11); __pyx_t_11++; 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_12 && PyTuple_CheckExact(__pyx_t_9)) { if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_9)) break; - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_11); __Pyx_INCREF(__pyx_t_4); __pyx_t_11++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_11); __Pyx_INCREF(__pyx_t_4); __pyx_t_11++; 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_9, __pyx_t_11); __pyx_t_11++; 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_12(__pyx_t_9); if (unlikely(!__pyx_t_4)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -45664,41 +45677,40 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_ __pyx_v_alt_id = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":914 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":909 * 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 = 914; __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 = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_10 = PyObject_GetItem(__pyx_t_4, __pyx_v_alt_id); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_GetItem(__pyx_t_4, __pyx_v_alt_id); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 909; __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_10, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_10, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyInt_FromLong(__pyx_v_3_sa_EPSILON); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyInt_FromLong(__pyx_v_3_sa_EPSILON); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_13 = PyObject_RichCompare(__pyx_t_4, __pyx_t_10, Py_NE); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_13); + __pyx_t_13 = PyObject_RichCompare(__pyx_t_4, __pyx_t_10, Py_NE); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 909; __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_5 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_5) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":915 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":910 * 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_13 = PyNumber_Add(__pyx_v_pathlen, __pyx_v_jump); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = PyNumber_Add(__pyx_v_pathlen, __pyx_v_jump); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_13); - __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 915; __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 = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_v_next_id); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_next_id); @@ -45713,26 +45725,26 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_ __pyx_v_newel = __pyx_t_10; __pyx_t_10 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":916 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":911 * 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_5 = (__Pyx_NegateNonNeg(PySequence_Contains(((PyObject *)__pyx_v_frontier), ((PyObject *)__pyx_v_newel)))); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = (__Pyx_PySequence_Contains(((PyObject *)__pyx_v_newel), ((PyObject *)__pyx_v_frontier), Py_NE)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_5) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":917 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":912 * newel = (next_id,alt_id,pathlen+jump) * if newel not in frontier: * frontier.append((next_id,alt_id,pathlen+jump)) # <<<<<<<<<<<<<< * return frontier * */ - __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_t_10 = PyNumber_Add(__pyx_v_pathlen, __pyx_v_jump); 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_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_13); __Pyx_INCREF(__pyx_v_next_id); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_next_id); @@ -45743,7 +45755,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_ PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_14 = PyList_Append(__pyx_v_frontier, ((PyObject *)__pyx_t_13)); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyList_Append(__pyx_v_frontier, ((PyObject *)__pyx_t_13)); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0; goto __pyx_L14; } @@ -45762,7 +45774,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":918 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":913 * if newel not in frontier: * frontier.append((next_id,alt_id,pathlen+jump)) * return frontier # <<<<<<<<<<<<<< @@ -45805,11 +45817,11 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_17reachable(PyObject *_ PyObject *__pyx_v_fwords = 0; PyObject *__pyx_v_ifrom = 0; PyObject *__pyx_v_dist = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fwords,&__pyx_n_s__ifrom,&__pyx_n_s__dist,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reachable (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fwords,&__pyx_n_s__ifrom,&__pyx_n_s__dist,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -45824,24 +45836,21 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_17reachable(PyObject *_ kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fwords); - if (likely(values[0])) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fwords)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ifrom); - if (likely(values[1])) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ifrom)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("reachable", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("reachable", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: - values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dist); - if (likely(values[2])) kw_args--; + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dist)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("reachable", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("reachable", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 915; __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 = 920; __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 = 915; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -45856,7 +45865,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_17reachable(PyObject *_ } 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 = 920; __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 = 915; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.reachable", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -45867,7 +45876,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_17reachable(PyObject *_ return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":920 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":915 * return frontier * * def reachable(self, fwords, ifrom, dist): # <<<<<<<<<<<<<< @@ -45897,36 +45906,35 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("reachable", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":921 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":916 * * 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 = 921; __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 = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_ret = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":922 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":917 * 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 = 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_t_2 = PyObject_Length(__pyx_v_fwords); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 917; __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 = 917; __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); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __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 = 917; __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 = 922; __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 = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":923 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":918 * ret = [] * if (ifrom >= len(fwords)): * return ret # <<<<<<<<<<<<<< @@ -45941,32 +45949,32 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __py } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":924 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":919 * 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 = 924; __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_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_t_2 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_2 == -1)) {__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_t_3 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 924; __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 = 919; __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 = 924; __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 = 919; __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 = 924; __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 = 919; __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 = 924; __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 = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; } @@ -45974,16 +45982,24 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __py for (;;) { if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; + #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 = 919; __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 = 919; __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; - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; + #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 = 919; __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 = 919; __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 = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -45993,54 +46009,53 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __py __pyx_v_alt_id = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":925 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":920 * 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 = 925; __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_6 = PyObject_GetItem(__pyx_t_3, __pyx_v_alt_id); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 925; __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 = 920; __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); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_6, 0, sizeof(long), PyInt_FromLong); 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_6); __pyx_t_6 = 0; - __pyx_t_6 = PyInt_FromLong(__pyx_v_3_sa_EPSILON); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyInt_FromLong(__pyx_v_3_sa_EPSILON); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_t_6, Py_EQ); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); + __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 = 920; __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 = 925; __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 = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_4) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":926 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":921 * 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 = PyObject_GetAttr(((PyObject *)__pyx_v_ret), __pyx_n_s__extend); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_GetAttr(((PyObject *)__pyx_v_ret), __pyx_n_s__extend); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = PyObject_GetAttr(((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_t_6 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__reachable); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 921; __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 = 926; __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 = 921; __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 = 926; __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 = 921; __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); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_8, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 921; __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 = 926; __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 = 921; __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 = 926; __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 = 921; __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); @@ -46051,16 +46066,16 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __py 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 = 926; __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 = 921; __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 = 926; __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 = 921; __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 = 926; __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 = 921; __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; @@ -46069,37 +46084,36 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __py } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":928 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":923 * 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); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 928; __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 = 923; __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 = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_4) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":929 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":924 * else: * if (dist==0): * if (ifrom not in ret): # <<<<<<<<<<<<<< * ret.append(ifrom) * else: */ - __pyx_t_4 = (__Pyx_NegateNonNeg(PySequence_Contains(((PyObject *)__pyx_v_ret), __pyx_v_ifrom))); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 929; __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 = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_4) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":930 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":925 * 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_9 = PyList_Append(__pyx_v_ret, __pyx_v_ifrom); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyList_Append(__pyx_v_ret, __pyx_v_ifrom); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L8; } __pyx_L8:; @@ -46107,29 +46121,29 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __py } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":932 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":927 * 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 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__reachable); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__reachable); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 927; __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 = 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 = 927; __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 = 932; __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 = 927; __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); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_7, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 927; __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 = 932; __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 = 927; __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 = 932; __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 = 927; __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 = 932; __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 = 927; __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); @@ -46140,7 +46154,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __py __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 = 932; __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 = 927; __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; @@ -46148,7 +46162,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __py __pyx_t_6 = __pyx_t_3; __Pyx_INCREF(__pyx_t_6); __pyx_t_10 = 0; __pyx_t_11 = NULL; } else { - __pyx_t_10 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_11 = Py_TYPE(__pyx_t_6)->tp_iternext; } @@ -46156,16 +46170,24 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __py for (;;) { if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_6)) { if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_6)) break; - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_6)) { if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_6)) break; - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else { __pyx_t_3 = __pyx_t_11(__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 = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -46175,24 +46197,24 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __py __pyx_v_ifromchild = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":933 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":928 * 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_4 = (__Pyx_NegateNonNeg(PySequence_Contains(((PyObject *)__pyx_v_ret), __pyx_v_ifromchild))); 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_PySequence_Contains(__pyx_v_ifromchild, ((PyObject *)__pyx_v_ret), Py_NE)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_4) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":934 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":929 * 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_9 = PyList_Append(__pyx_v_ret, __pyx_v_ifromchild); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyList_Append(__pyx_v_ret, __pyx_v_ifromchild); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L11; } __pyx_L11:; @@ -46205,7 +46227,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __py } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":936 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":931 * ret.append(ifromchild) * * return ret # <<<<<<<<<<<<<< @@ -46242,11 +46264,11 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_19shortest(PyObject *__ PyObject *__pyx_v_fwords = 0; PyObject *__pyx_v_ifrom = 0; PyObject *__pyx_v_ito = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fwords,&__pyx_n_s__ifrom,&__pyx_n_s__ito,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("shortest (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fwords,&__pyx_n_s__ifrom,&__pyx_n_s__ito,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -46261,24 +46283,21 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_19shortest(PyObject *__ kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fwords); - if (likely(values[0])) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fwords)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ifrom); - if (likely(values[1])) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ifrom)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("shortest", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("shortest", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: - values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ito); - if (likely(values[2])) kw_args--; + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ito)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("shortest", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("shortest", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 933; __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 = 938; __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 = 933; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -46293,7 +46312,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_19shortest(PyObject *__ } 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 = 938; __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 = 933; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.shortest", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -46304,7 +46323,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_19shortest(PyObject *__ return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":938 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":933 * return ret * * def shortest(self, fwords, ifrom, ito): # <<<<<<<<<<<<<< @@ -46329,7 +46348,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_18shortest(struct __pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("shortest", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":940 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":935 * def shortest(self, fwords, ifrom, ito): * cdef unsigned alt_id * min = 1000 # <<<<<<<<<<<<<< @@ -46339,20 +46358,19 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_18shortest(struct __pyx __Pyx_INCREF(__pyx_int_1000); __pyx_v_min = __pyx_int_1000; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":941 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":936 * 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); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 941; __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 = 941; __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 = 936; __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 = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":942 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":937 * min = 1000 * if (ifrom > ito): * return min # <<<<<<<<<<<<<< @@ -46367,20 +46385,19 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_18shortest(struct __pyx } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":943 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":938 * 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); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 943; __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 = 943; __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 = 938; __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 = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":944 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":939 * return min * if (ifrom == ito): * return 0 # <<<<<<<<<<<<<< @@ -46395,41 +46412,41 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_18shortest(struct __pyx } __pyx_L4:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":945 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":940 * 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 = 945; __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 = 940; __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 = 945; __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 = 940; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":946 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":941 * 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 = PyObject_GetAttr(((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_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__shortest); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 941; __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 = 946; __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 = 941; __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); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 946; __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); 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 = __Pyx_GetItemInt(__pyx_t_6, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, 2, sizeof(long), PyInt_FromLong); 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 = 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_t_6 = PyNumber_Add(__pyx_v_ifrom, __pyx_t_5); if (unlikely(!__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 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 946; __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 = 941; __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); @@ -46440,7 +46457,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_18shortest(struct __pyx 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 = 946; __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 = 941; __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; @@ -46448,39 +46465,38 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_18shortest(struct __pyx __pyx_v_currmin = __pyx_t_6; __pyx_t_6 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":947 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":942 * 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 0) { @@ -46587,7 +46600,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_21get_next_states(PyObj } } 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 = 953; __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 = 948; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -46604,7 +46617,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_21get_next_states(PyObj } 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 = 953; __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 = 948; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.get_next_states", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -46615,7 +46628,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_21get_next_states(PyObj return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":953 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":948 * return min * * def get_next_states(self, _columns, curr_idx, min_dist=2): # <<<<<<<<<<<<<< @@ -46648,26 +46661,26 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_next_states", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":954 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":949 * * 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 = 954; __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 = 949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_result = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":955 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":950 * 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 = 955; __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 = 950; __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); @@ -46675,7 +46688,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc __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 = 955; __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 = 950; __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)); @@ -46683,7 +46696,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc __pyx_v_candidate = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":957 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":952 * candidate = [[curr_idx,0]] * * while len(candidate) > 0: # <<<<<<<<<<<<<< @@ -46691,44 +46704,43 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc * if curr[0] >= len(_columns): */ while (1) { - __pyx_t_3 = PyList_GET_SIZE(((PyObject *)__pyx_v_candidate)); + __pyx_t_3 = PyList_GET_SIZE(((PyObject *)__pyx_v_candidate)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = (__pyx_t_3 > 0); if (!__pyx_t_4) break; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":958 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":953 * * 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 = 958; __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 = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF(__pyx_v_curr); __pyx_v_curr = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":959 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":954 * 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); 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_curr, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 954; __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 = 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_t_3 = PyObject_Length(__pyx_v__columns); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 954; __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 = 954; __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); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); + __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 = 954; __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 = 959; __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 = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_4) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":960 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":955 * curr = candidate.pop() * if curr[0] >= len(_columns): * continue # <<<<<<<<<<<<<< @@ -46740,32 +46752,30 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc } __pyx_L5:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":961 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":956 * 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); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_curr, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = (__Pyx_NegateNonNeg(PySequence_Contains(((PyObject *)__pyx_v_result), __pyx_t_5))); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 961; __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 = 956; __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); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_curr, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 956; __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); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __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 = 956; __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 = 961; __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 = 956; __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); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __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 = 956; __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 = 961; __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 = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = __pyx_t_6; } else { @@ -46773,38 +46783,38 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc } if (__pyx_t_7) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":962 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":957 * 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); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 0, sizeof(long), PyInt_FromLong); 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_8 = 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_t_8 = PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L6; } __pyx_L6:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":963 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":958 * 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); 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, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 958; __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 = 963; __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 = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_v_curr_col); __pyx_v_curr_col = __pyx_t_5; __pyx_t_5 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":964 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":959 * result.append(curr[0]); * curr_col = _columns[curr[0]] * for alt in curr_col: # <<<<<<<<<<<<<< @@ -46815,23 +46825,31 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc __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 = 964; __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 = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; } for (;;) { if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_5)) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_5)) break; - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; + #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 = 959; __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 = 959; __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; - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; + #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 = 959; __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 = 959; __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 = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -46841,18 +46859,18 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc __pyx_v_alt = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":965 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":960 * 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); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 960; __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); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_alt, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 960; __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 = 965; __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 = 960; __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; @@ -46860,7 +46878,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc __pyx_v_next_id = __pyx_t_10; __pyx_t_10 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":966 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":961 * for alt in curr_col: * next_id = curr[0]+alt[2] * jump = 1 # <<<<<<<<<<<<<< @@ -46871,26 +46889,25 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc __Pyx_XDECREF(__pyx_v_jump); __pyx_v_jump = __pyx_int_1; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":967 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":962 * 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); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_alt, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_2 = PyInt_FromLong(__pyx_v_3_sa_EPSILON); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong(__pyx_v_3_sa_EPSILON); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_10, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __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 = 962; __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 = 967; __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 = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_7) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":968 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":963 * jump = 1 * if (alt[0] == EPSILON): * jump = 0 # <<<<<<<<<<<<<< @@ -46904,32 +46921,30 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc } __pyx_L9:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":969 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":964 * 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_NegateNonNeg(PySequence_Contains(((PyObject *)__pyx_v_result), __pyx_v_next_id))); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 969; __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 = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_7) { - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 1, sizeof(long), PyInt_FromLong); 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 = 969; __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 = PyObject_RichCompare(__pyx_v_min_dist, __pyx_t_2, Py_LE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __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 = 964; __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 = 969; __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 = 964; __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); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __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 = 964; __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 = 969; __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 = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __pyx_t_4; } else { @@ -46937,19 +46952,19 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc } if (__pyx_t_6) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":970 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":965 * 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); 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, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 965; __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 = 970; __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 = 965; __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 = 970; __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 = 965; __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); @@ -46957,7 +46972,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_8 = PyList_Append(__pyx_v_candidate, ((PyObject *)__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 = PyList_Append(__pyx_v_candidate, ((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; goto __pyx_L10; } @@ -46967,7 +46982,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc __pyx_L3_continue:; } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":971 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":966 * 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); # <<<<<<<<<<<<<< @@ -46975,12 +46990,12 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc * def input(self, fwords, meta): */ __Pyx_XDECREF(__pyx_r); - __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_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 966; __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 = 971; __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 = 966; __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; @@ -47016,11 +47031,11 @@ static char __pyx_doc_3_sa_23HieroCachingRuleFactory_22input[] = "When this func static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_23input(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_fwords = 0; PyObject *__pyx_v_meta = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fwords,&__pyx_n_s__meta,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("input (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fwords,&__pyx_n_s__meta,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -47034,18 +47049,16 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_23input(PyObject *__pyx kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fwords); - if (likely(values[0])) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fwords)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__meta); - if (likely(values[1])) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__meta)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("input", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("input", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } 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 = 973; __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 = 968; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -47058,7 +47071,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_23input(PyObject *__pyx } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("input", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("input", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.input", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -47076,7 +47089,6 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_5input_lambda4(PyObject PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda4 (wrapper)", 0); - __pyx_self = __pyx_self; __pyx_r = __pyx_lambda_funcdef_lambda4(__pyx_self); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -47089,13 +47101,12 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_5input_7lambda4_lambda5 PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda5 (wrapper)", 0); - __pyx_self = __pyx_self; __pyx_r = __pyx_lambda_funcdef_lambda5(__pyx_self); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1142 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1145 * if len(extracts) > 0: * fcount = Counter() * fphrases = defaultdict(lambda: defaultdict(lambda: defaultdict(list))) # <<<<<<<<<<<<<< @@ -47114,14 +47125,14 @@ 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_GetName(__pyx_m, __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_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1145; __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 = 1142; __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 = 1145; __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 = 1142; __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 = 1145; __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; @@ -47154,16 +47165,16 @@ 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_GetName(__pyx_m, __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_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_5input_7lambda4_lambda5, 0, NULL, __pyx_n_s___sa, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_5input_7lambda4_lambda5, 0, NULL, __pyx_n_s___sa, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1145; __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 = 1142; __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 = 1145; __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 = 1142; __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 = 1145; __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; @@ -47192,13 +47203,12 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_5input_1lambda6(PyObjec PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda6 (wrapper)", 0); - __pyx_self = __pyx_self; __pyx_r = __pyx_lambda_funcdef_lambda6(__pyx_self, ((PyObject *)__pyx_v_x)); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1148 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1151 * for f, elist in fphrases.iteritems(): * for e, alslist in elist.iteritems(): * alignment, max_locs = max(alslist.iteritems(), key=lambda x: len(x[1])) # <<<<<<<<<<<<<< @@ -47216,11 +47226,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, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, sizeof(long), PyInt_FromLong); if (!__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_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_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __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 = 1148; __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 = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -47239,7 +47249,7 @@ static PyObject *__pyx_lambda_funcdef_lambda6(CYTHON_UNUSED PyObject *__pyx_self } static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_5input_4generator14(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1187 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1190 * # Online rule extraction and scoring * if self.online: * f_syms = tuple(word[0][0] for word in fwords) # <<<<<<<<<<<<<< @@ -47265,7 +47275,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_5input_2genexpr(PyObjec __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_3_sa_23HieroCachingRuleFactory_5input_4generator14, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_3_sa_23HieroCachingRuleFactory_5input_4generator14, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -47302,29 +47312,37 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_5input_4generator14(__p return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1187; __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 = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __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 = 1190; __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 = 1187; __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 = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; } for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #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 = 1190; __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 = 1190; __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; - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #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 = 1190; __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 = 1190; __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 = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -47335,9 +47353,9 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_5input_4generator14(__p __Pyx_GIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_v_word = __pyx_t_4; __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_word, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_word, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __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); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __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; @@ -47357,7 +47375,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_5input_4generator14(__p __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 = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyErr_SetNone(PyExc_StopIteration); @@ -47370,11 +47388,12 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_5input_4generator14(__p __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_generator->resume_label = -1; + __Pyx_Generator_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return NULL; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":973 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":968 * return sorted(result); * * def input(self, fwords, meta): # <<<<<<<<<<<<<< @@ -47406,7 +47425,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_22input(struct __pyx_ob __Pyx_INCREF(__pyx_cur_scope->__pyx_v_meta); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_meta); { - __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_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_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -47450,25 +47469,28 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene int __pyx_t_20; int __pyx_t_21; PyObject *(*__pyx_t_22)(PyObject *); - Py_ssize_t __pyx_t_23; - PyObject *(*__pyx_t_24)(PyObject *); + long __pyx_t_23; + Py_ssize_t __pyx_t_24; Py_ssize_t __pyx_t_25; - int __pyx_t_26; - int __pyx_t_27; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + int __pyx_t_28; + int __pyx_t_29; + PyObject *(*__pyx_t_30)(PyObject *); __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("None", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; - case 1: goto __pyx_L65_resume_from_yield; - case 2: goto __pyx_L86_resume_from_yield; + case 1: goto __pyx_L66_resume_from_yield; + case 2: goto __pyx_L87_resume_from_yield; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":984 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":979 * cdef Phrase hiero_phrase * * flen = len(fwords) # <<<<<<<<<<<<<< @@ -47477,27 +47499,27 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene */ __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 = 984; __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 = 979; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":985 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":980 * * flen = len(fwords) * start_time = monitor_cpu() # <<<<<<<<<<<<<< * self.extract_time = 0.0 * self.intersect_time = 0.0 */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __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_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 980; __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 = 985; __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 = 980; __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 = 985; __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 = 980; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":986 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":981 * flen = len(fwords) * start_time = monitor_cpu() * self.extract_time = 0.0 # <<<<<<<<<<<<<< @@ -47506,7 +47528,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene */ __pyx_cur_scope->__pyx_v_self->extract_time = 0.0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":987 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":982 * start_time = monitor_cpu() * self.extract_time = 0.0 * self.intersect_time = 0.0 # <<<<<<<<<<<<<< @@ -47515,20 +47537,20 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene */ __pyx_cur_scope->__pyx_v_self->intersect_time = 0.0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":988 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":983 * 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 = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 983; __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 = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":989 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":984 * self.intersect_time = 0.0 * nodes_isteps_away_buffer = {} * hit = 0 # <<<<<<<<<<<<<< @@ -47537,46 +47559,46 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene */ __pyx_cur_scope->__pyx_v_hit = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":990 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":985 * 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 = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 985; __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 = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":995 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":990 * # 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 = 995; __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 = 990; __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 = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":998 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":993 * * # 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 = 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 = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_PhraseLocation)), ((PyObject *)__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_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 993; __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 = 998; __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 = 993; __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_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 993; __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); @@ -47585,20 +47607,20 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_self->rules->root = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1000 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":995 * 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 = 1000; __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 = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); __pyx_cur_scope->__pyx_v_frontier = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1001 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":996 * * frontier = [] * for i in range(len(fwords)): # <<<<<<<<<<<<<< @@ -47607,73 +47629,72 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene */ __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 = 1001; __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 = 996; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1002 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":997 * 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); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1002; __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); 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_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_t_6 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 997; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1003 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":998 * 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); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1003; __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); if (!__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_3 = __Pyx_GetItemInt(__pyx_t_1, __pyx_cur_scope->__pyx_v_alt, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1003; __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); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 998; __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); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong); if (!__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(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyInt_FromLong(__pyx_v_3_sa_EPSILON); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(__pyx_v_3_sa_EPSILON); 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_8 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_NE); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); + __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 = 998; __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 = 1003; __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 = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1004 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":999 * 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 = 1004; __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 = 999; __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 = 1004; __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 = 999; __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 = 1004; __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 = 999; __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 = 1004; __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 = 999; __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 = 1004; __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 = 999; __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 = 1004; __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 = 999; __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 = 1004; __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 = 999; __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); @@ -47699,7 +47720,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_t_10 = 0; __pyx_t_1 = 0; __pyx_t_11 = 0; - __pyx_t_13 = 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 = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = 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 = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; goto __pyx_L8; } @@ -47707,7 +47728,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene } } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1006 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1001 * frontier.append((i, i, (i,), alt, 0, self.rules.root, (), False)) * * xroot = None # <<<<<<<<<<<<<< @@ -47718,7 +47739,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __Pyx_GIVEREF(Py_None); __pyx_cur_scope->__pyx_v_xroot = Py_None; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1007 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1002 * * xroot = None * x1 = sym_setindex(self.category, 1) # <<<<<<<<<<<<<< @@ -47727,32 +47748,32 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene */ __pyx_cur_scope->__pyx_v_x1 = __pyx_f_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, 1); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1008 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1003 * 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 = 1008; __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 = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); - __pyx_t_11 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_self->rules->root, __pyx_n_s__children); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyObject_GetAttr(__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_9 = ((PySequence_Contains(__pyx_t_11, __pyx_t_12))); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1008; __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 = 1003; __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; if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1009 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1004 * 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 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_self->rules->root, __pyx_n_s__children); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_self->rules->root, __pyx_n_s__children); 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 = __Pyx_GetItemInt(__pyx_t_11, __pyx_cur_scope->__pyx_v_x1, sizeof(int), PyInt_FromLong); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1009; __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); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1004; __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); @@ -47764,21 +47785,21 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1011 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1006 * 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 = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1006; __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 = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __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 = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), NULL); 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 (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_11) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __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 = 1006; __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_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_12)); 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); __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_xroot); @@ -47787,21 +47808,21 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_xroot = __pyx_t_11; __pyx_t_11 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1012 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1007 * 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 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_self->rules->root, __pyx_n_s__children); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_self->rules->root, __pyx_n_s__children); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1007; __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) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1012; __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) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __pyx_L9:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1014 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1009 * self.rules.root.children[x1] = xroot * * for i in range(self.min_gap_size, len(fwords)): # <<<<<<<<<<<<<< @@ -47810,82 +47831,81 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene */ __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 = 1014; __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 = 1009; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1015 + /* "/home/pauldb/workspace/cdec/python/src/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); if (!__pyx_t_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1015; __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); 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_6 = PyObject_Length(__pyx_t_11); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1015; __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 = 1010; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1016 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1011 * 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); if (!__pyx_t_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1016; __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); if (!__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_12 = __Pyx_GetItemInt(__pyx_t_11, __pyx_cur_scope->__pyx_v_alt, sizeof(int), PyInt_FromLong); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1016; __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); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __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); if (!__pyx_t_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_12, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __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_3_sa_EPSILON); 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_v_3_sa_EPSILON); 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_1 = PyObject_RichCompare(__pyx_t_11, __pyx_t_12, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __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 = 1011; __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_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); 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_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 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; if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1017 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1012 * 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 = 1017; __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 = 1012; __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 = 1017; __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 = 1012; __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 = 1017; __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 = 1012; __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 = 1017; __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 = 1012; __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 = 1017; __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 = 1012; __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 = 1017; __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 = 1012; __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 = 1017; __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 = 1012; __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 = 1017; __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 = 1012; __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_PyBool_FromLong(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1017; __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 = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_15 = PyTuple_New(8); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyTuple_New(8); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -47911,7 +47931,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_t_3 = 0; __pyx_t_14 = 0; __pyx_t_8 = 0; - __pyx_t_13 = PyList_Append(__pyx_cur_scope->__pyx_v_frontier, ((PyObject *)__pyx_t_15)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = PyList_Append(__pyx_cur_scope->__pyx_v_frontier, ((PyObject *)__pyx_t_15)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0; goto __pyx_L14; } @@ -47919,20 +47939,20 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene } } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1019 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1014 * 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_15 = PyList_New(0); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __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 = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_GIVEREF(((PyObject *)__pyx_t_15)); __pyx_cur_scope->__pyx_v_next_states = __pyx_t_15; __pyx_t_15 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1020 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1015 * * next_states = [] * for i in range(len(fwords)): # <<<<<<<<<<<<<< @@ -47941,25 +47961,25 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene */ __pyx_t_15 = __pyx_cur_scope->__pyx_v_fwords; __Pyx_INCREF(__pyx_t_15); - __pyx_t_2 = PyObject_Length(__pyx_t_15); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(__pyx_t_15); if (unlikely(__pyx_t_2 == -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; 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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1021 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1016 * 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: + * # for i in range(len(fwords)): */ - __pyx_t_15 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__get_next_states); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__get_next_states); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - __pyx_t_8 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1021; __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 = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_14 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->min_gap_size); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->min_gap_size); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1021; __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 = 1016; __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); @@ -47970,34 +47990,34 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __Pyx_GIVEREF(__pyx_t_14); __pyx_t_8 = 0; __pyx_t_14 = 0; - __pyx_t_14 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_13 = PyList_Append(__pyx_cur_scope->__pyx_v_next_states, __pyx_t_14); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = PyList_Append(__pyx_cur_scope->__pyx_v_next_states, __pyx_t_14); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1023 - * next_states.append(self.get_next_states(fwords,i,self.min_gap_size)) + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1021 + * # print >> sys.stderr, fwords[i][0][0], sym_tostring(fwords[i][0][0]) * * while len(frontier) > 0: # <<<<<<<<<<<<<< * new_frontier = [] * 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)); + __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 = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_9 = (__pyx_t_2 > 0); if (!__pyx_t_9) break; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1024 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1022 * * 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_14 = PyList_New(0); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyList_New(0); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_new_frontier)); __Pyx_XDECREF(((PyObject *)__pyx_cur_scope->__pyx_v_new_frontier)); @@ -48005,7 +48025,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_new_frontier = __pyx_t_14; __pyx_t_14 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1025 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1023 * while len(frontier) > 0: * new_frontier = [] * for k, i, input_match, alt, pathlen, node, prefix, is_shadow_path in frontier: # <<<<<<<<<<<<<< @@ -48015,15 +48035,25 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_t_14 = ((PyObject *)__pyx_cur_scope->__pyx_v_frontier); __Pyx_INCREF(__pyx_t_14); __pyx_t_2 = 0; for (;;) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_14)) break; - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_14, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __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 CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 8)) { + if (size > 8) __Pyx_RaiseTooManyValuesError(8); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 8)) { - if (PyTuple_GET_SIZE(sequence) > 8) __Pyx_RaiseTooManyValuesError(8); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } __pyx_t_15 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_11 = PyTuple_GET_ITEM(sequence, 2); @@ -48033,11 +48063,6 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_t_16 = PyTuple_GET_ITEM(sequence, 6); __pyx_t_17 = PyTuple_GET_ITEM(sequence, 7); } else { - if (unlikely(PyList_GET_SIZE(sequence) != 8)) { - if (PyList_GET_SIZE(sequence) > 8) __Pyx_RaiseTooManyValuesError(8); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } __pyx_t_15 = PyList_GET_ITEM(sequence, 0); __pyx_t_8 = PyList_GET_ITEM(sequence, 1); __pyx_t_11 = PyList_GET_ITEM(sequence, 2); @@ -48055,44 +48080,44 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(__pyx_t_17); + #else + Py_ssize_t i; + PyObject** temps[8] = {&__pyx_t_15,&__pyx_t_8,&__pyx_t_11,&__pyx_t_10,&__pyx_t_12,&__pyx_t_1,&__pyx_t_16,&__pyx_t_17}; + for (i=0; i < 8; i++) { + PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + *(temps[i]) = item; + } + #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { + } else + { Py_ssize_t index = -1; - __pyx_t_18 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyObject** temps[8] = {&__pyx_t_15,&__pyx_t_8,&__pyx_t_11,&__pyx_t_10,&__pyx_t_12,&__pyx_t_1,&__pyx_t_16,&__pyx_t_17}; + __pyx_t_18 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_19 = Py_TYPE(__pyx_t_18)->tp_iternext; - index = 0; __pyx_t_15 = __pyx_t_19(__pyx_t_18); if (unlikely(!__pyx_t_15)) goto __pyx_L21_unpacking_failed; - __Pyx_GOTREF(__pyx_t_15); - index = 1; __pyx_t_8 = __pyx_t_19(__pyx_t_18); if (unlikely(!__pyx_t_8)) goto __pyx_L21_unpacking_failed; - __Pyx_GOTREF(__pyx_t_8); - index = 2; __pyx_t_11 = __pyx_t_19(__pyx_t_18); if (unlikely(!__pyx_t_11)) goto __pyx_L21_unpacking_failed; - __Pyx_GOTREF(__pyx_t_11); - index = 3; __pyx_t_10 = __pyx_t_19(__pyx_t_18); if (unlikely(!__pyx_t_10)) goto __pyx_L21_unpacking_failed; - __Pyx_GOTREF(__pyx_t_10); - index = 4; __pyx_t_12 = __pyx_t_19(__pyx_t_18); if (unlikely(!__pyx_t_12)) goto __pyx_L21_unpacking_failed; - __Pyx_GOTREF(__pyx_t_12); - index = 5; __pyx_t_1 = __pyx_t_19(__pyx_t_18); if (unlikely(!__pyx_t_1)) goto __pyx_L21_unpacking_failed; - __Pyx_GOTREF(__pyx_t_1); - index = 6; __pyx_t_16 = __pyx_t_19(__pyx_t_18); if (unlikely(!__pyx_t_16)) goto __pyx_L21_unpacking_failed; - __Pyx_GOTREF(__pyx_t_16); - index = 7; __pyx_t_17 = __pyx_t_19(__pyx_t_18); if (unlikely(!__pyx_t_17)) goto __pyx_L21_unpacking_failed; - __Pyx_GOTREF(__pyx_t_17); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_19(__pyx_t_18), 8) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (index=0; index < 8; index++) { + PyObject* item = __pyx_t_19(__pyx_t_18); if (unlikely(!item)) goto __pyx_L21_unpacking_failed; + __Pyx_GOTREF(item); + *(temps[index]) = item; + } + if (__Pyx_IternextUnpackEndCheck(__pyx_t_19(__pyx_t_18), 8) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = NULL; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; goto __pyx_L22_unpacking_done; __pyx_L21_unpacking_failed:; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L22_unpacking_done:; } - __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_t_15); 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_t_5 = __Pyx_PyInt_AsInt(__pyx_t_15); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 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 = 1025; __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 = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_20 = __Pyx_PyInt_AsInt(__pyx_t_10); if (unlikely((__pyx_t_20 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_20 = __Pyx_PyInt_AsInt(__pyx_t_10); if (unlikely((__pyx_t_20 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __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; @@ -48123,19 +48148,19 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_is_shadow_path = __pyx_t_17; __pyx_t_17 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1026 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1024 * 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); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1026; __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); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_17 = __Pyx_GetItemInt(__pyx_t_3, __pyx_cur_scope->__pyx_v_alt, sizeof(int), PyInt_FromLong); if (!__pyx_t_17) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = __Pyx_GetItemInt(__pyx_t_3, __pyx_cur_scope->__pyx_v_alt, sizeof(int), PyInt_FromLong); if (!__pyx_t_17) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_17, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_17, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_word_id); @@ -48144,19 +48169,19 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_word_id = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1027 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1025 * 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); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1027; __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); if (!__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_17 = __Pyx_GetItemInt(__pyx_t_3, __pyx_cur_scope->__pyx_v_alt, sizeof(int), PyInt_FromLong); if (!__pyx_t_17) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = __Pyx_GetItemInt(__pyx_t_3, __pyx_cur_scope->__pyx_v_alt, sizeof(int), PyInt_FromLong); if (!__pyx_t_17) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_17, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_17, 2, sizeof(long), PyInt_FromLong); if (!__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_17); __pyx_t_17 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_spanlen); @@ -48165,49 +48190,47 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_spanlen = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1029 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1027 * 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_3_sa_EPSILON); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(__pyx_v_3_sa_EPSILON); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_17 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_word_id, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_17); + __pyx_t_17 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_word_id, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_17); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_17); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_17); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1031 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1029 * 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_17 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1031; __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 = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); - __pyx_t_3 = PyNumber_Add(__pyx_t_17, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Add(__pyx_t_17, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __pyx_t_17 = __pyx_cur_scope->__pyx_v_fwords; __Pyx_INCREF(__pyx_t_17); - __pyx_t_6 = PyObject_Length(__pyx_t_17); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1031; __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 = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - __pyx_t_17 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); - __pyx_t_16 = PyObject_RichCompare(__pyx_t_3, __pyx_t_17, Py_GE); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_16); + __pyx_t_16 = PyObject_RichCompare(__pyx_t_3, __pyx_t_17, Py_GE); __Pyx_XGOTREF(__pyx_t_16); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_16); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_16); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1032 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1030 * # skipping because word_id is epsilon * if i+spanlen >= len(fwords): * continue # <<<<<<<<<<<<<< @@ -48219,43 +48242,43 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene } __pyx_L24:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1033 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1031 * 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_16 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1033; __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 = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_16); - __pyx_t_17 = PyNumber_Add(__pyx_t_16, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PyNumber_Add(__pyx_t_16, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; - __pyx_t_16 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fwords, __pyx_t_17); if (!__pyx_t_16) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fwords, __pyx_t_17); if (!__pyx_t_16) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - __pyx_t_6 = PyObject_Length(__pyx_t_16); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_Length(__pyx_t_16); 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_16); __pyx_t_16 = 0; for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_6; __pyx_t_20+=1) { __pyx_cur_scope->__pyx_v_nualt = __pyx_t_20; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1034 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1032 * 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_16 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_16); - __pyx_t_17 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1034; __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 = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); - __pyx_t_3 = PyNumber_Add(__pyx_t_17, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Add(__pyx_t_17, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - __pyx_t_17 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_nualt); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_nualt); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); - __pyx_t_1 = PyTuple_New(8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1034; __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 = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_16); __Pyx_GIVEREF(__pyx_t_16); @@ -48281,11 +48304,11 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_t_16 = 0; __pyx_t_3 = 0; __pyx_t_17 = 0; - __pyx_t_13 = 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 = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = 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 = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1035 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1033 * for nualt in range(0,len(fwords[i+spanlen])): * frontier.append((k, i+spanlen, input_match, nualt, pathlen, node, prefix, is_shadow_path)) * continue # <<<<<<<<<<<<<< @@ -48297,19 +48320,19 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene } __pyx_L23:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1037 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1035 * 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 = 1037; __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 = 1035; __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_17 = PyNumber_Add(__pyx_cur_scope->__pyx_v_prefix, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PyNumber_Add(__pyx_cur_scope->__pyx_v_prefix, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_phrase); @@ -48318,19 +48341,19 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_phrase = __pyx_t_17; __pyx_t_17 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1038 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1036 * * phrase = prefix + (word_id,) * hiero_phrase = Phrase(phrase) # <<<<<<<<<<<<<< * arity = hiero_phrase.arity() * */ - __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1038; __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 = 1036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_phrase); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_cur_scope->__pyx_v_phrase); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_phrase); - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_17), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_17), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0; __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase)); @@ -48339,23 +48362,23 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_hiero_phrase = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1039 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1037 * phrase = prefix + (word_id,) * hiero_phrase = Phrase(phrase) * arity = hiero_phrase.arity() # <<<<<<<<<<<<<< * * lookup_required = False */ - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase), __pyx_n_s__arity); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase), __pyx_n_s__arity); if (unlikely(!__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_17 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_20 = __Pyx_PyInt_AsInt(__pyx_t_17); if (unlikely((__pyx_t_20 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_20 = __Pyx_PyInt_AsInt(__pyx_t_17); if (unlikely((__pyx_t_20 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __pyx_cur_scope->__pyx_v_arity = __pyx_t_20; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1041 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1039 * arity = hiero_phrase.arity() * * lookup_required = False # <<<<<<<<<<<<<< @@ -48364,36 +48387,36 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene */ __pyx_cur_scope->__pyx_v_lookup_required = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1042 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1040 * * lookup_required = False * if word_id in node.children: # <<<<<<<<<<<<<< * if node.children[word_id] is None: * # Path dead-ends at this node */ - __pyx_t_17 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); - __pyx_t_9 = ((PySequence_Contains(__pyx_t_17, __pyx_cur_scope->__pyx_v_word_id))); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = (__Pyx_PySequence_Contains(__pyx_cur_scope->__pyx_v_word_id, __pyx_t_17, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1043 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1041 * 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_17 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); - __pyx_t_1 = PyObject_GetItem(__pyx_t_17, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetItem(__pyx_t_17, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __pyx_t_9 = (__pyx_t_1 == Py_None); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1045 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1043 * if node.children[word_id] is None: * # Path dead-ends at this node * continue # <<<<<<<<<<<<<< @@ -48405,16 +48428,16 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1048 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1046 * else: * # Path continues at this node * node = node.children[word_id] # <<<<<<<<<<<<<< * else: * if node.suffix_link is None: */ - __pyx_t_1 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __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_t_1 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_17 = PyObject_GetItem(__pyx_t_1, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_17) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PyObject_GetItem(__pyx_t_1, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_17) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_node); @@ -48428,20 +48451,20 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1050 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1048 * node = node.children[word_id] * else: * if node.suffix_link is None: # <<<<<<<<<<<<<< * # Current node is root; lookup required * lookup_required = True */ - __pyx_t_17 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); __pyx_t_9 = (__pyx_t_17 == Py_None); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1052 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1050 * if node.suffix_link is None: * # Current node is root; lookup required * lookup_required = True # <<<<<<<<<<<<<< @@ -48453,54 +48476,54 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1054 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1052 * 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_17 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_17, __pyx_n_s__children); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_t_17, __pyx_n_s__children); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - __pyx_t_9 = ((PySequence_Contains(__pyx_t_1, __pyx_cur_scope->__pyx_v_word_id))); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1054; __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 = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1055 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1053 * 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 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_17 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__children); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__children); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetItem(__pyx_t_17, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetItem(__pyx_t_17, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __pyx_t_9 = (__pyx_t_1 == Py_None); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1057 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1055 * 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 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1055; __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 = 1057; __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 = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1058 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1056 * # Suffix link reports path is dead end * node.children[word_id] = None * continue # <<<<<<<<<<<<<< @@ -48512,7 +48535,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1061 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1059 * else: * # Suffix link indicates lookup is reqired * lookup_required = True # <<<<<<<<<<<<<< @@ -48526,18 +48549,18 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1064 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1062 * 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_122), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_k_tuple_122), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1062; __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 = 1064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L30:; } @@ -48545,7 +48568,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene } __pyx_L27:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1066 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1064 * raise Exception("Keyword trie error") * # checking whether lookup_required * if lookup_required: # <<<<<<<<<<<<<< @@ -48554,7 +48577,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene */ if (__pyx_cur_scope->__pyx_v_lookup_required) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1067 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1065 * # checking whether lookup_required * if lookup_required: * new_node = None # <<<<<<<<<<<<<< @@ -48567,66 +48590,66 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __Pyx_GIVEREF(Py_None); __pyx_cur_scope->__pyx_v_new_node = Py_None; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1068 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1066 * 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 = 1068; __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 = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1071 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1069 * # 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 = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __pyx_t_17 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_17, __pyx_n_s__children); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_17, __pyx_n_s__children); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - __pyx_t_17 = PyObject_GetItem(__pyx_t_3, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_17) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PyObject_GetItem(__pyx_t_3, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_17) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetAttr(__pyx_t_17, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_17, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1071; __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 = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1072 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1070 * # 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 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_17 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__children); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__children); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetItem(__pyx_t_17, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(__pyx_t_17, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__suffix_link), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1071; __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 = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1073 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1071 * 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 = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1071; __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 = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_new_node); @@ -48638,7 +48661,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1075 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1073 * phrase=hiero_phrase) * else: * if arity > 0: # <<<<<<<<<<<<<< @@ -48648,16 +48671,16 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_t_9 = (__pyx_cur_scope->__pyx_v_arity > 0); if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1077 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1075 * 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_GetName(__pyx_m, __pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1075; __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 = 1077; __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 = 1075; __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); @@ -48666,22 +48689,22 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_intersect_start_time = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1078 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1076 * # 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 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__children); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__children); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1076; __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 = 1078; __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 = 1076; __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_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 = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->intersect(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_node, __pyx_t_1, __pyx_cur_scope->__pyx_v_hiero_phrase)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1076; __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)); @@ -48690,16 +48713,16 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_phrase_location = ((struct __pyx_obj_3_sa_PhraseLocation *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1079 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1077 * 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_GetName(__pyx_m, __pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1077; __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 = 1079; __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 = 1077; __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); @@ -48708,67 +48731,67 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_intersect_stop_time = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1080 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1078 * 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 = 1080; __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 = 1078; __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 = 1080; __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 = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_17 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_3); 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_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_17); 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_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_17); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __pyx_cur_scope->__pyx_v_self->intersect_time = __pyx_t_4; goto __pyx_L34; } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1083 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1081 * 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_17 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); - if (!(likely(((__pyx_t_17) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_17, __pyx_ptype_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_17) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_17, __pyx_ptype_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location)); __Pyx_XDECREF(((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location)); __Pyx_GIVEREF(__pyx_t_17); __pyx_cur_scope->__pyx_v_phrase_location = ((struct __pyx_obj_3_sa_PhraseLocation *)__pyx_t_17); __pyx_t_17 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1084 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1082 * # 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_17 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self->fsa), __pyx_n_s__lookup); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self->fsa), __pyx_n_s__lookup); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_phrase, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_phrase, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_20 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_20 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_20 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_20 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyBytes_FromString(__pyx_f_3_sa_sym_tostring(__pyx_t_20)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyBytes_FromString(__pyx_f_3_sa_sym_tostring(__pyx_t_20)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1082; __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 = 1084; __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 = 1084; __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 = 1082; __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 = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_16 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_phrase_location->sa_low); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_phrase_location->sa_low); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_16); - __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 = 1084; __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 = 1082; __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 = 1084; __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 = 1082; __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)); @@ -48782,7 +48805,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_t_1 = 0; __pyx_t_16 = 0; __pyx_t_12 = 0; - __pyx_t_12 = PyObject_Call(__pyx_t_17, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyObject_Call(__pyx_t_17, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; @@ -48792,7 +48815,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_sa_range = __pyx_t_12; __pyx_t_12 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1085 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1083 * 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: # <<<<<<<<<<<<<< @@ -48802,24 +48825,24 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_t_9 = (__pyx_cur_scope->__pyx_v_sa_range != Py_None); if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1086 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1084 * 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 = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1084; __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); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_sa_range, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1084; __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 = 1086; __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 = 1084; __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); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_sa_range, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1084; __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 = 1086; __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 = 1084; __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_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_12)); 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(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; __Pyx_GOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location)); @@ -48831,7 +48854,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1088 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1086 * phrase_location = PhraseLocation(sa_low=sa_range[0], sa_high=sa_range[1]) * else: * phrase_location = None # <<<<<<<<<<<<<< @@ -48848,7 +48871,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene } __pyx_L34:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1090 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1088 * phrase_location = None * * if phrase_location is None: # <<<<<<<<<<<<<< @@ -48858,19 +48881,19 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_t_9 = (((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location) == Py_None); if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1091 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1089 * * if phrase_location is None: * node.children[word_id] = None # <<<<<<<<<<<<<< * # Search failed * continue */ - __pyx_t_10 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1089; __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 = 1091; __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 = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1093 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1091 * node.children[word_id] = None * # Search failed * continue # <<<<<<<<<<<<<< @@ -48882,7 +48905,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene } __pyx_L36:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1095 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1093 * continue * # Search succeeded * suffix_link = self.rules.root # <<<<<<<<<<<<<< @@ -48895,32 +48918,32 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self->rules->root); __pyx_cur_scope->__pyx_v_suffix_link = __pyx_cur_scope->__pyx_v_self->rules->root; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1096 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1094 * # 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 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1094; __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; if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1097 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1095 * 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 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_12 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__children); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyObject_GetAttr(__pyx_t_10, __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); __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 = 1097; __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 = 1095; __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); @@ -48932,35 +48955,35 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene } __pyx_L37:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1098 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1096 * 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 = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1096; __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 = 1098; __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 = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1099 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1097 * 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 = 1098; __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 = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1100 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1098 * 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 = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_12 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1098; __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 = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1096; __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); @@ -48971,19 +48994,19 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene } __pyx_L33:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1101 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1099 * suffix_link=suffix_link, * phrase=hiero_phrase) * node.children[word_id] = new_node # <<<<<<<<<<<<<< * node = new_node * */ - __pyx_t_12 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1099; __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 = 1101; __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 = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1102 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1100 * phrase=hiero_phrase) * node.children[word_id] = new_node * node = new_node # <<<<<<<<<<<<<< @@ -48996,7 +49019,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_new_node); __pyx_cur_scope->__pyx_v_node = __pyx_cur_scope->__pyx_v_new_node; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1107 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1105 * This should happen before we get to extraction (so that * the node will exist if needed)''' * if arity < self.max_nonterminals: # <<<<<<<<<<<<<< @@ -49006,14 +49029,14 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_t_9 = (__pyx_cur_scope->__pyx_v_arity < __pyx_cur_scope->__pyx_v_self->max_nonterminals); if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1108 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1106 * 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 = 1108; __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 = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_xcat_index); __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_xcat_index); @@ -49021,17 +49044,17 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_xcat_index = __pyx_t_12; __pyx_t_12 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1109 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1107 * 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_20 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_xcat_index); if (unlikely((__pyx_t_20 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_20 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_xcat_index); if (unlikely((__pyx_t_20 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_cur_scope->__pyx_v_xcat = __pyx_f_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_20); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1110 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1108 * xcat_index = arity+1 * xcat = sym_setindex(self.category, xcat_index) * suffix_link_xcat_index = xcat_index # <<<<<<<<<<<<<< @@ -49044,24 +49067,24 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_xcat_index); __pyx_cur_scope->__pyx_v_suffix_link_xcat_index = __pyx_cur_scope->__pyx_v_xcat_index; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1111 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1109 * 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_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 = 1111; __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 = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1112 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1110 * 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 = 1112; __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 = 1110; __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(__pyx_cur_scope->__pyx_v_suffix_link_xcat_index); @@ -49072,159 +49095,159 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene } __pyx_L39:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1113 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1111 * 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_20 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_suffix_link_xcat_index); if (unlikely((__pyx_t_20 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_20 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_suffix_link_xcat_index); if (unlikely((__pyx_t_20 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_cur_scope->__pyx_v_suffix_link_xcat = __pyx_f_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_20); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1114 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1112 * 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 = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_12)); - __pyx_t_10 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1112; __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 = 1114; __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 = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1115 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1113 * suffix_link_xcat = sym_setindex(self.category, suffix_link_xcat_index) * node.children[xcat] = ExtendedTrieNode(phrase_location=node.phrase_location, * suffix_link=node.suffix_link.children[suffix_link_xcat], # <<<<<<<<<<<<<< * phrase= Phrase(phrase + (xcat,))) * */ - __pyx_t_10 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_17 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__children); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__children); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_17, __pyx_cur_scope->__pyx_v_suffix_link_xcat, sizeof(int), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_17, __pyx_cur_scope->__pyx_v_suffix_link_xcat, sizeof(int), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__suffix_link), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __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 = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1116 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1114 * 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 = 1116; __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 = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1116; __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 = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); PyTuple_SET_ITEM(__pyx_t_17, 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_17)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyNumber_Add(__pyx_cur_scope->__pyx_v_phrase, ((PyObject *)__pyx_t_17)); 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_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 = 1116; __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 = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_17), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_17), NULL); 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_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0; - if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__phrase), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __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 = 1112; __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_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_12)); 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_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1114 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1112 * 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 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1112; __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) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __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) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1112; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1119 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1117 * * # sample from range * if not is_shadow_path: # <<<<<<<<<<<<<< * sample = self.sampler.sample(node.phrase_location) * num_subpatterns = ( node.phrase_location).num_subpatterns */ - __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 = 1119; __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 = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_21 = (!__pyx_t_9); if (__pyx_t_21) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1120 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1118 * # 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 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self->sampler), __pyx_n_s__sample); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self->sampler), __pyx_n_s__sample); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_12 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); - __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __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 = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_12); __Pyx_GIVEREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_17), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_17), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1118; __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_17)); __pyx_t_17 = 0; - if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_sample)); __Pyx_XDECREF(((PyObject *)__pyx_cur_scope->__pyx_v_sample)); __Pyx_GIVEREF(__pyx_t_12); __pyx_cur_scope->__pyx_v_sample = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_12); __pyx_t_12 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1121 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1119 * 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 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __pyx_cur_scope->__pyx_v_num_subpatterns = ((struct __pyx_obj_3_sa_PhraseLocation *)__pyx_t_12)->num_subpatterns; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1122 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1120 * 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 = 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 = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_12)); - __pyx_t_17 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_num_subpatterns); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_num_subpatterns); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); - if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_17) < 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__initial_len), __pyx_t_17) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - __pyx_t_17 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_chunklen)); @@ -49233,7 +49256,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_chunklen = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_17); __pyx_t_17 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1123 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1121 * num_subpatterns = ( node.phrase_location).num_subpatterns * chunklen = IntList(initial_len=num_subpatterns) * for j from 0 <= j < num_subpatterns: # <<<<<<<<<<<<<< @@ -49243,7 +49266,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_t_20 = __pyx_cur_scope->__pyx_v_num_subpatterns; for (__pyx_cur_scope->__pyx_v_j = 0; __pyx_cur_scope->__pyx_v_j < __pyx_t_20; __pyx_cur_scope->__pyx_v_j++) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1124 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1122 * chunklen = IntList(initial_len=num_subpatterns) * for j from 0 <= j < num_subpatterns: * chunklen.arr[j] = hiero_phrase.chunklen(j) # <<<<<<<<<<<<<< @@ -49253,14 +49276,14 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene (__pyx_cur_scope->__pyx_v_chunklen->arr[__pyx_cur_scope->__pyx_v_j]) = ((struct __pyx_vtabstruct_3_sa_Phrase *)__pyx_cur_scope->__pyx_v_hiero_phrase->__pyx_vtab)->chunklen(__pyx_cur_scope->__pyx_v_hiero_phrase, __pyx_cur_scope->__pyx_v_j); } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1125 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1123 * for j from 0 <= j < num_subpatterns: * chunklen.arr[j] = hiero_phrase.chunklen(j) * extracts = [] # <<<<<<<<<<<<<< * j = 0 * extract_start = monitor_cpu() */ - __pyx_t_17 = PyList_New(0); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PyList_New(0); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_extracts)); __Pyx_XDECREF(((PyObject *)__pyx_cur_scope->__pyx_v_extracts)); @@ -49268,7 +49291,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_extracts = __pyx_t_17; __pyx_t_17 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1126 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1124 * chunklen.arr[j] = hiero_phrase.chunklen(j) * extracts = [] * j = 0 # <<<<<<<<<<<<<< @@ -49277,16 +49300,16 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene */ __pyx_cur_scope->__pyx_v_j = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1127 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1125 * extracts = [] * j = 0 * extract_start = monitor_cpu() # <<<<<<<<<<<<<< * while j < sample.len: * extract = [] */ - __pyx_t_17 = __Pyx_GetName(__pyx_m, __pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = __Pyx_GetName(__pyx_m, __pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); - __pyx_t_12 = PyObject_Call(__pyx_t_17, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyObject_Call(__pyx_t_17, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_extract_start); @@ -49295,7 +49318,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_extract_start = __pyx_t_12; __pyx_t_12 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1128 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1126 * j = 0 * extract_start = monitor_cpu() * while j < sample.len: # <<<<<<<<<<<<<< @@ -49306,14 +49329,14 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_t_21 = (__pyx_cur_scope->__pyx_v_j < __pyx_cur_scope->__pyx_v_sample->len); if (!__pyx_t_21) break; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1129 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1127 * 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 = 1129; __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 = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_extract); __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_extract); @@ -49321,7 +49344,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_extract = ((PyObject *)__pyx_t_12); __pyx_t_12 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1131 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1129 * extract = [] * * assign_matching(&matching, sample.arr, j, num_subpatterns, self.fda.sent_id.arr) # <<<<<<<<<<<<<< @@ -49330,21 +49353,21 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene */ __pyx_f_3_sa_assign_matching((&__pyx_cur_scope->__pyx_v_matching), __pyx_cur_scope->__pyx_v_sample->arr, __pyx_cur_scope->__pyx_v_j, __pyx_cur_scope->__pyx_v_num_subpatterns, __pyx_cur_scope->__pyx_v_self->fda->sent_id->arr); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1132 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1130 * * 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_PySequence_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)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __Pyx_PySequence_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)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); - __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1132; __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 = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); PyTuple_SET_ITEM(__pyx_t_17, 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_17), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_17), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_loc); @@ -49353,14 +49376,14 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_loc = __pyx_t_12; __pyx_t_12 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1133 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1131 * 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 + * + * for f, e, count, als in extract: */ - __pyx_t_12 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->extract(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_hiero_phrase, (&__pyx_cur_scope->__pyx_v_matching), __pyx_cur_scope->__pyx_v_chunklen->arr, __pyx_cur_scope->__pyx_v_num_subpatterns); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->extract(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_hiero_phrase, (&__pyx_cur_scope->__pyx_v_matching), __pyx_cur_scope->__pyx_v_chunklen->arr, __pyx_cur_scope->__pyx_v_num_subpatterns); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_extract); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_extract); @@ -49368,38 +49391,232 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_extract = __pyx_t_12; __pyx_t_12 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1134 - * loc = tuple(sample[j:j+num_subpatterns]) + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1133 * extract = self.extract(hiero_phrase, &matching, chunklen.arr, num_subpatterns) + * + * for f, e, count, als in extract: # <<<<<<<<<<<<<< + * if str(e) == "[X,1] specific policy choices faced [X,2] , not": + * print >> sys.stderr, sample[j], sample[j + 1], num_subpatterns, hiero_phrase + */ + if (PyList_CheckExact(__pyx_cur_scope->__pyx_v_extract) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_extract)) { + __pyx_t_12 = __pyx_cur_scope->__pyx_v_extract; __Pyx_INCREF(__pyx_t_12); __pyx_t_6 = 0; + __pyx_t_22 = NULL; + } else { + __pyx_t_6 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_extract); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_22 = Py_TYPE(__pyx_t_12)->tp_iternext; + } + for (;;) { + if (!__pyx_t_22 && PyList_CheckExact(__pyx_t_12)) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_12)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_17 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_6); __Pyx_INCREF(__pyx_t_17); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_17 = PySequence_ITEM(__pyx_t_12, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_22 && PyTuple_CheckExact(__pyx_t_12)) { + if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_12)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_17 = PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_6); __Pyx_INCREF(__pyx_t_17); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_17 = PySequence_ITEM(__pyx_t_12, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_17 = __pyx_t_22(__pyx_t_12); + if (unlikely(!__pyx_t_17)) { + if (PyErr_Occurred()) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_17); + } + if ((likely(PyTuple_CheckExact(__pyx_t_17))) || (PyList_CheckExact(__pyx_t_17))) { + PyObject* sequence = __pyx_t_17; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 4)) { + if (size > 4) __Pyx_RaiseTooManyValuesError(4); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_16 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 3); + } else { + __pyx_t_10 = PyList_GET_ITEM(sequence, 0); + __pyx_t_16 = PyList_GET_ITEM(sequence, 1); + __pyx_t_1 = PyList_GET_ITEM(sequence, 2); + __pyx_t_3 = PyList_GET_ITEM(sequence, 3); + } + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(__pyx_t_16); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_3); + #else + Py_ssize_t i; + PyObject** temps[4] = {&__pyx_t_10,&__pyx_t_16,&__pyx_t_1,&__pyx_t_3}; + for (i=0; i < 4; i++) { + PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + *(temps[i]) = item; + } + #endif + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + } else + { + Py_ssize_t index = -1; + PyObject** temps[4] = {&__pyx_t_10,&__pyx_t_16,&__pyx_t_1,&__pyx_t_3}; + __pyx_t_11 = PyObject_GetIter(__pyx_t_17); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_19 = Py_TYPE(__pyx_t_11)->tp_iternext; + for (index=0; index < 4; index++) { + PyObject* item = __pyx_t_19(__pyx_t_11); if (unlikely(!item)) goto __pyx_L47_unpacking_failed; + __Pyx_GOTREF(item); + *(temps[index]) = item; + } + if (__Pyx_IternextUnpackEndCheck(__pyx_t_19(__pyx_t_11), 4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = NULL; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L48_unpacking_done; + __pyx_L47_unpacking_failed:; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_19 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L48_unpacking_done:; + } + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_f); + __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_f); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_cur_scope->__pyx_v_f = __pyx_t_10; + __pyx_t_10 = 0; + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_e); + __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_e); + __Pyx_GIVEREF(__pyx_t_16); + __pyx_cur_scope->__pyx_v_e = __pyx_t_16; + __pyx_t_16 = 0; + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_count); + __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_count); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_cur_scope->__pyx_v_count = __pyx_t_1; + __pyx_t_1 = 0; + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_als); + __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_als); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_cur_scope->__pyx_v_als = __pyx_t_3; + __pyx_t_3 = 0; + + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1134 + * + * for f, e, count, als in extract: + * if str(e) == "[X,1] specific policy choices faced [X,2] , not": # <<<<<<<<<<<<<< + * print >> sys.stderr, sample[j], sample[j + 1], num_subpatterns, hiero_phrase + * + */ + __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1134; __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); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e); + __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_17), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0; + __pyx_t_17 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_kp_s_123), Py_EQ); __Pyx_XGOTREF(__pyx_t_17); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_21 = __Pyx_PyObject_IsTrue(__pyx_t_17); if (unlikely(__pyx_t_21 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + if (__pyx_t_21) { + + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1135 + * for f, e, count, als in extract: + * if str(e) == "[X,1] specific policy choices faced [X,2] , not": + * print >> sys.stderr, sample[j], sample[j + 1], num_subpatterns, hiero_phrase # <<<<<<<<<<<<<< + * + * extracts.extend([(e, loc) for e in extract]) + */ + __pyx_t_17 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_17, __pyx_n_s__stderr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_17 = __Pyx_GetItemInt(((PyObject *)__pyx_cur_scope->__pyx_v_sample), __pyx_cur_scope->__pyx_v_j, sizeof(int), PyInt_FromLong); if (!__pyx_t_17) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_23 = (__pyx_cur_scope->__pyx_v_j + 1); + __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_cur_scope->__pyx_v_sample), __pyx_t_23, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_16 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_num_subpatterns); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_10 = PyTuple_New(4); 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); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_17); + __Pyx_GIVEREF(__pyx_t_17); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_16); + __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase)); + PyTuple_SET_ITEM(__pyx_t_10, 3, ((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase)); + __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase)); + __pyx_t_17 = 0; + __pyx_t_1 = 0; + __pyx_t_16 = 0; + if (__Pyx_Print(__pyx_t_3, ((PyObject *)__pyx_t_10), 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L49; + } + __pyx_L49:; + } + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1137 + * print >> sys.stderr, sample[j], sample[j + 1], num_subpatterns, hiero_phrase + * * extracts.extend([(e, loc) for e in extract]) # <<<<<<<<<<<<<< * j = j + num_subpatterns * */ - __pyx_t_12 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_extracts), __pyx_n_s__extend); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_extracts), __pyx_n_s__extend); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); - __pyx_t_17 = PyList_New(0); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_17); + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); 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 = 1134; __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 = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_22 = Py_TYPE(__pyx_t_10)->tp_iternext; } for (;;) { if (!__pyx_t_22 && PyList_CheckExact(__pyx_t_10)) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_10)) break; - __pyx_t_16 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_6); __Pyx_INCREF(__pyx_t_16); __pyx_t_6++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_16 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_6); __Pyx_INCREF(__pyx_t_16); __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_16 = PySequence_ITEM(__pyx_t_10, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __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; - __pyx_t_16 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_6); __Pyx_INCREF(__pyx_t_16); __pyx_t_6++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_16 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_6); __Pyx_INCREF(__pyx_t_16); __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_16 = PySequence_ITEM(__pyx_t_10, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else { __pyx_t_16 = __pyx_t_22(__pyx_t_10); if (unlikely(!__pyx_t_16)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -49410,7 +49627,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __Pyx_GIVEREF(__pyx_t_16); __pyx_cur_scope->__pyx_v_e = __pyx_t_16; __pyx_t_16 = 0; - __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1134; __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 = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_16); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_e); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_cur_scope->__pyx_v_e); @@ -49418,24 +49635,24 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __Pyx_INCREF(__pyx_cur_scope->__pyx_v_loc); PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_cur_scope->__pyx_v_loc); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_loc); - if (unlikely(PyList_Append(__pyx_t_17, (PyObject*)__pyx_t_16))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_PyList_Append(__pyx_t_3, (PyObject*)__pyx_t_16))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_16)); __pyx_t_16 = 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 = 1134; __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 = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __Pyx_INCREF(((PyObject *)__pyx_t_17)); - PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_t_17)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_17)); - __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0; - __pyx_t_17 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_17); + __Pyx_INCREF(((PyObject *)__pyx_t_3)); + PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_t_3)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1135 - * extract = self.extract(hiero_phrase, &matching, chunklen.arr, num_subpatterns) + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1138 + * * extracts.extend([(e, loc) for e in extract]) * j = j + num_subpatterns # <<<<<<<<<<<<<< * @@ -49444,7 +49661,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_j = (__pyx_cur_scope->__pyx_v_j + __pyx_cur_scope->__pyx_v_num_subpatterns); } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1137 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1140 * j = j + num_subpatterns * * num_samples = sample.len/num_subpatterns # <<<<<<<<<<<<<< @@ -49453,99 +49670,99 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene */ if (unlikely(__pyx_cur_scope->__pyx_v_num_subpatterns == 0)) { PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else if (sizeof(int) == sizeof(long) && unlikely(__pyx_cur_scope->__pyx_v_num_subpatterns == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_cur_scope->__pyx_v_sample->len))) { PyErr_Format(PyExc_OverflowError, "value too large to perform division"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1140; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1138 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1141 * * 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_17 = __Pyx_GetName(__pyx_m, __pyx_n_s__monitor_cpu); if (unlikely(!__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_10 = PyObject_Call(__pyx_t_17, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_10 = PyObject_Call(__pyx_t_3, ((PyObject *)__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_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_extract_stop); __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_extract_stop); __Pyx_GIVEREF(__pyx_t_10); __pyx_cur_scope->__pyx_v_extract_stop = __pyx_t_10; __pyx_t_10 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1139 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1142 * 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 = 1139; __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 = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_17 = PyNumber_Add(__pyx_t_10, __pyx_cur_scope->__pyx_v_extract_stop); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_17); + __pyx_t_3 = PyNumber_Add(__pyx_t_10, __pyx_cur_scope->__pyx_v_extract_stop); 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_10); __pyx_t_10 = 0; - __pyx_t_10 = PyNumber_Subtract(__pyx_t_17, __pyx_cur_scope->__pyx_v_extract_start); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyNumber_Subtract(__pyx_t_3, __pyx_cur_scope->__pyx_v_extract_start); 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_17); __pyx_t_17 = 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 = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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 = 1142; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1140 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1143 * 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)); + __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 = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_21 = (__pyx_t_6 > 0); if (__pyx_t_21) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1141 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1144 * 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_GetName(__pyx_m, __pyx_n_s__Counter); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__Counter); 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_t_17 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_17); + __pyx_t_3 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_fcount); __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_fcount); - __Pyx_GIVEREF(__pyx_t_17); - __pyx_cur_scope->__pyx_v_fcount = __pyx_t_17; - __pyx_t_17 = 0; + __Pyx_GIVEREF(__pyx_t_3); + __pyx_cur_scope->__pyx_v_fcount = __pyx_t_3; + __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1142 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1145 * 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_17 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); 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_10 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_5input_lambda4, 0, NULL, __pyx_n_s___sa, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_10 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_5input_lambda4, 0, NULL, __pyx_n_s___sa, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1145; __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 = 1142; __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 = 1145; __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_17, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_fphrases); __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_fphrases); @@ -49553,7 +49770,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_fphrases = __pyx_t_10; __pyx_t_10 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1143 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1146 * fcount = Counter() * fphrases = defaultdict(lambda: defaultdict(lambda: defaultdict(list))) * for (f, e, count, als), loc in extracts: # <<<<<<<<<<<<<< @@ -49563,100 +49780,120 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_t_10 = ((PyObject *)__pyx_cur_scope->__pyx_v_extracts); __Pyx_INCREF(__pyx_t_10); __pyx_t_6 = 0; for (;;) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_10)) break; - __pyx_t_12 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_6); __Pyx_INCREF(__pyx_t_12); __pyx_t_6++; + #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 = 1146; __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 = 1146; __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 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 = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { - if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_17 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_16 = PyTuple_GET_ITEM(sequence, 1); } else { - if (unlikely(PyList_GET_SIZE(sequence) != 2)) { - if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_17 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); __pyx_t_16 = PyList_GET_ITEM(sequence, 1); } - __Pyx_INCREF(__pyx_t_17); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_16); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - } else { + } 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 = 1143; __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 = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_19 = Py_TYPE(__pyx_t_1)->tp_iternext; - index = 0; __pyx_t_17 = __pyx_t_19(__pyx_t_1); if (unlikely(!__pyx_t_17)) goto __pyx_L50_unpacking_failed; - __Pyx_GOTREF(__pyx_t_17); - index = 1; __pyx_t_16 = __pyx_t_19(__pyx_t_1); if (unlikely(!__pyx_t_16)) goto __pyx_L50_unpacking_failed; + index = 0; __pyx_t_3 = __pyx_t_19(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L55_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_16 = __pyx_t_19(__pyx_t_1); if (unlikely(!__pyx_t_16)) goto __pyx_L55_unpacking_failed; __Pyx_GOTREF(__pyx_t_16); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_19(__pyx_t_1), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_IternextUnpackEndCheck(__pyx_t_19(__pyx_t_1), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = NULL; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L51_unpacking_done; - __pyx_L50_unpacking_failed:; + goto __pyx_L56_unpacking_done; + __pyx_L55_unpacking_failed:; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_L51_unpacking_done:; + __pyx_t_19 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L56_unpacking_done:; } - if ((likely(PyTuple_CheckExact(__pyx_t_17))) || (PyList_CheckExact(__pyx_t_17))) { - PyObject* sequence = __pyx_t_17; + if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { + PyObject* sequence = __pyx_t_3; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 4)) { + if (size > 4) __Pyx_RaiseTooManyValuesError(4); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 4)) { - if (PyTuple_GET_SIZE(sequence) > 4) __Pyx_RaiseTooManyValuesError(4); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_17 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_11 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 3); } else { - if (unlikely(PyList_GET_SIZE(sequence) != 4)) { - if (PyList_GET_SIZE(sequence) > 4) __Pyx_RaiseTooManyValuesError(4); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } __pyx_t_1 = PyList_GET_ITEM(sequence, 0); - __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + __pyx_t_17 = PyList_GET_ITEM(sequence, 1); __pyx_t_11 = PyList_GET_ITEM(sequence, 2); __pyx_t_8 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_17); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - } else { + #else + Py_ssize_t i; + PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_17,&__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 = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + *(temps[i]) = item; + } + #endif + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + { Py_ssize_t index = -1; - __pyx_t_15 = PyObject_GetIter(__pyx_t_17); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_17,&__pyx_t_11,&__pyx_t_8}; + __pyx_t_15 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1146; __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_3); __pyx_t_3 = 0; __pyx_t_19 = Py_TYPE(__pyx_t_15)->tp_iternext; - index = 0; __pyx_t_1 = __pyx_t_19(__pyx_t_15); if (unlikely(!__pyx_t_1)) goto __pyx_L52_unpacking_failed; - __Pyx_GOTREF(__pyx_t_1); - index = 1; __pyx_t_3 = __pyx_t_19(__pyx_t_15); if (unlikely(!__pyx_t_3)) goto __pyx_L52_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); - index = 2; __pyx_t_11 = __pyx_t_19(__pyx_t_15); if (unlikely(!__pyx_t_11)) goto __pyx_L52_unpacking_failed; - __Pyx_GOTREF(__pyx_t_11); - index = 3; __pyx_t_8 = __pyx_t_19(__pyx_t_15); if (unlikely(!__pyx_t_8)) goto __pyx_L52_unpacking_failed; - __Pyx_GOTREF(__pyx_t_8); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_19(__pyx_t_15), 4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (index=0; index < 4; index++) { + PyObject* item = __pyx_t_19(__pyx_t_15); if (unlikely(!item)) goto __pyx_L57_unpacking_failed; + __Pyx_GOTREF(item); + *(temps[index]) = item; + } + if (__Pyx_IternextUnpackEndCheck(__pyx_t_19(__pyx_t_15), 4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = NULL; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - goto __pyx_L53_unpacking_done; - __pyx_L52_unpacking_failed:; + goto __pyx_L58_unpacking_done; + __pyx_L57_unpacking_failed:; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_L53_unpacking_done:; + __pyx_t_19 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L58_unpacking_done:; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_f); __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_f); @@ -49665,9 +49902,9 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_e); __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_e); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_cur_scope->__pyx_v_e = __pyx_t_3; - __pyx_t_3 = 0; + __Pyx_GIVEREF(__pyx_t_17); + __pyx_cur_scope->__pyx_v_e = __pyx_t_17; + __pyx_t_17 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_count); __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_count); __Pyx_GIVEREF(__pyx_t_11); @@ -49684,7 +49921,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_loc = __pyx_t_16; __pyx_t_16 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1144 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1147 * fphrases = defaultdict(lambda: defaultdict(lambda: defaultdict(list))) * for (f, e, count, als), loc in extracts: * fcount[f] += count # <<<<<<<<<<<<<< @@ -49693,415 +49930,306 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene */ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f); __pyx_t_12 = __pyx_cur_scope->__pyx_v_f; - __pyx_t_16 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fcount, __pyx_t_12); if (!__pyx_t_16) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fcount, __pyx_t_12); if (!__pyx_t_16) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_16); - __pyx_t_17 = PyNumber_InPlaceAdd(__pyx_t_16, __pyx_cur_scope->__pyx_v_count); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_17); + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_16, __pyx_cur_scope->__pyx_v_count); 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_DECREF(__pyx_t_16); __pyx_t_16 = 0; - if (PyObject_SetItem(__pyx_cur_scope->__pyx_v_fcount, __pyx_t_12, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + if (PyObject_SetItem(__pyx_cur_scope->__pyx_v_fcount, __pyx_t_12, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1145 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1148 * 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 = 1145; __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 = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); - __pyx_t_17 = PyObject_GetItem(__pyx_t_12, __pyx_cur_scope->__pyx_v_e); if (!__pyx_t_17) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_17); + __pyx_t_3 = PyObject_GetItem(__pyx_t_12, __pyx_cur_scope->__pyx_v_e); if (!__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_12); __pyx_t_12 = 0; - __pyx_t_12 = PyObject_GetItem(__pyx_t_17, __pyx_cur_scope->__pyx_v_als); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyObject_GetItem(__pyx_t_3, __pyx_cur_scope->__pyx_v_als); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - __pyx_t_17 = __Pyx_PyObject_Append(__pyx_t_12, __pyx_cur_scope->__pyx_v_loc); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Append(__pyx_t_12, __pyx_cur_scope->__pyx_v_loc); 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_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1146 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1149 * fcount[f] += count * fphrases[f][e][als].append(loc) * for f, elist in fphrases.iteritems(): # <<<<<<<<<<<<<< * for e, alslist in elist.iteritems(): * alignment, max_locs = max(alslist.iteritems(), key=lambda x: len(x[1])) */ - __pyx_t_10 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_fphrases, __pyx_n_s__iteritems); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_17 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_17); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (PyList_CheckExact(__pyx_t_17) || PyTuple_CheckExact(__pyx_t_17)) { - __pyx_t_10 = __pyx_t_17; __Pyx_INCREF(__pyx_t_10); __pyx_t_6 = 0; - __pyx_t_22 = NULL; - } else { - __pyx_t_6 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_17); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1146; __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 = 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 = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - for (;;) { - if (!__pyx_t_22 && PyList_CheckExact(__pyx_t_10)) { - if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_10)) break; - __pyx_t_17 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_6); __Pyx_INCREF(__pyx_t_17); __pyx_t_6++; - } else if (!__pyx_t_22 && PyTuple_CheckExact(__pyx_t_10)) { - if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_10)) break; - __pyx_t_17 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_6); __Pyx_INCREF(__pyx_t_17); __pyx_t_6++; - } 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 = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - break; - } - __Pyx_GOTREF(__pyx_t_17); - } - if ((likely(PyTuple_CheckExact(__pyx_t_17))) || (PyList_CheckExact(__pyx_t_17))) { - PyObject* sequence = __pyx_t_17; - if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { - if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_12 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_16 = PyTuple_GET_ITEM(sequence, 1); - } else { - if (unlikely(PyList_GET_SIZE(sequence) != 2)) { - if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_12 = PyList_GET_ITEM(sequence, 0); - __pyx_t_16 = PyList_GET_ITEM(sequence, 1); - } - __Pyx_INCREF(__pyx_t_12); - __Pyx_INCREF(__pyx_t_16); - __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_8 = PyObject_GetIter(__pyx_t_17); 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_DECREF(__pyx_t_17); __pyx_t_17 = 0; - __pyx_t_19 = Py_TYPE(__pyx_t_8)->tp_iternext; - index = 0; __pyx_t_12 = __pyx_t_19(__pyx_t_8); if (unlikely(!__pyx_t_12)) goto __pyx_L56_unpacking_failed; - __Pyx_GOTREF(__pyx_t_12); - index = 1; __pyx_t_16 = __pyx_t_19(__pyx_t_8); if (unlikely(!__pyx_t_16)) goto __pyx_L56_unpacking_failed; - __Pyx_GOTREF(__pyx_t_16); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_19(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - goto __pyx_L57_unpacking_done; - __pyx_L56_unpacking_failed:; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_L57_unpacking_done:; - } + __pyx_t_3 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_fphrases, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_24), (&__pyx_t_20)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_10); + __pyx_t_10 = __pyx_t_3; + __pyx_t_3 = 0; + while (1) { + __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_10, __pyx_t_24, &__pyx_t_6, &__pyx_t_3, &__pyx_t_12, NULL, __pyx_t_20); + if (unlikely(__pyx_t_7 == 0)) break; + if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_f); __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_f); - __Pyx_GIVEREF(__pyx_t_12); - __pyx_cur_scope->__pyx_v_f = __pyx_t_12; - __pyx_t_12 = 0; + __Pyx_GIVEREF(__pyx_t_3); + __pyx_cur_scope->__pyx_v_f = __pyx_t_3; + __pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_elist); __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_elist); - __Pyx_GIVEREF(__pyx_t_16); - __pyx_cur_scope->__pyx_v_elist = __pyx_t_16; - __pyx_t_16 = 0; + __Pyx_GIVEREF(__pyx_t_12); + __pyx_cur_scope->__pyx_v_elist = __pyx_t_12; + __pyx_t_12 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1147 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1150 * fphrases[f][e][als].append(loc) * 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())) */ - __pyx_t_17 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_elist, __pyx_n_s__iteritems); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_17); - __pyx_t_16 = PyObject_Call(__pyx_t_17, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_16); - __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - if (PyList_CheckExact(__pyx_t_16) || PyTuple_CheckExact(__pyx_t_16)) { - __pyx_t_17 = __pyx_t_16; __Pyx_INCREF(__pyx_t_17); __pyx_t_23 = 0; - __pyx_t_24 = NULL; - } else { - __pyx_t_23 = -1; __pyx_t_17 = PyObject_GetIter(__pyx_t_16); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_17); - __pyx_t_24 = Py_TYPE(__pyx_t_17)->tp_iternext; + __pyx_t_25 = 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 = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; - for (;;) { - if (!__pyx_t_24 && PyList_CheckExact(__pyx_t_17)) { - if (__pyx_t_23 >= PyList_GET_SIZE(__pyx_t_17)) break; - __pyx_t_16 = PyList_GET_ITEM(__pyx_t_17, __pyx_t_23); __Pyx_INCREF(__pyx_t_16); __pyx_t_23++; - } else if (!__pyx_t_24 && PyTuple_CheckExact(__pyx_t_17)) { - if (__pyx_t_23 >= PyTuple_GET_SIZE(__pyx_t_17)) break; - __pyx_t_16 = PyTuple_GET_ITEM(__pyx_t_17, __pyx_t_23); __Pyx_INCREF(__pyx_t_16); __pyx_t_23++; - } else { - __pyx_t_16 = __pyx_t_24(__pyx_t_17); - if (unlikely(!__pyx_t_16)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - break; - } - __Pyx_GOTREF(__pyx_t_16); - } - if ((likely(PyTuple_CheckExact(__pyx_t_16))) || (PyList_CheckExact(__pyx_t_16))) { - PyObject* sequence = __pyx_t_16; - if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { - if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_12 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); - } else { - if (unlikely(PyList_GET_SIZE(sequence) != 2)) { - if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_12 = PyList_GET_ITEM(sequence, 0); - __pyx_t_8 = PyList_GET_ITEM(sequence, 1); - } - __Pyx_INCREF(__pyx_t_12); - __Pyx_INCREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_11 = PyObject_GetIter(__pyx_t_16); 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_DECREF(__pyx_t_16); __pyx_t_16 = 0; - __pyx_t_19 = Py_TYPE(__pyx_t_11)->tp_iternext; - index = 0; __pyx_t_12 = __pyx_t_19(__pyx_t_11); if (unlikely(!__pyx_t_12)) goto __pyx_L60_unpacking_failed; - __Pyx_GOTREF(__pyx_t_12); - index = 1; __pyx_t_8 = __pyx_t_19(__pyx_t_11); if (unlikely(!__pyx_t_8)) goto __pyx_L60_unpacking_failed; - __Pyx_GOTREF(__pyx_t_8); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_19(__pyx_t_11), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - goto __pyx_L61_unpacking_done; - __pyx_L60_unpacking_failed:; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_L61_unpacking_done:; - } + __pyx_t_3 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_elist, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_26), (&__pyx_t_7)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_12); + __pyx_t_12 = __pyx_t_3; + __pyx_t_3 = 0; + while (1) { + __pyx_t_5 = __Pyx_dict_iter_next(__pyx_t_12, __pyx_t_26, &__pyx_t_25, &__pyx_t_3, &__pyx_t_16, NULL, __pyx_t_7); + if (unlikely(__pyx_t_5 == 0)) break; + if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_e); __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_e); - __Pyx_GIVEREF(__pyx_t_12); - __pyx_cur_scope->__pyx_v_e = __pyx_t_12; - __pyx_t_12 = 0; + __Pyx_GIVEREF(__pyx_t_3); + __pyx_cur_scope->__pyx_v_e = __pyx_t_3; + __pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_alslist); __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_alslist); - __Pyx_GIVEREF(__pyx_t_8); - __pyx_cur_scope->__pyx_v_alslist = __pyx_t_8; - __pyx_t_8 = 0; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_cur_scope->__pyx_v_alslist = __pyx_t_16; + __pyx_t_16 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1148 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1151 * 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_16 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_alslist, __pyx_n_s__iteritems); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_alslist, __pyx_n_s__iteritems); 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_t_8 = PyObject_Call(__pyx_t_16, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = PyObject_Call(__pyx_t_16, ((PyObject *)__pyx_empty_tuple), NULL); 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_16); __pyx_t_16 = 0; - __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __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 = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_16); - PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_8); - __Pyx_GIVEREF(__pyx_t_8); - __pyx_t_8 = 0; - __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_8)); - __pyx_t_12 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_5input_1lambda6, 0, NULL, __pyx_n_s___sa, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - if (PyDict_SetItem(__pyx_t_8, ((PyObject *)__pyx_n_s__key), __pyx_t_12) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_16), ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_5input_1lambda6, 0, NULL, __pyx_n_s___sa, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__key), __pyx_t_8) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __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_16), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(((PyObject *)__pyx_t_16)); __pyx_t_16 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; - if ((likely(PyTuple_CheckExact(__pyx_t_12))) || (PyList_CheckExact(__pyx_t_12))) { - PyObject* sequence = __pyx_t_12; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) { + PyObject* sequence = __pyx_t_8; + #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 = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { - if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_16 = PyTuple_GET_ITEM(sequence, 1); } else { - if (unlikely(PyList_GET_SIZE(sequence) != 2)) { - if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_8 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); __pyx_t_16 = PyList_GET_ITEM(sequence, 1); } - __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_16); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - } else { + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } else + { Py_ssize_t index = -1; - __pyx_t_11 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __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 = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_19 = Py_TYPE(__pyx_t_11)->tp_iternext; - index = 0; __pyx_t_8 = __pyx_t_19(__pyx_t_11); if (unlikely(!__pyx_t_8)) goto __pyx_L62_unpacking_failed; - __Pyx_GOTREF(__pyx_t_8); - index = 1; __pyx_t_16 = __pyx_t_19(__pyx_t_11); if (unlikely(!__pyx_t_16)) goto __pyx_L62_unpacking_failed; + index = 0; __pyx_t_3 = __pyx_t_19(__pyx_t_11); if (unlikely(!__pyx_t_3)) goto __pyx_L63_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_16 = __pyx_t_19(__pyx_t_11); if (unlikely(!__pyx_t_16)) goto __pyx_L63_unpacking_failed; __Pyx_GOTREF(__pyx_t_16); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_19(__pyx_t_11), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_IternextUnpackEndCheck(__pyx_t_19(__pyx_t_11), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = NULL; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - goto __pyx_L63_unpacking_done; - __pyx_L62_unpacking_failed:; + goto __pyx_L64_unpacking_done; + __pyx_L63_unpacking_failed:; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_L63_unpacking_done:; + __pyx_t_19 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L64_unpacking_done:; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_alignment); __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_alignment); - __Pyx_GIVEREF(__pyx_t_8); - __pyx_cur_scope->__pyx_v_alignment = __pyx_t_8; - __pyx_t_8 = 0; + __Pyx_GIVEREF(__pyx_t_3); + __pyx_cur_scope->__pyx_v_alignment = __pyx_t_3; + __pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_max_locs); __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_max_locs); __Pyx_GIVEREF(__pyx_t_16); __pyx_cur_scope->__pyx_v_max_locs = __pyx_t_16; __pyx_t_16 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1149 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1152 * 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_12 = __Pyx_GetName(__pyx_m, __pyx_n_s__itertools); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_16 = PyObject_GetAttr(__pyx_t_12, __pyx_n_s__chain); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__itertools); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_16 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__chain); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_16); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyObject_GetAttr(__pyx_t_16, __pyx_n_s__from_iterable); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyObject_GetAttr(__pyx_t_16, __pyx_n_s__from_iterable); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; - __pyx_t_16 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_alslist, __pyx_n_s__itervalues); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_alslist, __pyx_n_s__itervalues); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_16); - __pyx_t_8 = PyObject_Call(__pyx_t_16, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = PyObject_Call(__pyx_t_16, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; - __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __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 = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_16); - PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_8); - __Pyx_GIVEREF(__pyx_t_8); - __pyx_t_8 = 0; - __pyx_t_8 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_t_16), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_16), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1152; __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_16)); __pyx_t_16 = 0; - __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __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 = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_16); - PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_8); - __Pyx_GIVEREF(__pyx_t_8); - __pyx_t_8 = 0; - __pyx_t_8 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_16), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_16), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(((PyObject *)__pyx_t_16)); __pyx_t_16 = 0; __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_locs)); __Pyx_XDECREF(((PyObject *)__pyx_cur_scope->__pyx_v_locs)); - __Pyx_GIVEREF(__pyx_t_8); - __pyx_cur_scope->__pyx_v_locs = ((PyObject*)__pyx_t_8); - __pyx_t_8 = 0; + __Pyx_GIVEREF(__pyx_t_3); + __pyx_cur_scope->__pyx_v_locs = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1150 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1153 * 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_25 = PyTuple_GET_SIZE(((PyObject *)__pyx_cur_scope->__pyx_v_locs)); - __pyx_t_8 = PyInt_FromSsize_t(__pyx_t_25); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_27 = PyTuple_GET_SIZE(((PyObject *)__pyx_cur_scope->__pyx_v_locs)); if (unlikely(__pyx_t_27 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_27); 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_XGOTREF(__pyx_cur_scope->__pyx_v_count); __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_count); - __Pyx_GIVEREF(__pyx_t_8); - __pyx_cur_scope->__pyx_v_count = __pyx_t_8; - __pyx_t_8 = 0; + __Pyx_GIVEREF(__pyx_t_3); + __pyx_cur_scope->__pyx_v_count = __pyx_t_3; + __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1151 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1154 * 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_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__FeatureContext); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FeatureContext); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1152 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1155 * 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_16 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fcount, __pyx_cur_scope->__pyx_v_f); if (!__pyx_t_16) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fcount, __pyx_cur_scope->__pyx_v_f); if (!__pyx_t_16) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_16); - __pyx_t_12 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_num_samples); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); + __pyx_t_8 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_num_samples); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1153 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1156 * 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 = 1153; __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 = 1156; __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 = 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 = 1153; __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 = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_1 = PyNumber_Add(__pyx_t_17, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1156; __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 = 1153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_11); + __Pyx_DECREF(__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 = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_11 = 0; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1157 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1160 * meta, * # Include online stats. None if none. * self.online_ctx_lookup(f, e))) # <<<<<<<<<<<<<< * # Phrase pair processed * if self.online: */ - __pyx_t_1 = PyObject_GetAttr(((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 = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((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 = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __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 = 1160; __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); @@ -50109,11 +50237,11 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __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_15 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __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 = 1151; __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 = 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); @@ -50126,10 +50254,10 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_count); PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_16); __Pyx_GIVEREF(__pyx_t_16); - PyTuple_SET_ITEM(__pyx_t_11, 4, __pyx_t_12); - __Pyx_GIVEREF(__pyx_t_12); - PyTuple_SET_ITEM(__pyx_t_11, 5, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); + 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_17)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_17)); __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)); @@ -50151,14 +50279,14 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene PyTuple_SET_ITEM(__pyx_t_11, 12, __pyx_t_15); __Pyx_GIVEREF(__pyx_t_15); __pyx_t_16 = 0; - __pyx_t_12 = 0; - __pyx_t_3 = 0; + __pyx_t_8 = 0; + __pyx_t_17 = 0; __pyx_t_15 = 0; - __pyx_t_15 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1154; __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_3); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0; - __pyx_t_11 = ((PyObject *)((struct __pyx_vtabstruct_3_sa_Scorer *)__pyx_cur_scope->__pyx_v_self->scorer->__pyx_vtab)->score(__pyx_cur_scope->__pyx_v_self->scorer, __pyx_t_15)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = ((PyObject *)((struct __pyx_vtabstruct_3_sa_Scorer *)__pyx_cur_scope->__pyx_v_self->scorer->__pyx_vtab)->score(__pyx_cur_scope->__pyx_v_self->scorer, __pyx_t_15)); 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_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_scores)); @@ -50167,7 +50295,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_scores = ((struct __pyx_obj_3_sa_FeatureVector *)__pyx_t_11); __pyx_t_11 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1159 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1162 * self.online_ctx_lookup(f, e))) * # Phrase pair processed * if self.online: # <<<<<<<<<<<<<< @@ -50176,14 +50304,14 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene */ if (__pyx_cur_scope->__pyx_v_self->online) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1160 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1163 * # 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 = 1160; __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 = 1163; __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); @@ -50191,22 +50319,22 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __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 = 1160; __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 = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0; - goto __pyx_L64; + goto __pyx_L65; } - __pyx_L64:; + __pyx_L65:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1161 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1164 * 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 = 1161; __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 = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); - __pyx_t_15 = PyTuple_New(5); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyTuple_New(5); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); @@ -50223,50 +50351,54 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene PyTuple_SET_ITEM(__pyx_t_15, 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_3_sa_Rule)), ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Rule)), ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0; __pyx_r = __pyx_t_11; __pyx_t_11 = 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_10); - __pyx_cur_scope->__pyx_t_2 = __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_14); - __pyx_cur_scope->__pyx_t_3 = __pyx_t_14; - __Pyx_XGIVEREF(__pyx_t_17); - __pyx_cur_scope->__pyx_t_4 = __pyx_t_17; - __pyx_cur_scope->__pyx_t_5 = __pyx_t_22; - __pyx_cur_scope->__pyx_t_6 = __pyx_t_23; + __pyx_cur_scope->__pyx_t_5 = __pyx_t_14; + __pyx_cur_scope->__pyx_t_6 = __pyx_t_20; __pyx_cur_scope->__pyx_t_7 = __pyx_t_24; + __pyx_cur_scope->__pyx_t_8 = __pyx_t_25; + __pyx_cur_scope->__pyx_t_9 = __pyx_t_26; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); /* return from generator, yielding value */ __pyx_generator->resume_label = 1; return __pyx_r; - __pyx_L65_resume_from_yield:; + __pyx_L66_resume_from_yield:; __pyx_t_2 = __pyx_cur_scope->__pyx_t_0; __pyx_t_6 = __pyx_cur_scope->__pyx_t_1; - __pyx_t_10 = __pyx_cur_scope->__pyx_t_2; - __pyx_cur_scope->__pyx_t_2 = 0; - __Pyx_XGOTREF(__pyx_t_10); - __pyx_t_14 = __pyx_cur_scope->__pyx_t_3; + __pyx_t_7 = __pyx_cur_scope->__pyx_t_2; + __pyx_t_10 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; - __Pyx_XGOTREF(__pyx_t_14); - __pyx_t_17 = __pyx_cur_scope->__pyx_t_4; + __Pyx_XGOTREF(__pyx_t_10); + __pyx_t_12 = __pyx_cur_scope->__pyx_t_4; __pyx_cur_scope->__pyx_t_4 = 0; - __Pyx_XGOTREF(__pyx_t_17); - __pyx_t_22 = __pyx_cur_scope->__pyx_t_5; - __pyx_t_23 = __pyx_cur_scope->__pyx_t_6; + __Pyx_XGOTREF(__pyx_t_12); + __pyx_t_14 = __pyx_cur_scope->__pyx_t_5; + __pyx_cur_scope->__pyx_t_5 = 0; + __Pyx_XGOTREF(__pyx_t_14); + __pyx_t_20 = __pyx_cur_scope->__pyx_t_6; __pyx_t_24 = __pyx_cur_scope->__pyx_t_7; - if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_25 = __pyx_cur_scope->__pyx_t_8; + __pyx_t_26 = __pyx_cur_scope->__pyx_t_9; + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - goto __pyx_L47; + goto __pyx_L52; } - __pyx_L47:; + __pyx_L52:; goto __pyx_L40; } __pyx_L40:; @@ -50274,123 +50406,121 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene } __pyx_L32:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1163 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1166 * 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_6 = PyObject_Length(__pyx_cur_scope->__pyx_v_phrase); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_21 = (__pyx_t_6 < __pyx_cur_scope->__pyx_v_self->max_length); + __pyx_t_24 = PyObject_Length(__pyx_cur_scope->__pyx_v_phrase); if (unlikely(__pyx_t_24 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_21 = (__pyx_t_24 < __pyx_cur_scope->__pyx_v_self->max_length); if (__pyx_t_21) { - __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1163; __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 = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_17 = PyNumber_Add(__pyx_t_10, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_17); + __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 = 1166; __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_6 = PyObject_Length(__pyx_t_10); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_24 = PyObject_Length(__pyx_t_10); if (unlikely(__pyx_t_24 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyInt_FromSsize_t(__pyx_t_24); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = PyObject_RichCompare(__pyx_t_17, __pyx_t_10, Py_LT); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __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 = 1166; __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_9 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_9) { - __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 = 1163; __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 = 1166; __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 = 1163; __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 = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_17 = PyObject_RichCompare(__pyx_t_11, __pyx_t_10, Py_LE); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_17); + __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 = 1166; __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_26 = __Pyx_PyObject_IsTrue(__pyx_t_17); if (unlikely(__pyx_t_26 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - __pyx_t_27 = __pyx_t_26; + __pyx_t_28 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_28 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_29 = __pyx_t_28; } else { - __pyx_t_27 = __pyx_t_9; + __pyx_t_29 = __pyx_t_9; } - __pyx_t_9 = __pyx_t_27; + __pyx_t_9 = __pyx_t_29; } else { __pyx_t_9 = __pyx_t_21; } if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1164 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1167 * * 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_17 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_17); - __pyx_t_10 = PyNumber_Add(__pyx_t_17, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1164; __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 = 1167; __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 = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - __pyx_t_17 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fwords, __pyx_t_10); if (!__pyx_t_17) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_17); + __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 = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_6 = PyObject_Length(__pyx_t_17); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_6; __pyx_t_20+=1) { + __pyx_t_24 = PyObject_Length(__pyx_t_12); if (unlikely(__pyx_t_24 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_24; __pyx_t_20+=1) { __pyx_cur_scope->__pyx_v_alt_id = __pyx_t_20; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1165 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1168 * 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_17 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_17); - __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1165; __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 = 1168; __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 = 1168; __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 = 1165; __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 = 1168; __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 = 1165; __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 = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_15 = PyNumber_Add(__pyx_cur_scope->__pyx_v_pathlen, __pyx_int_1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyNumber_Add(__pyx_cur_scope->__pyx_v_pathlen, __pyx_int_1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - __pyx_t_8 = PyTuple_New(8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_17); - __Pyx_GIVEREF(__pyx_t_17); - PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_11); + __pyx_t_3 = PyTuple_New(8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_input_match); - PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_cur_scope->__pyx_v_input_match); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_cur_scope->__pyx_v_input_match); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_input_match); - PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_t_15); + PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_t_15); __Pyx_GIVEREF(__pyx_t_15); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_node); - PyTuple_SET_ITEM(__pyx_t_8, 5, __pyx_cur_scope->__pyx_v_node); + PyTuple_SET_ITEM(__pyx_t_3, 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_8, 6, __pyx_cur_scope->__pyx_v_phrase); + PyTuple_SET_ITEM(__pyx_t_3, 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_8, 7, __pyx_cur_scope->__pyx_v_is_shadow_path); + PyTuple_SET_ITEM(__pyx_t_3, 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_12 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_15 = 0; - __pyx_t_13 = 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 = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; + __pyx_t_13 = PyList_Append(__pyx_cur_scope->__pyx_v_new_frontier, ((PyObject *)__pyx_t_3)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1166 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1169 * 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 # <<<<<<<<<<<<<< @@ -50399,18 +50529,18 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene */ __pyx_cur_scope->__pyx_v_num_subpatterns = __pyx_cur_scope->__pyx_v_arity; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1167 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1170 * 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_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 = 1167; __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 = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_21 = (!__pyx_t_9); if (__pyx_t_21) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1168 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1171 * num_subpatterns = arity * if not is_shadow_path: * num_subpatterns = num_subpatterns + 1 # <<<<<<<<<<<<<< @@ -50418,34 +50548,34 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene * xcat = sym_setindex(self.category, arity+1) */ __pyx_cur_scope->__pyx_v_num_subpatterns = (__pyx_cur_scope->__pyx_v_num_subpatterns + 1); - goto __pyx_L69; + goto __pyx_L70; } - __pyx_L69:; + __pyx_L70:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1169 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1172 * 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_6 = PyObject_Length(__pyx_cur_scope->__pyx_v_phrase); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_21 = ((__pyx_t_6 + 1) < __pyx_cur_scope->__pyx_v_self->max_length); + __pyx_t_24 = PyObject_Length(__pyx_cur_scope->__pyx_v_phrase); if (unlikely(__pyx_t_24 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_21 = ((__pyx_t_24 + 1) < __pyx_cur_scope->__pyx_v_self->max_length); if (__pyx_t_21) { __pyx_t_9 = (__pyx_cur_scope->__pyx_v_arity < __pyx_cur_scope->__pyx_v_self->max_nonterminals); if (__pyx_t_9) { - __pyx_t_27 = (__pyx_cur_scope->__pyx_v_num_subpatterns < __pyx_cur_scope->__pyx_v_self->max_chunks); - __pyx_t_26 = __pyx_t_27; + __pyx_t_29 = (__pyx_cur_scope->__pyx_v_num_subpatterns < __pyx_cur_scope->__pyx_v_self->max_chunks); + __pyx_t_28 = __pyx_t_29; } else { - __pyx_t_26 = __pyx_t_9; + __pyx_t_28 = __pyx_t_9; } - __pyx_t_9 = __pyx_t_26; + __pyx_t_9 = __pyx_t_28; } else { __pyx_t_9 = __pyx_t_21; } if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1170 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1173 * 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) # <<<<<<<<<<<<<< @@ -50454,41 +50584,41 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene */ __pyx_cur_scope->__pyx_v_xcat = __pyx_f_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, (__pyx_cur_scope->__pyx_v_arity + 1)); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1171 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1174 * 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_8 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_8, __pyx_cur_scope->__pyx_v_xcat, sizeof(int), PyInt_FromLong); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_3, __pyx_cur_scope->__pyx_v_xcat, sizeof(int), PyInt_FromLong); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1174; __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_3); __pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_xnode); __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_xnode); __Pyx_GIVEREF(__pyx_t_15); __pyx_cur_scope->__pyx_v_xnode = __pyx_t_15; __pyx_t_15 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1173 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1176 * 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_15 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->min_gap_size); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1173; __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 = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - __pyx_t_8 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_10 = PyList_New(4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1173; __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 = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_10 = PyList_New(4); 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); PyList_SET_ITEM(__pyx_t_10, 0, __pyx_t_15); __Pyx_GIVEREF(__pyx_t_15); - PyList_SET_ITEM(__pyx_t_10, 1, __pyx_t_8); - __Pyx_GIVEREF(__pyx_t_8); + PyList_SET_ITEM(__pyx_t_10, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); __Pyx_INCREF(__pyx_int_1); PyList_SET_ITEM(__pyx_t_10, 2, __pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); @@ -50496,73 +50626,73 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene PyList_SET_ITEM(__pyx_t_10, 3, __pyx_cur_scope->__pyx_v_pathlen); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_pathlen); __pyx_t_15 = 0; - __pyx_t_8 = 0; - __pyx_t_8 = ((PyObject *)PyList_AsTuple(__pyx_t_10)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_8)); + __pyx_t_3 = 0; + __pyx_t_3 = ((PyObject *)PyList_AsTuple(__pyx_t_10)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_key)); __Pyx_XDECREF(((PyObject *)__pyx_cur_scope->__pyx_v_key)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_8)); - __pyx_cur_scope->__pyx_v_key = __pyx_t_8; - __pyx_t_8 = 0; + __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); + __pyx_cur_scope->__pyx_v_key = __pyx_t_3; + __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1174 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1177 * # 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_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_frontier_nodes); __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_frontier_nodes); - __Pyx_GIVEREF(((PyObject *)__pyx_t_8)); - __pyx_cur_scope->__pyx_v_frontier_nodes = ((PyObject *)__pyx_t_8); - __pyx_t_8 = 0; + __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); + __pyx_cur_scope->__pyx_v_frontier_nodes = ((PyObject *)__pyx_t_3); + __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1175 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1178 * 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_9 = ((PyDict_Contains(((PyObject *)__pyx_cur_scope->__pyx_v_nodes_isteps_away_buffer), ((PyObject *)__pyx_cur_scope->__pyx_v_key)))); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = (__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_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1176 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1179 * 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_8 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_nodes_isteps_away_buffer), ((PyObject *)__pyx_cur_scope->__pyx_v_key)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_nodes_isteps_away_buffer), ((PyObject *)__pyx_cur_scope->__pyx_v_key)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_frontier_nodes); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_frontier_nodes); - __Pyx_GIVEREF(__pyx_t_8); - __pyx_cur_scope->__pyx_v_frontier_nodes = __pyx_t_8; - __pyx_t_8 = 0; - goto __pyx_L71; + __Pyx_GIVEREF(__pyx_t_3); + __pyx_cur_scope->__pyx_v_frontier_nodes = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L72; } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1178 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1181 * 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_8 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_123); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __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 = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_124); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __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 = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_15 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - __pyx_t_11 = PyTuple_New(7); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1178; __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 = 1181; __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); @@ -50585,9 +50715,9 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_reachable_buffer)); __pyx_t_10 = 0; __pyx_t_15 = 0; - __pyx_t_15 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __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_3); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_frontier_nodes); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_frontier_nodes); @@ -50595,18 +50725,18 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_frontier_nodes = __pyx_t_15; __pyx_t_15 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1179 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1182 * 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 = 1179; __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 = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_L71:; + __pyx_L72:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1181 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1184 * nodes_isteps_away_buffer[key] = frontier_nodes * * for (i, alt, pathlen) in frontier_nodes: # <<<<<<<<<<<<<< @@ -50614,26 +50744,34 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene * frontier = new_frontier */ if (PyList_CheckExact(__pyx_cur_scope->__pyx_v_frontier_nodes) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_frontier_nodes)) { - __pyx_t_15 = __pyx_cur_scope->__pyx_v_frontier_nodes; __Pyx_INCREF(__pyx_t_15); __pyx_t_6 = 0; + __pyx_t_15 = __pyx_cur_scope->__pyx_v_frontier_nodes; __Pyx_INCREF(__pyx_t_15); __pyx_t_24 = 0; __pyx_t_22 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_15 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_frontier_nodes); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_24 = -1; __pyx_t_15 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_frontier_nodes); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __pyx_t_22 = Py_TYPE(__pyx_t_15)->tp_iternext; } for (;;) { if (!__pyx_t_22 && PyList_CheckExact(__pyx_t_15)) { - if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_15)) break; - __pyx_t_11 = PyList_GET_ITEM(__pyx_t_15, __pyx_t_6); __Pyx_INCREF(__pyx_t_11); __pyx_t_6++; + if (__pyx_t_24 >= PyList_GET_SIZE(__pyx_t_15)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_11 = PyList_GET_ITEM(__pyx_t_15, __pyx_t_24); __Pyx_INCREF(__pyx_t_11); __pyx_t_24++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_11 = PySequence_ITEM(__pyx_t_15, __pyx_t_24); __pyx_t_24++; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else if (!__pyx_t_22 && PyTuple_CheckExact(__pyx_t_15)) { - if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_15)) break; - __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_15, __pyx_t_6); __Pyx_INCREF(__pyx_t_11); __pyx_t_6++; + if (__pyx_t_24 >= PyTuple_GET_SIZE(__pyx_t_15)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_15, __pyx_t_24); __Pyx_INCREF(__pyx_t_11); __pyx_t_24++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_11 = PySequence_ITEM(__pyx_t_15, __pyx_t_24); __pyx_t_24++; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else { __pyx_t_11 = __pyx_t_22(__pyx_t_15); if (unlikely(!__pyx_t_11)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -50641,137 +50779,145 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene } 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 + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 3)) { + if (size > 3) __Pyx_RaiseTooManyValuesError(3); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 3)) { - if (PyTuple_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_17 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_12 = PyTuple_GET_ITEM(sequence, 2); } else { - if (unlikely(PyList_GET_SIZE(sequence) != 3)) { - if (PyList_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_8 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); __pyx_t_10 = PyList_GET_ITEM(sequence, 1); - __pyx_t_17 = PyList_GET_ITEM(sequence, 2); + __pyx_t_12 = PyList_GET_ITEM(sequence, 2); } - __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(__pyx_t_17); + __Pyx_INCREF(__pyx_t_12); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1184; __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 = 1184; __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 = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - } else { + } 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 = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_17 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_19 = Py_TYPE(__pyx_t_3)->tp_iternext; - index = 0; __pyx_t_8 = __pyx_t_19(__pyx_t_3); if (unlikely(!__pyx_t_8)) goto __pyx_L74_unpacking_failed; - __Pyx_GOTREF(__pyx_t_8); - index = 1; __pyx_t_10 = __pyx_t_19(__pyx_t_3); if (unlikely(!__pyx_t_10)) goto __pyx_L74_unpacking_failed; + __pyx_t_19 = Py_TYPE(__pyx_t_17)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_19(__pyx_t_17); if (unlikely(!__pyx_t_3)) goto __pyx_L75_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_10 = __pyx_t_19(__pyx_t_17); if (unlikely(!__pyx_t_10)) goto __pyx_L75_unpacking_failed; __Pyx_GOTREF(__pyx_t_10); - index = 2; __pyx_t_17 = __pyx_t_19(__pyx_t_3); if (unlikely(!__pyx_t_17)) goto __pyx_L74_unpacking_failed; - __Pyx_GOTREF(__pyx_t_17); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_19(__pyx_t_3), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L75_unpacking_done; - __pyx_L74_unpacking_failed:; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_L75_unpacking_done:; + index = 2; __pyx_t_12 = __pyx_t_19(__pyx_t_17); if (unlikely(!__pyx_t_12)) goto __pyx_L75_unpacking_failed; + __Pyx_GOTREF(__pyx_t_12); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_19(__pyx_t_17), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = NULL; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + goto __pyx_L76_unpacking_done; + __pyx_L75_unpacking_failed:; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_19 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L76_unpacking_done:; } - __pyx_t_20 = __Pyx_PyInt_AsInt(__pyx_t_8); if (unlikely((__pyx_t_20 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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 = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_20 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_20 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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 = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_cur_scope->__pyx_v_i = __pyx_t_20; __pyx_cur_scope->__pyx_v_alt = __pyx_t_7; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_pathlen); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_pathlen); - __Pyx_GIVEREF(__pyx_t_17); - __pyx_cur_scope->__pyx_v_pathlen = __pyx_t_17; - __pyx_t_17 = 0; + __Pyx_GIVEREF(__pyx_t_12); + __pyx_cur_scope->__pyx_v_pathlen = __pyx_t_12; + __pyx_t_12 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1182 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1185 * * 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 = 1182; __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 = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); - __pyx_t_17 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_17); - __pyx_t_10 = PyInt_FromLong(__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_t_12 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1185; __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 = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_10); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyNumber_Add(__pyx_cur_scope->__pyx_v_input_match, ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyNumber_Add(__pyx_cur_scope->__pyx_v_input_match, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_alt); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_17 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_xcat); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_17); + __Pyx_GIVEREF(__pyx_t_17); + __pyx_t_17 = 0; + __pyx_t_17 = PyNumber_Add(__pyx_cur_scope->__pyx_v_phrase, ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; - __pyx_t_8 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_alt); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __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 = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_xcat); 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_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - PyTuple_SET_ITEM(__pyx_t_12, 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_12)); 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_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; - __pyx_t_12 = PyTuple_New(8); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); - PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_17); - __Pyx_GIVEREF(__pyx_t_17); - PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_10); + 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); __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_12, 3, __pyx_t_8); - __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_pathlen); - PyTuple_SET_ITEM(__pyx_t_12, 4, __pyx_cur_scope->__pyx_v_pathlen); + PyTuple_SET_ITEM(__pyx_t_8, 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_12, 5, __pyx_cur_scope->__pyx_v_xnode); + PyTuple_SET_ITEM(__pyx_t_8, 5, __pyx_cur_scope->__pyx_v_xnode); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_xnode); - PyTuple_SET_ITEM(__pyx_t_12, 6, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_8, 6, __pyx_t_17); + __Pyx_GIVEREF(__pyx_t_17); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_is_shadow_path); - PyTuple_SET_ITEM(__pyx_t_12, 7, __pyx_cur_scope->__pyx_v_is_shadow_path); + PyTuple_SET_ITEM(__pyx_t_8, 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_17 = 0; + __pyx_t_12 = 0; __pyx_t_10 = 0; - __pyx_t_8 = 0; __pyx_t_3 = 0; - __pyx_t_13 = PyList_Append(__pyx_cur_scope->__pyx_v_new_frontier, ((PyObject *)__pyx_t_12)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; + __pyx_t_17 = 0; + __pyx_t_13 = 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 = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - goto __pyx_L70; + goto __pyx_L71; } - __pyx_L70:; - goto __pyx_L66; + __pyx_L71:; + goto __pyx_L67; } - __pyx_L66:; + __pyx_L67:; __pyx_L19_continue:; } __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1183 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1186 * 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 # <<<<<<<<<<<<<< @@ -50785,7 +50931,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_frontier = __pyx_cur_scope->__pyx_v_new_frontier; } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1186 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1189 * * # Online rule extraction and scoring * if self.online: # <<<<<<<<<<<<<< @@ -50794,118 +50940,134 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene */ if (__pyx_cur_scope->__pyx_v_self->online) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1187 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1190 * # Online rule extraction and scoring * if self.online: * 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_14 = __pyx_pf_3_sa_23HieroCachingRuleFactory_5input_2genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __pyx_pf_3_sa_23HieroCachingRuleFactory_5input_2genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __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 = 1187; __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 = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_14); __Pyx_GIVEREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0; __Pyx_GIVEREF(__pyx_t_14); __pyx_cur_scope->__pyx_v_f_syms = ((PyObject*)__pyx_t_14); __pyx_t_14 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1188 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1191 * if self.online: * 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_14 = PyObject_GetAttr(((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 = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyObject_GetAttr(((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 = 1191; __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 = 1188; __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 = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_f_syms)); PyTuple_SET_ITEM(__pyx_t_15, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_f_syms)); __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_f_syms)); - __pyx_t_12 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); + __pyx_t_8 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0; - if (PyList_CheckExact(__pyx_t_12) || PyTuple_CheckExact(__pyx_t_12)) { - __pyx_t_15 = __pyx_t_12; __Pyx_INCREF(__pyx_t_15); __pyx_t_2 = 0; + if (PyList_CheckExact(__pyx_t_8) || PyTuple_CheckExact(__pyx_t_8)) { + __pyx_t_15 = __pyx_t_8; __Pyx_INCREF(__pyx_t_15); __pyx_t_2 = 0; __pyx_t_22 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_15 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = -1; __pyx_t_15 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __pyx_t_22 = Py_TYPE(__pyx_t_15)->tp_iternext; } - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; for (;;) { if (!__pyx_t_22 && PyList_CheckExact(__pyx_t_15)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_15)) break; - __pyx_t_12 = PyList_GET_ITEM(__pyx_t_15, __pyx_t_2); __Pyx_INCREF(__pyx_t_12); __pyx_t_2++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_15, __pyx_t_2); __Pyx_INCREF(__pyx_t_8); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_15, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else if (!__pyx_t_22 && PyTuple_CheckExact(__pyx_t_15)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_15)) break; - __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_15, __pyx_t_2); __Pyx_INCREF(__pyx_t_12); __pyx_t_2++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_15, __pyx_t_2); __Pyx_INCREF(__pyx_t_8); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_15, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else { - __pyx_t_12 = __pyx_t_22(__pyx_t_15); - if (unlikely(!__pyx_t_12)) { + __pyx_t_8 = __pyx_t_22(__pyx_t_15); + if (unlikely(!__pyx_t_8)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } - __Pyx_GOTREF(__pyx_t_12); + __Pyx_GOTREF(__pyx_t_8); } - if ((likely(PyTuple_CheckExact(__pyx_t_12))) || (PyList_CheckExact(__pyx_t_12))) { - PyObject* sequence = __pyx_t_12; + if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) { + PyObject* sequence = __pyx_t_8; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 3)) { + if (size > 3) __Pyx_RaiseTooManyValuesError(3); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 3)) { - if (PyTuple_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } __pyx_t_14 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_17 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); } else { - if (unlikely(PyList_GET_SIZE(sequence) != 3)) { - if (PyList_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } __pyx_t_14 = PyList_GET_ITEM(sequence, 0); - __pyx_t_3 = PyList_GET_ITEM(sequence, 1); - __pyx_t_8 = PyList_GET_ITEM(sequence, 2); + __pyx_t_17 = PyList_GET_ITEM(sequence, 1); + __pyx_t_3 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_14); + __Pyx_INCREF(__pyx_t_17); __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - } else { + #else + __pyx_t_14 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1191; __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 = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } else + { Py_ssize_t index = -1; - __pyx_t_10 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __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 = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_19 = Py_TYPE(__pyx_t_10)->tp_iternext; - index = 0; __pyx_t_14 = __pyx_t_19(__pyx_t_10); if (unlikely(!__pyx_t_14)) goto __pyx_L79_unpacking_failed; + index = 0; __pyx_t_14 = __pyx_t_19(__pyx_t_10); if (unlikely(!__pyx_t_14)) goto __pyx_L80_unpacking_failed; __Pyx_GOTREF(__pyx_t_14); - index = 1; __pyx_t_3 = __pyx_t_19(__pyx_t_10); if (unlikely(!__pyx_t_3)) goto __pyx_L79_unpacking_failed; + index = 1; __pyx_t_17 = __pyx_t_19(__pyx_t_10); if (unlikely(!__pyx_t_17)) goto __pyx_L80_unpacking_failed; + __Pyx_GOTREF(__pyx_t_17); + index = 2; __pyx_t_3 = __pyx_t_19(__pyx_t_10); if (unlikely(!__pyx_t_3)) goto __pyx_L80_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); - index = 2; __pyx_t_8 = __pyx_t_19(__pyx_t_10); if (unlikely(!__pyx_t_8)) goto __pyx_L79_unpacking_failed; - __Pyx_GOTREF(__pyx_t_8); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_19(__pyx_t_10), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_IternextUnpackEndCheck(__pyx_t_19(__pyx_t_10), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - goto __pyx_L80_unpacking_done; - __pyx_L79_unpacking_failed:; + goto __pyx_L81_unpacking_done; + __pyx_L80_unpacking_failed:; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_L80_unpacking_done:; + __pyx_t_19 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L81_unpacking_done:; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_f); __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_f); @@ -50914,208 +51076,216 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_t_14 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_lex_i); __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_lex_i); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_cur_scope->__pyx_v_lex_i = __pyx_t_3; - __pyx_t_3 = 0; + __Pyx_GIVEREF(__pyx_t_17); + __pyx_cur_scope->__pyx_v_lex_i = __pyx_t_17; + __pyx_t_17 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_lex_j); __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_lex_j); - __Pyx_GIVEREF(__pyx_t_8); - __pyx_cur_scope->__pyx_v_lex_j = __pyx_t_8; - __pyx_t_8 = 0; + __Pyx_GIVEREF(__pyx_t_3); + __pyx_cur_scope->__pyx_v_lex_j = __pyx_t_3; + __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1189 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1192 * 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_12 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_lex_j, __pyx_cur_scope->__pyx_v_lex_i); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_8 = PyNumber_Add(__pyx_t_12, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __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 = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_8, __pyx_int_1); 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_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_spanlen); __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_spanlen); - __Pyx_GIVEREF(__pyx_t_8); - __pyx_cur_scope->__pyx_v_spanlen = __pyx_t_8; - __pyx_t_8 = 0; + __Pyx_GIVEREF(__pyx_t_3); + __pyx_cur_scope->__pyx_v_spanlen = __pyx_t_3; + __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1190 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1193 * 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_8 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_f, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __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 = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_f, 0, sizeof(long), PyInt_FromLong); if (!__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_7 = __Pyx_PyInt_AsInt(__pyx_t_3); 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_3); __pyx_t_3 = 0; __pyx_t_9 = (!__pyx_f_3_sa_sym_isvar(__pyx_t_7)); if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1191 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1194 * spanlen = (lex_j - lex_i) + 1 * if not sym_isvar(f[0]): * spanlen += 1 # <<<<<<<<<<<<<< * if not sym_isvar(f[1]): * spanlen += 1 */ - __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_cur_scope->__pyx_v_spanlen, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_cur_scope->__pyx_v_spanlen, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_spanlen); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_spanlen); - __Pyx_GIVEREF(__pyx_t_8); - __pyx_cur_scope->__pyx_v_spanlen = __pyx_t_8; - __pyx_t_8 = 0; - goto __pyx_L81; + __Pyx_GIVEREF(__pyx_t_3); + __pyx_cur_scope->__pyx_v_spanlen = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L82; } - __pyx_L81:; + __pyx_L82:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1192 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1195 * if not sym_isvar(f[0]): * spanlen += 1 * if not sym_isvar(f[1]): # <<<<<<<<<<<<<< * spanlen += 1 * for e in self.phrases_fe.get(f, ()): */ - __pyx_t_8 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_f, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __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 = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_f, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_9 = (!__pyx_f_3_sa_sym_isvar(__pyx_t_7)); if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1193 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1196 * spanlen += 1 * if not sym_isvar(f[1]): * spanlen += 1 # <<<<<<<<<<<<<< * for e in self.phrases_fe.get(f, ()): * if (f, e) not in seen_phrases: */ - __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_cur_scope->__pyx_v_spanlen, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_cur_scope->__pyx_v_spanlen, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_spanlen); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_spanlen); - __Pyx_GIVEREF(__pyx_t_8); - __pyx_cur_scope->__pyx_v_spanlen = __pyx_t_8; - __pyx_t_8 = 0; - goto __pyx_L82; + __Pyx_GIVEREF(__pyx_t_3); + __pyx_cur_scope->__pyx_v_spanlen = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L83; } - __pyx_L82:; + __pyx_L83:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1194 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1197 * if not sym_isvar(f[1]): * spanlen += 1 * for e in self.phrases_fe.get(f, ()): # <<<<<<<<<<<<<< * if (f, e) not in seen_phrases: * # Don't add multiple instances of the same phrase here */ - __pyx_t_8 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_self->phrases_fe, __pyx_n_s__get); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_self->phrases_fe, __pyx_n_s__get); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f); - PyTuple_SET_ITEM(__pyx_t_12, 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(((PyObject *)__pyx_empty_tuple)); - PyTuple_SET_ITEM(__pyx_t_12, 1, ((PyObject *)__pyx_empty_tuple)); + PyTuple_SET_ITEM(__pyx_t_8, 1, ((PyObject *)__pyx_empty_tuple)); __Pyx_GIVEREF(((PyObject *)__pyx_empty_tuple)); - __pyx_t_3 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1194; __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_12)); __pyx_t_12 = 0; - if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) { - __pyx_t_12 = __pyx_t_3; __Pyx_INCREF(__pyx_t_12); __pyx_t_6 = 0; - __pyx_t_24 = NULL; + __pyx_t_17 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; + if (PyList_CheckExact(__pyx_t_17) || PyTuple_CheckExact(__pyx_t_17)) { + __pyx_t_8 = __pyx_t_17; __Pyx_INCREF(__pyx_t_8); __pyx_t_24 = 0; + __pyx_t_30 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_24 = Py_TYPE(__pyx_t_12)->tp_iternext; + __pyx_t_24 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_17); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_30 = Py_TYPE(__pyx_t_8)->tp_iternext; } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; for (;;) { - if (!__pyx_t_24 && PyList_CheckExact(__pyx_t_12)) { - if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_12)) break; - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; - } else if (!__pyx_t_24 && PyTuple_CheckExact(__pyx_t_12)) { - if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_12)) break; - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; + if (!__pyx_t_30 && PyList_CheckExact(__pyx_t_8)) { + if (__pyx_t_24 >= PyList_GET_SIZE(__pyx_t_8)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_17 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_24); __Pyx_INCREF(__pyx_t_17); __pyx_t_24++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_17 = PySequence_ITEM(__pyx_t_8, __pyx_t_24); __pyx_t_24++; if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_30 && PyTuple_CheckExact(__pyx_t_8)) { + if (__pyx_t_24 >= PyTuple_GET_SIZE(__pyx_t_8)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_17 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_24); __Pyx_INCREF(__pyx_t_17); __pyx_t_24++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_17 = PySequence_ITEM(__pyx_t_8, __pyx_t_24); __pyx_t_24++; if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else { - __pyx_t_3 = __pyx_t_24(__pyx_t_12); - if (unlikely(!__pyx_t_3)) { + __pyx_t_17 = __pyx_t_30(__pyx_t_8); + if (unlikely(!__pyx_t_17)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } - __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_17); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_e); __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_e); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_cur_scope->__pyx_v_e = __pyx_t_3; - __pyx_t_3 = 0; + __Pyx_GIVEREF(__pyx_t_17); + __pyx_cur_scope->__pyx_v_e = __pyx_t_17; + __pyx_t_17 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1195 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1198 * spanlen += 1 * for e in self.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 = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_17 = PyTuple_New(2); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); __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_17, 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_17, 1, __pyx_cur_scope->__pyx_v_e); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e); - __pyx_t_9 = (__Pyx_NegateNonNeg(PySequence_Contains(((PyObject *)__pyx_cur_scope->__pyx_v_seen_phrases), ((PyObject *)__pyx_t_3)))); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __pyx_t_9 = (__Pyx_PySequence_Contains(((PyObject *)__pyx_t_17), ((PyObject *)__pyx_cur_scope->__pyx_v_seen_phrases), Py_NE)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0; if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1197 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1200 * 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 = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_17 = PyTuple_New(2); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); __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_17, 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_17, 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 = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __pyx_t_13 = PySet_Add(__pyx_cur_scope->__pyx_v_seen_phrases, ((PyObject *)__pyx_t_17)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1198 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1201 * # 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_GetName(__pyx_m, __pyx_n_s__FeatureContext); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_17 = __Pyx_GetName(__pyx_m, __pyx_n_s__FeatureContext); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1203 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1206 * fwords, self.fda, self.eda, * meta, * self.online_ctx_lookup(f, e))) # <<<<<<<<<<<<<< * alignment = self.phrases_al[f][e] * yield Rule(self.category, f, e, scores, alignment) */ - __pyx_t_8 = PyObject_GetAttr(((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 = 1203; __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 = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__online_ctx_lookup); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_cur_scope->__pyx_v_f); @@ -51123,11 +51293,11 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __Pyx_INCREF(__pyx_cur_scope->__pyx_v_e); PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_cur_scope->__pyx_v_e); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e); - __pyx_t_10 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0; - __pyx_t_14 = PyTuple_New(13); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyTuple_New(13); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_cur_scope->__pyx_v_f); @@ -51168,11 +51338,11 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene PyTuple_SET_ITEM(__pyx_t_14, 12, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_Call(__pyx_t_17, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0; - __pyx_t_14 = ((PyObject *)((struct __pyx_vtabstruct_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_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyObject *)((struct __pyx_vtabstruct_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_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_scores)); @@ -51181,16 +51351,16 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_scores = ((struct __pyx_obj_3_sa_FeatureVector *)__pyx_t_14); __pyx_t_14 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1204 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1207 * meta, * self.online_ctx_lookup(f, e))) * alignment = self.phrases_al[f][e] # <<<<<<<<<<<<<< * yield Rule(self.category, f, e, scores, alignment) * */ - __pyx_t_14 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_self->phrases_al, __pyx_cur_scope->__pyx_v_f); if (!__pyx_t_14) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_self->phrases_al, __pyx_cur_scope->__pyx_v_f); if (!__pyx_t_14) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); - __pyx_t_10 = PyObject_GetItem(__pyx_t_14, __pyx_cur_scope->__pyx_v_e); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_GetItem(__pyx_t_14, __pyx_cur_scope->__pyx_v_e); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_alignment); @@ -51199,16 +51369,16 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_cur_scope->__pyx_v_alignment = __pyx_t_10; __pyx_t_10 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1205 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1208 * self.online_ctx_lookup(f, e))) * alignment = self.phrases_al[f][e] * yield Rule(self.category, f, e, scores, alignment) # <<<<<<<<<<<<<< * * stop_time = monitor_cpu() */ - __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->category); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->category); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_14 = PyTuple_New(5); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyTuple_New(5); 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); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); @@ -51225,165 +51395,165 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene PyTuple_SET_ITEM(__pyx_t_14, 4, __pyx_cur_scope->__pyx_v_alignment); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_alignment); __pyx_t_10 = 0; - __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Rule)), ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Rule)), ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0; __pyx_r = __pyx_t_10; __pyx_t_10 = 0; __pyx_cur_scope->__pyx_t_0 = __pyx_t_2; - __pyx_cur_scope->__pyx_t_1 = __pyx_t_6; - __Pyx_XGIVEREF(__pyx_t_12); - __pyx_cur_scope->__pyx_t_2 = __pyx_t_12; + __Pyx_XGIVEREF(__pyx_t_8); + __pyx_cur_scope->__pyx_t_3 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_t_15); - __pyx_cur_scope->__pyx_t_3 = __pyx_t_15; - __pyx_cur_scope->__pyx_t_5 = __pyx_t_22; - __pyx_cur_scope->__pyx_t_7 = __pyx_t_24; + __pyx_cur_scope->__pyx_t_4 = __pyx_t_15; + __pyx_cur_scope->__pyx_t_10 = __pyx_t_22; + __pyx_cur_scope->__pyx_t_1 = __pyx_t_24; + __pyx_cur_scope->__pyx_t_11 = __pyx_t_30; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); /* return from generator, yielding value */ __pyx_generator->resume_label = 2; return __pyx_r; - __pyx_L86_resume_from_yield:; + __pyx_L87_resume_from_yield:; __pyx_t_2 = __pyx_cur_scope->__pyx_t_0; - __pyx_t_6 = __pyx_cur_scope->__pyx_t_1; - __pyx_t_12 = __pyx_cur_scope->__pyx_t_2; - __pyx_cur_scope->__pyx_t_2 = 0; - __Pyx_XGOTREF(__pyx_t_12); - __pyx_t_15 = __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_8); + __pyx_t_15 = __pyx_cur_scope->__pyx_t_4; + __pyx_cur_scope->__pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_t_15); - __pyx_t_22 = __pyx_cur_scope->__pyx_t_5; - __pyx_t_24 = __pyx_cur_scope->__pyx_t_7; - if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L85; + __pyx_t_22 = __pyx_cur_scope->__pyx_t_10; + __pyx_t_24 = __pyx_cur_scope->__pyx_t_1; + __pyx_t_30 = __pyx_cur_scope->__pyx_t_11; + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L86; } - __pyx_L85:; + __pyx_L86:; } - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - goto __pyx_L76; + goto __pyx_L77; } - __pyx_L76:; + __pyx_L77:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1207 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1210 * 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_15 = __Pyx_GetName(__pyx_m, __pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = __Pyx_GetName(__pyx_m, __pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - __pyx_t_12 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); + __pyx_t_8 = PyObject_Call(__pyx_t_15, ((PyObject *)__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_15); __pyx_t_15 = 0; - __Pyx_GIVEREF(__pyx_t_12); - __pyx_cur_scope->__pyx_v_stop_time = __pyx_t_12; - __pyx_t_12 = 0; + __Pyx_GIVEREF(__pyx_t_8); + __pyx_cur_scope->__pyx_v_stop_time = __pyx_t_8; + __pyx_t_8 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1208 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1211 * * stop_time = monitor_cpu() * logger.info("Total time for rule lookup, extraction, and scoring = %f seconds", (stop_time - start_time)) # <<<<<<<<<<<<<< * gc.collect() * logger.info(" Extract time = %f seconds", self.extract_time) */ - __pyx_t_12 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_15 = PyObject_GetAttr(__pyx_t_12, __pyx_n_s__info); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_15 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__info); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_start_time); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_10 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_stop_time, __pyx_t_12); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_start_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_10 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_stop_time, __pyx_t_8); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_124)); - PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)__pyx_kp_s_124)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_124)); - PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(2); 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_INCREF(((PyObject *)__pyx_kp_s_125)); + PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_kp_s_125)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_125)); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1209 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1212 * 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_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__gc); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__gc); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_12 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__collect); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); + __pyx_t_8 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__collect); 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_10); __pyx_t_10 = 0; - __pyx_t_10 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1210 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1213 * 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_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_12 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__info); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); + __pyx_t_8 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__info); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __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 = 1210; __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 = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_125)); - PyTuple_SET_ITEM(__pyx_t_15, 0, ((PyObject *)__pyx_kp_s_125)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_125)); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_126)); + PyTuple_SET_ITEM(__pyx_t_15, 0, ((PyObject *)__pyx_kp_s_126)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_126)); PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1210; __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 = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1211 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1214 * gc.collect() * logger.info(" Extract time = %f seconds", self.extract_time) * logger.info(" Intersect time = %f seconds", self.intersect_time) # <<<<<<<<<<<<<< * * */ - __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_15 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__info); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__info); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->intersect_time); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->intersect_time); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_126)); - PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)__pyx_kp_s_126)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_126)); - PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_10); + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_127)); + PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_kp_s_127)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_127)); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; @@ -51403,11 +51573,12 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_generator->resume_label = -1; + __Pyx_Generator_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return NULL; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1214 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1217 * * * cdef int find_fixpoint(self, # <<<<<<<<<<<<<< @@ -51437,7 +51608,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj int __pyx_clineno = 0; __Pyx_RefNannySetupContext("find_fixpoint", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1229 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1232 * 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 # <<<<<<<<<<<<<< @@ -51446,7 +51617,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj */ (__pyx_v_e_low[0]) = __pyx_v_e_in_low; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1230 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1233 * * e_low[0] = e_in_low * e_high[0] = e_in_high # <<<<<<<<<<<<<< @@ -51455,19 +51626,19 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj */ (__pyx_v_e_high[0]) = __pyx_v_e_in_high; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1231 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1234 * 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 = 1231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_projection(__pyx_v_self, __pyx_v_f_low, __pyx_t_1, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_low, __pyx_v_e_high); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1231; __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 = 1234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_projection(__pyx_v_self, __pyx_v_f_low, __pyx_t_1, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_low, __pyx_v_e_high); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1232 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1235 * 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: # <<<<<<<<<<<<<< @@ -51477,7 +51648,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj __pyx_t_3 = ((__pyx_v_e_low[0]) == -1); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1238 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1241 * # rule X -> X_1 w X_2 / X_1 X_2. This is probably * # not worth the bother, though. * return 0 # <<<<<<<<<<<<<< @@ -51489,7 +51660,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj goto __pyx_L3; } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1239 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1242 * # not worth the bother, though. * return 0 * elif e_in_low != -1 and e_low[0] != e_in_low: # <<<<<<<<<<<<<< @@ -51505,7 +51676,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } if (__pyx_t_5) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1240 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1243 * return 0 * elif e_in_low != -1 and e_low[0] != e_in_low: * if e_in_low - e_low[0] < min_ex_size: # <<<<<<<<<<<<<< @@ -51515,7 +51686,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj __pyx_t_5 = ((__pyx_v_e_in_low - (__pyx_v_e_low[0])) < __pyx_v_min_ex_size); if (__pyx_t_5) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1241 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1244 * 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 # <<<<<<<<<<<<<< @@ -51524,7 +51695,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj */ (__pyx_v_e_low[0]) = (__pyx_v_e_in_low - __pyx_v_min_ex_size); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1242 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1245 * if e_in_low - e_low[0] < min_ex_size: * e_low[0] = e_in_low - min_ex_size * if e_low[0] < 0: # <<<<<<<<<<<<<< @@ -51534,7 +51705,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj __pyx_t_5 = ((__pyx_v_e_low[0]) < 0); if (__pyx_t_5) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1243 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1246 * e_low[0] = e_in_low - min_ex_size * if e_low[0] < 0: * return 0 # <<<<<<<<<<<<<< @@ -51553,7 +51724,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1245 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1248 * return 0 * * if e_high[0] - e_low[0] > max_e_len: # <<<<<<<<<<<<<< @@ -51563,7 +51734,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj __pyx_t_5 = (((__pyx_v_e_high[0]) - (__pyx_v_e_low[0])) > __pyx_v_max_e_len); if (__pyx_t_5) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1246 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1249 * * if e_high[0] - e_low[0] > max_e_len: * return 0 # <<<<<<<<<<<<<< @@ -51575,7 +51746,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj goto __pyx_L6; } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1247 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1250 * if e_high[0] - e_low[0] > max_e_len: * return 0 * elif e_in_high != -1 and e_high[0] != e_in_high: # <<<<<<<<<<<<<< @@ -51591,7 +51762,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } if (__pyx_t_4) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1248 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1251 * return 0 * elif e_in_high != -1 and e_high[0] != e_in_high: * if e_high[0] - e_in_high < min_ex_size: # <<<<<<<<<<<<<< @@ -51601,7 +51772,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj __pyx_t_4 = (((__pyx_v_e_high[0]) - __pyx_v_e_in_high) < __pyx_v_min_ex_size); if (__pyx_t_4) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1249 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1252 * 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 # <<<<<<<<<<<<<< @@ -51610,7 +51781,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj */ (__pyx_v_e_high[0]) = (__pyx_v_e_in_high + __pyx_v_min_ex_size); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1250 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1253 * 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: # <<<<<<<<<<<<<< @@ -51620,7 +51791,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj __pyx_t_4 = ((__pyx_v_e_high[0]) > __pyx_v_e_sent_len); if (__pyx_t_4) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1251 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1254 * e_high[0] = e_in_high + min_ex_size * if e_high[0] > e_sent_len: * return 0 # <<<<<<<<<<<<<< @@ -51639,7 +51810,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } __pyx_L6:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1253 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1256 * return 0 * * f_back_low[0] = -1 # <<<<<<<<<<<<<< @@ -51648,7 +51819,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj */ (__pyx_v_f_back_low[0]) = -1; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1254 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1257 * * f_back_low[0] = -1 * f_back_high[0] = -1 # <<<<<<<<<<<<<< @@ -51657,7 +51828,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj */ (__pyx_v_f_back_high[0]) = -1; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1255 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1258 * f_back_low[0] = -1 * f_back_high[0] = -1 * f_low_prev = f_low # <<<<<<<<<<<<<< @@ -51666,17 +51837,17 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj */ __pyx_v_f_low_prev = __pyx_v_f_low; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1256 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1259 * 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 = 1256; __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 = 1259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_f_high_prev = __pyx_t_1; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1257 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1260 * f_low_prev = f_low * f_high_prev = f_high * new_x = 0 # <<<<<<<<<<<<<< @@ -51685,7 +51856,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj */ __pyx_v_new_x = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1258 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1261 * f_high_prev = f_high * new_x = 0 * new_low_x = 0 # <<<<<<<<<<<<<< @@ -51694,7 +51865,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj */ __pyx_v_new_low_x = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1259 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1262 * new_x = 0 * new_low_x = 0 * new_high_x = 0 # <<<<<<<<<<<<<< @@ -51703,7 +51874,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj */ __pyx_v_new_high_x = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1261 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1264 * new_high_x = 0 * * while True: # <<<<<<<<<<<<<< @@ -51713,7 +51884,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj while (1) { if (!1) break; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1263 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1266 * while True: * * if f_back_low[0] == -1: # <<<<<<<<<<<<<< @@ -51723,45 +51894,45 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj __pyx_t_4 = ((__pyx_v_f_back_low[0]) == -1); if (__pyx_t_4) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1264 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1267 * * 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_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 = 1264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_projection(__pyx_v_self, (__pyx_v_e_low[0]), (__pyx_v_e_high[0]), __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_f_back_low, __pyx_v_f_back_high); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1267; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1266 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1269 * 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_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 = 1266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_projection(__pyx_v_self, (__pyx_v_e_low[0]), __pyx_v_e_low_prev, __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_f_back_low, __pyx_v_f_back_high); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1267 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1270 * 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_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 = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_projection(__pyx_v_self, __pyx_v_e_high_prev, (__pyx_v_e_high[0]), __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_f_back_low, __pyx_v_f_back_high); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_L11:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1269 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1272 * 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: # <<<<<<<<<<<<<< @@ -51771,7 +51942,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj __pyx_t_4 = ((__pyx_v_f_back_low[0]) > __pyx_v_f_low); if (__pyx_t_4) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1270 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1273 * * if f_back_low[0] > f_low: * f_back_low[0] = f_low # <<<<<<<<<<<<<< @@ -51783,36 +51954,35 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } __pyx_L12:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1272 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1275 * 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 = 1272; __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 = 1275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_v_f_high, Py_LT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); + __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 = 1275; __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 = 1272; __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 = 1275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_4) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1273 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1276 * * 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 = 1273; __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 = 1276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} (__pyx_v_f_back_high[0]) = __pyx_t_1; goto __pyx_L13; } __pyx_L13:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1275 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1278 * f_back_high[0] = f_high * * if f_back_low[0] == f_low_prev and f_back_high[0] == f_high_prev: # <<<<<<<<<<<<<< @@ -51828,12 +51998,12 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1276 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1279 * * if f_back_low[0] == f_low_prev and f_back_high[0] == f_high_prev: * return 1 # <<<<<<<<<<<<<< * - * if allow_low_x == 0 and f_back_low[0] < f_low: + * # print >> sys.stderr, "continue 1", f_back_low[0], f_back_high[0], f_low, f_high */ __pyx_r = 1; goto __pyx_L0; @@ -51841,8 +52011,8 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } __pyx_L14:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1278 - * return 1 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1283 + * # print >> sys.stderr, "continue 1", f_back_low[0], f_back_high[0], f_low, f_high * * if allow_low_x == 0 and f_back_low[0] < f_low: # <<<<<<<<<<<<<< * # FAIL: f phrase is not tight @@ -51857,7 +52027,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } if (__pyx_t_5) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1280 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1285 * if allow_low_x == 0 and f_back_low[0] < f_low: * # FAIL: f phrase is not tight * return 0 # <<<<<<<<<<<<<< @@ -51870,18 +52040,18 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } __pyx_L15:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1282 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1287 * return 0 * * if f_back_high[0] - f_back_low[0] > max_f_len: # <<<<<<<<<<<<<< + * # print >> sys.stderr, "iese aici" * # FAIL: f back projection is too wide - * return 0 */ __pyx_t_5 = (((__pyx_v_f_back_high[0]) - (__pyx_v_f_back_low[0])) > __pyx_v_max_f_len); if (__pyx_t_5) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1284 - * if f_back_high[0] - f_back_low[0] > max_f_len: + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1290 + * # print >> sys.stderr, "iese aici" * # FAIL: f back projection is too wide * return 0 # <<<<<<<<<<<<<< * @@ -51893,7 +52063,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } __pyx_L16:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1286 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1292 * return 0 * * if allow_high_x == 0 and f_back_high[0] > f_high: # <<<<<<<<<<<<<< @@ -51902,12 +52072,11 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj */ __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 = 1286; __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 = 1292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_v_f_high, Py_GT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __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 = 1292; __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 = 1286; __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 = 1292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __pyx_t_3; } else { @@ -51915,7 +52084,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } if (__pyx_t_4) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1288 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1294 * if allow_high_x == 0 and f_back_high[0] > f_high: * # FAIL: extension on high side not allowed * return 0 # <<<<<<<<<<<<<< @@ -51928,7 +52097,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } __pyx_L17:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1290 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1296 * return 0 * * if f_low != f_back_low[0]: # <<<<<<<<<<<<<< @@ -51938,7 +52107,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj __pyx_t_4 = (__pyx_v_f_low != (__pyx_v_f_back_low[0])); if (__pyx_t_4) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1291 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1297 * * if f_low != f_back_low[0]: * if new_low_x == 0: # <<<<<<<<<<<<<< @@ -51948,7 +52117,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj __pyx_t_4 = (__pyx_v_new_low_x == 0); if (__pyx_t_4) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1292 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1298 * if f_low != f_back_low[0]: * if new_low_x == 0: * if new_x >= max_new_x: # <<<<<<<<<<<<<< @@ -51958,7 +52127,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj __pyx_t_4 = (__pyx_v_new_x >= __pyx_v_max_new_x); if (__pyx_t_4) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1294 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1300 * if new_x >= max_new_x: * # FAIL: extension required on low side violates max # of gaps * return 0 # <<<<<<<<<<<<<< @@ -51971,7 +52140,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1296 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1302 * return 0 * else: * new_x = new_x + 1 # <<<<<<<<<<<<<< @@ -51980,7 +52149,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj */ __pyx_v_new_x = (__pyx_v_new_x + 1); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1297 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1303 * else: * new_x = new_x + 1 * new_low_x = 1 # <<<<<<<<<<<<<< @@ -51994,7 +52163,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } __pyx_L19:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1298 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1304 * new_x = new_x + 1 * new_low_x = 1 * if f_low - f_back_low[0] < min_fx_size: # <<<<<<<<<<<<<< @@ -52004,7 +52173,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj __pyx_t_4 = ((__pyx_v_f_low - (__pyx_v_f_back_low[0])) < __pyx_v_min_fx_size); if (__pyx_t_4) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1299 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1305 * new_low_x = 1 * if f_low - f_back_low[0] < min_fx_size: * f_back_low[0] = f_low - min_fx_size # <<<<<<<<<<<<<< @@ -52013,7 +52182,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj */ (__pyx_v_f_back_low[0]) = (__pyx_v_f_low - __pyx_v_min_fx_size); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1300 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1306 * 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: # <<<<<<<<<<<<<< @@ -52023,7 +52192,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj __pyx_t_4 = (((__pyx_v_f_back_high[0]) - (__pyx_v_f_back_low[0])) > __pyx_v_max_f_len); if (__pyx_t_4) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1302 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1308 * if f_back_high[0] - f_back_low[0] > max_f_len: * # FAIL: extension required on low side violates max initial length * return 0 # <<<<<<<<<<<<<< @@ -52036,7 +52205,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } __pyx_L22:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1303 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1309 * # FAIL: extension required on low side violates max initial length * return 0 * if f_back_low[0] < 0: # <<<<<<<<<<<<<< @@ -52046,7 +52215,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj __pyx_t_4 = ((__pyx_v_f_back_low[0]) < 0); if (__pyx_t_4) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1305 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1311 * if f_back_low[0] < 0: * # FAIL: extension required on low side violates sentence boundary * return 0 # <<<<<<<<<<<<<< @@ -52065,23 +52234,22 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } __pyx_L18:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1307 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1313 * 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 = 1307; __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 = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyObject_RichCompare(__pyx_v_f_high, __pyx_t_2, Py_NE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); + __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 = 1313; __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 = 1307; __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 = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_4) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1308 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1314 * * if f_high != f_back_high[0]: * if new_high_x == 0: # <<<<<<<<<<<<<< @@ -52091,7 +52259,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj __pyx_t_4 = (__pyx_v_new_high_x == 0); if (__pyx_t_4) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1309 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1315 * if f_high != f_back_high[0]: * if new_high_x == 0: * if new_x >= max_new_x: # <<<<<<<<<<<<<< @@ -52101,7 +52269,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj __pyx_t_4 = (__pyx_v_new_x >= __pyx_v_max_new_x); if (__pyx_t_4) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1311 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1317 * if new_x >= max_new_x: * # FAIL: extension required on high side violates max # of gaps * return 0 # <<<<<<<<<<<<<< @@ -52114,7 +52282,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1313 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1319 * return 0 * else: * new_x = new_x + 1 # <<<<<<<<<<<<<< @@ -52123,7 +52291,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj */ __pyx_v_new_x = (__pyx_v_new_x + 1); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1314 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1320 * else: * new_x = new_x + 1 * new_high_x = 1 # <<<<<<<<<<<<<< @@ -52137,45 +52305,44 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } __pyx_L25:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1315 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1321 * 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 = 1315; __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 = 1321; __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 = 1315; __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 = 1321; __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 = 1315; __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 = 1321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyObject_RichCompare(__pyx_t_2, __pyx_t_6, Py_LT); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); + __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 = 1321; __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 = 1315; __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 = 1321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_4) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1316 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1322 * 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 = 1316; __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 = 1322; __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 = 1316; __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 = 1322; __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 = 1316; __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 = 1322; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1317 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1323 * 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: # <<<<<<<<<<<<<< @@ -52185,7 +52352,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj __pyx_t_4 = (((__pyx_v_f_back_high[0]) - (__pyx_v_f_back_low[0])) > __pyx_v_max_f_len); if (__pyx_t_4) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1319 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1325 * if f_back_high[0] - f_back_low[0] > max_f_len: * # FAIL: extension required on high side violates max initial length * return 0 # <<<<<<<<<<<<<< @@ -52198,7 +52365,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } __pyx_L28:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1320 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1326 * # FAIL: extension required on high side violates max initial length * return 0 * if f_back_high[0] > f_sent_len: # <<<<<<<<<<<<<< @@ -52208,7 +52375,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj __pyx_t_4 = ((__pyx_v_f_back_high[0]) > __pyx_v_f_sent_len); if (__pyx_t_4) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1322 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1328 * if f_back_high[0] > f_sent_len: * # FAIL: extension required on high side violates sentence boundary * return 0 # <<<<<<<<<<<<<< @@ -52227,7 +52394,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } __pyx_L24:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1324 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1330 * return 0 * * e_low_prev = e_low[0] # <<<<<<<<<<<<<< @@ -52236,7 +52403,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj */ __pyx_v_e_low_prev = (__pyx_v_e_low[0]); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1325 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1331 * * e_low_prev = e_low[0] * e_high_prev = e_high[0] # <<<<<<<<<<<<<< @@ -52245,29 +52412,29 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj */ __pyx_v_e_high_prev = (__pyx_v_e_high[0]); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1327 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1333 * 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_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 = 1327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_projection(__pyx_v_self, (__pyx_v_f_back_low[0]), __pyx_v_f_low_prev, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_low, __pyx_v_e_high); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1328 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1334 * * 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_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 = 1328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_projection(__pyx_v_self, __pyx_v_f_high_prev, (__pyx_v_f_back_high[0]), __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_low, __pyx_v_e_high); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1329 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1335 * 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: # <<<<<<<<<<<<<< @@ -52283,7 +52450,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1330 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1336 * 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 # <<<<<<<<<<<<<< @@ -52296,7 +52463,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } __pyx_L30:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1331 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1337 * if e_low[0] == e_low_prev and e_high[0] == e_high_prev: * return 1 * if allow_arbitrary_x == 0: # <<<<<<<<<<<<<< @@ -52306,7 +52473,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj __pyx_t_3 = (__pyx_v_allow_arbitrary_x == 0); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1333 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1339 * if allow_arbitrary_x == 0: * # FAIL: arbitrary expansion not permitted * return 0 # <<<<<<<<<<<<<< @@ -52319,7 +52486,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } __pyx_L31:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1334 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1340 * # FAIL: arbitrary expansion not permitted * return 0 * if e_high[0] - e_low[0] > max_e_len: # <<<<<<<<<<<<<< @@ -52329,7 +52496,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj __pyx_t_3 = (((__pyx_v_e_high[0]) - (__pyx_v_e_low[0])) > __pyx_v_max_e_len); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1336 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1342 * if e_high[0] - e_low[0] > max_e_len: * # FAIL: re-projection violates sentence max phrase length * return 0 # <<<<<<<<<<<<<< @@ -52342,7 +52509,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj } __pyx_L32:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1337 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1343 * # FAIL: re-projection violates sentence max phrase length * return 0 * f_low_prev = f_back_low[0] # <<<<<<<<<<<<<< @@ -52351,7 +52518,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj */ __pyx_v_f_low_prev = (__pyx_v_f_back_low[0]); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1338 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1344 * return 0 * f_low_prev = f_back_low[0] * f_high_prev = f_back_high[0] # <<<<<<<<<<<<<< @@ -52374,7 +52541,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1341 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1347 * * * cdef find_projection(self, int in_low, int in_high, int* in_links_low, int* in_links_high, # <<<<<<<<<<<<<< @@ -52392,7 +52559,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_find_projection(CYTHON_U int __pyx_t_4; __Pyx_RefNannySetupContext("find_projection", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1344 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1350 * int* out_low, int* out_high): * cdef int i * for i from in_low <= i < in_high: # <<<<<<<<<<<<<< @@ -52402,7 +52569,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_find_projection(CYTHON_U __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1345 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1351 * cdef int i * for i from in_low <= i < in_high: * if in_links_low[i] != -1: # <<<<<<<<<<<<<< @@ -52412,7 +52579,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_find_projection(CYTHON_U __pyx_t_2 = ((__pyx_v_in_links_low[__pyx_v_i]) != -1); if (__pyx_t_2) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1346 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1352 * 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]: # <<<<<<<<<<<<<< @@ -52428,7 +52595,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_find_projection(CYTHON_U } if (__pyx_t_4) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1347 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1353 * 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] # <<<<<<<<<<<<<< @@ -52440,7 +52607,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_find_projection(CYTHON_U } __pyx_L6:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1348 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1354 * 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]: # <<<<<<<<<<<<<< @@ -52456,7 +52623,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_find_projection(CYTHON_U } if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1349 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1355 * 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] # <<<<<<<<<<<<<< @@ -52478,7 +52645,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_find_projection(CYTHON_U return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1352 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1358 * * * cdef int* int_arr_extend(self, int* arr, int* arr_len, int* data, int data_len): # <<<<<<<<<<<<<< @@ -52492,7 +52659,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTHON_UNUSED __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("int_arr_extend", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1354 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1360 * 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 # <<<<<<<<<<<<<< @@ -52501,7 +52668,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTHON_UNUSED */ __pyx_v_new_len = ((__pyx_v_arr_len[0]) + __pyx_v_data_len); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1355 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1361 * cdef int new_len * new_len = arr_len[0] + data_len * arr = realloc(arr, new_len*sizeof(int)) # <<<<<<<<<<<<<< @@ -52510,7 +52677,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTHON_UNUSED */ __pyx_v_arr = ((int *)realloc(__pyx_v_arr, (__pyx_v_new_len * (sizeof(int))))); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1356 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1362 * new_len = arr_len[0] + data_len * arr = realloc(arr, new_len*sizeof(int)) * memcpy(arr+arr_len[0], data, data_len*sizeof(int)) # <<<<<<<<<<<<<< @@ -52519,7 +52686,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTHON_UNUSED */ memcpy((__pyx_v_arr + (__pyx_v_arr_len[0])), __pyx_v_data, (__pyx_v_data_len * (sizeof(int)))); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1357 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1363 * arr = realloc(arr, new_len*sizeof(int)) * memcpy(arr+arr_len[0], data, data_len*sizeof(int)) * arr_len[0] = new_len # <<<<<<<<<<<<<< @@ -52528,7 +52695,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTHON_UNUSED */ (__pyx_v_arr_len[0]) = __pyx_v_new_len; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1358 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1364 * memcpy(arr+arr_len[0], data, data_len*sizeof(int)) * arr_len[0] = new_len * return arr # <<<<<<<<<<<<<< @@ -52544,7 +52711,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTHON_UNUSED return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1361 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1367 * * * 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, # <<<<<<<<<<<<<< @@ -52590,19 +52757,19 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("extract_phrases", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1369 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1375 * 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 = 1369; __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 = 1375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_result = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1370 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1376 * * result = [] * len1 = 0 # <<<<<<<<<<<<<< @@ -52611,7 +52778,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_len1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1371 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1377 * result = [] * len1 = 0 * e_gaps1 = malloc(0) # <<<<<<<<<<<<<< @@ -52620,19 +52787,19 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_e_gaps1 = ((int *)malloc(0)); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1372 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1378 * 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_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_ephr_arr = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1374 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1380 * ephr_arr = IntList() * * e_gap_order = malloc(num_gaps*sizeof(int)) # <<<<<<<<<<<<<< @@ -52641,7 +52808,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_e_gap_order = ((int *)malloc((__pyx_v_num_gaps * (sizeof(int))))); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1375 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1381 * * e_gap_order = malloc(num_gaps*sizeof(int)) * if num_gaps > 0: # <<<<<<<<<<<<<< @@ -52651,7 +52818,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_t_2 = (__pyx_v_num_gaps > 0); if (__pyx_t_2) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1376 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1382 * e_gap_order = malloc(num_gaps*sizeof(int)) * if num_gaps > 0: * e_gap_order[0] = 0 # <<<<<<<<<<<<<< @@ -52660,7 +52827,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ (__pyx_v_e_gap_order[0]) = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1377 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1383 * if num_gaps > 0: * e_gap_order[0] = 0 * for i from 1 <= i < num_gaps: # <<<<<<<<<<<<<< @@ -52670,7 +52837,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_t_3 = __pyx_v_num_gaps; for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1378 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1384 * e_gap_order[0] = 0 * for i from 1 <= i < num_gaps: * for j from 0 <= j < i: # <<<<<<<<<<<<<< @@ -52680,7 +52847,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_t_4 = __pyx_v_i; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_4; __pyx_v_j++) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1379 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1385 * for i from 1 <= i < num_gaps: * for j from 0 <= j < i: * if e_gap_low[i] < e_gap_low[j]: # <<<<<<<<<<<<<< @@ -52690,7 +52857,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_t_2 = ((__pyx_v_e_gap_low[__pyx_v_i]) < (__pyx_v_e_gap_low[__pyx_v_j])); if (__pyx_t_2) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1380 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1386 * for j from 0 <= j < i: * if e_gap_low[i] < e_gap_low[j]: * for k from j <= k < i: # <<<<<<<<<<<<<< @@ -52700,7 +52867,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_t_5 = __pyx_v_i; for (__pyx_v_k = __pyx_v_j; __pyx_v_k < __pyx_t_5; __pyx_v_k++) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1381 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1387 * if e_gap_low[i] < e_gap_low[j]: * for k from j <= k < i: * e_gap_order[k+1] = e_gap_order[k] # <<<<<<<<<<<<<< @@ -52710,7 +52877,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ (__pyx_v_e_gap_order[(__pyx_v_k + 1)]) = (__pyx_v_e_gap_order[__pyx_v_k]); } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1382 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1388 * for k from j <= k < i: * e_gap_order[k+1] = e_gap_order[k] * e_gap_order[j] = i # <<<<<<<<<<<<<< @@ -52719,7 +52886,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ (__pyx_v_e_gap_order[__pyx_v_j]) = __pyx_v_i; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1383 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1389 * e_gap_order[k+1] = e_gap_order[k] * e_gap_order[j] = i * break # <<<<<<<<<<<<<< @@ -52733,7 +52900,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1385 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1391 * break * else: * e_gap_order[i] = i # <<<<<<<<<<<<<< @@ -52748,7 +52915,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1387 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1393 * e_gap_order[i] = i * * e_x_low = e_low # <<<<<<<<<<<<<< @@ -52757,7 +52924,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_e_x_low = __pyx_v_e_low; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1388 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1394 * * e_x_low = e_low * e_x_high = e_high # <<<<<<<<<<<<<< @@ -52766,7 +52933,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_e_x_high = __pyx_v_e_high; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1389 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1395 * e_x_low = e_low * e_x_high = e_high * if not self.tight_phrases: # <<<<<<<<<<<<<< @@ -52776,7 +52943,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_t_2 = (!__pyx_v_self->tight_phrases); if (__pyx_t_2) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1390 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1396 * 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: # <<<<<<<<<<<<<< @@ -52799,7 +52966,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ } if (!__pyx_t_6) break; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1391 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1397 * 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 # <<<<<<<<<<<<<< @@ -52809,7 +52976,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_v_e_x_low = (__pyx_v_e_x_low - 1); } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1392 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1398 * 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: # <<<<<<<<<<<<<< @@ -52832,7 +52999,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ } if (!__pyx_t_2) break; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1393 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1399 * 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 # <<<<<<<<<<<<<< @@ -52845,7 +53012,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ } __pyx_L11:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1395 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1401 * e_x_high = e_x_high + 1 * * for i from e_x_low <= i <= e_low: # <<<<<<<<<<<<<< @@ -52855,7 +53022,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1396 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1402 * * for i from e_x_low <= i <= e_low: * e_gaps1 = self.int_arr_extend(e_gaps1, &len1, &i, 1) # <<<<<<<<<<<<<< @@ -52865,7 +53032,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_v_e_gaps1 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->int_arr_extend(__pyx_v_self, __pyx_v_e_gaps1, (&__pyx_v_len1), (&__pyx_v_i), 1); } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1398 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1404 * e_gaps1 = self.int_arr_extend(e_gaps1, &len1, &i, 1) * * for i from 0 <= i < num_gaps: # <<<<<<<<<<<<<< @@ -52875,7 +53042,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_t_3 = __pyx_v_num_gaps; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1399 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1405 * * for i from 0 <= i < num_gaps: * e_gaps2 = malloc(0) # <<<<<<<<<<<<<< @@ -52884,7 +53051,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_e_gaps2 = ((int *)malloc(0)); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1400 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1406 * for i from 0 <= i < num_gaps: * e_gaps2 = malloc(0) * len2 = 0 # <<<<<<<<<<<<<< @@ -52893,7 +53060,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_len2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1402 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1408 * len2 = 0 * * j = e_gap_order[i] # <<<<<<<<<<<<<< @@ -52902,7 +53069,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_j = (__pyx_v_e_gap_order[__pyx_v_i]); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1403 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1409 * * j = e_gap_order[i] * e_x_gap_low = e_gap_low[j] # <<<<<<<<<<<<<< @@ -52911,7 +53078,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_e_x_gap_low = (__pyx_v_e_gap_low[__pyx_v_j]); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1404 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1410 * j = e_gap_order[i] * e_x_gap_low = e_gap_low[j] * e_x_gap_high = e_gap_high[j] # <<<<<<<<<<<<<< @@ -52920,7 +53087,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_e_x_gap_high = (__pyx_v_e_gap_high[__pyx_v_j]); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1405 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1411 * e_x_gap_low = e_gap_low[j] * e_x_gap_high = e_gap_high[j] * if not self.tight_phrases: # <<<<<<<<<<<<<< @@ -52930,7 +53097,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_t_2 = (!__pyx_v_self->tight_phrases); if (__pyx_t_2) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1406 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1412 * 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: # <<<<<<<<<<<<<< @@ -52947,7 +53114,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ } if (!__pyx_t_7) break; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1407 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1413 * 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 # <<<<<<<<<<<<<< @@ -52957,7 +53124,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_v_e_x_gap_low = (__pyx_v_e_x_gap_low - 1); } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1408 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1414 * 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: # <<<<<<<<<<<<<< @@ -52974,7 +53141,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ } if (!__pyx_t_6) break; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1409 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1415 * 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 # <<<<<<<<<<<<<< @@ -52987,7 +53154,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ } __pyx_L20:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1411 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1417 * e_x_gap_high = e_x_gap_high + 1 * * k = 0 # <<<<<<<<<<<<<< @@ -52996,7 +53163,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_k = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1412 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1418 * * k = 0 * step = 1+(i*2) # <<<<<<<<<<<<<< @@ -53005,7 +53172,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_step = (1 + (__pyx_v_i * 2)); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1413 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1419 * k = 0 * step = 1+(i*2) * while k < len1: # <<<<<<<<<<<<<< @@ -53016,7 +53183,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_t_6 = (__pyx_v_k < __pyx_v_len1); if (!__pyx_t_6) break; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1414 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1420 * step = 1+(i*2) * while k < len1: * for m from e_x_gap_low <= m <= e_gap_low[j]: # <<<<<<<<<<<<<< @@ -53026,7 +53193,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1415 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1421 * while k < len1: * for m from e_x_gap_low <= m <= e_gap_low[j]: * if m >= e_gaps1[k+step-1]: # <<<<<<<<<<<<<< @@ -53036,7 +53203,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_t_6 = (__pyx_v_m >= (__pyx_v_e_gaps1[((__pyx_v_k + __pyx_v_step) - 1)])); if (__pyx_t_6) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1416 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1422 * 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: # <<<<<<<<<<<<<< @@ -53046,7 +53213,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1417 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1423 * 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 # <<<<<<<<<<<<<< @@ -53056,7 +53223,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_t_6 = ((__pyx_v_n - __pyx_v_m) >= 1); if (__pyx_t_6) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1418 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1424 * 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) # <<<<<<<<<<<<<< @@ -53065,7 +53232,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_e_gaps2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->int_arr_extend(__pyx_v_self, __pyx_v_e_gaps2, (&__pyx_v_len2), (__pyx_v_e_gaps1 + __pyx_v_k), __pyx_v_step); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1419 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1425 * 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) # <<<<<<<<<<<<<< @@ -53074,7 +53241,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_e_gaps2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->int_arr_extend(__pyx_v_self, __pyx_v_e_gaps2, (&__pyx_v_len2), (&__pyx_v_m), 1); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1420 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1426 * 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) # <<<<<<<<<<<<<< @@ -53091,7 +53258,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_L29:; } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1421 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1427 * 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 # <<<<<<<<<<<<<< @@ -53101,7 +53268,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_v_k = (__pyx_v_k + __pyx_v_step); } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1422 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1428 * e_gaps2 = self.int_arr_extend(e_gaps2, &len2, &n, 1) * k = k + step * free(e_gaps1) # <<<<<<<<<<<<<< @@ -53110,7 +53277,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ free(__pyx_v_e_gaps1); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1423 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1429 * k = k + step * free(e_gaps1) * e_gaps1 = e_gaps2 # <<<<<<<<<<<<<< @@ -53119,7 +53286,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_e_gaps1 = __pyx_v_e_gaps2; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1424 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1430 * free(e_gaps1) * e_gaps1 = e_gaps2 * len1 = len2 # <<<<<<<<<<<<<< @@ -53129,7 +53296,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_v_len1 = __pyx_v_len2; } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1426 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1432 * len1 = len2 * * step = 1+(num_gaps*2) # <<<<<<<<<<<<<< @@ -53138,7 +53305,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_step = (1 + (__pyx_v_num_gaps * 2)); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1427 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1433 * * step = 1+(num_gaps*2) * e_gaps2 = malloc(0) # <<<<<<<<<<<<<< @@ -53147,7 +53314,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_e_gaps2 = ((int *)malloc(0)); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1428 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1434 * step = 1+(num_gaps*2) * e_gaps2 = malloc(0) * len2 = 0 # <<<<<<<<<<<<<< @@ -53156,7 +53323,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_len2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1429 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1435 * e_gaps2 = malloc(0) * len2 = 0 * for i from e_high <= i <= e_x_high: # <<<<<<<<<<<<<< @@ -53166,7 +53333,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1430 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1436 * len2 = 0 * for i from e_high <= i <= e_x_high: * j = 0 # <<<<<<<<<<<<<< @@ -53175,7 +53342,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_j = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1431 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1437 * for i from e_high <= i <= e_x_high: * j = 0 * while j < len1: # <<<<<<<<<<<<<< @@ -53186,7 +53353,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_t_6 = (__pyx_v_j < __pyx_v_len1); if (!__pyx_t_6) break; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1432 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1438 * j = 0 * while j < len1: * if i - e_gaps1[j] <= self.train_max_initial_size and i >= e_gaps1[j+step-1]: # <<<<<<<<<<<<<< @@ -53202,7 +53369,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ } if (__pyx_t_2) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1433 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1439 * 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) # <<<<<<<<<<<<<< @@ -53211,7 +53378,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_e_gaps2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->int_arr_extend(__pyx_v_self, __pyx_v_e_gaps2, (&__pyx_v_len2), (__pyx_v_e_gaps1 + __pyx_v_j), __pyx_v_step); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1434 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1440 * 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) # <<<<<<<<<<<<<< @@ -53223,7 +53390,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ } __pyx_L37:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1435 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1441 * 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 # <<<<<<<<<<<<<< @@ -53234,7 +53401,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ } } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1436 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1442 * e_gaps2 = self.int_arr_extend(e_gaps2, &len2, &i, 1) * j = j + step * free(e_gaps1) # <<<<<<<<<<<<<< @@ -53243,7 +53410,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ free(__pyx_v_e_gaps1); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1437 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1443 * j = j + step * free(e_gaps1) * e_gaps1 = e_gaps2 # <<<<<<<<<<<<<< @@ -53252,7 +53419,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_e_gaps1 = __pyx_v_e_gaps2; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1438 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1444 * free(e_gaps1) * e_gaps1 = e_gaps2 * len1 = len2 # <<<<<<<<<<<<<< @@ -53261,7 +53428,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_len1 = __pyx_v_len2; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1440 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1446 * len1 = len2 * * step = (num_gaps+1)*2 # <<<<<<<<<<<<<< @@ -53270,7 +53437,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_step = ((__pyx_v_num_gaps + 1) * 2); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1441 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1447 * * step = (num_gaps+1)*2 * i = 0 # <<<<<<<<<<<<<< @@ -53279,7 +53446,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_i = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1443 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1449 * i = 0 * * while i < len1: # <<<<<<<<<<<<<< @@ -53290,7 +53457,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_t_2 = (__pyx_v_i < __pyx_v_len1); if (!__pyx_t_2) break; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1444 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1450 * * while i < len1: * ephr_arr._clear() # <<<<<<<<<<<<<< @@ -53299,7 +53466,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_ephr_arr->__pyx_vtab)->_clear(__pyx_v_ephr_arr); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1445 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1451 * while i < len1: * ephr_arr._clear() * num_chunks = 0 # <<<<<<<<<<<<<< @@ -53308,20 +53475,20 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_num_chunks = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1446 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1452 * ephr_arr._clear() * num_chunks = 0 * indexes = [] # <<<<<<<<<<<<<< * for j from 0 <= j < num_gaps+1: * if e_gaps1[i+2*j] < e_gaps1[i+(2*j)+1]: */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1446; __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 = 1452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF(((PyObject *)__pyx_v_indexes)); __pyx_v_indexes = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1447 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1453 * num_chunks = 0 * indexes = [] * for j from 0 <= j < num_gaps+1: # <<<<<<<<<<<<<< @@ -53331,7 +53498,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_t_9 = (__pyx_v_num_gaps + 1); for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_9; __pyx_v_j++) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1448 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1454 * indexes = [] * for j from 0 <= j < num_gaps+1: * if e_gaps1[i+2*j] < e_gaps1[i+(2*j)+1]: # <<<<<<<<<<<<<< @@ -53341,7 +53508,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_t_2 = ((__pyx_v_e_gaps1[(__pyx_v_i + (2 * __pyx_v_j))]) < (__pyx_v_e_gaps1[((__pyx_v_i + (2 * __pyx_v_j)) + 1)])); if (__pyx_t_2) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1449 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1455 * 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 # <<<<<<<<<<<<<< @@ -53353,7 +53520,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ } __pyx_L42:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1450 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1456 * 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]: # <<<<<<<<<<<<<< @@ -53363,19 +53530,19 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1451 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1457 * 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 = 1451; __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 = 1457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = PyList_Append(__pyx_v_indexes, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyList_Append(__pyx_v_indexes, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1452 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1458 * 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]]) # <<<<<<<<<<<<<< @@ -53383,14 +53550,14 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ * indexes.append(sym_setindex(self.category, e_gap_order[j]+1)) */ __pyx_t_4 = (__pyx_v_self->eda->data->arr[(__pyx_v_e_sent_start + __pyx_v_k)]); - __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->eid2symid), __pyx_t_4, sizeof(int), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->eid2symid), __pyx_t_4, sizeof(int), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_ephr_arr->__pyx_vtab)->_append(__pyx_v_ephr_arr, __pyx_t_4); } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1453 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1459 * indexes.append(k) * ephr_arr._append(self.eid2symid[self.eda.data.arr[e_sent_start+k]]) * if j < num_gaps: # <<<<<<<<<<<<<< @@ -53400,19 +53567,19 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_t_2 = (__pyx_v_j < __pyx_v_num_gaps); if (__pyx_t_2) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1454 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1460 * ephr_arr._append(self.eid2symid[self.eda.data.arr[e_sent_start+k]]) * if j < num_gaps: * indexes.append(sym_setindex(self.category, e_gap_order[j]+1)) # <<<<<<<<<<<<<< * ephr_arr._append(sym_setindex(self.category, e_gap_order[j]+1)) * i = i + step */ - __pyx_t_1 = PyInt_FromLong(__pyx_f_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 = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, ((__pyx_v_e_gap_order[__pyx_v_j]) + 1))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = PyList_Append(__pyx_v_indexes, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyList_Append(__pyx_v_indexes, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1455 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1461 * 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)) # <<<<<<<<<<<<<< @@ -53425,7 +53592,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_L45:; } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1456 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1462 * 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 # <<<<<<<<<<<<<< @@ -53434,7 +53601,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ __pyx_v_i = (__pyx_v_i + __pyx_v_step); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1457 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1463 * 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: # <<<<<<<<<<<<<< @@ -53450,22 +53617,22 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ } if (__pyx_t_7) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1458 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1464 * 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 = 1458; __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 = 1464; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_ephr_arr)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_ephr_arr)); __Pyx_GIVEREF(((PyObject *)__pyx_v_ephr_arr)); - __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1464; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1458; __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 = 1464; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); @@ -53473,7 +53640,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_indexes)); __Pyx_GIVEREF(((PyObject *)__pyx_v_indexes)); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_PyObject_Append(__pyx_v_result, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_PyObject_Append(__pyx_v_result, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1464; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; @@ -53482,7 +53649,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ __pyx_L46:; } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1460 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1466 * result.append((Phrase(ephr_arr),indexes)) * * free(e_gaps1) # <<<<<<<<<<<<<< @@ -53491,7 +53658,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ free(__pyx_v_e_gaps1); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1461 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1467 * * free(e_gaps1) * free(e_gap_order) # <<<<<<<<<<<<<< @@ -53500,7 +53667,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ */ free(__pyx_v_e_gap_order); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1462 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1468 * free(e_gaps1) * free(e_gap_order) * return result # <<<<<<<<<<<<<< @@ -53528,7 +53695,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _ return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1464 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1470 * return result * * cdef IntList create_alignments(self, int* sent_links, int num_links, findexes, eindexes): # <<<<<<<<<<<<<< @@ -53556,56 +53723,55 @@ static struct __pyx_obj_3_sa_IntList *__pyx_f_3_sa_23HieroCachingRuleFactory_cre int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_alignments", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1466 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1472 * cdef IntList create_alignments(self, int* sent_links, int num_links, findexes, eindexes): * cdef unsigned i * cdef IntList ret = IntList() # <<<<<<<<<<<<<< * for i in range(len(findexes)): * s = findexes[i] */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_ret = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1467 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1473 * cdef unsigned i * cdef IntList ret = IntList() * for i in range(len(findexes)): # <<<<<<<<<<<<<< * s = findexes[i] * if (s<0): */ - __pyx_t_2 = PyObject_Length(__pyx_v_findexes); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(__pyx_v_findexes); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1468 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1474 * cdef IntList ret = IntList() * for i in range(len(findexes)): * s = findexes[i] # <<<<<<<<<<<<<< * if (s<0): * continue */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_findexes, __pyx_v_i, sizeof(unsigned int)+1, PyLong_FromUnsignedLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_findexes, __pyx_v_i, sizeof(unsigned int)+1, PyLong_FromUnsignedLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF(__pyx_v_s); __pyx_v_s = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1469 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1475 * for i in range(len(findexes)): * s = findexes[i] * if (s<0): # <<<<<<<<<<<<<< * continue * idx = 0 */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_s, __pyx_int_0, Py_LT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_s, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1475; __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 = 1475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_4) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1470 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1476 * s = findexes[i] * if (s<0): * continue # <<<<<<<<<<<<<< @@ -53617,7 +53783,7 @@ static struct __pyx_obj_3_sa_IntList *__pyx_f_3_sa_23HieroCachingRuleFactory_cre } __pyx_L5:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1471 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1477 * if (s<0): * continue * idx = 0 # <<<<<<<<<<<<<< @@ -53628,7 +53794,7 @@ static struct __pyx_obj_3_sa_IntList *__pyx_f_3_sa_23HieroCachingRuleFactory_cre __Pyx_XDECREF(__pyx_v_idx); __pyx_v_idx = __pyx_int_0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1472 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1478 * continue * idx = 0 * while (idx < num_links*2): # <<<<<<<<<<<<<< @@ -53636,53 +53802,51 @@ static struct __pyx_obj_3_sa_IntList *__pyx_f_3_sa_23HieroCachingRuleFactory_cre * 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 = 1472; __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 = 1478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_idx, __pyx_t_1, Py_LT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); + __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 = 1478; __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 = 1472; __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 = 1478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (!__pyx_t_4) break; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1473 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1479 * idx = 0 * while (idx < num_links*2): * if (sent_links[idx] == s): # <<<<<<<<<<<<<< * j = eindexes.index(sent_links[idx+1]) * ret.append(i*65536+j) */ - __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_5 = PyInt_FromLong((__pyx_v_sent_links[__pyx_t_6])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1473; __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 = 1479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong((__pyx_v_sent_links[__pyx_t_6])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_v_s, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_v_s, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1473; __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 = 1479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_4) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1474 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1480 * while (idx < num_links*2): * if (sent_links[idx] == s): * j = eindexes.index(sent_links[idx+1]) # <<<<<<<<<<<<<< * ret.append(i*65536+j) * idx += 2 */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_eindexes, __pyx_n_s__index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_eindexes, __pyx_n_s__index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyNumber_Add(__pyx_v_idx, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Add(__pyx_v_idx, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyInt_FromLong((__pyx_v_sent_links[__pyx_t_6])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong((__pyx_v_sent_links[__pyx_t_6])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1474; __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 = 1480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; @@ -53690,19 +53854,19 @@ static struct __pyx_obj_3_sa_IntList *__pyx_f_3_sa_23HieroCachingRuleFactory_cre __pyx_v_j = __pyx_t_5; __pyx_t_5 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1475 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1481 * if (sent_links[idx] == s): * j = eindexes.index(sent_links[idx+1]) * ret.append(i*65536+j) # <<<<<<<<<<<<<< * idx += 2 * return ret */ - __pyx_t_5 = PyInt_FromLong((__pyx_v_i * 65536)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong((__pyx_v_i * 65536)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = PyNumber_Add(__pyx_t_5, __pyx_v_j); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyNumber_Add(__pyx_t_5, __pyx_v_j); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_ret), __pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_ret), __pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -53710,14 +53874,14 @@ static struct __pyx_obj_3_sa_IntList *__pyx_f_3_sa_23HieroCachingRuleFactory_cre } __pyx_L8:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1476 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1482 * j = eindexes.index(sent_links[idx+1]) * ret.append(i*65536+j) * idx += 2 # <<<<<<<<<<<<<< * return ret * */ - __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_idx, __pyx_int_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_idx, __pyx_int_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_v_idx); __pyx_v_idx = __pyx_t_5; @@ -53726,7 +53890,7 @@ static struct __pyx_obj_3_sa_IntList *__pyx_f_3_sa_23HieroCachingRuleFactory_cre __pyx_L3_continue:; } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1477 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1483 * ret.append(i*65536+j) * idx += 2 * return ret # <<<<<<<<<<<<<< @@ -53756,7 +53920,7 @@ static struct __pyx_obj_3_sa_IntList *__pyx_f_3_sa_23HieroCachingRuleFactory_cre return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1479 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1485 * return ret * * cdef extract(self, Phrase phrase, Matching* matching, int* chunklen, int num_chunks): # <<<<<<<<<<<<<< @@ -53850,19 +54014,19 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj int __pyx_clineno = 0; __Pyx_RefNannySetupContext("extract", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1492 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1498 * cdef reason_for_failure * * fphr_arr = IntList() # <<<<<<<<<<<<<< * phrase_len = phrase.n * extracts = [] */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_fphr_arr = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1493 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1499 * * fphr_arr = IntList() * phrase_len = phrase.n # <<<<<<<<<<<<<< @@ -53871,19 +54035,19 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_phrase_len = __pyx_v_phrase->n; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1494 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1500 * 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 = 1494; __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 = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_extracts = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1495 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1501 * phrase_len = phrase.n * extracts = [] * sent_links = self.alignment._get_sent_links(matching.sent_id, &num_links) # <<<<<<<<<<<<<< @@ -53892,7 +54056,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_sent_links = ((struct __pyx_vtabstruct_3_sa_Alignment *)__pyx_v_self->alignment->__pyx_vtab)->_get_sent_links(__pyx_v_self->alignment, __pyx_v_matching->sent_id, (&__pyx_v_num_links)); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1497 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1503 * sent_links = self.alignment._get_sent_links(matching.sent_id, &num_links) * * e_sent_start = self.eda.sent_index.arr[matching.sent_id] # <<<<<<<<<<<<<< @@ -53901,7 +54065,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_e_sent_start = (__pyx_v_self->eda->sent_index->arr[__pyx_v_matching->sent_id]); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1498 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1504 * * e_sent_start = self.eda.sent_index.arr[matching.sent_id] * e_sent_end = self.eda.sent_index.arr[matching.sent_id+1] # <<<<<<<<<<<<<< @@ -53910,7 +54074,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_e_sent_end = (__pyx_v_self->eda->sent_index->arr[(__pyx_v_matching->sent_id + 1)]); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1499 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1505 * 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 # <<<<<<<<<<<<<< @@ -53919,7 +54083,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_e_sent_len = ((__pyx_v_e_sent_end - __pyx_v_e_sent_start) - 1); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1500 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1506 * 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] # <<<<<<<<<<<<<< @@ -53928,7 +54092,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_f_sent_start = (__pyx_v_self->fda->sent_index->arr[__pyx_v_matching->sent_id]); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1501 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1507 * 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] # <<<<<<<<<<<<<< @@ -53937,7 +54101,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_f_sent_end = (__pyx_v_self->fda->sent_index->arr[(__pyx_v_matching->sent_id + 1)]); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1502 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1508 * 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 # <<<<<<<<<<<<<< @@ -53946,21 +54110,21 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_f_sent_len = ((__pyx_v_f_sent_end - __pyx_v_f_sent_start) - 1); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1504 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1510 * f_sent_len = f_sent_end - f_sent_start - 1 * * self.findexes1.reset() # <<<<<<<<<<<<<< * sofar = 0 * for i in range(num_chunks): */ - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes1), __pyx_n_s__reset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes1), __pyx_n_s__reset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1510; __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 = 1504; __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 = 1510; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1505 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1511 * * self.findexes1.reset() * sofar = 0 # <<<<<<<<<<<<<< @@ -53970,7 +54134,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __Pyx_INCREF(__pyx_int_0); __pyx_v_sofar = __pyx_int_0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1506 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1512 * self.findexes1.reset() * sofar = 0 * for i in range(num_chunks): # <<<<<<<<<<<<<< @@ -53981,7 +54145,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1507 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1513 * sofar = 0 * for i in range(num_chunks): * for j in range(chunklen[i]): # <<<<<<<<<<<<<< @@ -53992,35 +54156,35 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_j = __pyx_t_6; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1508 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1514 * 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+1arr[(__pyx_v_matching->start + __pyx_v_i)]) + __pyx_v_j) - __pyx_v_f_sent_start)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong((((__pyx_v_matching->arr[(__pyx_v_matching->start + __pyx_v_i)]) + __pyx_v_j) - __pyx_v_f_sent_start)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes1), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes1), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1514; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1509 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1515 * for j in range(chunklen[i]): * self.findexes1.append(matching.arr[matching.start+i]+j-f_sent_start); * sofar += 1 # <<<<<<<<<<<<<< * if (i+1findexes1), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes1), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1517; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1512 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1518 * if (i+1 malloc(e_sent_len*sizeof(int)) # <<<<<<<<<<<<<< @@ -54070,7 +54234,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_e_links_low = ((int *)malloc((__pyx_v_e_sent_len * (sizeof(int))))); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1516 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1522 * * e_links_low = malloc(e_sent_len*sizeof(int)) * e_links_high = malloc(e_sent_len*sizeof(int)) # <<<<<<<<<<<<<< @@ -54079,7 +54243,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_e_links_high = ((int *)malloc((__pyx_v_e_sent_len * (sizeof(int))))); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1517 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1523 * 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)) # <<<<<<<<<<<<<< @@ -54088,7 +54252,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_f_links_low = ((int *)malloc((__pyx_v_f_sent_len * (sizeof(int))))); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1518 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1524 * 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)) # <<<<<<<<<<<<<< @@ -54097,7 +54261,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_f_links_high = ((int *)malloc((__pyx_v_f_sent_len * (sizeof(int))))); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1519 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1525 * 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)) # <<<<<<<<<<<<<< @@ -54106,7 +54270,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_f_gap_low = ((int *)malloc(((__pyx_v_num_chunks + 1) * (sizeof(int))))); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1520 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1526 * 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)) # <<<<<<<<<<<<<< @@ -54115,7 +54279,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_f_gap_high = ((int *)malloc(((__pyx_v_num_chunks + 1) * (sizeof(int))))); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1521 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1527 * 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)) # <<<<<<<<<<<<<< @@ -54124,7 +54288,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_e_gap_low = ((int *)malloc(((__pyx_v_num_chunks + 1) * (sizeof(int))))); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1522 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1528 * 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)) # <<<<<<<<<<<<<< @@ -54133,7 +54297,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_e_gap_high = ((int *)malloc(((__pyx_v_num_chunks + 1) * (sizeof(int))))); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1523 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1529 * 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)) # <<<<<<<<<<<<<< @@ -54142,7 +54306,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ memset(__pyx_v_f_gap_low, 0, ((__pyx_v_num_chunks + 1) * (sizeof(int)))); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1524 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1530 * 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)) # <<<<<<<<<<<<<< @@ -54151,7 +54315,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ memset(__pyx_v_f_gap_high, 0, ((__pyx_v_num_chunks + 1) * (sizeof(int)))); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1525 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1531 * 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)) # <<<<<<<<<<<<<< @@ -54160,7 +54324,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ memset(__pyx_v_e_gap_low, 0, ((__pyx_v_num_chunks + 1) * (sizeof(int)))); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1526 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1532 * 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)) # <<<<<<<<<<<<<< @@ -54169,7 +54333,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ memset(__pyx_v_e_gap_high, 0, ((__pyx_v_num_chunks + 1) * (sizeof(int)))); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1528 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1534 * memset(e_gap_high, 0, (num_chunks+1)*sizeof(int)) * * reason_for_failure = "" # <<<<<<<<<<<<<< @@ -54179,7 +54343,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __Pyx_INCREF(((PyObject *)__pyx_kp_s_45)); __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_45); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1530 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1536 * reason_for_failure = "" * * for i from 0 <= i < e_sent_len: # <<<<<<<<<<<<<< @@ -54189,7 +54353,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_3 = __pyx_v_e_sent_len; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1531 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1537 * * for i from 0 <= i < e_sent_len: * e_links_low[i] = -1 # <<<<<<<<<<<<<< @@ -54198,7 +54362,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ (__pyx_v_e_links_low[__pyx_v_i]) = -1; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1532 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1538 * for i from 0 <= i < e_sent_len: * e_links_low[i] = -1 * e_links_high[i] = -1 # <<<<<<<<<<<<<< @@ -54208,7 +54372,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj (__pyx_v_e_links_high[__pyx_v_i]) = -1; } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1533 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1539 * e_links_low[i] = -1 * e_links_high[i] = -1 * for i from 0 <= i < f_sent_len: # <<<<<<<<<<<<<< @@ -54218,7 +54382,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_3 = __pyx_v_f_sent_len; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1534 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1540 * e_links_high[i] = -1 * for i from 0 <= i < f_sent_len: * f_links_low[i] = -1 # <<<<<<<<<<<<<< @@ -54227,7 +54391,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ (__pyx_v_f_links_low[__pyx_v_i]) = -1; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1535 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1541 * for i from 0 <= i < f_sent_len: * f_links_low[i] = -1 * f_links_high[i] = -1 # <<<<<<<<<<<<<< @@ -54237,7 +54401,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj (__pyx_v_f_links_high[__pyx_v_i]) = -1; } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1541 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1547 * # links that we care about (but then how to look up * # when we want to check something on the e side?) * i = 0 # <<<<<<<<<<<<<< @@ -54246,7 +54410,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_i = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1542 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1548 * # when we want to check something on the e side?) * i = 0 * while i < num_links*2: # <<<<<<<<<<<<<< @@ -54257,7 +54421,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_7 = (__pyx_v_i < (__pyx_v_num_links * 2)); if (!__pyx_t_7) break; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1543 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1549 * i = 0 * while i < num_links*2: * f_i = sent_links[i] # <<<<<<<<<<<<<< @@ -54266,7 +54430,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_f_i = (__pyx_v_sent_links[__pyx_v_i]); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1544 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1550 * while i < num_links*2: * f_i = sent_links[i] * e_i = sent_links[i+1] # <<<<<<<<<<<<<< @@ -54275,7 +54439,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_e_i = (__pyx_v_sent_links[(__pyx_v_i + 1)]); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1545 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1551 * 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: # <<<<<<<<<<<<<< @@ -54291,7 +54455,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1546 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1552 * 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 # <<<<<<<<<<<<<< @@ -54303,7 +54467,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L14:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1547 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1553 * 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: # <<<<<<<<<<<<<< @@ -54319,7 +54483,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if (__pyx_t_8) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1548 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1554 * 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 # <<<<<<<<<<<<<< @@ -54331,7 +54495,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L15:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1549 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1555 * 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: # <<<<<<<<<<<<<< @@ -54347,7 +54511,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if (__pyx_t_7) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1550 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1556 * 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 # <<<<<<<<<<<<<< @@ -54359,7 +54523,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L16:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1551 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1557 * 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: # <<<<<<<<<<<<<< @@ -54375,7 +54539,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1552 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1558 * 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 # <<<<<<<<<<<<<< @@ -54387,7 +54551,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L17:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1553 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1559 * 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 # <<<<<<<<<<<<<< @@ -54397,19 +54561,19 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_v_i = (__pyx_v_i + 2); } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1555 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1561 * i = i + 2 * * als = [] # <<<<<<<<<<<<<< * for x in range(matching.start,matching.end): * al = (matching.arr[x]-f_sent_start,f_links_low[matching.arr[x]-f_sent_start]) */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_v_als = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1556 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1562 * * als = [] * for x in range(matching.start,matching.end): # <<<<<<<<<<<<<< @@ -54420,18 +54584,18 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj for (__pyx_t_4 = __pyx_v_matching->start; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_x = __pyx_t_4; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1557 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1563 * als = [] * for x in range(matching.start,matching.end): * al = (matching.arr[x]-f_sent_start,f_links_low[matching.arr[x]-f_sent_start]) # <<<<<<<<<<<<<< * als.append(al) * # check all source-side alignment constraints */ - __pyx_t_2 = PyInt_FromLong(((__pyx_v_matching->arr[__pyx_v_x]) - __pyx_v_f_sent_start)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong(((__pyx_v_matching->arr[__pyx_v_x]) - __pyx_v_f_sent_start)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyInt_FromLong((__pyx_v_f_links_low[((__pyx_v_matching->arr[__pyx_v_x]) - __pyx_v_f_sent_start)])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1557; __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 = 1563; __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 = 1557; __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 = 1563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); @@ -54443,17 +54607,17 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_v_al = __pyx_t_10; __pyx_t_10 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1558 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1564 * for x in range(matching.start,matching.end): * al = (matching.arr[x]-f_sent_start,f_links_low[matching.arr[x]-f_sent_start]) * als.append(al) # <<<<<<<<<<<<<< * # check all source-side alignment constraints * met_constraints = 1 */ - __pyx_t_11 = PyList_Append(__pyx_v_als, ((PyObject *)__pyx_v_al)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyList_Append(__pyx_v_als, ((PyObject *)__pyx_v_al)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1560 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1566 * als.append(al) * # check all source-side alignment constraints * met_constraints = 1 # <<<<<<<<<<<<<< @@ -54462,7 +54626,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_met_constraints = 1; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1561 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1567 * # check all source-side alignment constraints * met_constraints = 1 * if self.require_aligned_terminal: # <<<<<<<<<<<<<< @@ -54471,7 +54635,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ if (__pyx_v_self->require_aligned_terminal) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1562 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1568 * met_constraints = 1 * if self.require_aligned_terminal: * num_aligned_chunks = 0 # <<<<<<<<<<<<<< @@ -54480,7 +54644,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_num_aligned_chunks = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1563 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1569 * if self.require_aligned_terminal: * num_aligned_chunks = 0 * for i from 0 <= i < num_chunks: # <<<<<<<<<<<<<< @@ -54490,7 +54654,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_3 = __pyx_v_num_chunks; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1564 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1570 * num_aligned_chunks = 0 * for i from 0 <= i < num_chunks: * for j from 0 <= j < chunklen[i]: # <<<<<<<<<<<<<< @@ -54500,7 +54664,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_4 = (__pyx_v_chunklen[__pyx_v_i]); for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_4; __pyx_v_j++) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1565 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1571 * 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: # <<<<<<<<<<<<<< @@ -54510,7 +54674,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_9 = ((__pyx_v_f_links_low[(((__pyx_v_matching->arr[(__pyx_v_matching->start + __pyx_v_i)]) + __pyx_v_j) - __pyx_v_f_sent_start)]) > -1); if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1566 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1572 * 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 # <<<<<<<<<<<<<< @@ -54519,7 +54683,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_num_aligned_chunks = (__pyx_v_num_aligned_chunks + 1); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1567 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1573 * if f_links_low[matching.arr[matching.start+i]+j-f_sent_start] > -1: * num_aligned_chunks = num_aligned_chunks + 1 * break # <<<<<<<<<<<<<< @@ -54534,7 +54698,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_L24_break:; } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1568 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1574 * num_aligned_chunks = num_aligned_chunks + 1 * break * if num_aligned_chunks == 0: # <<<<<<<<<<<<<< @@ -54544,18 +54708,18 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_9 = (__pyx_v_num_aligned_chunks == 0); if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1569 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1575 * 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_127)); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_128)); __Pyx_DECREF(__pyx_v_reason_for_failure); - __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_127); + __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_128); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1570 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1576 * if num_aligned_chunks == 0: * reason_for_failure = "No aligned terminals" * met_constraints = 0 # <<<<<<<<<<<<<< @@ -54567,7 +54731,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L26:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1571 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1577 * reason_for_failure = "No aligned terminals" * met_constraints = 0 * if self.require_aligned_chunks and num_aligned_chunks < num_chunks: # <<<<<<<<<<<<<< @@ -54582,18 +54746,18 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if (__pyx_t_7) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1572 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1578 * 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_128)); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_129)); __Pyx_DECREF(__pyx_v_reason_for_failure); - __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_128); + __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_129); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1573 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1579 * if self.require_aligned_chunks and num_aligned_chunks < num_chunks: * reason_for_failure = "Unaligned chunk" * met_constraints = 0 # <<<<<<<<<<<<<< @@ -54608,7 +54772,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L20:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1575 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1581 * met_constraints = 0 * * if met_constraints and self.tight_phrases: # <<<<<<<<<<<<<< @@ -54623,7 +54787,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1577 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1583 * if met_constraints and self.tight_phrases: * # outside edge constraints are checked later * for i from 0 <= i < num_chunks-1: # <<<<<<<<<<<<<< @@ -54633,7 +54797,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_12 = (__pyx_v_num_chunks - 1); for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_12; __pyx_v_i++) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1578 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1584 * # 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: # <<<<<<<<<<<<<< @@ -54643,18 +54807,18 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __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); if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1579 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1585 * 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_129)); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_130)); __Pyx_DECREF(__pyx_v_reason_for_failure); - __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_129); + __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_130); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1580 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1586 * 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 # <<<<<<<<<<<<<< @@ -54663,7 +54827,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_met_constraints = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1581 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1587 * reason_for_failure = "Gaps are not tight phrases" * met_constraints = 0 * break # <<<<<<<<<<<<<< @@ -54675,7 +54839,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L31:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1582 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1588 * met_constraints = 0 * break * if f_links_low[matching.arr[matching.start+i+1]-1-f_sent_start] == -1: # <<<<<<<<<<<<<< @@ -54685,18 +54849,18 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __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); if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1583 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1589 * 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_129)); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_130)); __Pyx_DECREF(__pyx_v_reason_for_failure); - __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_129); + __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_130); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1584 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1590 * 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 # <<<<<<<<<<<<<< @@ -54705,7 +54869,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_met_constraints = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1585 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1591 * reason_for_failure = "Gaps are not tight phrases" * met_constraints = 0 * break # <<<<<<<<<<<<<< @@ -54722,7 +54886,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L28:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1587 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1593 * break * * f_low = matching.arr[matching.start] - f_sent_start # <<<<<<<<<<<<<< @@ -54731,7 +54895,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_f_low = ((__pyx_v_matching->arr[__pyx_v_matching->start]) - __pyx_v_f_sent_start); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1588 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1594 * * 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 # <<<<<<<<<<<<<< @@ -54740,7 +54904,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1589 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1595 * 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: # <<<<<<<<<<<<<< @@ -54749,17 +54913,17 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ if (__pyx_v_met_constraints) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1591 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1597 * 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 = 1591; __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 = 1597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1595 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1601 * 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): # <<<<<<<<<<<<<< @@ -54770,7 +54934,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1596 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1602 * self.train_min_gap_size, 0, * self.max_nonterminals - num_chunks + 1, 1, 1, 0, 0): * gap_error = 0 # <<<<<<<<<<<<<< @@ -54779,7 +54943,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_gap_error = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1597 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1603 * self.max_nonterminals - num_chunks + 1, 1, 1, 0, 0): * gap_error = 0 * num_gaps = 0 # <<<<<<<<<<<<<< @@ -54788,7 +54952,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_num_gaps = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1599 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1605 * num_gaps = 0 * * if f_back_low < f_low: # <<<<<<<<<<<<<< @@ -54798,7 +54962,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_9 = (__pyx_v_f_back_low < __pyx_v_f_low); if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1600 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1606 * * if f_back_low < f_low: * f_gap_low[0] = f_back_low # <<<<<<<<<<<<<< @@ -54807,7 +54971,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ (__pyx_v_f_gap_low[0]) = __pyx_v_f_back_low; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1601 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1607 * if f_back_low < f_low: * f_gap_low[0] = f_back_low * f_gap_high[0] = f_low # <<<<<<<<<<<<<< @@ -54816,7 +54980,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ (__pyx_v_f_gap_high[0]) = __pyx_v_f_low; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1602 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1608 * f_gap_low[0] = f_back_low * f_gap_high[0] = f_low * num_gaps = 1 # <<<<<<<<<<<<<< @@ -54825,7 +54989,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_num_gaps = 1; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1603 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1609 * f_gap_high[0] = f_low * num_gaps = 1 * gap_start = 0 # <<<<<<<<<<<<<< @@ -54834,7 +54998,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_gap_start = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1604 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1610 * num_gaps = 1 * gap_start = 0 * phrase_len = phrase_len+1 # <<<<<<<<<<<<<< @@ -54843,7 +55007,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_phrase_len = (__pyx_v_phrase_len + 1); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1605 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1611 * gap_start = 0 * phrase_len = phrase_len+1 * if phrase_len > self.max_length: # <<<<<<<<<<<<<< @@ -54853,7 +55017,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_9 = (__pyx_v_phrase_len > __pyx_v_self->max_length); if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1606 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1612 * phrase_len = phrase_len+1 * if phrase_len > self.max_length: * gap_error = 1 # <<<<<<<<<<<<<< @@ -54865,7 +55029,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L36:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1607 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1613 * if phrase_len > self.max_length: * gap_error = 1 * if self.tight_phrases: # <<<<<<<<<<<<<< @@ -54874,7 +55038,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ if (__pyx_v_self->tight_phrases) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1608 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1614 * gap_error = 1 * if self.tight_phrases: * if f_links_low[f_back_low] == -1 or f_links_low[f_low-1] == -1: # <<<<<<<<<<<<<< @@ -54890,7 +55054,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if (__pyx_t_8) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1609 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1615 * if self.tight_phrases: * if f_links_low[f_back_low] == -1 or f_links_low[f_low-1] == -1: * gap_error = 1 # <<<<<<<<<<<<<< @@ -54899,16 +55063,16 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_gap_error = 1; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1610 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1616 * 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_130)); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_131)); __Pyx_DECREF(__pyx_v_reason_for_failure); - __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_130); + __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_131); goto __pyx_L38; } __pyx_L38:; @@ -54919,7 +55083,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1612 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1618 * reason_for_failure = "Inside edges of preceding subphrase are not tight" * else: * gap_start = 1 # <<<<<<<<<<<<<< @@ -54928,7 +55092,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_gap_start = 1; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1613 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1619 * else: * gap_start = 1 * if self.tight_phrases and f_links_low[f_low] == -1: # <<<<<<<<<<<<<< @@ -54943,7 +55107,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1616 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1622 * # 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 # <<<<<<<<<<<<<< @@ -54957,7 +55121,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L35:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1618 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1624 * met_constraints = 0 * * for i from 0 <= i < matching.size - 1: # <<<<<<<<<<<<<< @@ -54967,7 +55131,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_12 = (__pyx_v_matching->size - 1); for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_12; __pyx_v_i++) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1619 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1625 * * for i from 0 <= i < matching.size - 1: * f_gap_low[1+i] = matching.arr[matching.start+i] + chunklen[i] - f_sent_start # <<<<<<<<<<<<<< @@ -54976,7 +55140,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ (__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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1620 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1626 * 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 # <<<<<<<<<<<<<< @@ -54985,7 +55149,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ (__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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1621 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1627 * 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 # <<<<<<<<<<<<<< @@ -54995,7 +55159,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_v_num_gaps = (__pyx_v_num_gaps + 1); } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1623 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1629 * num_gaps = num_gaps + 1 * * if f_high < f_back_high: # <<<<<<<<<<<<<< @@ -55005,7 +55169,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_9 = (__pyx_v_f_high < __pyx_v_f_back_high); if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1624 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1630 * * if f_high < f_back_high: * f_gap_low[gap_start+num_gaps] = f_high # <<<<<<<<<<<<<< @@ -55014,7 +55178,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ (__pyx_v_f_gap_low[(__pyx_v_gap_start + __pyx_v_num_gaps)]) = __pyx_v_f_high; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1625 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1631 * 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 # <<<<<<<<<<<<<< @@ -55023,7 +55187,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ (__pyx_v_f_gap_high[(__pyx_v_gap_start + __pyx_v_num_gaps)]) = __pyx_v_f_back_high; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1626 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1632 * f_gap_low[gap_start+num_gaps] = f_high * f_gap_high[gap_start+num_gaps] = f_back_high * num_gaps = num_gaps + 1 # <<<<<<<<<<<<<< @@ -55032,7 +55196,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_num_gaps = (__pyx_v_num_gaps + 1); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1627 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1633 * f_gap_high[gap_start+num_gaps] = f_back_high * num_gaps = num_gaps + 1 * phrase_len = phrase_len+1 # <<<<<<<<<<<<<< @@ -55041,7 +55205,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_phrase_len = (__pyx_v_phrase_len + 1); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1628 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1634 * num_gaps = num_gaps + 1 * phrase_len = phrase_len+1 * if phrase_len > self.max_length: # <<<<<<<<<<<<<< @@ -55051,7 +55215,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_9 = (__pyx_v_phrase_len > __pyx_v_self->max_length); if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1629 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1635 * phrase_len = phrase_len+1 * if phrase_len > self.max_length: * gap_error = 1 # <<<<<<<<<<<<<< @@ -55063,7 +55227,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L43:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1630 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1636 * if phrase_len > self.max_length: * gap_error = 1 * if self.tight_phrases: # <<<<<<<<<<<<<< @@ -55072,7 +55236,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ if (__pyx_v_self->tight_phrases) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1631 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1637 * gap_error = 1 * if self.tight_phrases: * if f_links_low[f_back_high-1] == -1 or f_links_low[f_high] == -1: # <<<<<<<<<<<<<< @@ -55088,7 +55252,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if (__pyx_t_7) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1632 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1638 * if self.tight_phrases: * if f_links_low[f_back_high-1] == -1 or f_links_low[f_high] == -1: * gap_error = 1 # <<<<<<<<<<<<<< @@ -55097,16 +55261,16 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_gap_error = 1; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1633 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1639 * 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_131)); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_132)); __Pyx_DECREF(__pyx_v_reason_for_failure); - __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_131); + __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_132); goto __pyx_L45; } __pyx_L45:; @@ -55117,7 +55281,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1635 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1641 * reason_for_failure = "Inside edges of following subphrase are not tight" * else: * if self.tight_phrases and f_links_low[f_high-1] == -1: # <<<<<<<<<<<<<< @@ -55132,7 +55296,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1636 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1642 * else: * if self.tight_phrases and f_links_low[f_high-1] == -1: * met_constraints = 0 # <<<<<<<<<<<<<< @@ -55146,7 +55310,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L42:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1638 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1644 * met_constraints = 0 * * if gap_error == 0: # <<<<<<<<<<<<<< @@ -55156,7 +55320,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_9 = (__pyx_v_gap_error == 0); if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1639 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1645 * * if gap_error == 0: * e_word_count = e_high - e_low # <<<<<<<<<<<<<< @@ -55165,7 +55329,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_e_word_count = (__pyx_v_e_high - __pyx_v_e_low); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1640 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1646 * if gap_error == 0: * e_word_count = e_high - e_low * for i from 0 <= i < num_gaps: # check integrity of subphrases # <<<<<<<<<<<<<< @@ -55175,17 +55339,17 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_3 = __pyx_v_num_gaps; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1641 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1647 * 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 = 1641; __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 = 1647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1646 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1652 * 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, # <<<<<<<<<<<<<< @@ -55196,7 +55360,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1648 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1654 * self.train_max_initial_size, self.train_max_initial_size, * 0, 0, 0, 0, 0, 0, 0) == 0: * gap_error = 1 # <<<<<<<<<<<<<< @@ -55205,18 +55369,18 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_gap_error = 1; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1649 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1655 * 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 = 1649; __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 = 1655; __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 = 1649; __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 = 1655; __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 = 1649; __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 = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); @@ -55224,14 +55388,14 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __Pyx_GIVEREF(__pyx_t_1); __pyx_t_10 = 0; __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_132), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_133), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_v_reason_for_failure); __pyx_v_reason_for_failure = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1650 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1656 * 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 # <<<<<<<<<<<<<< @@ -55248,7 +55412,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L47:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1652 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1658 * break * * if gap_error == 0: # <<<<<<<<<<<<<< @@ -55258,7 +55422,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_9 = (__pyx_v_gap_error == 0); if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1653 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1659 * * if gap_error == 0: * i = 1 # <<<<<<<<<<<<<< @@ -55267,21 +55431,21 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_i = 1; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1654 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1660 * if gap_error == 0: * i = 1 * self.findexes.reset() # <<<<<<<<<<<<<< * if f_back_low < f_low: * fphr_arr._append(sym_setindex(self.category, i)) */ - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1660; __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 = 1654; __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 = 1660; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1655 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1661 * i = 1 * self.findexes.reset() * if f_back_low < f_low: # <<<<<<<<<<<<<< @@ -55291,7 +55455,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_9 = (__pyx_v_f_back_low < __pyx_v_f_low); if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1656 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1662 * self.findexes.reset() * if f_back_low < f_low: * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -55300,7 +55464,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1657 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1663 * if f_back_low < f_low: * fphr_arr._append(sym_setindex(self.category, i)) * i = i+1 # <<<<<<<<<<<<<< @@ -55309,16 +55473,16 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_i = (__pyx_v_i + 1); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1658 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1664 * fphr_arr._append(sym_setindex(self.category, i)) * i = i+1 * self.findexes.append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< * self.findexes.extend(self.findexes1) * for j from 0 <= j < phrase.n: */ - __pyx_t_2 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1664; __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; @@ -55326,27 +55490,27 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L52:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1659 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1665 * i = i+1 * self.findexes.append(sym_setindex(self.category, i)) * self.findexes.extend(self.findexes1) # <<<<<<<<<<<<<< * for j from 0 <= j < phrase.n: * if sym_isvar(phrase.syms[j]): */ - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1665; __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 = 1659; __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 = 1665; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_self->findexes1)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self->findexes1)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self->findexes1)); - __pyx_t_10 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1665; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1660 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1666 * self.findexes.append(sym_setindex(self.category, i)) * self.findexes.extend(self.findexes1) * for j from 0 <= j < phrase.n: # <<<<<<<<<<<<<< @@ -55356,7 +55520,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_3 = __pyx_v_phrase->n; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_3; __pyx_v_j++) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1661 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1667 * self.findexes.extend(self.findexes1) * for j from 0 <= j < phrase.n: * if sym_isvar(phrase.syms[j]): # <<<<<<<<<<<<<< @@ -55366,7 +55530,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_4 = __pyx_f_3_sa_sym_isvar((__pyx_v_phrase->syms[__pyx_v_j])); if (__pyx_t_4) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1662 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1668 * for j from 0 <= j < phrase.n: * if sym_isvar(phrase.syms[j]): * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -55375,7 +55539,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1663 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1669 * if sym_isvar(phrase.syms[j]): * fphr_arr._append(sym_setindex(self.category, i)) * i = i + 1 # <<<<<<<<<<<<<< @@ -55387,7 +55551,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1665 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1671 * i = i + 1 * else: * fphr_arr._append(phrase.syms[j]) # <<<<<<<<<<<<<< @@ -55399,7 +55563,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_L55:; } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1666 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1672 * else: * fphr_arr._append(phrase.syms[j]) * if f_back_high > f_high: # <<<<<<<<<<<<<< @@ -55409,7 +55573,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_9 = (__pyx_v_f_back_high > __pyx_v_f_high); if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1667 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1673 * fphr_arr._append(phrase.syms[j]) * if f_back_high > f_high: * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -55418,16 +55582,16 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1668 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1674 * 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_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1668; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_2 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1668; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -55435,25 +55599,25 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L56:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1670 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1676 * 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_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1670; __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 = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_fphr_arr)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_fphr_arr)); __Pyx_GIVEREF(((PyObject *)__pyx_v_fphr_arr)); - __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __pyx_v_fphr = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_10); __pyx_t_10 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1671 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1677 * * fphr = Phrase(fphr_arr) * if met_constraints: # <<<<<<<<<<<<<< @@ -55462,47 +55626,47 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ if (__pyx_v_met_constraints) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1674 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1680 * 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_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 = 1672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->extract_phrases(__pyx_v_self, __pyx_v_e_low, __pyx_v_e_high, (__pyx_v_e_gap_low + __pyx_v_gap_start), (__pyx_v_e_gap_high + __pyx_v_gap_start), __pyx_v_e_links_low, __pyx_v_num_gaps, __pyx_v_f_back_low, __pyx_v_f_back_high, (__pyx_v_f_gap_low + __pyx_v_gap_start), (__pyx_v_f_gap_high + __pyx_v_gap_start), __pyx_v_f_links_low, __pyx_v_matching->sent_id, __pyx_v_e_sent_len, __pyx_v_e_sent_start); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_v_phrase_list = __pyx_t_10; __pyx_t_10 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1675 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1681 * 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 = 1675; __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 = 1681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_9 = (__pyx_t_13 > 0); if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1676 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1682 * 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 = 1676; __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 = 1682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(__pyx_t_13 == 0)) { PyErr_Format(PyExc_ZeroDivisionError, "float division"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_v_pair_count = (1.0 / __pyx_t_13); goto __pyx_L58; } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1678 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1684 * pair_count = 1.0 / len(phrase_list) * else: * pair_count = 0 # <<<<<<<<<<<<<< @@ -55511,22 +55675,22 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_pair_count = 0.0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1679 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1685 * 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 = 1679; __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 = 1685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_2 = PyInt_FromLong(__pyx_v_f_back_high); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong(__pyx_v_f_back_high); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyInt_FromLong(__pyx_v_e_low); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1679; __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 = 1685; __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 = 1679; __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 = 1685; __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 = 1679; __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 = 1685; __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); @@ -55540,7 +55704,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_14 = 0; - __pyx_t_14 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_133), ((PyObject *)__pyx_t_15)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_134), ((PyObject *)__pyx_t_15)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_14)); __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_v_reason_for_failure); @@ -55549,7 +55713,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L58:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1680 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1686 * 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: # <<<<<<<<<<<<<< @@ -55560,23 +55724,31 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __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 = 1680; __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 = 1686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); __pyx_t_16 = Py_TYPE(__pyx_t_14)->tp_iternext; } for (;;) { if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_14)) { if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_14)) break; - __pyx_t_15 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_15); __pyx_t_13++; + #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 = 1686; __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 = 1686; __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; - __pyx_t_15 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_15); __pyx_t_13++; + #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 = 1686; __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 = 1686; __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 = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -55584,29 +55756,35 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if ((likely(PyTuple_CheckExact(__pyx_t_15))) || (PyList_CheckExact(__pyx_t_15))) { PyObject* sequence = __pyx_t_15; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { - if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { - if (unlikely(PyList_GET_SIZE(sequence) != 2)) { - if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); + #else + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - } else { + } else + { Py_ssize_t index = -1; - __pyx_t_10 = PyObject_GetIter(__pyx_t_15); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1680; __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 = 1686; __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; @@ -55614,14 +55792,15 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_17(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L61_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1680; __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 = 1686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L62_unpacking_done; __pyx_L61_unpacking_failed:; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L62_unpacking_done:; } __Pyx_XDECREF(__pyx_v_phrase2); @@ -55631,7 +55810,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_v_eindexes = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1681 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1687 * 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) # <<<<<<<<<<<<<< @@ -55640,31 +55819,31 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_t_15 = ((PyObject *)__pyx_v_self->findexes); __Pyx_INCREF(__pyx_t_15); - __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, __pyx_t_15, __pyx_v_eindexes)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, __pyx_t_15, __pyx_v_eindexes)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(((PyObject *)__pyx_v_als1)); __pyx_v_als1 = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1682 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1688 * 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_2 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1682; __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 = 1688; __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 = 1682; __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 = 1688; __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 = 1682; __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 = 1688; __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)); @@ -55678,7 +55857,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __Pyx_GIVEREF(__pyx_t_1); __pyx_t_2 = 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 = 1682; __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 = 1688; __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; @@ -55688,7 +55867,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L57:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1683 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1689 * 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 # <<<<<<<<<<<<<< @@ -55698,7 +55877,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_9 = (__pyx_v_num_gaps < __pyx_v_self->max_nonterminals); if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1684 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1690 * extracts.append((fphr, phrase2, pair_count, tuple(als1))) * if (num_gaps < self.max_nonterminals and * phrase_len < self.max_length and # <<<<<<<<<<<<<< @@ -55708,7 +55887,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_7 = (__pyx_v_phrase_len < __pyx_v_self->max_length); if (__pyx_t_7) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1685 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1691 * 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): # <<<<<<<<<<<<<< @@ -55726,7 +55905,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if (__pyx_t_7) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1686 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1692 * 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 # <<<<<<<<<<<<<< @@ -55736,7 +55915,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_7 = (__pyx_v_f_back_low == __pyx_v_f_low); if (__pyx_t_7) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1687 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1693 * 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 # <<<<<<<<<<<<<< @@ -55746,7 +55925,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_9 = (__pyx_v_f_low >= __pyx_v_self->train_min_gap_size); if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1688 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1694 * 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))): # <<<<<<<<<<<<<< @@ -55776,7 +55955,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1689 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1695 * 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 # <<<<<<<<<<<<<< @@ -55785,7 +55964,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_f_x_low = (__pyx_v_f_low - __pyx_v_self->train_min_gap_size); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1690 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1696 * ((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 # <<<<<<<<<<<<<< @@ -55794,7 +55973,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_met_constraints = 1; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1691 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1697 * f_x_low = f_low-self.train_min_gap_size * met_constraints = 1 * if self.tight_phrases: # <<<<<<<<<<<<<< @@ -55803,7 +55982,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ if (__pyx_v_self->tight_phrases) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1692 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1698 * met_constraints = 1 * if self.tight_phrases: * while f_x_low >= 0 and f_links_low[f_x_low] == -1: # <<<<<<<<<<<<<< @@ -55820,7 +55999,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if (!__pyx_t_18) break; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1693 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1699 * if self.tight_phrases: * while f_x_low >= 0 and f_links_low[f_x_low] == -1: * f_x_low = f_x_low - 1 # <<<<<<<<<<<<<< @@ -55833,7 +56012,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L65:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1694 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1700 * 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: # <<<<<<<<<<<<<< @@ -55849,7 +56028,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if (__pyx_t_7) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1695 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1701 * 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 # <<<<<<<<<<<<<< @@ -55861,85 +56040,85 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L68:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1697 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1703 * met_constraints = 0 * * if (met_constraints and # <<<<<<<<<<<<<< - * self.find_fixpoint(f_x_low, f_back_high, + * (self.find_fixpoint(f_x_low, f_back_high, * f_links_low, f_links_high, e_links_low, e_links_high, */ if (__pyx_v_met_constraints) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1698 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1704 * * if (met_constraints and - * self.find_fixpoint(f_x_low, f_back_high, # <<<<<<<<<<<<<< + * (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 = 1698; __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 = 1704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1702 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1708 * e_low, e_high, &e_x_low, &e_x_high, &f_x_low, &f_x_high, * f_sent_len, e_sent_len, * self.train_max_initial_size, self.train_max_initial_size, # <<<<<<<<<<<<<< - * 1, 1, 1, 1, 0, 1, 0) and + * 1, 1, 1, 1, 0, 1, 0) == 1) and * ((not self.tight_phrases) or f_links_low[f_x_low] != -1) and */ - if (((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_x_low, __pyx_t_14, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_e_low, __pyx_v_e_high, (&__pyx_v_e_x_low), (&__pyx_v_e_x_high), (&__pyx_v_f_x_low), (&__pyx_v_f_x_high), __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, 1, 1, 1, 1, 0, 1, 0)) { - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_7 = (((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_x_low, __pyx_t_14, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_e_low, __pyx_v_e_high, (&__pyx_v_e_x_low), (&__pyx_v_e_x_high), (&__pyx_v_f_x_low), (&__pyx_v_f_x_high), __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, 1, 1, 1, 1, 0, 1, 0) == 1); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (__pyx_t_7) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1704 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1710 * self.train_max_initial_size, self.train_max_initial_size, - * 1, 1, 1, 1, 0, 1, 0) and + * 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, */ - __pyx_t_7 = (!__pyx_v_self->tight_phrases); - if (!__pyx_t_7) { - __pyx_t_18 = ((__pyx_v_f_links_low[__pyx_v_f_x_low]) != -1); - __pyx_t_9 = __pyx_t_18; + __pyx_t_18 = (!__pyx_v_self->tight_phrases); + if (!__pyx_t_18) { + __pyx_t_9 = ((__pyx_v_f_links_low[__pyx_v_f_x_low]) != -1); + __pyx_t_8 = __pyx_t_9; } else { - __pyx_t_9 = __pyx_t_7; + __pyx_t_8 = __pyx_t_18; } - if (__pyx_t_9) { + if (__pyx_t_8) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1705 - * 1, 1, 1, 1, 0, 1, 0) and + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1711 + * 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_1 = PyInt_FromLong(__pyx_v_f_low); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_14 = PyInt_FromLong(__pyx_v_f_low); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1709 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1715 * -1, -1, e_gap_low, e_gap_high, f_gap_low, f_gap_high, * f_sent_len, e_sent_len, * self.train_max_initial_size, self.train_max_initial_size, # <<<<<<<<<<<<<< * 0, 0, 0, 0, 0, 0, 0)): * fphr_arr._clear() */ - __pyx_t_7 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_x_low, __pyx_t_1, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, -1, -1, __pyx_v_e_gap_low, __pyx_v_e_gap_high, __pyx_v_f_gap_low, __pyx_v_f_gap_high, __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, 0, 0, 0, 0, 0, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_18 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_x_low, __pyx_t_14, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, -1, -1, __pyx_v_e_gap_low, __pyx_v_e_gap_high, __pyx_v_f_gap_low, __pyx_v_f_gap_high, __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, 0, 0, 0, 0, 0, 0, 0); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } else { - __pyx_t_7 = __pyx_t_9; + __pyx_t_18 = __pyx_t_8; } - __pyx_t_9 = __pyx_t_7; + __pyx_t_8 = __pyx_t_18; } else { - __pyx_t_9 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_x_low, __pyx_t_14, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_e_low, __pyx_v_e_high, (&__pyx_v_e_x_low), (&__pyx_v_e_x_high), (&__pyx_v_f_x_low), (&__pyx_v_f_x_high), __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, 1, 1, 1, 1, 0, 1, 0); - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_8 = __pyx_t_7; } - __pyx_t_7 = __pyx_t_9; + __pyx_t_7 = __pyx_t_8; } else { __pyx_t_7 = __pyx_v_met_constraints; } if (__pyx_t_7) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1711 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1717 * self.train_max_initial_size, self.train_max_initial_size, * 0, 0, 0, 0, 0, 0, 0)): * fphr_arr._clear() # <<<<<<<<<<<<<< @@ -55948,7 +56127,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_clear(__pyx_v_fphr_arr); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1712 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1718 * 0, 0, 0, 0, 0, 0, 0)): * fphr_arr._clear() * i = 1 # <<<<<<<<<<<<<< @@ -55957,35 +56136,35 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_i = 1; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1713 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1719 * fphr_arr._clear() * i = 1 * self.findexes.reset() # <<<<<<<<<<<<<< * self.findexes.append(sym_setindex(self.category, i)) * fphr_arr._append(sym_setindex(self.category, i)) */ - __pyx_t_14 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1713; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1719; __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 = 1713; __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 = 1719; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1714 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1720 * 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_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1720; __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 = 1714; __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 = 1720; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1715 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1721 * self.findexes.reset() * self.findexes.append(sym_setindex(self.category, i)) * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -55994,7 +56173,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1716 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1722 * self.findexes.append(sym_setindex(self.category, i)) * fphr_arr._append(sym_setindex(self.category, i)) * i = i+1 # <<<<<<<<<<<<<< @@ -56003,27 +56182,27 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_i = (__pyx_v_i + 1); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1717 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1723 * fphr_arr._append(sym_setindex(self.category, i)) * i = i+1 * self.findexes.extend(self.findexes1) # <<<<<<<<<<<<<< * for j from 0 <= j < phrase.n: * if sym_isvar(phrase.syms[j]): */ - __pyx_t_14 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1717; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1723; __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 = 1717; __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_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 = 1717; __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 = 1723; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1718 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1724 * i = i+1 * self.findexes.extend(self.findexes1) * for j from 0 <= j < phrase.n: # <<<<<<<<<<<<<< @@ -56033,7 +56212,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_3 = __pyx_v_phrase->n; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_3; __pyx_v_j++) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1719 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1725 * self.findexes.extend(self.findexes1) * for j from 0 <= j < phrase.n: * if sym_isvar(phrase.syms[j]): # <<<<<<<<<<<<<< @@ -56043,7 +56222,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_4 = __pyx_f_3_sa_sym_isvar((__pyx_v_phrase->syms[__pyx_v_j])); if (__pyx_t_4) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1720 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1726 * for j from 0 <= j < phrase.n: * if sym_isvar(phrase.syms[j]): * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -56052,7 +56231,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1721 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1727 * if sym_isvar(phrase.syms[j]): * fphr_arr._append(sym_setindex(self.category, i)) * i = i + 1 # <<<<<<<<<<<<<< @@ -56064,7 +56243,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1723 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1729 * i = i + 1 * else: * fphr_arr._append(phrase.syms[j]) # <<<<<<<<<<<<<< @@ -56076,7 +56255,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_L72:; } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1724 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1730 * else: * fphr_arr._append(phrase.syms[j]) * if f_back_high > f_high: # <<<<<<<<<<<<<< @@ -56086,7 +56265,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_7 = (__pyx_v_f_back_high > __pyx_v_f_high); if (__pyx_t_7) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1725 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1731 * fphr_arr._append(phrase.syms[j]) * if f_back_high > f_high: * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -56095,16 +56274,16 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1726 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1732 * 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_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1726; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1732; __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 = 1726; __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 = 1732; __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; @@ -56112,67 +56291,67 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L73:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1727 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1733 * 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 = 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 = 1733; __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_3_sa_Phrase)), ((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(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_fphr)); __pyx_v_fphr = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_15); __pyx_t_15 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1730 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1736 * 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_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 = 1728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->extract_phrases(__pyx_v_self, __pyx_v_e_x_low, __pyx_v_e_x_high, __pyx_v_e_gap_low, __pyx_v_e_gap_high, __pyx_v_e_links_low, (__pyx_v_num_gaps + 1), __pyx_v_f_x_low, __pyx_v_f_x_high, __pyx_v_f_gap_low, __pyx_v_f_gap_high, __pyx_v_f_links_low, __pyx_v_matching->sent_id, __pyx_v_e_sent_len, __pyx_v_e_sent_start); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_XDECREF(__pyx_v_phrase_list); __pyx_v_phrase_list = __pyx_t_15; __pyx_t_15 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1731 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1737 * 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 = 1731; __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 = 1737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = (__pyx_t_13 > 0); if (__pyx_t_7) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1732 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1738 * 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 = 1732; __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 = 1738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(__pyx_t_13 == 0)) { PyErr_Format(PyExc_ZeroDivisionError, "float division"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_v_pair_count = (1.0 / __pyx_t_13); goto __pyx_L74; } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1734 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1740 * pair_count = 1.0 / len(phrase_list) * else: * pair_count = 0 # <<<<<<<<<<<<<< @@ -56183,7 +56362,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L74:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1735 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1741 * else: * pair_count = 0 * for phrase2,eindexes in phrase_list: # <<<<<<<<<<<<<< @@ -56194,23 +56373,31 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __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 = 1735; __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 = 1741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __pyx_t_16 = Py_TYPE(__pyx_t_15)->tp_iternext; } for (;;) { if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_15)) { if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_15)) break; - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_15, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; + #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 = 1741; __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 = 1741; __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; - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_15, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; + #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 = 1741; __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 = 1741; __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 = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -56218,29 +56405,35 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { - if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } __pyx_t_14 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { - if (unlikely(PyList_GET_SIZE(sequence) != 2)) { - if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } __pyx_t_14 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(__pyx_t_2); + #else + __pyx_t_14 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } else { + } 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 = 1735; __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 = 1741; __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; @@ -56248,14 +56441,15 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __Pyx_GOTREF(__pyx_t_14); index = 1; __pyx_t_2 = __pyx_t_17(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L77_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1735; __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 = 1741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L78_unpacking_done; __pyx_L77_unpacking_failed:; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L78_unpacking_done:; } __Pyx_XDECREF(__pyx_v_phrase2); @@ -56265,7 +56459,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_v_eindexes = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1736 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1742 * pair_count = 0 * for phrase2,eindexes in phrase_list: * als2 = self.create_alignments(sent_links,num_links,self.findexes,eindexes) # <<<<<<<<<<<<<< @@ -56274,31 +56468,31 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_t_1 = ((PyObject *)__pyx_v_self->findexes); __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, __pyx_t_1, __pyx_v_eindexes)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, __pyx_t_1, __pyx_v_eindexes)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(((PyObject *)__pyx_v_als2)); __pyx_v_als2 = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1737 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1743 * 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_2 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1743; __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 = 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 = 1743; __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 = 1737; __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 = 1743; __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 = 1737; __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 = 1743; __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)); @@ -56312,7 +56506,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __Pyx_GIVEREF(__pyx_t_14); __pyx_t_2 = 0; __pyx_t_14 = 0; - __pyx_t_14 = __Pyx_PyObject_Append(__pyx_v_extracts, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1737; __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 = 1743; __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; @@ -56325,7 +56519,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L64:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1739 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1745 * extracts.append((fphr, phrase2, pair_count, tuple(als2))) * * if (f_back_high == f_high and # <<<<<<<<<<<<<< @@ -56335,17 +56529,17 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_7 = (__pyx_v_f_back_high == __pyx_v_f_high); if (__pyx_t_7) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1740 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1746 * * 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_9 = ((__pyx_v_f_sent_len - __pyx_v_f_high) >= __pyx_v_self->train_min_gap_size); - if (__pyx_t_9) { + __pyx_t_8 = ((__pyx_v_f_sent_len - __pyx_v_f_high) >= __pyx_v_self->train_min_gap_size); + if (__pyx_t_8) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1741 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1747 * 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))): # <<<<<<<<<<<<<< @@ -56354,28 +56548,28 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_t_18 = (!__pyx_v_self->tight_phrases); if (!__pyx_t_18) { - __pyx_t_8 = ((__pyx_v_f_links_low[__pyx_v_f_high]) != -1); - if (__pyx_t_8) { + __pyx_t_9 = ((__pyx_v_f_links_low[__pyx_v_f_high]) != -1); + if (__pyx_t_9) { __pyx_t_20 = ((__pyx_v_f_links_low[__pyx_v_f_back_low]) != -1); __pyx_t_19 = __pyx_t_20; } else { - __pyx_t_19 = __pyx_t_8; + __pyx_t_19 = __pyx_t_9; } - __pyx_t_8 = __pyx_t_19; + __pyx_t_9 = __pyx_t_19; } 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_8; } - __pyx_t_9 = __pyx_t_18; + __pyx_t_8 = __pyx_t_18; } else { - __pyx_t_9 = __pyx_t_7; + __pyx_t_8 = __pyx_t_7; } - if (__pyx_t_9) { + if (__pyx_t_8) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1742 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1748 * 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 # <<<<<<<<<<<<<< @@ -56384,7 +56578,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_f_x_high = (__pyx_v_f_high + __pyx_v_self->train_min_gap_size); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1743 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1749 * ((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 # <<<<<<<<<<<<<< @@ -56393,7 +56587,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_met_constraints = 1; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1744 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1750 * f_x_high = f_high+self.train_min_gap_size * met_constraints = 1 * if self.tight_phrases: # <<<<<<<<<<<<<< @@ -56402,7 +56596,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ if (__pyx_v_self->tight_phrases) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1745 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1751 * met_constraints = 1 * if self.tight_phrases: * while f_x_high <= f_sent_len and f_links_low[f_x_high-1] == -1: # <<<<<<<<<<<<<< @@ -56410,16 +56604,16 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj * if f_x_high > f_sent_len or f_x_high - f_back_low > self.train_max_initial_size: */ while (1) { - __pyx_t_9 = (__pyx_v_f_x_high <= __pyx_v_f_sent_len); - if (__pyx_t_9) { + __pyx_t_8 = (__pyx_v_f_x_high <= __pyx_v_f_sent_len); + if (__pyx_t_8) { __pyx_t_7 = ((__pyx_v_f_links_low[(__pyx_v_f_x_high - 1)]) == -1); __pyx_t_18 = __pyx_t_7; } else { - __pyx_t_18 = __pyx_t_9; + __pyx_t_18 = __pyx_t_8; } if (!__pyx_t_18) break; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1746 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1752 * 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 # <<<<<<<<<<<<<< @@ -56432,7 +56626,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L80:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1747 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1753 * 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: # <<<<<<<<<<<<<< @@ -56441,14 +56635,14 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_t_18 = (__pyx_v_f_x_high > __pyx_v_f_sent_len); if (!__pyx_t_18) { - __pyx_t_9 = ((__pyx_v_f_x_high - __pyx_v_f_back_low) > __pyx_v_self->train_max_initial_size); - __pyx_t_7 = __pyx_t_9; + __pyx_t_8 = ((__pyx_v_f_x_high - __pyx_v_f_back_low) > __pyx_v_self->train_max_initial_size); + __pyx_t_7 = __pyx_t_8; } else { __pyx_t_7 = __pyx_t_18; } if (__pyx_t_7) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1748 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1754 * 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 # <<<<<<<<<<<<<< @@ -56460,7 +56654,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L83:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1750 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1756 * met_constraints = 0 * * if (met_constraints and # <<<<<<<<<<<<<< @@ -56469,17 +56663,17 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ if (__pyx_v_met_constraints) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1751 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1757 * * 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 = 1751; __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 = 1757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1755 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1761 * 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, # <<<<<<<<<<<<<< @@ -56489,7 +56683,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj if (((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_back_low, __pyx_t_15, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_e_low, __pyx_v_e_high, (&__pyx_v_e_x_low), (&__pyx_v_e_x_high), (&__pyx_v_f_x_low), (&__pyx_v_f_x_high), __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, 1, 1, 1, 0, 1, 1, 0)) { __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1757 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1763 * 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 # <<<<<<<<<<<<<< @@ -56499,23 +56693,23 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_7 = (!__pyx_v_self->tight_phrases); if (!__pyx_t_7) { __pyx_t_18 = ((__pyx_v_f_links_low[(__pyx_v_f_x_high - 1)]) != -1); - __pyx_t_9 = __pyx_t_18; + __pyx_t_8 = __pyx_t_18; } else { - __pyx_t_9 = __pyx_t_7; + __pyx_t_8 = __pyx_t_7; } - if (__pyx_t_9) { + if (__pyx_t_8) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1758 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1764 * 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 = 1758; __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 = 1764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1763 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1769 * 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, # <<<<<<<<<<<<<< @@ -56525,20 +56719,20 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_7 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_high, __pyx_t_14, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, -1, -1, ((__pyx_v_e_gap_low + __pyx_v_gap_start) + __pyx_v_num_gaps), ((__pyx_v_e_gap_high + __pyx_v_gap_start) + __pyx_v_num_gaps), ((__pyx_v_f_gap_low + __pyx_v_gap_start) + __pyx_v_num_gaps), ((__pyx_v_f_gap_high + __pyx_v_gap_start) + __pyx_v_num_gaps), __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, 0, 0, 0, 0, 0, 0, 0); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } else { - __pyx_t_7 = __pyx_t_9; + __pyx_t_7 = __pyx_t_8; } - __pyx_t_9 = __pyx_t_7; + __pyx_t_8 = __pyx_t_7; } else { - __pyx_t_9 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_back_low, __pyx_t_15, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_e_low, __pyx_v_e_high, (&__pyx_v_e_x_low), (&__pyx_v_e_x_high), (&__pyx_v_f_x_low), (&__pyx_v_f_x_high), __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, 1, 1, 1, 0, 1, 1, 0); + __pyx_t_8 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_back_low, __pyx_t_15, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_e_low, __pyx_v_e_high, (&__pyx_v_e_x_low), (&__pyx_v_e_x_high), (&__pyx_v_f_x_low), (&__pyx_v_f_x_high), __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, 1, 1, 1, 0, 1, 1, 0); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } - __pyx_t_7 = __pyx_t_9; + __pyx_t_7 = __pyx_t_8; } else { __pyx_t_7 = __pyx_v_met_constraints; } if (__pyx_t_7) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1765 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1771 * self.train_max_initial_size, self.train_max_initial_size, * 0, 0, 0, 0, 0, 0, 0)): * fphr_arr._clear() # <<<<<<<<<<<<<< @@ -56547,7 +56741,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_clear(__pyx_v_fphr_arr); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1766 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1772 * 0, 0, 0, 0, 0, 0, 0)): * fphr_arr._clear() * i = 1 # <<<<<<<<<<<<<< @@ -56556,21 +56750,21 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_i = 1; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1767 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1773 * 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 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1773; __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 = 1767; __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 = 1773; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1768 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1774 * i = 1 * self.findexes.reset() * if f_back_low < f_low: # <<<<<<<<<<<<<< @@ -56580,7 +56774,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_7 = (__pyx_v_f_back_low < __pyx_v_f_low); if (__pyx_t_7) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1769 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1775 * self.findexes.reset() * if f_back_low < f_low: * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -56589,7 +56783,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1770 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1776 * if f_back_low < f_low: * fphr_arr._append(sym_setindex(self.category, i)) * i = i+1 # <<<<<<<<<<<<<< @@ -56598,16 +56792,16 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_i = (__pyx_v_i + 1); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1771 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1777 * 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_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1771; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1777; __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 = 1771; __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 = 1777; __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; @@ -56615,27 +56809,27 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L85:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1772 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1778 * 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 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1778; __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 = 1772; __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 = 1778; __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 = 1772; __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 = 1778; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1773 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1779 * self.findexes.append(sym_setindex(self.category, i)) * self.findexes.extend(self.findexes1) * for j from 0 <= j < phrase.n: # <<<<<<<<<<<<<< @@ -56645,7 +56839,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_3 = __pyx_v_phrase->n; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_3; __pyx_v_j++) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1774 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1780 * self.findexes.extend(self.findexes1) * for j from 0 <= j < phrase.n: * if sym_isvar(phrase.syms[j]): # <<<<<<<<<<<<<< @@ -56655,7 +56849,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_4 = __pyx_f_3_sa_sym_isvar((__pyx_v_phrase->syms[__pyx_v_j])); if (__pyx_t_4) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1775 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1781 * for j from 0 <= j < phrase.n: * if sym_isvar(phrase.syms[j]): * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -56664,7 +56858,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1776 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1782 * if sym_isvar(phrase.syms[j]): * fphr_arr._append(sym_setindex(self.category, i)) * i = i + 1 # <<<<<<<<<<<<<< @@ -56676,7 +56870,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1778 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1784 * i = i + 1 * else: * fphr_arr._append(phrase.syms[j]) # <<<<<<<<<<<<<< @@ -56688,7 +56882,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_L88:; } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1779 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1785 * else: * fphr_arr._append(phrase.syms[j]) * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -56697,81 +56891,81 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1780 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1786 * 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_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1786; __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 = 1780; __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 = 1786; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1781 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1787 * 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 = 1781; __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_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_3_sa_Phrase)), ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_fphr)); __pyx_v_fphr = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1784 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1790 * 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_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 = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->extract_phrases(__pyx_v_self, __pyx_v_e_x_low, __pyx_v_e_x_high, (__pyx_v_e_gap_low + __pyx_v_gap_start), (__pyx_v_e_gap_high + __pyx_v_gap_start), __pyx_v_e_links_low, (__pyx_v_num_gaps + 1), __pyx_v_f_x_low, __pyx_v_f_x_high, (__pyx_v_f_gap_low + __pyx_v_gap_start), (__pyx_v_f_gap_high + __pyx_v_gap_start), __pyx_v_f_links_low, __pyx_v_matching->sent_id, __pyx_v_e_sent_len, __pyx_v_e_sent_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF(__pyx_v_phrase_list); __pyx_v_phrase_list = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1785 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1791 * 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 = 1785; __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 = 1791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = (__pyx_t_13 > 0); if (__pyx_t_7) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1786 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1792 * 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 = 1786; __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 = 1792; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(__pyx_t_13 == 0)) { PyErr_Format(PyExc_ZeroDivisionError, "float division"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1792; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_v_pair_count = (1.0 / __pyx_t_13); goto __pyx_L89; } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1788 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1794 * pair_count = 1.0 / len(phrase_list) * else: * pair_count = 0 # <<<<<<<<<<<<<< @@ -56782,7 +56976,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L89:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1789 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1795 * else: * pair_count = 0 * for phrase2, eindexes in phrase_list: # <<<<<<<<<<<<<< @@ -56793,23 +56987,31 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __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 = 1789; __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 = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_16 = Py_TYPE(__pyx_t_1)->tp_iternext; } for (;;) { if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_14 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_13); __Pyx_INCREF(__pyx_t_14); __pyx_t_13++; + #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 = 1795; __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 = 1795; __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; - __pyx_t_14 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_13); __Pyx_INCREF(__pyx_t_14); __pyx_t_13++; + #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 = 1795; __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 = 1795; __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 = 1789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -56817,29 +57019,35 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if ((likely(PyTuple_CheckExact(__pyx_t_14))) || (PyList_CheckExact(__pyx_t_14))) { PyObject* sequence = __pyx_t_14; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { - if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } __pyx_t_15 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { - if (unlikely(PyList_GET_SIZE(sequence) != 2)) { - if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } __pyx_t_15 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_15); __Pyx_INCREF(__pyx_t_2); + #else + __pyx_t_15 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - } else { + } 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 = 1789; __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 = 1795; __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; @@ -56847,14 +57055,15 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __Pyx_GOTREF(__pyx_t_15); index = 1; __pyx_t_2 = __pyx_t_17(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L92_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1789; __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 = 1795; __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; __pyx_L92_unpacking_failed:; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L93_unpacking_done:; } __Pyx_XDECREF(__pyx_v_phrase2); @@ -56864,7 +57073,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_v_eindexes = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1790 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1796 * pair_count = 0 * for phrase2, eindexes in phrase_list: * als3 = self.create_alignments(sent_links,num_links,self.findexes,eindexes) # <<<<<<<<<<<<<< @@ -56873,31 +57082,31 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_t_14 = ((PyObject *)__pyx_v_self->findexes); __Pyx_INCREF(__pyx_t_14); - __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, __pyx_t_14, __pyx_v_eindexes)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, __pyx_t_14, __pyx_v_eindexes)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(((PyObject *)__pyx_v_als3)); __pyx_v_als3 = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1791 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1797 * 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_2 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 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 = 1797; __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 = 1791; __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 = 1797; __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 = 1791; __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 = 1797; __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)); @@ -56911,7 +57120,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __Pyx_GIVEREF(__pyx_t_15); __pyx_t_2 = 0; __pyx_t_15 = 0; - __pyx_t_15 = __Pyx_PyObject_Append(__pyx_v_extracts, ((PyObject *)__pyx_t_14)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1791; __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 = 1797; __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; @@ -56924,7 +57133,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L79:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1792 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1798 * 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 # <<<<<<<<<<<<<< @@ -56934,17 +57143,17 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_7 = (__pyx_v_num_gaps < (__pyx_v_self->max_nonterminals - 1)); if (__pyx_t_7) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1793 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1799 * 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_9 = ((__pyx_v_phrase_len + 1) < __pyx_v_self->max_length); - if (__pyx_t_9) { + __pyx_t_8 = ((__pyx_v_phrase_len + 1) < __pyx_v_self->max_length); + if (__pyx_t_8) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1794 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1800 * if (num_gaps < self.max_nonterminals - 1 and * phrase_len+1 < self.max_length and * f_back_high == f_high and # <<<<<<<<<<<<<< @@ -56954,17 +57163,17 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_18 = (__pyx_v_f_back_high == __pyx_v_f_high); if (__pyx_t_18) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1795 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1801 * 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_8 = (__pyx_v_f_back_low == __pyx_v_f_low); - if (__pyx_t_8) { + __pyx_t_9 = (__pyx_v_f_back_low == __pyx_v_f_low); + if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1796 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1802 * 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 # <<<<<<<<<<<<<< @@ -56974,7 +57183,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_19 = (((__pyx_v_f_back_high - __pyx_v_f_back_low) + (2 * __pyx_v_self->train_min_gap_size)) <= __pyx_v_self->train_max_initial_size); if (__pyx_t_19) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1797 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1803 * 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 # <<<<<<<<<<<<<< @@ -56984,7 +57193,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_20 = (__pyx_v_f_low >= __pyx_v_self->train_min_gap_size); if (__pyx_t_20) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1798 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1804 * 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 # <<<<<<<<<<<<<< @@ -56994,7 +57203,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_21 = (__pyx_v_f_high <= (__pyx_v_f_sent_len - __pyx_v_self->train_min_gap_size)); if (__pyx_t_21) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1799 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1805 * 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))): # <<<<<<<<<<<<<< @@ -57028,23 +57237,23 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_t_19 = __pyx_t_20; } else { - __pyx_t_19 = __pyx_t_8; + __pyx_t_19 = __pyx_t_9; } - __pyx_t_8 = __pyx_t_19; + __pyx_t_9 = __pyx_t_19; } 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_8; } - __pyx_t_9 = __pyx_t_18; + __pyx_t_8 = __pyx_t_18; } else { - __pyx_t_9 = __pyx_t_7; + __pyx_t_8 = __pyx_t_7; } - if (__pyx_t_9) { + if (__pyx_t_8) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1801 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1807 * ((not self.tight_phrases) or (f_links_low[f_low-1] != -1 and f_links_low[f_high] != -1))): * * met_constraints = 1 # <<<<<<<<<<<<<< @@ -57053,7 +57262,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_met_constraints = 1; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1802 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1808 * * met_constraints = 1 * f_x_low = f_low-self.train_min_gap_size # <<<<<<<<<<<<<< @@ -57062,7 +57271,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_f_x_low = (__pyx_v_f_low - __pyx_v_self->train_min_gap_size); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1803 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1809 * met_constraints = 1 * f_x_low = f_low-self.train_min_gap_size * if self.tight_phrases: # <<<<<<<<<<<<<< @@ -57071,7 +57280,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ if (__pyx_v_self->tight_phrases) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1804 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1810 * 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: # <<<<<<<<<<<<<< @@ -57079,16 +57288,16 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj * if f_x_low < 0: */ while (1) { - __pyx_t_9 = (__pyx_v_f_x_low >= 0); - if (__pyx_t_9) { + __pyx_t_8 = (__pyx_v_f_x_low >= 0); + if (__pyx_t_8) { __pyx_t_7 = ((__pyx_v_f_links_low[__pyx_v_f_x_low]) == -1); __pyx_t_18 = __pyx_t_7; } else { - __pyx_t_18 = __pyx_t_9; + __pyx_t_18 = __pyx_t_8; } if (!__pyx_t_18) break; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1805 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1811 * if self.tight_phrases: * while f_x_low >= 0 and f_links_low[f_x_low] == -1: * f_x_low = f_x_low - 1 # <<<<<<<<<<<<<< @@ -57101,7 +57310,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L95:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1806 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1812 * 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: # <<<<<<<<<<<<<< @@ -57111,7 +57320,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_18 = (__pyx_v_f_x_low < 0); if (__pyx_t_18) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1807 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1813 * f_x_low = f_x_low - 1 * if f_x_low < 0: * met_constraints = 0 # <<<<<<<<<<<<<< @@ -57123,7 +57332,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L98:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1809 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1815 * met_constraints = 0 * * f_x_high = f_high+self.train_min_gap_size # <<<<<<<<<<<<<< @@ -57132,7 +57341,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_f_x_high = (__pyx_v_f_high + __pyx_v_self->train_min_gap_size); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1810 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1816 * * f_x_high = f_high+self.train_min_gap_size * if self.tight_phrases: # <<<<<<<<<<<<<< @@ -57141,7 +57350,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ if (__pyx_v_self->tight_phrases) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1811 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1817 * 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: # <<<<<<<<<<<<<< @@ -57151,14 +57360,14 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj while (1) { __pyx_t_18 = (__pyx_v_f_x_high <= __pyx_v_f_sent_len); if (__pyx_t_18) { - __pyx_t_9 = ((__pyx_v_f_links_low[(__pyx_v_f_x_high - 1)]) == -1); - __pyx_t_7 = __pyx_t_9; + __pyx_t_8 = ((__pyx_v_f_links_low[(__pyx_v_f_x_high - 1)]) == -1); + __pyx_t_7 = __pyx_t_8; } else { __pyx_t_7 = __pyx_t_18; } if (!__pyx_t_7) break; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1812 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1818 * 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 # <<<<<<<<<<<<<< @@ -57171,7 +57380,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L99:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1813 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1819 * 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: # <<<<<<<<<<<<<< @@ -57181,13 +57390,13 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_7 = (__pyx_v_f_x_high > __pyx_v_f_sent_len); if (!__pyx_t_7) { __pyx_t_18 = ((__pyx_v_f_x_high - __pyx_v_f_x_low) > __pyx_v_self->train_max_initial_size); - __pyx_t_9 = __pyx_t_18; + __pyx_t_8 = __pyx_t_18; } else { - __pyx_t_9 = __pyx_t_7; + __pyx_t_8 = __pyx_t_7; } - if (__pyx_t_9) { + if (__pyx_t_8) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1814 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1820 * 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 # <<<<<<<<<<<<<< @@ -57199,7 +57408,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L102:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1816 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1822 * met_constraints = 0 * * if (met_constraints and # <<<<<<<<<<<<<< @@ -57208,28 +57417,28 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ if (__pyx_v_met_constraints) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1817 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1823 * * 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 = 1817; __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 = 1823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1821 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1827 * e_low, e_high, &e_x_low, &e_x_high, &f_x_low, &f_x_high, * f_sent_len, e_sent_len, * self.train_max_initial_size, self.train_max_initial_size, # <<<<<<<<<<<<<< * 1, 1, 2, 1, 1, 1, 1) == 1) and * ((not self.tight_phrases) or (f_links_low[f_x_low] != -1 and f_links_low[f_x_high-1] != -1)) and */ - __pyx_t_9 = (((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_x_low, __pyx_t_1, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_e_low, __pyx_v_e_high, (&__pyx_v_e_x_low), (&__pyx_v_e_x_high), (&__pyx_v_f_x_low), (&__pyx_v_f_x_high), __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, 1, 1, 2, 1, 1, 1, 1) == 1); + __pyx_t_8 = (((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_x_low, __pyx_t_1, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_e_low, __pyx_v_e_high, (&__pyx_v_e_x_low), (&__pyx_v_e_x_high), (&__pyx_v_f_x_low), (&__pyx_v_f_x_high), __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, 1, 1, 2, 1, 1, 1, 1) == 1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_9) { + if (__pyx_t_8) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1823 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1829 * 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 # <<<<<<<<<<<<<< @@ -57240,8 +57449,8 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj if (!__pyx_t_7) { __pyx_t_18 = ((__pyx_v_f_links_low[__pyx_v_f_x_low]) != -1); if (__pyx_t_18) { - __pyx_t_8 = ((__pyx_v_f_links_low[(__pyx_v_f_x_high - 1)]) != -1); - __pyx_t_19 = __pyx_t_8; + __pyx_t_9 = ((__pyx_v_f_links_low[(__pyx_v_f_x_high - 1)]) != -1); + __pyx_t_19 = __pyx_t_9; } else { __pyx_t_19 = __pyx_t_18; } @@ -57251,17 +57460,17 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if (__pyx_t_18) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1824 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1830 * 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 = 1824; __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 = 1830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1828 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1834 * -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, # <<<<<<<<<<<<<< @@ -57272,17 +57481,17 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1830 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1836 * 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 = 1830; __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 = 1836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1835 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1841 * 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, # <<<<<<<<<<<<<< @@ -57301,15 +57510,15 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_t_18 = __pyx_t_19; } else { - __pyx_t_18 = __pyx_t_9; + __pyx_t_18 = __pyx_t_8; } - __pyx_t_9 = __pyx_t_18; + __pyx_t_8 = __pyx_t_18; } else { - __pyx_t_9 = __pyx_v_met_constraints; + __pyx_t_8 = __pyx_v_met_constraints; } - if (__pyx_t_9) { + if (__pyx_t_8) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1837 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1843 * self.train_max_initial_size, self.train_max_initial_size, * 0, 0, 0, 0, 0, 0, 0)): * fphr_arr._clear() # <<<<<<<<<<<<<< @@ -57318,7 +57527,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_clear(__pyx_v_fphr_arr); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1838 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1844 * 0, 0, 0, 0, 0, 0, 0)): * fphr_arr._clear() * i = 1 # <<<<<<<<<<<<<< @@ -57327,35 +57536,35 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_i = 1; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1839 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1845 * 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 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1845; __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 = 1839; __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 = 1845; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1840 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1846 * 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_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1846; __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 = 1840; __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 = 1846; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1841 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1847 * self.findexes.reset() * self.findexes.append(sym_setindex(self.category, i)) * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -57364,7 +57573,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1842 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1848 * self.findexes.append(sym_setindex(self.category, i)) * fphr_arr._append(sym_setindex(self.category, i)) * i = i+1 # <<<<<<<<<<<<<< @@ -57373,27 +57582,27 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_v_i = (__pyx_v_i + 1); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1843 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1849 * 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 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1849; __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 = 1843; __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 = 1849; __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 = 1843; __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 = 1849; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1844 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1850 * i = i+1 * self.findexes.extend(self.findexes1) * for j from 0 <= j < phrase.n: # <<<<<<<<<<<<<< @@ -57403,7 +57612,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_3 = __pyx_v_phrase->n; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_3; __pyx_v_j++) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1845 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1851 * self.findexes.extend(self.findexes1) * for j from 0 <= j < phrase.n: * if sym_isvar(phrase.syms[j]): # <<<<<<<<<<<<<< @@ -57413,7 +57622,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_t_4 = __pyx_f_3_sa_sym_isvar((__pyx_v_phrase->syms[__pyx_v_j])); if (__pyx_t_4) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1846 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1852 * for j from 0 <= j < phrase.n: * if sym_isvar(phrase.syms[j]): * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -57422,7 +57631,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1847 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1853 * if sym_isvar(phrase.syms[j]): * fphr_arr._append(sym_setindex(self.category, i)) * i = i + 1 # <<<<<<<<<<<<<< @@ -57434,7 +57643,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1849 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1855 * i = i + 1 * else: * fphr_arr._append(phrase.syms[j]) # <<<<<<<<<<<<<< @@ -57446,7 +57655,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_L106:; } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1850 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1856 * else: * fphr_arr._append(phrase.syms[j]) * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< @@ -57455,81 +57664,81 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1851 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1857 * 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_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1851; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1857; __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 = 1851; __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 = 1857; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1852 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1858 * 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 = 1852; __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_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_3_sa_Phrase)), ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_fphr)); __pyx_v_fphr = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_14); __pyx_t_14 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1855 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1861 * 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_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 = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->extract_phrases(__pyx_v_self, __pyx_v_e_x_low, __pyx_v_e_x_high, __pyx_v_e_gap_low, __pyx_v_e_gap_high, __pyx_v_e_links_low, (__pyx_v_num_gaps + 2), __pyx_v_f_x_low, __pyx_v_f_x_high, __pyx_v_f_gap_low, __pyx_v_f_gap_high, __pyx_v_f_links_low, __pyx_v_matching->sent_id, __pyx_v_e_sent_len, __pyx_v_e_sent_start); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); __Pyx_XDECREF(__pyx_v_phrase_list); __pyx_v_phrase_list = __pyx_t_14; __pyx_t_14 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1856 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1862 * 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 = 1856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_9 = (__pyx_t_13 > 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 = 1862; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = (__pyx_t_13 > 0); + if (__pyx_t_8) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1857 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1863 * 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 = 1857; __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 = 1863; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(__pyx_t_13 == 0)) { PyErr_Format(PyExc_ZeroDivisionError, "float division"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1857; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1863; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_v_pair_count = (1.0 / __pyx_t_13); goto __pyx_L107; } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1859 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1865 * pair_count = 1.0 / len(phrase_list) * else: * pair_count = 0 # <<<<<<<<<<<<<< @@ -57540,7 +57749,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } __pyx_L107:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1860 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1866 * else: * pair_count = 0 * for phrase2, eindexes in phrase_list: # <<<<<<<<<<<<<< @@ -57551,23 +57760,31 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __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 = 1860; __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 = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); __pyx_t_16 = Py_TYPE(__pyx_t_14)->tp_iternext; } for (;;) { if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_14)) { if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_14)) break; - __pyx_t_15 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_15); __pyx_t_13++; + #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 = 1866; __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 = 1866; __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; - __pyx_t_15 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_15); __pyx_t_13++; + #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 = 1866; __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 = 1866; __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 = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -57575,29 +57792,35 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } if ((likely(PyTuple_CheckExact(__pyx_t_15))) || (PyList_CheckExact(__pyx_t_15))) { PyObject* sequence = __pyx_t_15; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { - if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { - if (unlikely(PyList_GET_SIZE(sequence) != 2)) { - if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); + #else + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - } else { + } else + { Py_ssize_t index = -1; - __pyx_t_10 = PyObject_GetIter(__pyx_t_15); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1860; __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 = 1866; __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; @@ -57605,14 +57828,15 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_17(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L110_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1860; __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 = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L111_unpacking_done; __pyx_L110_unpacking_failed:; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L111_unpacking_done:; } __Pyx_XDECREF(__pyx_v_phrase2); @@ -57622,7 +57846,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __pyx_v_eindexes = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1861 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1867 * pair_count = 0 * for phrase2, eindexes in phrase_list: * als4 = self.create_alignments(sent_links,num_links,self.findexes,eindexes) # <<<<<<<<<<<<<< @@ -57631,31 +57855,31 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ __pyx_t_15 = ((PyObject *)__pyx_v_self->findexes); __Pyx_INCREF(__pyx_t_15); - __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, __pyx_t_15, __pyx_v_eindexes)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1861; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, __pyx_t_15, __pyx_v_eindexes)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1867; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(((PyObject *)__pyx_v_als4)); __pyx_v_als4 = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1862 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1868 * 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_2 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1862; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1868; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 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 = 1868; __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 = 1862; __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 = 1868; __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 = 1862; __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 = 1868; __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)); @@ -57669,7 +57893,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj __Pyx_GIVEREF(__pyx_t_1); __pyx_t_2 = 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 = 1862; __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 = 1868; __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; @@ -57691,23 +57915,23 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1864 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1870 * 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_134)); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_135)); __Pyx_DECREF(__pyx_v_reason_for_failure); - __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_134); + __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_135); } __pyx_L34:; goto __pyx_L33; } __pyx_L33:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1866 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1872 * reason_for_failure = "Unable to extract basic phrase" * * free(sent_links) # <<<<<<<<<<<<<< @@ -57716,7 +57940,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ free(__pyx_v_sent_links); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1867 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1873 * * free(sent_links) * free(f_links_low) # <<<<<<<<<<<<<< @@ -57725,7 +57949,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ free(__pyx_v_f_links_low); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1868 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1874 * free(sent_links) * free(f_links_low) * free(f_links_high) # <<<<<<<<<<<<<< @@ -57734,7 +57958,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ free(__pyx_v_f_links_high); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1869 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1875 * free(f_links_low) * free(f_links_high) * free(e_links_low) # <<<<<<<<<<<<<< @@ -57743,7 +57967,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ free(__pyx_v_e_links_low); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1870 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1876 * free(f_links_high) * free(e_links_low) * free(e_links_high) # <<<<<<<<<<<<<< @@ -57752,7 +57976,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ free(__pyx_v_e_links_high); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1871 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1877 * free(e_links_low) * free(e_links_high) * free(f_gap_low) # <<<<<<<<<<<<<< @@ -57761,7 +57985,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ free(__pyx_v_f_gap_low); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1872 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1878 * free(e_links_high) * free(f_gap_low) * free(f_gap_high) # <<<<<<<<<<<<<< @@ -57770,7 +57994,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ free(__pyx_v_f_gap_high); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1873 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1879 * free(f_gap_low) * free(f_gap_high) * free(e_gap_low) # <<<<<<<<<<<<<< @@ -57779,7 +58003,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ free(__pyx_v_e_gap_low); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1874 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1880 * free(f_gap_high) * free(e_gap_low) * free(e_gap_high) # <<<<<<<<<<<<<< @@ -57788,7 +58012,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj */ free(__pyx_v_e_gap_high); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1876 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1882 * free(e_gap_high) * * return extracts # <<<<<<<<<<<<<< @@ -57836,11 +58060,11 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_26add_instance(PyObject PyObject *__pyx_v_f_words = 0; PyObject *__pyx_v_e_words = 0; PyObject *__pyx_v_alignment = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__f_words,&__pyx_n_s__e_words,&__pyx_n_s__alignment,0}; PyObject *__pyx_r = 0; __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,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -57855,24 +58079,21 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_26add_instance(PyObject kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f_words); - if (likely(values[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: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e_words); - if (likely(values[1])) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e_words)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("add_instance", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1884; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("add_instance", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1890; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: - values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__alignment); - if (likely(values[2])) kw_args--; + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__alignment)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("add_instance", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1884; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("add_instance", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1890; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_instance") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1884; __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 = 1890; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -57887,7 +58108,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_26add_instance(PyObject } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("add_instance", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1884; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("add_instance", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1890; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.add_instance", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -57911,12 +58132,11 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_12add_instance_1extract PyObject *__pyx_v_links = 0; PyObject *__pyx_v_nt = 0; PyObject *__pyx_v_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 *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("extract (wrapper)", 0); - __pyx_self = __pyx_self; { + 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; @@ -57937,60 +58157,51 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_12add_instance_1extract kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f_i); - if (likely(values[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: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f_j); - if (likely(values[1])) 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 = 1918; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: - values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e_i); - if (likely(values[2])) 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 = 1918; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: - values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e_j); - if (likely(values[3])) 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 = 1918; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: - values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__min_bound); - if (likely(values[4])) 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 = 1918; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 4); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: - values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__wc); - if (likely(values[5])) 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 = 1918; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 5); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 6: - values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__links); - if (likely(values[6])) 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 = 1918; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 6); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 7: - values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nt); - if (likely(values[7])) 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 = 1918; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 7); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 8: - values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nt_open); - if (likely(values[8])) 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 = 1918; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 8); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1924; __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 = 1918; __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 = 1924; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 9) { goto __pyx_L5_argtuple_error; @@ -58017,7 +58228,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_12add_instance_1extract } 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 = 1918; __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 = 1924; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.add_instance.extract", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -58028,7 +58239,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_12add_instance_1extract return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1918 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1924 * # 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): # <<<<<<<<<<<<<< @@ -58074,35 +58285,33 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __pyx_outer_scope = (struct __pyx_obj_3_sa___pyx_scope_struct_21_add_instance *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1920 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1926 * 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 = 1920; __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 = 1920; __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 = 1926; __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 = 1926; __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); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __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 = 1926; __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 = 1920; __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 = 1926; __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 = 1920; __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 = 1926; __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 = 1920; __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 = 1926; __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 = 1920; __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 = 1920; __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 = 1926; __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 = 1926; __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); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __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 = 1926; __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 = 1920; __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 = 1926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = __pyx_t_5; } else { @@ -58110,7 +58319,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } if (__pyx_t_6) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1921 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1927 * # Phrase extraction limits * if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size: * return # <<<<<<<<<<<<<< @@ -58124,42 +58333,41 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1923 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1929 * 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 = 1923; __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 = 1923; __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 = 1929; __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 = 1929; __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 = 1923; __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 = 1929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = (!__pyx_t_6); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1925 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1931 * 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 = 1925; __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 = 1931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_3) { - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1931; __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); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 2, sizeof(long), PyInt_FromLong); 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_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 = 1925; __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 = 1931; __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); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __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 = 1931; __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 = 1925; __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 = 1931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = __pyx_t_6; } else { @@ -58167,38 +58375,38 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } if (__pyx_t_5) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1926 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1932 * # 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); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1932; __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); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1926; __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); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1932; __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 = 1926; __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 = 1932; __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) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1926; __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) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1932; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1927 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1933 * 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 */ - if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1927; __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 = 1927; __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 = 1933; __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 = 1933; __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 = 1927; __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 = 1933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_New(9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1933; __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); @@ -58227,49 +58435,48 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __Pyx_GIVEREF(__pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_4), NULL); 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_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1928 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1934 * 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_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = 2; - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, __pyx_t_7, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, __pyx_t_7, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__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_1 = PyNumber_InPlaceSubtract(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_t_4, __pyx_int_1); 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; - if (__Pyx_SetItemInt(__pyx_t_2, __pyx_t_7, __pyx_t_1, sizeof(Py_ssize_t), PyInt_FromSsize_t) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetItemInt(__pyx_t_2, __pyx_t_7, __pyx_t_1, sizeof(Py_ssize_t), PyInt_FromSsize_t) < 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_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L5; } __pyx_L5:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1931 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1937 * # 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 = 1931; __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 = 1937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = (!__pyx_t_5); 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 = 1931; __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 = 1937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_RichCompare(__pyx_v_wc, __pyx_t_2, Py_LT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __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 = 1937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1931; __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 = 1937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __pyx_t_5; } else { @@ -58277,21 +58484,21 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } if (__pyx_t_6) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1932 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1938 * # 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 */ - if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1932; __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 = 1932; __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 = 1938; __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 = 1938; __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 = 1932; __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 = 1938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1932; __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 = 1938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = PyTuple_New(9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyTuple_New(9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1938; __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); @@ -58320,7 +58527,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -58328,7 +58535,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } __pyx_L6:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1933 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1939 * 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 # <<<<<<<<<<<<<< @@ -58342,38 +58549,38 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } __pyx_L4:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1935 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1941 * 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 = 1935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_4 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fe_span, __pyx_v_f_j); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1935; __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 = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fe_span, __pyx_v_f_j); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1941; __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); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 0, sizeof(long), PyInt_FromLong); 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_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_link_i = __pyx_t_8; __pyx_t_8 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1936 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1942 * # 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) */ - __pyx_t_8 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fe_span, __pyx_v_f_j); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fe_span, __pyx_v_f_j); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1942; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_8, 1, sizeof(long), PyInt_FromLong); 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_8, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1942; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_link_j = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1937 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1943 * link_i = fe_span[f_j][0] * link_j = fe_span[f_j][1] * new_e_i = min(link_i, e_i) # <<<<<<<<<<<<<< @@ -58384,9 +58591,8 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __pyx_t_4 = __pyx_v_e_i; __Pyx_INCREF(__pyx_v_link_i); __pyx_t_8 = __pyx_v_link_i; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_8, Py_LT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_8, Py_LT); __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_4); @@ -58401,7 +58607,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __pyx_v_new_e_i = __pyx_t_2; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1938 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1944 * link_j = fe_span[f_j][1] * new_e_i = min(link_i, e_i) * new_e_j = max(link_j, e_j) # <<<<<<<<<<<<<< @@ -58412,9 +58618,8 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __pyx_t_2 = __pyx_v_e_j; __Pyx_INCREF(__pyx_v_link_j); __pyx_t_4 = __pyx_v_link_j; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_GT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1944; __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 = 1944; __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); @@ -58429,7 +58634,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __pyx_v_new_e_j = __pyx_t_8; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1941 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1947 * # 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 # <<<<<<<<<<<<<< @@ -58439,56 +58644,54 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __Pyx_INCREF(__pyx_v_min_bound); __pyx_v_new_min_bound = __pyx_v_min_bound; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1943 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1949 * 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); if (unlikely(!__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_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1943; __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 = 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) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1944 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1950 * # 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 = 1944; __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 = 1944; __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 = 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; __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 = 1944; __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(__pyx_v_i); __pyx_v_i = __pyx_t_8; __pyx_t_8 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1945 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1951 * 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 = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_8 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_i); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1945; __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;} } + __pyx_t_8 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_i); 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_2 = __Pyx_GetItemInt(__pyx_t_8, 0, sizeof(long), PyInt_FromLong); 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); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1951; __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); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); + __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 = 1951; __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 = 1945; __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 = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_6) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1946 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1952 * for i from new_e_i <= i <= new_e_j: * if ef_span[i][0] < f_i: * return # <<<<<<<<<<<<<< @@ -58502,23 +58705,22 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } __pyx_L10:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1947 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1953 * 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: */ - __pyx_t_8 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_i); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_i); 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_2 = __Pyx_GetItemInt(__pyx_t_8, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1953; __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); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __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_2, __pyx_t_8, 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_2); @@ -58533,17 +58735,17 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __Pyx_DECREF(__pyx_v_new_min_bound); __pyx_v_new_min_bound = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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 = 1944; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1944 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1950 * # 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_4 = PyInt_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1944; __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(__pyx_v_i); __pyx_v_i = __pyx_t_4; @@ -58552,43 +58754,42 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } /*else*/ { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1950 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1956 * # 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 = 1950; __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 = 1950; __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 = 1956; __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 = 1956; __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_4 = PyInt_FromLong(__pyx_t_9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1950; __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 = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF(__pyx_v_i); __pyx_v_i = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1951 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1957 * 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 = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_4 = PyObject_GetItem(__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;} + 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;} } + __pyx_t_4 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_i); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_v_f_i, Py_LT); if (unlikely(!__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_4 = PyObject_RichCompare(__pyx_t_2, __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_2); __pyx_t_2 = 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_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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1952 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1958 * for i from new_e_i <= i < e_i: * if ef_span[i][0] < f_i: * return # <<<<<<<<<<<<<< @@ -58602,23 +58803,22 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } __pyx_L13:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1953 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1959 * 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: */ - __pyx_t_4 = PyObject_GetItem(__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 (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __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_2, __pyx_t_4, Py_GT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __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_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1959; __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 = 1959; __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); @@ -58633,59 +58833,58 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __Pyx_DECREF(__pyx_v_new_min_bound); __pyx_v_new_min_bound = __pyx_t_8; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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 = 1950; __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 = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1950 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1956 * # 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_8 = PyInt_FromLong(__pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyInt_FromLong(__pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF(__pyx_v_i); __pyx_v_i = __pyx_t_8; __pyx_t_8 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1954 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1960 * 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 = 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_e_j); 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_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 = 1960; __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_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 = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF(__pyx_v_i); __pyx_v_i = __pyx_t_8; __pyx_t_8 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1955 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1961 * 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 = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_8 = PyObject_GetItem(__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;} + 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;} } + __pyx_t_8 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_i); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1961; __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); 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); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1961; __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); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); + __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 = 1961; __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 = 1961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_6) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1956 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1962 * for i from e_j < i <= new_e_j: * if ef_span[i][0] < f_i: * return # <<<<<<<<<<<<<< @@ -58699,23 +58898,22 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } __pyx_L16:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1957 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1963 * 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: */ - __pyx_t_8 = PyObject_GetItem(__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(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_i); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1963; __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); 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); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1963; __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); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __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 = 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_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_2); @@ -58730,17 +58928,17 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __Pyx_DECREF(__pyx_v_new_min_bound); __pyx_v_new_min_bound = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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 = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1954 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1960 * 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_4 = PyInt_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1954; __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 = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF(__pyx_v_i); __pyx_v_i = __pyx_t_4; @@ -58748,18 +58946,18 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } __pyx_L7:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1959 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1965 * 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 = 1959; __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 = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = (!__pyx_t_6); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1960 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1966 * # Extract, extend with word (unless non-terminal open) * if not nt_open: * nt_collision = False # <<<<<<<<<<<<<< @@ -58768,20 +58966,20 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( */ __pyx_v_nt_collision = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1961 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1967 * if not nt_open: * nt_collision = False * for link in al[f_j]: # <<<<<<<<<<<<<< * if e_nt_cover[link]: * nt_collision = True */ - __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 = 1961; __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 = 1967; __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_2 = __pyx_t_4; __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_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); 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_t_12 = Py_TYPE(__pyx_t_2)->tp_iternext; } @@ -58789,16 +58987,24 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( for (;;) { if (!__pyx_t_12 && PyList_CheckExact(__pyx_t_2)) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break; - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1967; __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; - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else { __pyx_t_4 = __pyx_t_12(__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 = 1961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -58808,21 +59014,21 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __pyx_v_link = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1962 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1968 * 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 = 1962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_4 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_e_nt_cover, __pyx_v_link); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1962; __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 = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_e_nt_cover, __pyx_v_link); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1962; __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 = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1963 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1969 * for link in al[f_j]: * if e_nt_cover[link]: * nt_collision = True # <<<<<<<<<<<<<< @@ -58836,7 +59042,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1966 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1972 * # 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: # <<<<<<<<<<<<<< @@ -58845,12 +59051,11 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( */ __pyx_t_3 = (!__pyx_v_nt_collision); 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 = 1966; __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 = 1972; __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); if (unlikely(!__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_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 = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1966; __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 = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = __pyx_t_6; } else { @@ -58858,32 +59063,32 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } if (__pyx_t_5) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1967 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1973 * # 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_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1967; __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 = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_v_plus_links = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1968 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1974 * 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_4 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_j); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __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 = 1974; __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_2 = __pyx_t_4; __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_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_12 = Py_TYPE(__pyx_t_2)->tp_iternext; } @@ -58891,16 +59096,24 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( for (;;) { if (!__pyx_t_12 && PyList_CheckExact(__pyx_t_2)) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break; - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1974; __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; - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else { __pyx_t_4 = __pyx_t_12(__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 = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -58910,14 +59123,14 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __pyx_v_link = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1969 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1975 * plus_links = [] * for link in al[f_j]: * plus_links.append((f_j, link)) # <<<<<<<<<<<<<< * cover[link] += 1 * links.append(plus_links) */ - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1969; __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 = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_f_j); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_f_j); @@ -58925,10 +59138,10 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __Pyx_INCREF(__pyx_v_link); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_link); __Pyx_GIVEREF(__pyx_v_link); - __pyx_t_13 = PyList_Append(__pyx_v_plus_links, ((PyObject *)__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_t_13 = PyList_Append(__pyx_v_plus_links, ((PyObject *)__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(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1970 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1976 * for link in al[f_j]: * plus_links.append((f_j, link)) * cover[link] += 1 # <<<<<<<<<<<<<< @@ -58937,42 +59150,41 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( */ __Pyx_INCREF(__pyx_v_link); __pyx_t_4 = __pyx_v_link; - if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_8 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_cover, __pyx_t_4); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1970; __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 = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_8 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_cover, __pyx_t_4); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_8, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_8, __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); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - if (PyObject_SetItem(__pyx_cur_scope->__pyx_v_cover, __pyx_t_4, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1970; __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 = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (PyObject_SetItem(__pyx_cur_scope->__pyx_v_cover, __pyx_t_4, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1976; __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_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1971 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1977 * 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 = 1971; __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 = 1977; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1972 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1978 * 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 = 1972; __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 = 1978; __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); 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_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __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 = 1978; __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 = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_6 = __pyx_t_3; } else { @@ -58980,35 +59192,35 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } if (__pyx_t_6) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1973 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1979 * 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 = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_2 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_rules, __pyx_n_s__add); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __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 = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_rules, __pyx_n_s__add); if (unlikely(!__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 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__form_rule); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__form_rule); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - if (unlikely(!__pyx_cur_scope->__pyx_v_f_words)) { __Pyx_RaiseClosureNameError("f_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_f_i); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __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 = 1973; __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 = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_f_i); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __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 = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PySequence_GetSlice(__pyx_cur_scope->__pyx_v_f_words, __pyx_t_7, __pyx_t_14); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PySequence_GetSlice(__pyx_cur_scope->__pyx_v_f_words, __pyx_t_7, __pyx_t_14); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (unlikely(!__pyx_cur_scope->__pyx_v_e_words)) { __Pyx_RaiseClosureNameError("e_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_v_new_e_i); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __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 = 1973; __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 = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_v_new_e_i); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __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 = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__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_t_8 = __Pyx_PySequence_GetSlice(__pyx_cur_scope->__pyx_v_e_words, __pyx_t_14, __pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PySequence_GetSlice(__pyx_cur_scope->__pyx_v_e_words, __pyx_t_14, __pyx_t_7); 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_t_15 = PyTuple_New(6); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyTuple_New(6); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_INCREF(__pyx_v_f_i); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_f_i); @@ -59028,16 +59240,16 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __Pyx_GIVEREF(__pyx_v_links); __pyx_t_1 = 0; __pyx_t_8 = 0; - __pyx_t_8 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_15), NULL); 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; __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0; - __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __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 = 1979; __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 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_15), NULL); 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_2); __pyx_t_2 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0; @@ -59046,21 +59258,21 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } __pyx_L24:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1974 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1980 * 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]: */ - if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1974; __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 = 1974; __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 = 1980; __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 = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_15 = PyNumber_Add(__pyx_v_wc, __pyx_int_1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyNumber_Add(__pyx_v_wc, __pyx_int_1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1974; __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 = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_New(9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(9); 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_INCREF(__pyx_v_f_i); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_f_i); @@ -59089,36 +59301,36 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __pyx_t_8 = 0; __pyx_t_15 = 0; __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_4), NULL); 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); __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1975 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1981 * 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_2 = __Pyx_PyObject_Pop(__pyx_v_links); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Pop(__pyx_v_links); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1976 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1982 * 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_2 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_j); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_j); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1982; __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_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0; __pyx_t_12 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_12 = Py_TYPE(__pyx_t_4)->tp_iternext; } @@ -59126,16 +59338,24 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( for (;;) { if (!__pyx_t_12 && PyList_CheckExact(__pyx_t_4)) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_4)) break; - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else if (!__pyx_t_12 && PyTuple_CheckExact(__pyx_t_4)) { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_4)) break; - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else { __pyx_t_2 = __pyx_t_12(__pyx_t_4); if (unlikely(!__pyx_t_2)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -59145,7 +59365,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __pyx_v_link = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1977 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1983 * links.pop() * for link in al[f_j]: * cover[link] -= 1 # <<<<<<<<<<<<<< @@ -59154,14 +59374,14 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( */ __Pyx_INCREF(__pyx_v_link); __pyx_t_2 = __pyx_v_link; - if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1977; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_15 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_cover, __pyx_t_2); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1977; __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 = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_15 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_cover, __pyx_t_2); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - __pyx_t_8 = PyNumber_InPlaceSubtract(__pyx_t_15, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1977; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyNumber_InPlaceSubtract(__pyx_t_15, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1977; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - if (PyObject_SetItem(__pyx_cur_scope->__pyx_v_cover, __pyx_t_2, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1977; __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 = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (PyObject_SetItem(__pyx_cur_scope->__pyx_v_cover, __pyx_t_2, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __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; } @@ -59173,27 +59393,26 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } __pyx_L17:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1979 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1985 * 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 = 1979; __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 = 1985; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_6) { - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1985; __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); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1985; __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 = 1979; __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 = 1985; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_EQ); 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_t_8 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__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_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 = 1979; __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 = 1985; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_3 = __pyx_t_5; } else { @@ -59201,71 +59420,70 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1981 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1987 * 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_8 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_4 = __Pyx_PySequence_GetSlice(__pyx_t_8, 0, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PySequence_GetSlice(__pyx_t_8, 0, PY_SSIZE_T_MAX); 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_8); __pyx_t_8 = 0; __pyx_v_old_last_nt = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1982 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1988 * # 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_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_SetItemInt(__pyx_t_4, 2, __pyx_v_f_j, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetItemInt(__pyx_t_4, 2, __pyx_v_f_j, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1983 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1989 * 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_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1989; __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); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1989; __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_v_link_i, __pyx_t_8, Py_LT); 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_4 = PyObject_RichCompare(__pyx_v_link_i, __pyx_t_8, Py_LT); __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_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 = 1983; __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 = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1984 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1990 * 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_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_check); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_check); 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); - if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __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 = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1990; __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); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 3, sizeof(long), PyInt_FromLong); 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_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 = 1984; __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 = 1990; __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 = 1984; __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(__pyx_cur_scope->__pyx_v_cover); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_cover); @@ -59276,25 +59494,25 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( 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 = 1984; __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 = 1990; __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_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __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 = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_6 = (!__pyx_t_3); if (__pyx_t_6) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1985 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1991 * 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) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1985; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetItemInt(__pyx_v_nt, -1, __pyx_v_old_last_nt, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1986 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1992 * if not span_check(cover, link_i, nt[-1][3] - 1): * nt[-1] = old_last_nt * return # <<<<<<<<<<<<<< @@ -59308,24 +59526,24 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } __pyx_L29:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1987 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1993 * 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_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_inc); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_inc); 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_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __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); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __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 = 1987; __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 = 1993; __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 = 1987; __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 = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_cover); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_cover); @@ -59336,31 +59554,31 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( 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_8, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __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 = 1993; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1988 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1994 * 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_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_inc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_inc); 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_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1988; __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 = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__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_GetItemInt(__pyx_t_4, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 3, sizeof(long), PyInt_FromLong); if (!__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 = PyNumber_Subtract(__pyx_t_8, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1988; __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 = 1994; __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 = 1988; __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 = 1994; __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); @@ -59371,65 +59589,64 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( 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 = 1988; __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 = 1994; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1989 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1995 * 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_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_SetItemInt(__pyx_t_4, 3, __pyx_v_link_i, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetItemInt(__pyx_t_4, 3, __pyx_v_link_i, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L28; } __pyx_L28:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1990 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1996 * 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_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1996; __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); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1996; __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_v_link_j, __pyx_t_8, Py_GT); 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_4 = PyObject_RichCompare(__pyx_v_link_j, __pyx_t_8, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1996; __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 = 1990; __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 = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1991 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1997 * 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_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_check); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_check); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __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 = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1991; __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 = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __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); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 4, sizeof(long), PyInt_FromLong); 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_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 = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_int_1); 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_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 = 1991; __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 = 1997; __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); @@ -59440,25 +59657,25 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_link_j); __Pyx_GIVEREF(__pyx_v_link_j); __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 = 1991; __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 = 1997; __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_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1991; __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 = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_3 = (!__pyx_t_6); if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1992 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1998 * 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) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetItemInt(__pyx_v_nt, -1, __pyx_v_old_last_nt, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1993 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1999 * if not span_check(cover, nt[-1][4] + 1, link_j): * nt[-1] = old_last_nt * return # <<<<<<<<<<<<<< @@ -59472,24 +59689,24 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } __pyx_L31:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1994 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2000 * 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_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_inc); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_inc); 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_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); 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_t_4 = __Pyx_GetItemInt(__pyx_t_2, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 4, sizeof(long), PyInt_FromLong); if (!__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_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 = 1994; __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 = 2000; __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 = 1994; __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 = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_cover); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_cover); @@ -59500,31 +59717,31 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( 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 = 1994; __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 = 2000; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1995 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2001 * 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_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_inc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_inc); 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); - if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1995; __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 = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); 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_t_8 = __Pyx_GetItemInt(__pyx_t_4, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 4, sizeof(long), PyInt_FromLong); if (!__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_t_4 = PyNumber_Add(__pyx_t_8, __pyx_int_1); 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_t_8, __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); __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 = 1995; __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 = 2001; __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); @@ -59535,39 +59752,38 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( 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 = 1995; __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 = 2001; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1996 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2002 * 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_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_SetItemInt(__pyx_t_4, 4, __pyx_v_link_j, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetItemInt(__pyx_t_4, 4, __pyx_v_link_j, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L30; } __pyx_L30:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1997 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2003 * 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 = 1997; __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 = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_3) { - __pyx_t_4 = PyObject_RichCompare(__pyx_v_f_j, __pyx_v_new_min_bound, Py_GE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __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 = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_f_j, __pyx_v_new_min_bound, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2003; __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 = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = __pyx_t_6; } else { @@ -59575,35 +59791,35 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } if (__pyx_t_5) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1998 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2004 * 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 = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_4 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_rules, __pyx_n_s__add); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __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 = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_rules, __pyx_n_s__add); 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_t_8 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__form_rule); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__form_rule); 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_f_words)) { __Pyx_RaiseClosureNameError("f_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_f_i); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __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 = 1998; __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 = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_f_i); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __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 = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PySequence_GetSlice(__pyx_cur_scope->__pyx_v_f_words, __pyx_t_7, __pyx_t_14); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PySequence_GetSlice(__pyx_cur_scope->__pyx_v_f_words, __pyx_t_7, __pyx_t_14); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (unlikely(!__pyx_cur_scope->__pyx_v_e_words)) { __Pyx_RaiseClosureNameError("e_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_v_new_e_i); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_15 = PyNumber_Add(__pyx_v_new_e_j, __pyx_int_1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __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 = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_v_new_e_i); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyNumber_Add(__pyx_v_new_e_j, __pyx_int_1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_15); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_15); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = __Pyx_PySequence_GetSlice(__pyx_cur_scope->__pyx_v_e_words, __pyx_t_14, __pyx_t_7); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = __Pyx_PySequence_GetSlice(__pyx_cur_scope->__pyx_v_e_words, __pyx_t_14, __pyx_t_7); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - __pyx_t_1 = PyTuple_New(6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(6); 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_v_f_i); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_f_i); @@ -59623,16 +59839,16 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __Pyx_GIVEREF(__pyx_v_links); __pyx_t_2 = 0; __pyx_t_15 = 0; - __pyx_t_15 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __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 = 1998; __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 = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_15); __Pyx_GIVEREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; @@ -59641,19 +59857,19 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } __pyx_L32:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1999 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2005 * 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]: */ - if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_15 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1999; __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 = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_15 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1999; __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 = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(9); 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); __Pyx_INCREF(__pyx_v_f_i); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_f_i); @@ -59682,58 +59898,57 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __Pyx_GIVEREF(__pyx_t_1); __pyx_t_15 = 0; __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_4), 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(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2000 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2006 * 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) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetItemInt(__pyx_v_nt, -1, __pyx_v_old_last_nt, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2001 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2007 * 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_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); 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_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2007; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 3, sizeof(long), PyInt_FromLong); 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_1, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2007; __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_RichCompare(__pyx_v_link_i, __pyx_t_4, Py_LT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_1 = PyObject_RichCompare(__pyx_v_link_i, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2007; __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 = 2001; __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 = 2007; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2002 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2008 * 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_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_dec); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_dec); 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); - if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("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); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2002; __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 = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_4, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_4, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Subtract(__pyx_t_15, __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_Subtract(__pyx_t_15, __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_15); __pyx_t_15 = 0; - __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2002; __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 = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_cover); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_cur_scope->__pyx_v_cover); @@ -59744,31 +59959,31 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_15), 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_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2003 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2009 * 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_GetName(__pyx_m, __pyx_n_s__span_dec); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_dec); 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 = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2003; __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_15 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_15, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_15, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = PyNumber_Subtract(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyNumber_Subtract(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __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 = 2003; __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 = 2009; __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); @@ -59779,7 +59994,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_15); __Pyx_GIVEREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; @@ -59788,44 +60003,43 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } __pyx_L33:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2004 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2010 * 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_15 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_15, 4, sizeof(long), PyInt_FromLong); 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_t_15, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = PyObject_RichCompare(__pyx_v_link_j, __pyx_t_1, Py_GT); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); + __pyx_t_15 = PyObject_RichCompare(__pyx_v_link_j, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_15); if (unlikely(!__pyx_t_15)) {__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_5 = __Pyx_PyObject_IsTrue(__pyx_t_15); 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_t_15); 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_15); __pyx_t_15 = 0; if (__pyx_t_5) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2005 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2011 * 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_15 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_dec); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_dec); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("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, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2005; __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 = 2011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 4, sizeof(long), PyInt_FromLong); 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_1, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __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 = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __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 = 2011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_cover); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_cover); @@ -59836,31 +60050,31 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_link_j); __Pyx_GIVEREF(__pyx_v_link_j); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2011; __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_4)); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2006 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2012 * 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_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_dec); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_dec); 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); - if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2006; __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 = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_4, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_4, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Add(__pyx_t_15, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Add(__pyx_t_15, __pyx_int_1); 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); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2006; __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 = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_e_nt_cover); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_cur_scope->__pyx_v_e_nt_cover); @@ -59871,7 +60085,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_v_link_j); __Pyx_GIVEREF(__pyx_v_link_j); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_15), NULL); 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); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0; @@ -59883,43 +60097,41 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } __pyx_L27:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2008 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2014 * 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 = 2008; __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 = 2014; __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); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_4, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_4, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Subtract(__pyx_v_f_j, __pyx_t_15); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Subtract(__pyx_v_f_j, __pyx_t_15); 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_15); __pyx_t_15 = 0; - __pyx_t_15 = PyObject_RichCompare(__pyx_t_4, __pyx_int_1, Py_GT); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); + __pyx_t_15 = PyObject_RichCompare(__pyx_t_4, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_15); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __pyx_t_6 = __pyx_t_5; } else { __pyx_t_6 = __pyx_t_3; } if (__pyx_t_6) { - __pyx_t_15 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_wc, __pyx_t_15, Py_LT); 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_t_4 = PyObject_RichCompare(__pyx_v_wc, __pyx_t_15, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __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 = 2014; __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 = 2008; __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 = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = (__pyx_t_7 < __pyx_cur_scope->__pyx_v_self->max_nonterminals); __pyx_t_16 = __pyx_t_5; } else { @@ -59931,17 +60143,17 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2010 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2016 * 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_GetName(__pyx_m, __pyx_n_s__span_check); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_check); 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); - if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2010; __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 = 2010; __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 = 2016; __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 = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_cover); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_cur_scope->__pyx_v_cover); @@ -59952,16 +60164,16 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __Pyx_INCREF(__pyx_v_link_j); PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_v_link_j); __Pyx_GIVEREF(__pyx_v_link_j); - __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_15), NULL); 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_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2010; __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 = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = (!__pyx_t_3); if (__pyx_t_6) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2011 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2017 * # Check for collisions * if not span_check(cover, link_i, link_j): * return # <<<<<<<<<<<<<< @@ -59975,16 +60187,16 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } __pyx_L36:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2012 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2018 * 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_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_inc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_inc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __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 = 2018; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_cover); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_cur_scope->__pyx_v_cover); @@ -59995,23 +60207,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __Pyx_INCREF(__pyx_v_link_j); PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_v_link_j); __Pyx_GIVEREF(__pyx_v_link_j); - __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_15), 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_1, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2018; __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_15)); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2013 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2019 * 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_GetName(__pyx_m, __pyx_n_s__span_inc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_inc); 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); - 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_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) {__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 = 2019; __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 = 2019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_e_nt_cover); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_cur_scope->__pyx_v_e_nt_cover); @@ -60022,27 +60234,27 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __Pyx_INCREF(__pyx_v_link_j); PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_v_link_j); __Pyx_GIVEREF(__pyx_v_link_j); - __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_15), NULL); 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); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2014 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2020 * 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 = 2014; __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 = 2020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_6) { - __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_15, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_15, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = __pyx_t_15; @@ -60051,7 +60263,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __Pyx_INCREF(__pyx_int_1); __pyx_t_1 = __pyx_int_1; } - __pyx_t_15 = PyList_New(5); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyList_New(5); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); PyList_SET_ITEM(__pyx_t_15, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -60068,23 +60280,22 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( PyList_SET_ITEM(__pyx_t_15, 4, __pyx_v_link_j); __Pyx_GIVEREF(__pyx_v_link_j); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Append(__pyx_v_nt, ((PyObject *)__pyx_t_15)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Append(__pyx_v_nt, ((PyObject *)__pyx_t_15)); 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(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2016 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2022 * 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 = 2016; __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 = 2022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_6) { - __pyx_t_1 = PyObject_RichCompare(__pyx_v_f_j, __pyx_v_new_min_bound, Py_GE); 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_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 2022; __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 = 2022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_16 = __pyx_t_3; } else { @@ -60092,35 +60303,35 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } if (__pyx_t_16) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2017 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2023 * # 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 = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_1 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_rules, __pyx_n_s__add); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2017; __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 = 2023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_rules, __pyx_n_s__add); 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_t_15 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__form_rule); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__form_rule); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - if (unlikely(!__pyx_cur_scope->__pyx_v_f_words)) { __Pyx_RaiseClosureNameError("f_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_f_i); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2017; __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 = 2017; __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 = 2023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_f_i); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2023; __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 = 2023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PySequence_GetSlice(__pyx_cur_scope->__pyx_v_f_words, __pyx_t_7, __pyx_t_14); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PySequence_GetSlice(__pyx_cur_scope->__pyx_v_f_words, __pyx_t_7, __pyx_t_14); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - if (unlikely(!__pyx_cur_scope->__pyx_v_e_words)) { __Pyx_RaiseClosureNameError("e_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_v_new_e_i); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2017; __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 = 2017; __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 = 2023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_v_new_e_i); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2023; __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 = 2023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PySequence_GetSlice(__pyx_cur_scope->__pyx_v_e_words, __pyx_t_14, __pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PySequence_GetSlice(__pyx_cur_scope->__pyx_v_e_words, __pyx_t_14, __pyx_t_7); 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_t_2 = PyTuple_New(6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(6); 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(__pyx_v_f_i); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_f_i); @@ -60140,16 +60351,16 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __Pyx_GIVEREF(__pyx_v_links); __pyx_t_4 = 0; __pyx_t_8 = 0; - __pyx_t_8 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_t_2), NULL); 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_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2017; __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 = 2023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); 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_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; @@ -60158,21 +60369,21 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( } __pyx_L37:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2018 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2024 * 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) */ - if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2018; __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 = 2018; __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 = 2024; __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 = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = PyNumber_Add(__pyx_v_wc, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2018; __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 = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2018; __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 = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_15 = PyTuple_New(9); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyTuple_New(9); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_INCREF(__pyx_v_f_i); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_f_i); @@ -60201,32 +60412,32 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __pyx_t_8 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_15), NULL); 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_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2019 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2025 * 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_1 = __Pyx_PyObject_Pop(__pyx_v_nt); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Pop(__pyx_v_nt); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2020 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2026 * 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_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_dec); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_dec); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2020; __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 = 2026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_cover); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_cur_scope->__pyx_v_cover); @@ -60237,22 +60448,22 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __Pyx_INCREF(__pyx_v_link_j); PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_v_link_j); __Pyx_GIVEREF(__pyx_v_link_j); - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_15), 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_1, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2026; __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_15)); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2021 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2027 * 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_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_dec); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_dec); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2021; __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 = 2027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_e_nt_cover); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_cur_scope->__pyx_v_e_nt_cover); @@ -60263,7 +60474,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( __Pyx_INCREF(__pyx_v_link_j); PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_v_link_j); __Pyx_GIVEREF(__pyx_v_link_j); - __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2027; __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_15)); __pyx_t_15 = 0; @@ -60297,7 +60508,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract( return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1884 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1890 * # Aggregate stats from a training instance * # (Extract rules, update counts) * def add_instance(self, f_words, e_words, alignment): # <<<<<<<<<<<<<< @@ -60358,7 +60569,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_e_words); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e_words); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1886 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1892 * def add_instance(self, f_words, e_words, alignment): * * self.online = True # <<<<<<<<<<<<<< @@ -60367,20 +60578,20 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ */ __pyx_cur_scope->__pyx_v_self->online = 1; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1893 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1899 * # 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 = 1893; __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 = 1899; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1895 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1901 * rules = set() * * f_len = len(f_words) # <<<<<<<<<<<<<< @@ -60389,15 +60600,15 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ */ __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 = 1895; __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 = 1901; __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 = 1895; __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 = 1901; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1896 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1902 * * f_len = len(f_words) * e_len = len(e_words) # <<<<<<<<<<<<<< @@ -60406,35 +60617,35 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ */ __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 = 1896; __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 = 1902; __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 = 1896; __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 = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_e_len = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1899 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1905 * * # 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 = 1899; __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 = 1905; __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 = 1899; __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 = 1905; __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 = 1899; __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 = 1905; __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 = 1899; __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 = 1905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; } @@ -60442,16 +60653,24 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ for (;;) { if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break; - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #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 = 1905; __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 = 1905; __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; - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #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 = 1905; __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 = 1905; __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 = 1899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -60460,9 +60679,9 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __Pyx_XDECREF(__pyx_v_i); __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 = 1899; __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 = 1905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - if (unlikely(PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1905; __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; @@ -60471,28 +60690,28 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __pyx_cur_scope->__pyx_v_al = ((PyObject *)__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1900 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1906 * # 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 = 1900; __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 = 1906; __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 = 1900; __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 = 1906; __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 = 1900; __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 = 1906; __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 = 1900; __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 = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; } @@ -60500,16 +60719,24 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ for (;;) { if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break; - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #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 = 1906; __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 = 1906; __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; - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #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 = 1906; __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 = 1906; __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 = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -60518,9 +60745,9 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __Pyx_XDECREF(__pyx_v_i); __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 = 1900; __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 = 1906; __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 = 1900; __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 = 1906; __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); @@ -60528,7 +60755,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ PyList_SET_ITEM(__pyx_t_6, 1, __pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); __pyx_t_4 = 0; - if (unlikely(PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1906; __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; @@ -60537,28 +60764,28 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __pyx_cur_scope->__pyx_v_fe_span = ((PyObject *)__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1901 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1907 * 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 = 1901; __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 = 1907; __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 = 1901; __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 = 1907; __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 = 1901; __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 = 1907; __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 = 1901; __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 = 1907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; } @@ -60566,16 +60793,24 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ for (;;) { if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break; - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; + #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 = 1907; __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 = 1907; __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; - __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; + #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 = 1907; __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 = 1907; __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 = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -60584,9 +60819,9 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __Pyx_XDECREF(__pyx_v_i); __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 = 1901; __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 = 1907; __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 = 1901; __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 = 1907; __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); @@ -60594,7 +60829,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ PyList_SET_ITEM(__pyx_t_4, 1, __pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); __pyx_t_6 = 0; - if (unlikely(PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1907; __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; @@ -60603,7 +60838,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __pyx_cur_scope->__pyx_v_ef_span = ((PyObject *)__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1902 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1908 * 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: # <<<<<<<<<<<<<< @@ -60614,23 +60849,31 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __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 = 1902; __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 = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; } for (;;) { if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; + #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 = 1908; __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 = 1908; __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; - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; + #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 = 1908; __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 = 1908; __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 = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -60638,29 +60881,35 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ } 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 = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { - if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { - if (unlikely(PyList_GET_SIZE(sequence) != 2)) { - if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } __pyx_t_4 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __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 = 1908; __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 = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #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 = 1902; __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 = 1908; __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; @@ -60668,14 +60917,15 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __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 = 1902; __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 = 1908; __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; __pyx_L11_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L12_unpacking_done:; } __Pyx_XDECREF(__pyx_v_f); @@ -60685,21 +60935,21 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __pyx_v_e = __pyx_t_6; __pyx_t_6 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1903 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1909 * 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 = 1903; __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 = 1909; __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 = 1903; __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 = 1909; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1904 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1910 * for (f, e) in alignment: * al[f].append(e) * fe_span[f][0] = min(fe_span[f][0], e) # <<<<<<<<<<<<<< @@ -60708,14 +60958,13 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ */ __Pyx_INCREF(__pyx_v_e); __pyx_t_6 = __pyx_v_e; - __pyx_t_3 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fe_span, __pyx_v_f); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fe_span, __pyx_v_f); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1910; __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); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1910; __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); 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_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1904; __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 = 1910; __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 = 1910; __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); @@ -60726,13 +60975,13 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __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 (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fe_span, __pyx_v_f); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_SetItemInt(__pyx_t_6, 0, __pyx_t_3, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetItemInt(__pyx_t_6, 0, __pyx_t_3, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1910; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1905 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1911 * al[f].append(e) * fe_span[f][0] = min(fe_span[f][0], e) * fe_span[f][1] = max(fe_span[f][1], e) # <<<<<<<<<<<<<< @@ -60741,14 +60990,13 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ */ __Pyx_INCREF(__pyx_v_e); __pyx_t_3 = __pyx_v_e; - __pyx_t_6 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fe_span, __pyx_v_f); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fe_span, __pyx_v_f); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_GT); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 1911; __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 = 1911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_9) { __Pyx_INCREF(__pyx_t_3); @@ -60759,13 +61007,13 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fe_span, __pyx_v_f); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fe_span, __pyx_v_f); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1911; __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) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetItemInt(__pyx_t_3, 1, __pyx_t_6, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1911; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1906 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1912 * 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) # <<<<<<<<<<<<<< @@ -60774,14 +61022,13 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ */ __Pyx_INCREF(__pyx_v_f); __pyx_t_6 = __pyx_v_f; - __pyx_t_3 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_e); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_e); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1912; __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); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1912; __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); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1906; __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 = 1912; __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 = 1912; __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); @@ -60792,13 +61039,13 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __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 (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_e); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_SetItemInt(__pyx_t_6, 0, __pyx_t_3, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetItemInt(__pyx_t_6, 0, __pyx_t_3, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1912; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1907 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1913 * 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) # <<<<<<<<<<<<<< @@ -60807,14 +61054,13 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ */ __Pyx_INCREF(__pyx_v_f); __pyx_t_3 = __pyx_v_f; - __pyx_t_6 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_e); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_e); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_GT); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 1913; __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 = 1913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_9) { __Pyx_INCREF(__pyx_t_3); @@ -60825,27 +61071,27 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_e); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_e); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1913; __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) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetItemInt(__pyx_t_3, 1, __pyx_t_6, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1913; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1910 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1916 * * # 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 = 1910; __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 = 1916; __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 = 1910; __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 = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_temp); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = __pyx_temp; @@ -60854,19 +61100,19 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __pyx_cur_scope->__pyx_v_cover = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1912 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1918 * 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 = 1912; __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 = 1918; __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 = 1912; __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 = 1918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_temp); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = __pyx_temp; @@ -60874,19 +61120,19 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __pyx_v_f_nt_cover = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1913 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1919 * # 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 = 1913; __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 = 1919; __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 = 1913; __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 = 1919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_temp); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = __pyx_temp; @@ -60895,44 +61141,44 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __pyx_cur_scope->__pyx_v_e_nt_cover = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1918 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1924 * # 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_3_sa_23HieroCachingRuleFactory_12add_instance_1extract, 0, ((PyObject*)__pyx_cur_scope), __pyx_n_s___sa, ((PyObject *)__pyx_k_codeobj_136)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_12add_instance_1extract, 0, ((PyObject*)__pyx_cur_scope), __pyx_n_s___sa, ((PyObject *)__pyx_k_codeobj_137)); 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_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_extract = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2024 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2030 * * # 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 = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 2030; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2026 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2032 * 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); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2026; __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); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2032; __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 = 2026; __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 = 2032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_11 = (!__pyx_t_9); if (__pyx_t_11) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2027 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2033 * # Skip if phrases won't be tight on left side * if not al[f_i]: * continue # <<<<<<<<<<<<<< @@ -60944,28 +61190,28 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ } __pyx_L15:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2028 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2034 * if not al[f_i]: * continue * extract(f_i, f_i, f_len + 1, -1, f_i, 0, [], [], False) # <<<<<<<<<<<<<< * * # Update possible phrases (samples) */ - __pyx_t_1 = PyInt_FromLong(__pyx_v_f_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __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 = 2034; __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 = 2028; __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 = 2034; __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 = 2028; __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 = 2034; __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 = 2028; __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 = 2034; __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 = 2028; __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 = 2034; __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 = 2028; __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 = 2034; __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 = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_13); - __pyx_t_14 = PyTuple_New(9); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyTuple_New(9); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2034; __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); @@ -60994,28 +61240,28 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __pyx_t_7 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; - __pyx_t_13 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_L13_continue:; } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2033 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2039 * # 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): # <<<<<<<<<<<<<< * self.samples_f[f] += 1 * */ - __pyx_t_13 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__get_f_phrases); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__get_f_phrases); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_13); - __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __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 = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f_words); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_cur_scope->__pyx_v_f_words); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f_words); - __pyx_t_12 = PyObject_Call(__pyx_t_13, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyObject_Call(__pyx_t_13, ((PyObject *)__pyx_t_14), NULL); 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_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0; @@ -61023,7 +61269,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __pyx_t_14 = __pyx_t_12; __Pyx_INCREF(__pyx_t_14); __pyx_t_2 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__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_5 = Py_TYPE(__pyx_t_14)->tp_iternext; } @@ -61031,16 +61277,24 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ for (;;) { if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_14)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_14)) break; - __pyx_t_12 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_12); __pyx_t_2++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_12 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_12); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_12 = PySequence_ITEM(__pyx_t_14, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_14)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_14)) break; - __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_12); __pyx_t_2++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_12); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_12 = PySequence_ITEM(__pyx_t_14, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else { __pyx_t_12 = __pyx_t_5(__pyx_t_14); if (unlikely(!__pyx_t_12)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -61048,21 +61302,22 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ } if ((likely(PyTuple_CheckExact(__pyx_t_12))) || (PyList_CheckExact(__pyx_t_12))) { PyObject* sequence = __pyx_t_12; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 3)) { + if (size > 3) __Pyx_RaiseTooManyValuesError(3); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 3)) { - if (PyTuple_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } __pyx_t_13 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); } else { - if (unlikely(PyList_GET_SIZE(sequence) != 3)) { - if (PyList_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } __pyx_t_13 = PyList_GET_ITEM(sequence, 0); __pyx_t_7 = PyList_GET_ITEM(sequence, 1); __pyx_t_4 = PyList_GET_ITEM(sequence, 2); @@ -61070,10 +61325,16 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_13 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - } else { + } 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 = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2039; __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; @@ -61083,14 +61344,15 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __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; __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_3), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __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 = 2039; __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; __pyx_L18_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L19_unpacking_done:; } __Pyx_XDECREF(__pyx_v_f); @@ -61103,7 +61365,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __pyx_v_lex_j = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2034 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2040 * # at the cost of readability * for (f, lex_i, lex_j) in self.get_f_phrases(f_words): * self.samples_f[f] += 1 # <<<<<<<<<<<<<< @@ -61114,19 +61376,19 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __pyx_t_12 = __pyx_cur_scope->__pyx_v_self->samples_f; __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 = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_GetItem(__pyx_t_12, __pyx_t_4); 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_t_13 = PyNumber_InPlaceAdd(__pyx_t_7, __pyx_int_1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = PyNumber_InPlaceAdd(__pyx_t_7, __pyx_int_1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2040; __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_12, __pyx_t_4, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_t_12, __pyx_t_4, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2040; __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_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2037 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2043 * * # Update phrase counts * for rule in rules: # <<<<<<<<<<<<<< @@ -61137,23 +61399,31 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __pyx_t_14 = __pyx_cur_scope->__pyx_v_rules; __Pyx_INCREF(__pyx_t_14); __pyx_t_2 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_rules); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_rules); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); __pyx_t_5 = Py_TYPE(__pyx_t_14)->tp_iternext; } for (;;) { if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_14)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_14)) break; - __pyx_t_12 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_12); __pyx_t_2++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_12 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_12); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_12 = PySequence_ITEM(__pyx_t_14, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_14)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_14)) break; - __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_12); __pyx_t_2++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_12); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_12 = PySequence_ITEM(__pyx_t_14, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else { __pyx_t_12 = __pyx_t_5(__pyx_t_14); if (unlikely(!__pyx_t_12)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -61163,32 +61433,33 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __pyx_v_rule = __pyx_t_12; __pyx_t_12 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2038 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2044 * # Update phrase counts * for rule in rules: * (f_ph, e_ph, al) = rule[:3] # <<<<<<<<<<<<<< * self.phrases_f[f_ph] += 1 * self.phrases_e[e_ph] += 1 */ - __pyx_t_12 = __Pyx_PySequence_GetSlice(__pyx_v_rule, 0, 3); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __Pyx_PySequence_GetSlice(__pyx_v_rule, 0, 3); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2044; __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 + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 3)) { + if (size > 3) __Pyx_RaiseTooManyValuesError(3); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 3)) { - if (PyTuple_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_13 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); } else { - if (unlikely(PyList_GET_SIZE(sequence) != 3)) { - if (PyList_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } __pyx_t_4 = PyList_GET_ITEM(sequence, 0); __pyx_t_13 = PyList_GET_ITEM(sequence, 1); __pyx_t_7 = PyList_GET_ITEM(sequence, 2); @@ -61196,10 +61467,16 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(__pyx_t_7); + #else + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - } else { + } 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 = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2044; __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; @@ -61209,14 +61486,15 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __Pyx_GOTREF(__pyx_t_13); 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 = 2038; __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 = 2044; __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; __pyx_L22_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L23_unpacking_done:; } __Pyx_XDECREF(__pyx_v_f_ph); @@ -61231,7 +61509,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __pyx_cur_scope->__pyx_v_al = __pyx_t_7; __pyx_t_7 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2039 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2045 * for rule in rules: * (f_ph, e_ph, al) = rule[:3] * self.phrases_f[f_ph] += 1 # <<<<<<<<<<<<<< @@ -61242,17 +61520,17 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __pyx_t_12 = __pyx_cur_scope->__pyx_v_self->phrases_f; __Pyx_INCREF(__pyx_v_f_ph); __pyx_t_7 = __pyx_v_f_ph; - __pyx_t_13 = PyObject_GetItem(__pyx_t_12, __pyx_t_7); if (!__pyx_t_13) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = PyObject_GetItem(__pyx_t_12, __pyx_t_7); if (!__pyx_t_13) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_13); - __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_13, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_13, __pyx_int_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_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (PyObject_SetItem(__pyx_t_12, __pyx_t_7, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_t_12, __pyx_t_7, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __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_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2040 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2046 * (f_ph, e_ph, al) = rule[:3] * self.phrases_f[f_ph] += 1 * self.phrases_e[e_ph] += 1 # <<<<<<<<<<<<<< @@ -61263,64 +61541,64 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __pyx_t_12 = __pyx_cur_scope->__pyx_v_self->phrases_e; __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 = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetItem(__pyx_t_12, __pyx_t_7); if (!__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_13 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyObject_SetItem(__pyx_t_12, __pyx_t_7, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_t_12, __pyx_t_7, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2046; __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_12); __pyx_t_12 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2041 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2047 * self.phrases_f[f_ph] += 1 * self.phrases_e[e_ph] += 1 * self.phrases_fe[f_ph][e_ph] += 1 # <<<<<<<<<<<<<< * if not self.phrases_al[f_ph][e_ph]: * self.phrases_al[f_ph][e_ph] = al */ - __pyx_t_12 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_self->phrases_fe, __pyx_v_f_ph); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2041; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_self->phrases_fe, __pyx_v_f_ph); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_v_e_ph); __pyx_t_7 = __pyx_v_e_ph; - __pyx_t_13 = PyObject_GetItem(__pyx_t_12, __pyx_t_7); if (!__pyx_t_13) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2041; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = PyObject_GetItem(__pyx_t_12, __pyx_t_7); if (!__pyx_t_13) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_13); - __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_13, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2041; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_13, __pyx_int_1); 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_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (PyObject_SetItem(__pyx_t_12, __pyx_t_7, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2041; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_t_12, __pyx_t_7, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2047; __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_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2042 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2048 * self.phrases_e[e_ph] += 1 * self.phrases_fe[f_ph][e_ph] += 1 * if not self.phrases_al[f_ph][e_ph]: # <<<<<<<<<<<<<< * self.phrases_al[f_ph][e_ph] = al * */ - __pyx_t_12 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_self->phrases_al, __pyx_v_f_ph); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_self->phrases_al, __pyx_v_f_ph); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); - __pyx_t_7 = PyObject_GetItem(__pyx_t_12, __pyx_v_e_ph); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_GetItem(__pyx_t_12, __pyx_v_e_ph); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2048; __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 = 2042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_9 = (!__pyx_t_11); if (__pyx_t_9) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2043 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2049 * self.phrases_fe[f_ph][e_ph] += 1 * if not self.phrases_al[f_ph][e_ph]: * self.phrases_al[f_ph][e_ph] = al # <<<<<<<<<<<<<< * * # Update Bilexical counts */ - __pyx_t_7 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_self->phrases_al, __pyx_v_f_ph); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_self->phrases_al, __pyx_v_f_ph); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - if (PyObject_SetItem(__pyx_t_7, __pyx_v_e_ph, __pyx_cur_scope->__pyx_v_al) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_t_7, __pyx_v_e_ph, __pyx_cur_scope->__pyx_v_al) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L24; } @@ -61328,7 +61606,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ } __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2046 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2052 * * # Update Bilexical counts * for e_w in e_words: # <<<<<<<<<<<<<< @@ -61339,23 +61617,31 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __pyx_t_14 = __pyx_cur_scope->__pyx_v_e_words; __Pyx_INCREF(__pyx_t_14); __pyx_t_2 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_e_words); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_e_words); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); __pyx_t_5 = Py_TYPE(__pyx_t_14)->tp_iternext; } for (;;) { if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_14)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_14)) break; - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_14, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_14)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_14)) break; - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_14, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else { __pyx_t_7 = __pyx_t_5(__pyx_t_14); if (unlikely(!__pyx_t_7)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -61365,7 +61651,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __pyx_v_e_w = __pyx_t_7; __pyx_t_7 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2047 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2053 * # Update Bilexical counts * for e_w in e_words: * self.bilex_e[e_w] += 1 # <<<<<<<<<<<<<< @@ -61376,19 +61662,19 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __pyx_t_7 = __pyx_cur_scope->__pyx_v_self->bilex_e; __Pyx_INCREF(__pyx_v_e_w); __pyx_t_12 = __pyx_v_e_w; - __pyx_t_4 = PyObject_GetItem(__pyx_t_7, __pyx_t_12); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetItem(__pyx_t_7, __pyx_t_12); if (!__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_13 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyObject_SetItem(__pyx_t_7, __pyx_t_12, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_t_7, __pyx_t_12, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2048 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2054 * for e_w in e_words: * self.bilex_e[e_w] += 1 * for f_w in f_words: # <<<<<<<<<<<<<< @@ -61399,23 +61685,31 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __pyx_t_14 = __pyx_cur_scope->__pyx_v_f_words; __Pyx_INCREF(__pyx_t_14); __pyx_t_2 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_f_words); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_f_words); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); __pyx_t_5 = Py_TYPE(__pyx_t_14)->tp_iternext; } for (;;) { if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_14)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_14)) break; - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_14, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_14)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_14)) break; - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_14, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else { __pyx_t_7 = __pyx_t_5(__pyx_t_14); if (unlikely(!__pyx_t_7)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -61425,7 +61719,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __pyx_v_f_w = __pyx_t_7; __pyx_t_7 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2049 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2055 * self.bilex_e[e_w] += 1 * for f_w in f_words: * self.bilex_f[f_w] += 1 # <<<<<<<<<<<<<< @@ -61436,17 +61730,17 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __pyx_t_7 = __pyx_cur_scope->__pyx_v_self->bilex_f; __Pyx_INCREF(__pyx_v_f_w); __pyx_t_12 = __pyx_v_f_w; - __pyx_t_13 = PyObject_GetItem(__pyx_t_7, __pyx_t_12); if (!__pyx_t_13) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = PyObject_GetItem(__pyx_t_7, __pyx_t_12); if (!__pyx_t_13) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_13); - __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_13, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_13, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (PyObject_SetItem(__pyx_t_7, __pyx_t_12, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_t_7, __pyx_t_12, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2055; __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; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2050 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2056 * for f_w in f_words: * self.bilex_f[f_w] += 1 * for e_w in e_words: # <<<<<<<<<<<<<< @@ -61457,23 +61751,31 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __pyx_t_7 = __pyx_cur_scope->__pyx_v_e_words; __Pyx_INCREF(__pyx_t_7); __pyx_t_15 = 0; __pyx_t_16 = NULL; } else { - __pyx_t_15 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_e_words); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_e_words); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_16 = Py_TYPE(__pyx_t_7)->tp_iternext; } for (;;) { if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_7)) { if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_7)) break; - __pyx_t_12 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_15); __Pyx_INCREF(__pyx_t_12); __pyx_t_15++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_12 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_15); __Pyx_INCREF(__pyx_t_12); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_12 = PySequence_ITEM(__pyx_t_7, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_7)) { if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_7)) break; - __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_15); __Pyx_INCREF(__pyx_t_12); __pyx_t_15++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_15); __Pyx_INCREF(__pyx_t_12); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_12 = PySequence_ITEM(__pyx_t_7, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else { __pyx_t_12 = __pyx_t_16(__pyx_t_7); if (unlikely(!__pyx_t_12)) { 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;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -61483,23 +61785,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _ __pyx_v_e_w = __pyx_t_12; __pyx_t_12 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2051 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2057 * self.bilex_f[f_w] += 1 * for e_w in e_words: * self.bilex_fe[f_w][e_w] += 1 # <<<<<<<<<<<<<< * * # Create a rule from source, target, non-terminals, and alignments */ - __pyx_t_12 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_self->bilex_fe, __pyx_v_f_w); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_self->bilex_fe, __pyx_v_f_w); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_v_e_w); __pyx_t_4 = __pyx_v_e_w; - __pyx_t_13 = PyObject_GetItem(__pyx_t_12, __pyx_t_4); if (!__pyx_t_13) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = PyObject_GetItem(__pyx_t_12, __pyx_t_4); if (!__pyx_t_13) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_13); - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_13, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_13, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (PyObject_SetItem(__pyx_t_12, __pyx_t_4, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_t_12, __pyx_t_4, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; @@ -61549,11 +61851,11 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_28form_rule(PyObject *_ PyObject *__pyx_v_e_span = 0; PyObject *__pyx_v_nt = 0; PyObject *__pyx_v_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 *__pyx_r = 0; __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}; PyObject* values[6] = {0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -61571,42 +61873,36 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_28form_rule(PyObject *_ kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f_i); - if (likely(values[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: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e_i); - if (likely(values[1])) 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 = 2054; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: - values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f_span); - if (likely(values[2])) 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 = 2054; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: - values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e_span); - if (likely(values[3])) 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 = 2054; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: - values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nt); - if (likely(values[4])) 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 = 2054; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 4); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: - values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__al); - if (likely(values[5])) 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 = 2054; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 5); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2060; __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 = 2054; __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 = 2060; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { goto __pyx_L5_argtuple_error; @@ -61627,7 +61923,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_28form_rule(PyObject *_ } 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 = 2054; __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 = 2060; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.form_rule", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -61644,12 +61940,11 @@ static PyMethodDef __pyx_mdef_3_sa_23HieroCachingRuleFactory_9form_rule_lambda7 static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_9form_rule_lambda7(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__x,&__pyx_n_s__y,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda7 (wrapper)", 0); - __pyx_self = __pyx_self; { + 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; @@ -61663,18 +61958,16 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_9form_rule_lambda7(PyOb kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__x); - if (likely(values[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: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__y); - if (likely(values[1])) 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 = 2057; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("lambda7", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2063; __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 = 2057; __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 = 2063; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -61687,7 +61980,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_9form_rule_lambda7(PyOb } 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 = 2057; __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 = 2063; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.form_rule.lambda7", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -61698,7 +61991,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_9form_rule_lambda7(PyOb return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2057 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2063 * * # Substitute in non-terminals * nt_inv = sorted(nt, cmp=lambda x, y: cmp(x[3], y[3])) # <<<<<<<<<<<<<< @@ -61717,11 +62010,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, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 3, sizeof(long), PyInt_FromLong); 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_2 = __Pyx_GetItemInt(__pyx_v_y, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_y, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2063; __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 = 2057; __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 = 2063; __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); @@ -61729,7 +62022,7 @@ 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 = 2057; __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 = 2063; __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; @@ -61756,12 +62049,11 @@ static PyMethodDef __pyx_mdef_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda8 static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__x,&__pyx_n_s__y,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda8 (wrapper)", 0); - __pyx_self = __pyx_self; { + 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; @@ -61775,18 +62067,16 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda8(PyO kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__x); - if (likely(values[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: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__y); - if (likely(values[1])) kw_args--; + 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 = 2081; __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 = 2081; __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; @@ -61799,7 +62089,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda8(PyO } 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 = 2081; __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("_sa.HieroCachingRuleFactory.form_rule.lambda8", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -61810,7 +62100,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda8(PyO return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2081 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2087 * # 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])) # <<<<<<<<<<<<<< @@ -61829,11 +62119,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, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, sizeof(long), PyInt_FromLong); 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, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_y, 1, sizeof(long), PyInt_FromLong); 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 = 2081; __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); @@ -61841,7 +62131,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 = 2081; __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; @@ -61863,7 +62153,7 @@ static PyObject *__pyx_lambda_funcdef_lambda8(CYTHON_UNUSED PyObject *__pyx_self } static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_9form_rule_4generator15(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2115 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2121 * f = Phrase(f_sym) * e = Phrase(e_sym) * a = tuple(self.alignment.link(i, j) for (i, j) in links) # <<<<<<<<<<<<<< @@ -61889,7 +62179,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_9form_rule_2genexpr(PyO __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_3_sa_23HieroCachingRuleFactory_9form_rule_4generator15, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_3_sa_23HieroCachingRuleFactory_9form_rule_4generator15, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -61931,29 +62221,37 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_9form_rule_4generator15 return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __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 = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __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 = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } if (PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_links) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_links)) { __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_links; __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_links); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_links); if (unlikely(!__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 = Py_TYPE(__pyx_t_1)->tp_iternext; } for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #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 = 2121; __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 = 2121; __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; - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #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 = 2121; __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 = 2121; __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 = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -61961,29 +62259,35 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_9form_rule_4generator15 } if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { PyObject* sequence = __pyx_t_4; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { - if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { - if (unlikely(PyList_GET_SIZE(sequence) != 2)) { - if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); + #else + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __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 = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } else { + } else + { Py_ssize_t index = -1; - __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __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 = 2121; __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; @@ -61991,14 +62295,15 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_9form_rule_4generator15 __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __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 = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L7_unpacking_done:; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i); @@ -62011,10 +62316,10 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_9form_rule_4generator15 __Pyx_GIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_v_j = __pyx_t_6; __pyx_t_6 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_i); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_j); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PyInt_FromLong(((struct __pyx_vtabstruct_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_9, __pyx_t_10)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __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 = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_i); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_j); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(((struct __pyx_vtabstruct_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_9, __pyx_t_10)); 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_r = __pyx_t_4; __pyx_t_4 = 0; @@ -62033,7 +62338,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_9form_rule_4generator15 __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 = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyErr_SetNone(PyExc_StopIteration); @@ -62048,11 +62353,12 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_9form_rule_4generator15 __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_generator->resume_label = -1; + __Pyx_Generator_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return NULL; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2054 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2060 * * # Create a rule from source, target, non-terminals, and alignments * def form_rule(self, f_i, e_i, f_span, e_span, nt, al): # <<<<<<<<<<<<<< @@ -62109,52 +62415,52 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2057 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2063 * * # 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 = 2057; __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 = 2063; __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 = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_9form_rule_lambda7, 0, NULL, __pyx_n_s___sa, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_9form_rule_lambda7, 0, NULL, __pyx_n_s___sa, NULL); 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); - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__cmp), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2057; __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 = 2063; __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 = 2057; __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 = 2063; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2058 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2064 * # 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_PySequence_GetSlice(__pyx_v_f_span, 0, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PySequence_GetSlice(__pyx_v_f_span, 0, PY_SSIZE_T_MAX); 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_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_t_2 = PyTuple_New(1); 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); 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 = 2058; __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 = 2064; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2059 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2065 * nt_inv = sorted(nt, cmp=lambda x, y: cmp(x[3], y[3])) * f_sym = list(f_span[:]) * off = f_i # <<<<<<<<<<<<<< @@ -62164,7 +62470,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __Pyx_INCREF(__pyx_v_f_i); __pyx_v_off = __pyx_v_f_i; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2060 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2066 * f_sym = list(f_span[:]) * off = f_i * for next_nt in nt: # <<<<<<<<<<<<<< @@ -62175,23 +62481,31 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __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 = 2060; __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 = 2066; __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_3)) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; + #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 = 2066; __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 = 2066; __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; - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; + #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 = 2066; __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 = 2066; __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;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -62201,29 +62515,29 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __pyx_v_next_nt = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2061 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2067 * 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); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_next_nt, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2067; __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); if (!__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, 1, sizeof(long), PyInt_FromLong); 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 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __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 = 2067; __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 = 2061; __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 = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_v_nt_len); __pyx_v_nt_len = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2062 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2068 * for next_nt in nt: * nt_len = (next_nt[2] - next_nt[1]) + 1 * i = 0 # <<<<<<<<<<<<<< @@ -62234,7 +62548,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __Pyx_XDECREF(__pyx_v_i); __pyx_v_i = __pyx_int_0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2063 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2069 * nt_len = (next_nt[2] - next_nt[1]) + 1 * i = 0 * while i < nt_len: # <<<<<<<<<<<<<< @@ -62242,84 +62556,83 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py * i += 1 */ while (1) { - __pyx_t_1 = PyObject_RichCompare(__pyx_v_i, __pyx_v_nt_len, Py_LT); 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_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2063; __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 = 2069; __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 = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_7) break; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2064 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2070 * 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 = PyObject_GetAttr(((PyObject *)__pyx_v_f_sym), __pyx_n_s__pop); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_f_sym), __pyx_n_s__pop); 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_6 = __Pyx_GetItemInt(__pyx_v_next_nt, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_next_nt, 1, sizeof(long), PyInt_FromLong); 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_t_2 = PyNumber_Subtract(__pyx_t_6, __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_6, __pyx_v_off); 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_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 = 2064; __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); 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 = 2064; __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 = 2070; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2065 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2071 * 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 = 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 = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_v_i); __pyx_v_i = __pyx_t_2; __pyx_t_2 = 0; } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2066 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2072 * 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); 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, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2072; __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 = 2066; __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 = 2072; __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 = 2066; __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 = 2072; __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); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_next_nt, 0, sizeof(long), PyInt_FromLong); 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_9 = __Pyx_PyInt_AsInt(__pyx_t_6); 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_AsInt(__pyx_t_6); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyInt_FromLong(__pyx_f_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 = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyInt_FromLong(__pyx_f_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 = 2072; __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 = 2066; __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 = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2067 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2073 * 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 = 2067; __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 = 2073; __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 = 2067; __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 = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_v_off); @@ -62328,27 +62641,27 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2068 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2074 * 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_PySequence_GetSlice(__pyx_v_e_span, 0, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PySequence_GetSlice(__pyx_v_e_span, 0, PY_SSIZE_T_MAX); 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_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2068; __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 = 2074; __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 = 2068; __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 = 2074; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2069 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2075 * off += (nt_len - 1) * e_sym = list(e_span[:]) * off = e_i # <<<<<<<<<<<<<< @@ -62359,7 +62672,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __Pyx_DECREF(__pyx_v_off); __pyx_v_off = __pyx_v_e_i; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2070 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2076 * e_sym = list(e_span[:]) * off = e_i * for next_nt in nt_inv: # <<<<<<<<<<<<<< @@ -62370,23 +62683,31 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __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 = 2070; __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 = 2076; __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_3)) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; + #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 = 2076; __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 = 2076; __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; - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; + #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 = 2076; __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 = 2076; __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 = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -62396,29 +62717,29 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __pyx_v_next_nt = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2071 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2077 * 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); 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_next_nt, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2077; __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); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_next_nt, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2077; __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 = 2071; __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 = 2077; __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 = 2071; __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 = 2077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_v_nt_len); __pyx_v_nt_len = __pyx_t_6; __pyx_t_6 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2072 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2078 * for next_nt in nt_inv: * nt_len = (next_nt[4] - next_nt[3]) + 1 * i = 0 # <<<<<<<<<<<<<< @@ -62429,7 +62750,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __Pyx_XDECREF(__pyx_v_i); __pyx_v_i = __pyx_int_0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2073 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2079 * nt_len = (next_nt[4] - next_nt[3]) + 1 * i = 0 * while i < nt_len: # <<<<<<<<<<<<<< @@ -62437,84 +62758,83 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py * i += 1 */ while (1) { - __pyx_t_6 = PyObject_RichCompare(__pyx_v_i, __pyx_v_nt_len, Py_LT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __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 = 2079; __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 = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (!__pyx_t_7) break; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2074 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2080 * 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 = PyObject_GetAttr(((PyObject *)__pyx_v_e_sym), __pyx_n_s__pop); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_v_e_sym), __pyx_n_s__pop); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2080; __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); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_next_nt, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2080; __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 = 2074; __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 = 2080; __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 = 2074; __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 = 2080; __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 = 2074; __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 = 2080; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2075 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2081 * 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 = 2075; __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 = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_v_i); __pyx_v_i = __pyx_t_2; __pyx_t_2 = 0; } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2076 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2082 * 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); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_next_nt, 3, sizeof(long), PyInt_FromLong); if (!__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_1 = PyNumber_Subtract(__pyx_t_2, __pyx_v_off); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __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 = 2082; __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 = 2076; __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 = 2082; __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); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_next_nt, 0, sizeof(long), PyInt_FromLong); if (!__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_9 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __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 = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyInt_FromLong(__pyx_f_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 = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_f_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 = 2082; __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 = 2076; __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 = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2077 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2083 * 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 = 2077; __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 = 2083; __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 = 2077; __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 = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_v_off); @@ -62523,36 +62843,44 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2080 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2086 * * # 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 = 2080; __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 = 2086; __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 = 2080; __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 = 2086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; } for (;;) { if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_2)) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break; - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; + #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 = 2086; __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 = 2086; __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; - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; + #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 = 2086; __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 = 2086; __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 = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -62565,23 +62893,31 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __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 = 2080; __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 = 2086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_11 = Py_TYPE(__pyx_t_1)->tp_iternext; } for (;;) { if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; + #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 = 2086; __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 = 2086; __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; - __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; + #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 = 2086; __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 = 2086; __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 = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -62590,15 +62926,15 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __Pyx_XDECREF(__pyx_v_link); __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 = 2080; __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 = 2086; __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 = 2080; __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 = 2086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - if (unlikely(PyList_Append(__pyx_t_3, (PyObject*)__pyx_t_12))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_PyList_Append(__pyx_t_3, (PyObject*)__pyx_t_12))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2086; __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; @@ -62609,32 +62945,32 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __pyx_cur_scope->__pyx_v_links = ((PyObject *)__pyx_t_3); __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2081 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2087 * # 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 = 2081; __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 = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __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 = 2081; __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_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda8, 0, NULL, __pyx_n_s___sa, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda8, 0, NULL, __pyx_n_s___sa, NULL); 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); - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__cmp), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __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 = 2087; __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 = 2081; __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 = 2087; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2082 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2088 * 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) # <<<<<<<<<<<<<< @@ -62643,28 +62979,28 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py */ __pyx_t_1 = __pyx_cur_scope->__pyx_v_links; __Pyx_INCREF(__pyx_t_1); - __pyx_t_4 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2088; __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 = 2082; __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 = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_links_len = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2083 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2089 * 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 = 2083; __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 = 2083; __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 = 2089; __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 = 2089; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF(__pyx_v_nt_len); __pyx_v_nt_len = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2084 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2090 * links_len = len(links) * nt_len = len(nt) * nt_i = 0 # <<<<<<<<<<<<<< @@ -62674,7 +63010,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __Pyx_INCREF(__pyx_int_0); __pyx_v_nt_i = __pyx_int_0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2085 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2091 * nt_len = len(nt) * nt_i = 0 * off = f_i # <<<<<<<<<<<<<< @@ -62685,7 +63021,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __Pyx_DECREF(__pyx_v_off); __pyx_v_off = __pyx_v_f_i; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2086 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2092 * nt_i = 0 * off = f_i * i = 0 # <<<<<<<<<<<<<< @@ -62696,7 +63032,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __Pyx_XDECREF(__pyx_v_i); __pyx_v_i = __pyx_int_0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2087 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2093 * off = f_i * i = 0 * while i < links_len: # <<<<<<<<<<<<<< @@ -62704,13 +63040,12 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py * 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); 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_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2087; __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 = 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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2088 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2094 * i = 0 * while i < links_len: * while nt_i < nt_len and links[i][0] > nt[nt_i][1]: # <<<<<<<<<<<<<< @@ -62718,26 +63053,24 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py * nt_i += 1 */ while (1) { - __pyx_t_1 = PyObject_RichCompare(__pyx_v_nt_i, __pyx_v_nt_len, Py_LT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __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_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 = 2094; __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 = 2094; __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(__pyx_cur_scope->__pyx_v_links, __pyx_v_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_links, __pyx_v_i); if (!__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_2 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__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_t_1 = PyObject_GetItem(__pyx_v_nt, __pyx_v_nt_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2088; __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 = 2094; __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); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2094; __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); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __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 = 2094; __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 = 2088; __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 = 2094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_14 = __pyx_t_13; } else { @@ -62745,82 +63078,82 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py } if (!__pyx_t_14) break; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2089 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2095 * 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 = 2089; __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 = 2095; __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); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2089; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2095; __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 = 2089; __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 = 2095; __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); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2089; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__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(__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 = 2089; __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 = 2095; __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 = 2089; __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 = 2095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_v_off); __pyx_v_off = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2090 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2096 * 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 = 2090; __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 = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_v_nt_i); __pyx_v_nt_i = __pyx_t_2; __pyx_t_2 = 0; } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2091 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2097 * 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(__pyx_cur_scope->__pyx_v_links, __pyx_v_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_links, __pyx_v_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2097; __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); 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_t_2, __pyx_t_4, sizeof(Py_ssize_t), PyInt_FromSsize_t); 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 = PyNumber_InPlaceSubtract(__pyx_t_1, __pyx_v_off); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2091; __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 = 2097; __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) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2091; __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) {__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_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2092 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2098 * 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 = 2092; __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 = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_v_i); __pyx_v_i = __pyx_t_2; __pyx_t_2 = 0; } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2093 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2099 * links[i][0] -= off * i += 1 * nt_i = 0 # <<<<<<<<<<<<<< @@ -62831,7 +63164,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __Pyx_DECREF(__pyx_v_nt_i); __pyx_v_nt_i = __pyx_int_0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2094 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2100 * i += 1 * nt_i = 0 * off = e_i # <<<<<<<<<<<<<< @@ -62842,7 +63175,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __Pyx_DECREF(__pyx_v_off); __pyx_v_off = __pyx_v_e_i; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2095 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2101 * nt_i = 0 * off = e_i * i = 0 # <<<<<<<<<<<<<< @@ -62853,7 +63186,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __Pyx_DECREF(__pyx_v_i); __pyx_v_i = __pyx_int_0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2096 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2102 * off = e_i * i = 0 * while i < links_len: # <<<<<<<<<<<<<< @@ -62861,13 +63194,12 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py * 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); if (unlikely(!__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_14 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2096; __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 = 2102; __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 = 2102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_14) break; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2097 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2103 * i = 0 * while i < links_len: * while nt_i < nt_len and links_inv[i][1] > nt_inv[nt_i][3]: # <<<<<<<<<<<<<< @@ -62875,26 +63207,24 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py * nt_i += 1 */ while (1) { - __pyx_t_2 = PyObject_RichCompare(__pyx_v_nt_i, __pyx_v_nt_len, Py_LT); 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_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2097; __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 = 2103; __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 = 2103; __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 = 2097; __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 = 2103; __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); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2097; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong); if (!__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(__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 = 2097; __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 = 2103; __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); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2097; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 3, sizeof(long), PyInt_FromLong); if (!__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(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_GT); 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_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 = 2103; __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 = 2097; __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 = 2103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_13 = __pyx_t_7; } else { @@ -62902,82 +63232,82 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py } if (!__pyx_t_13) break; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2098 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2104 * 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 = 2098; __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 = 2104; __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); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 4, sizeof(long), PyInt_FromLong); 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_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 = 2098; __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 = 2104; __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); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2104; __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 = 2098; __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 = 2104; __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 = 2098; __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 = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_v_off); __pyx_v_off = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2099 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2105 * 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 = 2099; __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 = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_v_nt_i); __pyx_v_nt_i = __pyx_t_3; __pyx_t_3 = 0; } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2100 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2106 * 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 = 2100; __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 = 2106; __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); 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_t_3, __pyx_t_4, sizeof(Py_ssize_t), PyInt_FromSsize_t); 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_InPlaceSubtract(__pyx_t_2, __pyx_v_off); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __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 = 2106; __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) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __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) {__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_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2101 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2107 * 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 = 2101; __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 = 2107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_v_i); __pyx_v_i = __pyx_t_3; __pyx_t_3 = 0; } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2104 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2110 * * # Find lexical span * lex_f_i = f_i # <<<<<<<<<<<<<< @@ -62987,76 +63317,75 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py __Pyx_INCREF(__pyx_v_f_i); __pyx_v_lex_f_i = __pyx_v_f_i; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2105 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2111 * # 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 = 2105; __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 = 2105; __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 = 2111; __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 = 2111; __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 = 2105; __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 = 2111; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2106 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2112 * 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 = 2106; __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 = 2112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_13) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2107 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2113 * 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); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2113; __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); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2113; __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); 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_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 = 2113; __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 = 2107; __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 = 2113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_13) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2108 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2114 * 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); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2114; __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); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2114; __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); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2114; __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); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2114; __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 = 2108; __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 = 2114; __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 = 2108; __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 = 2114; __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 = 2108; __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 = 2114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_v_lex_f_i); @@ -63066,50 +63395,49 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py } __pyx_L24:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2109 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2115 * 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); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __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); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __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); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __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 = 2115; __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 = 2109; __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 = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_13) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2110 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2116 * 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); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2116; __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); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong); if (!__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_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2116; __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); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2116; __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 = 2110; __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 = 2116; __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 = 2110; __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 = 2116; __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 = 2110; __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 = 2116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_v_lex_f_j); @@ -63122,63 +63450,63 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py } __pyx_L23:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2113 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2119 * * # 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 = 2113; __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 = 2119; __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_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_1), 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(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __pyx_v_f = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2114 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2120 * # 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 = 2114; __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 = 2120; __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_3_sa_Phrase)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __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_3_sa_Phrase *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2115 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2121 * 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_3_sa_23HieroCachingRuleFactory_9form_rule_2genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_pf_3_sa_23HieroCachingRuleFactory_9form_rule_2genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__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 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __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 = 2121; __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 = 2115; __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 = 2121; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2116 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2122 * 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) # <<<<<<<<<<<<<< @@ -63186,7 +63514,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py * # 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 = 2116; __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 = 2122; __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)); @@ -63247,11 +63575,11 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_30fmt_rule(PyObject *__ PyObject *__pyx_v_f = 0; PyObject *__pyx_v_e = 0; PyObject *__pyx_v_a = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__f,&__pyx_n_s__e,&__pyx_n_s__a,0}; PyObject *__pyx_r = 0; __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}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -63266,24 +63594,21 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_30fmt_rule(PyObject *__ kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f); - if (likely(values[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: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e); - if (likely(values[1])) 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 = 2119; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("fmt_rule", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: - values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__a); - if (likely(values[2])) 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 = 2119; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("fmt_rule", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2125; __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 = 2119; __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 = 2125; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -63298,7 +63623,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_30fmt_rule(PyObject *__ } 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 = 2119; __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 = 2125; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.fmt_rule", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -63310,7 +63635,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_30fmt_rule(PyObject *__ } static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_8fmt_rule_2generator16(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2120 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2126 * # 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) # <<<<<<<<<<<<<< @@ -63336,7 +63661,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8fmt_rule_genexpr(PyObj __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_3_sa_23HieroCachingRuleFactory_8fmt_rule_2generator16, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_3_sa_23HieroCachingRuleFactory_8fmt_rule_2generator16, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -63375,29 +63700,37 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_8fmt_rule_2generator16( return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __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 = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2126; __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 = 2126; __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 = 2120; __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 = 2126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; } for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #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 = 2126; __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 = 2126; __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; - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #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 = 2126; __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 = 2126; __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 = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -63408,24 +63741,24 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_8fmt_rule_2generator16( __Pyx_GIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_v_packed = __pyx_t_4; __pyx_t_4 = 0; - __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_138), __pyx_n_s__format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_139), __pyx_n_s__format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2126; __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 = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_5 = PyObject_GetAttr(((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 = 2120; __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 = 2126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_5 = PyObject_GetAttr(((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 = 2126; __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 = 2120; __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 = 2126; __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 = 2120; __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 = 2126; __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 = 2120; __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 = 2126; __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 = 2120; __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 = 2126; __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; @@ -63446,7 +63779,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_8fmt_rule_2generator16( __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 = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyErr_SetNone(PyExc_StopIteration); @@ -63461,11 +63794,12 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_8fmt_rule_2generator16( __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_generator->resume_label = -1; + __Pyx_Generator_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return NULL; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2119 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2125 * * # Rule string from rule * def fmt_rule(self, f, e, a): # <<<<<<<<<<<<<< @@ -63498,30 +63832,30 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_29fmt_rule(struct __pyx __Pyx_INCREF(__pyx_cur_scope->__pyx_v_a); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_a); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2120 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2126 * # 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 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_67), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_67), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_pf_3_sa_23HieroCachingRuleFactory_8fmt_rule_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __pyx_pf_3_sa_23HieroCachingRuleFactory_8fmt_rule_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2126; __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 = 2120; __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 = 2126; __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 = 2120; __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 = 2126; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2121 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2127 * 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) # <<<<<<<<<<<<<< @@ -63529,9 +63863,9 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_29fmt_rule(struct __pyx * # Debugging */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_139), __pyx_n_s__format); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_140), __pyx_n_s__format); if (unlikely(!__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 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __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 = 2127; __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); @@ -63542,7 +63876,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_29fmt_rule(struct __pyx __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 = 2121; __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 = 2127; __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; @@ -63577,7 +63911,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_32dump_online_stats(PyO return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2124 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2130 * * # Debugging * def dump_online_stats(self): # <<<<<<<<<<<<<< @@ -63607,75 +63941,75 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str int __pyx_clineno = 0; __Pyx_RefNannySetupContext("dump_online_stats", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2125 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2131 * # Debugging * def dump_online_stats(self): * logger.info('------------------------------') # <<<<<<<<<<<<<< * logger.info(' Online Stats ') * logger.info('------------------------------') */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); 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_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_141), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_142), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2131; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2126 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2132 * def dump_online_stats(self): * logger.info('------------------------------') * logger.info(' Online Stats ') # <<<<<<<<<<<<<< * logger.info('------------------------------') * logger.info('f') */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); 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_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_143), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_144), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2127 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2133 * logger.info('------------------------------') * logger.info(' Online Stats ') * logger.info('------------------------------') # <<<<<<<<<<<<<< * logger.info('f') * for w in self.bilex_f: */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __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_144), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_145), NULL); 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_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2128 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2134 * logger.info(' Online Stats ') * logger.info('------------------------------') * logger.info('f') # <<<<<<<<<<<<<< * for w in self.bilex_f: * logger.info(sym_tostring(w) + ' : ' + str(self.bilex_f[w])) */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); 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_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_145), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_146), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2134; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2129 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2135 * logger.info('------------------------------') * logger.info('f') * for w in self.bilex_f: # <<<<<<<<<<<<<< @@ -63686,23 +64020,31 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str __pyx_t_1 = __pyx_v_self->bilex_f; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->bilex_f); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->bilex_f); 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_4 = Py_TYPE(__pyx_t_1)->tp_iternext; } for (;;) { if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } 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(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -63712,44 +64054,44 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str __pyx_v_w = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2130 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2136 * logger.info('f') * for w in self.bilex_f: * logger.info(sym_tostring(w) + ' : ' + str(self.bilex_f[w])) # <<<<<<<<<<<<<< * logger.info('e') * for w in self.bilex_e: */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__info); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__info); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_w); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyBytes_FromString(__pyx_f_3_sa_sym_tostring(__pyx_t_6)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_w); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyBytes_FromString(__pyx_f_3_sa_sym_tostring(__pyx_t_6)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __pyx_t_7 = PyNumber_Add(((PyObject *)__pyx_t_2), ((PyObject *)__pyx_kp_s_146)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyNumber_Add(((PyObject *)__pyx_t_2), ((PyObject *)__pyx_kp_s_147)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetItem(__pyx_v_self->bilex_f, __pyx_v_w); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetItem(__pyx_v_self->bilex_f, __pyx_v_w); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __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 = 2136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_8, 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_8), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; - __pyx_t_8 = PyNumber_Add(__pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyNumber_Add(__pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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[8]; __pyx_lineno = 2130; __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 = 2136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; @@ -63757,24 +64099,24 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2131 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2137 * for w in self.bilex_f: * logger.info(sym_tostring(w) + ' : ' + str(self.bilex_f[w])) * logger.info('e') # <<<<<<<<<<<<<< * for w in self.bilex_e: * logger.info(sym_tostring(w) + ' : ' + str(self.bilex_e[w])) */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __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_Call(__pyx_t_8, ((PyObject *)__pyx_k_tuple_147), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_k_tuple_148), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2132 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2138 * logger.info(sym_tostring(w) + ' : ' + str(self.bilex_f[w])) * logger.info('e') * for w in self.bilex_e: # <<<<<<<<<<<<<< @@ -63785,23 +64127,31 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str __pyx_t_1 = __pyx_v_self->bilex_e; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->bilex_e); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->bilex_e); 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_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; } for (;;) { if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else { __pyx_t_8 = __pyx_t_4(__pyx_t_1); if (unlikely(!__pyx_t_8)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -63811,44 +64161,44 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str __pyx_v_w = __pyx_t_8; __pyx_t_8 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2133 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2139 * logger.info('e') * for w in self.bilex_e: * logger.info(sym_tostring(w) + ' : ' + str(self.bilex_e[w])) # <<<<<<<<<<<<<< * logger.info('fe') * for w in self.bilex_fe: */ - __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__info); 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_8); __pyx_t_8 = 0; - __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_w); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_8 = PyBytes_FromString(__pyx_f_3_sa_sym_tostring(__pyx_t_6)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_w); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyBytes_FromString(__pyx_f_3_sa_sym_tostring(__pyx_t_6)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_8)); - __pyx_t_5 = PyNumber_Add(((PyObject *)__pyx_t_8), ((PyObject *)__pyx_kp_s_146)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Add(((PyObject *)__pyx_t_8), ((PyObject *)__pyx_kp_s_147)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; - __pyx_t_8 = PyObject_GetItem(__pyx_v_self->bilex_e, __pyx_v_w); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_GetItem(__pyx_v_self->bilex_e, __pyx_v_w); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __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 = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_Add(__pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyNumber_Add(__pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __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 = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; @@ -63856,24 +64206,24 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2134 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2140 * for w in self.bilex_e: * logger.info(sym_tostring(w) + ' : ' + str(self.bilex_e[w])) * logger.info('fe') # <<<<<<<<<<<<<< * for w in self.bilex_fe: * for w2 in self.bilex_fe[w]: */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_k_tuple_148), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_k_tuple_149), 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(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2135 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2141 * logger.info(sym_tostring(w) + ' : ' + str(self.bilex_e[w])) * logger.info('fe') * for w in self.bilex_fe: # <<<<<<<<<<<<<< @@ -63884,23 +64234,31 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str __pyx_t_1 = __pyx_v_self->bilex_fe; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->bilex_fe); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->bilex_fe); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; } for (;;) { if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_7); __pyx_t_3++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_7); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_7); __pyx_t_3++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_7); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else { __pyx_t_7 = __pyx_t_4(__pyx_t_1); if (unlikely(!__pyx_t_7)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -63910,20 +64268,20 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str __pyx_v_w = __pyx_t_7; __pyx_t_7 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2136 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2142 * logger.info('fe') * for w in self.bilex_fe: * for w2 in self.bilex_fe[w]: # <<<<<<<<<<<<<< * logger.info(sym_tostring(w) + ' : ' + sym_tostring(w2) + ' : ' + str(self.bilex_fe[w][w2])) * logger.info('F') */ - __pyx_t_7 = PyObject_GetItem(__pyx_v_self->bilex_fe, __pyx_v_w); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_GetItem(__pyx_v_self->bilex_fe, __pyx_v_w); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); if (PyList_CheckExact(__pyx_t_7) || PyTuple_CheckExact(__pyx_t_7)) { __pyx_t_8 = __pyx_t_7; __Pyx_INCREF(__pyx_t_8); __pyx_t_9 = 0; __pyx_t_10 = NULL; } else { - __pyx_t_9 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_10 = Py_TYPE(__pyx_t_8)->tp_iternext; } @@ -63931,16 +64289,24 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str for (;;) { if (!__pyx_t_10 && PyList_CheckExact(__pyx_t_8)) { if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_8)) break; - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_7); __pyx_t_9++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_7); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else if (!__pyx_t_10 && PyTuple_CheckExact(__pyx_t_8)) { if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_8)) break; - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_7); __pyx_t_9++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_7); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else { __pyx_t_7 = __pyx_t_10(__pyx_t_8); if (unlikely(!__pyx_t_7)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -63950,57 +64316,57 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str __pyx_v_w2 = __pyx_t_7; __pyx_t_7 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2137 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2143 * for w in self.bilex_fe: * for w2 in self.bilex_fe[w]: * logger.info(sym_tostring(w) + ' : ' + sym_tostring(w2) + ' : ' + str(self.bilex_fe[w][w2])) # <<<<<<<<<<<<<< * logger.info('F') * for ph in self.phrases_f: */ - __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_w); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_7 = PyBytes_FromString(__pyx_f_3_sa_sym_tostring(__pyx_t_6)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_w); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyBytes_FromString(__pyx_f_3_sa_sym_tostring(__pyx_t_6)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_7)); - __pyx_t_5 = PyNumber_Add(((PyObject *)__pyx_t_7), ((PyObject *)__pyx_kp_s_146)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Add(((PyObject *)__pyx_t_7), ((PyObject *)__pyx_kp_s_147)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; - __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_w2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_7 = PyBytes_FromString(__pyx_f_3_sa_sym_tostring(__pyx_t_6)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_w2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyBytes_FromString(__pyx_f_3_sa_sym_tostring(__pyx_t_6)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_7)); - __pyx_t_11 = PyNumber_Add(__pyx_t_5, ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyNumber_Add(__pyx_t_5, ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_Add(__pyx_t_11, ((PyObject *)__pyx_kp_s_146)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyNumber_Add(__pyx_t_11, ((PyObject *)__pyx_kp_s_147)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyObject_GetItem(__pyx_v_self->bilex_fe, __pyx_v_w); if (!__pyx_t_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyObject_GetItem(__pyx_v_self->bilex_fe, __pyx_v_w); if (!__pyx_t_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); - __pyx_t_5 = PyObject_GetItem(__pyx_t_11, __pyx_v_w2); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetItem(__pyx_t_11, __pyx_v_w2); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __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 = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_11, 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_11), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0; - __pyx_t_11 = PyNumber_Add(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyNumber_Add(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __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_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __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 = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __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_5)); __pyx_t_5 = 0; @@ -64010,24 +64376,24 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2138 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2144 * for w2 in self.bilex_fe[w]: * logger.info(sym_tostring(w) + ' : ' + sym_tostring(w2) + ' : ' + str(self.bilex_fe[w][w2])) * logger.info('F') # <<<<<<<<<<<<<< * for ph in self.phrases_f: * logger.info(str(ph) + ' ||| ' + str(self.phrases_f[ph])) */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2144; __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_Call(__pyx_t_8, ((PyObject *)__pyx_k_tuple_149), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_k_tuple_150), 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(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2139 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2145 * logger.info(sym_tostring(w) + ' : ' + sym_tostring(w2) + ' : ' + str(self.bilex_fe[w][w2])) * logger.info('F') * for ph in self.phrases_f: # <<<<<<<<<<<<<< @@ -64038,23 +64404,31 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str __pyx_t_1 = __pyx_v_self->phrases_f; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->phrases_f); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->phrases_f); 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_4 = Py_TYPE(__pyx_t_1)->tp_iternext; } for (;;) { if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else { __pyx_t_8 = __pyx_t_4(__pyx_t_1); if (unlikely(!__pyx_t_8)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -64064,49 +64438,49 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str __pyx_v_ph = __pyx_t_8; __pyx_t_8 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2140 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2146 * logger.info('F') * for ph in self.phrases_f: * logger.info(str(ph) + ' ||| ' + str(self.phrases_f[ph])) # <<<<<<<<<<<<<< * logger.info('E') * for ph in self.phrases_e: */ - __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_11 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__info); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__info); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __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 = 2146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_ph); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_ph); __Pyx_GIVEREF(__pyx_v_ph); - __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; - __pyx_t_8 = PyNumber_Add(__pyx_t_5, ((PyObject *)__pyx_kp_s_18)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyNumber_Add(__pyx_t_5, ((PyObject *)__pyx_kp_s_18)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_GetItem(__pyx_v_self->phrases_f, __pyx_v_ph); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetItem(__pyx_v_self->phrases_f, __pyx_v_ph); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __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_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 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_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Add(__pyx_t_8, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Add(__pyx_t_8, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2146; __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_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __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 = 2146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; @@ -64114,24 +64488,24 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2141 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2147 * for ph in self.phrases_f: * logger.info(str(ph) + ' ||| ' + str(self.phrases_f[ph])) * logger.info('E') # <<<<<<<<<<<<<< * for ph in self.phrases_e: * logger.info(str(ph) + ' ||| ' + str(self.phrases_e[ph])) */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); 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_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_150), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_151), NULL); 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; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2142 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2148 * logger.info(str(ph) + ' ||| ' + str(self.phrases_f[ph])) * logger.info('E') * for ph in self.phrases_e: # <<<<<<<<<<<<<< @@ -64142,23 +64516,31 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str __pyx_t_1 = __pyx_v_self->phrases_e; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->phrases_e); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->phrases_e); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; } for (;;) { if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } 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(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -64168,49 +64550,49 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str __pyx_v_ph = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2143 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2149 * logger.info('E') * for ph in self.phrases_e: * logger.info(str(ph) + ' ||| ' + str(self.phrases_e[ph])) # <<<<<<<<<<<<<< * logger.info('FE') * self.dump_online_rules() */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__info); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__info); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __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 = 2149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_ph); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_ph); __Pyx_GIVEREF(__pyx_v_ph); - __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Add(__pyx_t_11, ((PyObject *)__pyx_kp_s_18)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Add(__pyx_t_11, ((PyObject *)__pyx_kp_s_18)); 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_11); __pyx_t_11 = 0; - __pyx_t_11 = PyObject_GetItem(__pyx_v_self->phrases_e, __pyx_v_ph); if (!__pyx_t_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyObject_GetItem(__pyx_v_self->phrases_e, __pyx_v_ph); if (!__pyx_t_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __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 = 2149; __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); __pyx_t_11 = 0; - __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; - __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_t_11); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_t_11); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __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 = 2149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0; @@ -64218,33 +64600,33 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2144 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2150 * for ph in self.phrases_e: * logger.info(str(ph) + ' ||| ' + str(self.phrases_e[ph])) * logger.info('FE') # <<<<<<<<<<<<<< * self.dump_online_rules() * */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __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_Call(__pyx_t_8, ((PyObject *)__pyx_k_tuple_151), 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(__pyx_t_8, ((PyObject *)__pyx_k_tuple_152), NULL); 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_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2145 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2151 * logger.info(str(ph) + ' ||| ' + str(self.phrases_e[ph])) * logger.info('FE') * self.dump_online_rules() # <<<<<<<<<<<<<< * * def dump_online_rules(self): */ - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__dump_online_rules); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__dump_online_rules); 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_t_8 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2151; __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_8); __pyx_t_8 = 0; @@ -64280,7 +64662,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_34dump_online_rules(PyO return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2147 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2153 * self.dump_online_rules() * * def dump_online_rules(self): # <<<<<<<<<<<<<< @@ -64310,7 +64692,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_33dump_online_rules(str int __pyx_clineno = 0; __Pyx_RefNannySetupContext("dump_online_rules", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2148 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2154 * * def dump_online_rules(self): * for ph in self.phrases_fe: # <<<<<<<<<<<<<< @@ -64321,23 +64703,31 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_33dump_online_rules(str __pyx_t_1 = __pyx_v_self->phrases_fe; __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_self->phrases_fe); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->phrases_fe); 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_3 = Py_TYPE(__pyx_t_1)->tp_iternext; } for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #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 = 2154; __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 = 2154; __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; - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #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 = 2154; __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 = 2154; __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 = 2148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -64347,20 +64737,20 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_33dump_online_rules(str __pyx_v_ph = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2149 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2155 * def dump_online_rules(self): * for ph in self.phrases_fe: * for ph2 in self.phrases_fe[ph]: # <<<<<<<<<<<<<< * logger.info(self.fmt_rule(str(ph), str(ph2), self.phrases_al[ph][ph2]) + ' ||| ' + str(self.phrases_fe[ph][ph2])) * */ - __pyx_t_4 = PyObject_GetItem(__pyx_v_self->phrases_fe, __pyx_v_ph); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetItem(__pyx_v_self->phrases_fe, __pyx_v_ph); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2155; __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_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; } @@ -64368,16 +64758,24 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_33dump_online_rules(str for (;;) { if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_5)) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break; - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_5)) { if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break; - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else { __pyx_t_4 = __pyx_t_7(__pyx_t_5); if (unlikely(!__pyx_t_4)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -64387,42 +64785,42 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_33dump_online_rules(str __pyx_v_ph2 = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2150 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2156 * for ph in self.phrases_fe: * for ph2 in self.phrases_fe[ph]: * logger.info(self.fmt_rule(str(ph), str(ph2), self.phrases_al[ph][ph2]) + ' ||| ' + str(self.phrases_fe[ph][ph2])) # <<<<<<<<<<<<<< * * # Lookup online stats for phrase pair (f, e). Return None if no match. */ - __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); 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_8 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__info); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__info); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2156; __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_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__fmt_rule); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__fmt_rule); 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_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_ph); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_ph); __Pyx_GIVEREF(__pyx_v_ph); - __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_ph2); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_ph2); __Pyx_GIVEREF(__pyx_v_ph2); - __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; - __pyx_t_9 = PyObject_GetItem(__pyx_v_self->phrases_al, __pyx_v_ph); if (!__pyx_t_9) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_GetItem(__pyx_v_self->phrases_al, __pyx_v_ph); if (!__pyx_t_9) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_12 = PyObject_GetItem(__pyx_t_9, __pyx_v_ph2); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyObject_GetItem(__pyx_t_9, __pyx_v_ph2); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); @@ -64433,36 +64831,36 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_33dump_online_rules(str __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; - __pyx_t_12 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; - __pyx_t_9 = PyNumber_Add(__pyx_t_12, ((PyObject *)__pyx_kp_s_18)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyNumber_Add(__pyx_t_12, ((PyObject *)__pyx_kp_s_18)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyObject_GetItem(__pyx_v_self->phrases_fe, __pyx_v_ph); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyObject_GetItem(__pyx_v_self->phrases_fe, __pyx_v_ph); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); - __pyx_t_4 = PyObject_GetItem(__pyx_t_12, __pyx_v_ph2); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetItem(__pyx_t_12, __pyx_v_ph2); if (!__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_12); __pyx_t_12 = 0; - __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __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 = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_12, 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_12), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_12), NULL); 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(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; - __pyx_t_12 = PyNumber_Add(__pyx_t_9, __pyx_t_4); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyNumber_Add(__pyx_t_9, __pyx_t_4); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __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 = 2150; __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 = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_12); __Pyx_GIVEREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; @@ -64498,11 +64896,11 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_36online_ctx_lookup(PyO static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_36online_ctx_lookup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_f = 0; PyObject *__pyx_v_e = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__f,&__pyx_n_s__e,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("online_ctx_lookup (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__f,&__pyx_n_s__e,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -64516,18 +64914,16 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_36online_ctx_lookup(PyO kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f); - if (likely(values[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: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e); - if (likely(values[1])) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("online_ctx_lookup", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("online_ctx_lookup", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2160; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } 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 = 2154; __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 = 2160; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -64540,7 +64936,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_36online_ctx_lookup(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("online_ctx_lookup", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("online_ctx_lookup", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2160; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.online_ctx_lookup", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -64551,7 +64947,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_36online_ctx_lookup(PyO return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2154 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2160 * # 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): # <<<<<<<<<<<<<< @@ -64576,7 +64972,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_35online_ctx_lookup(str int __pyx_clineno = 0; __Pyx_RefNannySetupContext("online_ctx_lookup", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2155 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2161 * # IMPORTANT: use get() to avoid adding items to defaultdict * def online_ctx_lookup(self, f, e): * if self.online: # <<<<<<<<<<<<<< @@ -64585,16 +64981,16 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_35online_ctx_lookup(str */ if (__pyx_v_self->online) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2156 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2162 * def online_ctx_lookup(self, f, e): * if self.online: * fcount = self.phrases_f.get(f, 0) # <<<<<<<<<<<<<< * fsample_count = self.samples_f.get(f, 0) * d = self.phrases_fe.get(f, None) */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->phrases_f, __pyx_n_s__get); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->phrases_f, __pyx_n_s__get); 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_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2156; __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 = 2162; __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); @@ -64602,23 +64998,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_35online_ctx_lookup(str __Pyx_INCREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_0); __Pyx_GIVEREF(__pyx_int_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 = 2156; __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 = 2162; __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_v_fcount = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2157 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2163 * if self.online: * fcount = self.phrases_f.get(f, 0) * fsample_count = self.samples_f.get(f, 0) # <<<<<<<<<<<<<< * d = self.phrases_fe.get(f, None) * paircount = d.get(e, 0) if d else 0 */ - __pyx_t_3 = PyObject_GetAttr(__pyx_v_self->samples_f, __pyx_n_s__get); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_self->samples_f, __pyx_n_s__get); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2157; __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 = 2163; __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); @@ -64626,23 +65022,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_35online_ctx_lookup(str __Pyx_INCREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - __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 = 2157; __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 = 2163; __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_v_fsample_count = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2158 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2164 * fcount = self.phrases_f.get(f, 0) * fsample_count = self.samples_f.get(f, 0) * d = self.phrases_fe.get(f, None) # <<<<<<<<<<<<<< * paircount = d.get(e, 0) if d else 0 * return OnlineFeatureContext(fcount, fsample_count, paircount, self.bilex_f, self.bilex_e, self.bilex_fe) */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->phrases_fe, __pyx_n_s__get); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->phrases_fe, __pyx_n_s__get); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2164; __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 = 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 = 2164; __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); @@ -64650,25 +65046,25 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_35online_ctx_lookup(str __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 = 2158; __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 = 2164; __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_v_d = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2159 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2165 * fsample_count = self.samples_f.get(f, 0) * d = self.phrases_fe.get(f, None) * paircount = d.get(e, 0) if d else 0 # <<<<<<<<<<<<<< * return OnlineFeatureContext(fcount, fsample_count, paircount, self.bilex_f, self.bilex_e, self.bilex_fe) * return None */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_d); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_d); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_4) { - __pyx_t_2 = PyObject_GetAttr(__pyx_v_d, __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 = PyObject_GetAttr(__pyx_v_d, __pyx_n_s__get); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2159; __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 = 2165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_e); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_e); @@ -64676,7 +65072,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_35online_ctx_lookup(str __Pyx_INCREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2165; __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_1)); __pyx_t_1 = 0; @@ -64689,7 +65085,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_35online_ctx_lookup(str __pyx_v_paircount = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2160 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2166 * d = self.phrases_fe.get(f, None) * paircount = d.get(e, 0) if d else 0 * return OnlineFeatureContext(fcount, fsample_count, paircount, self.bilex_f, self.bilex_e, self.bilex_fe) # <<<<<<<<<<<<<< @@ -64697,9 +65093,9 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_35online_ctx_lookup(str * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s_152); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s_153); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2166; __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); @@ -64719,7 +65115,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_35online_ctx_lookup(str __Pyx_INCREF(__pyx_v_self->bilex_fe); PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_v_self->bilex_fe); __Pyx_GIVEREF(__pyx_v_self->bilex_fe); - __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2166; __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_5)); __pyx_t_5 = 0; @@ -64730,7 +65126,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_35online_ctx_lookup(str } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2161 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2167 * paircount = d.get(e, 0) if d else 0 * return OnlineFeatureContext(fcount, fsample_count, paircount, self.bilex_f, self.bilex_e, self.bilex_fe) * return None # <<<<<<<<<<<<<< @@ -64783,12 +65179,11 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_13get_f_phrases_1extrac PyObject *__pyx_v_wc = 0; PyObject *__pyx_v_ntc = 0; PyObject *__pyx_v_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 *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("extract (wrapper)", 0); - __pyx_self = __pyx_self; { + 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; @@ -64807,48 +65202,41 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_13get_f_phrases_1extrac kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f_i); - if (likely(values[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: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f_j); - if (likely(values[1])) 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 = 2171; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: - values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lex_i); - if (likely(values[2])) 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 = 2171; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: - values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lex_j); - if (likely(values[3])) 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 = 2171; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: - values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__wc); - if (likely(values[4])) 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 = 2171; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 4); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: - values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ntc); - if (likely(values[5])) 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 = 2171; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 5); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 6: - values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__syms); - if (likely(values[6])) 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 = 2171; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 6); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2177; __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 = 2171; __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 = 2177; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 7) { goto __pyx_L5_argtuple_error; @@ -64871,7 +65259,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_13get_f_phrases_1extrac } 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 = 2171; __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 = 2177; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.get_f_phrases.extract", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -64882,7 +65270,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_13get_f_phrases_1extrac return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2171 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2177 * phrases = set() # (fphrase, lex_i, lex_j) * * def extract(f_i, f_j, lex_i, lex_j, wc, ntc, syms): # <<<<<<<<<<<<<< @@ -64914,35 +65302,33 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract __pyx_outer_scope = (struct __pyx_obj_3_sa___pyx_scope_struct_26_get_f_phrases *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2173 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2179 * 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 = 2173; __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 = 2173; __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 = 2179; __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 = 2179; __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); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __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 = 2179; __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 = 2173; __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 = 2179; __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 = 2173; __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 = 2179; __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 = 2173; __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 = 2179; __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 = 2173; __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 = 2173; __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 = 2179; __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 = 2179; __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); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __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 = 2179; __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 = 2173; __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 = 2179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = __pyx_t_5; } else { @@ -64950,7 +65336,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract } if (__pyx_t_6) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2174 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2180 * # Phrase extraction limits * if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size: * return # <<<<<<<<<<<<<< @@ -64964,59 +65350,58 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract } __pyx_L3:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2176 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2182 * 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 = 2176; __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 = 2182; __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 = 2176; __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 = 2182; __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); 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_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 = 2182; __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 = 2176; __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 = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2177 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2183 * # 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 = 2177; __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 = 2177; __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 = 2183; __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 = 2183; __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 = 2177; __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 = 2183; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2178 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2184 * 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 = 2178; __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 = 2184; __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_3_sa_Phrase)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_2), NULL); 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_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __pyx_v_f = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2179 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2185 * syms.append(f_words[f_j]) * f = Phrase(syms) * new_lex_i = min(lex_i, f_j) # <<<<<<<<<<<<<< @@ -65027,9 +65412,8 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract __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); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2179; __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 = 2185; __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 = 2185; __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); @@ -65044,7 +65428,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract __pyx_v_new_lex_i = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2180 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2186 * f = Phrase(syms) * new_lex_i = min(lex_i, f_j) * new_lex_j = max(lex_j, f_j) # <<<<<<<<<<<<<< @@ -65055,9 +65439,8 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract __pyx_t_4 = __pyx_v_f_j; __Pyx_INCREF(__pyx_v_lex_j); __pyx_t_1 = __pyx_v_lex_j; - __pyx_t_7 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_GT); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2186; __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 = 2186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_4); @@ -65072,17 +65455,17 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract __pyx_v_new_lex_j = __pyx_t_2; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2181 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2187 * 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 = 2181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_2 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_phrases, __pyx_n_s__add); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2181; __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 = 2187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_phrases, __pyx_n_s__add); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2181; __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 = 2187; __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)); @@ -65093,30 +65476,30 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract __Pyx_INCREF(__pyx_v_new_lex_j); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_new_lex_j); __Pyx_GIVEREF(__pyx_v_new_lex_j); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2181; __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 = 2187; __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(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2181; __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 = 2187; __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_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2182 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2188 * 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 */ - if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2182; __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 = 2182; __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 = 2188; __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 = 2188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyNumber_Add(__pyx_v_wc, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2182; __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 = 2188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_f_i); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_f_i); @@ -65139,37 +65522,37 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract __Pyx_GIVEREF(__pyx_v_syms); __pyx_t_4 = 0; __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_2), NULL); 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(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2183 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2189 * 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_1 = __Pyx_PyObject_Pop(__pyx_v_syms); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Pop(__pyx_v_syms); 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(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L4; } __pyx_L4:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2185 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2191 * 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 = 2185; __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 = 2191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_6) { - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_syms, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_syms, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __pyx_f_3_sa_sym_isvar(__pyx_t_8); } else { @@ -65177,17 +65560,17 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract } if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2187 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2193 * 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: */ - if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2187; __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 = 2187; __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 = 2193; __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 = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_f_i); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_f_i); @@ -65210,7 +65593,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract PyTuple_SET_ITEM(__pyx_t_2, 6, __pyx_v_syms); __Pyx_GIVEREF(__pyx_v_syms); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_2), NULL); 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(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -65218,46 +65601,44 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract } __pyx_L5:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2189 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2195 * 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_1 = PyNumber_Add(__pyx_v_wc, __pyx_v_ntc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2189; __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 = 2195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __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 = 2189; __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 = 2195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); 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); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; __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 = 2189; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2190 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2196 * # 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 = 2190; __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 = 2196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = (!__pyx_t_3); if (!__pyx_t_6) { - __pyx_t_4 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_nonterminals); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_nonterminals); 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_t_2 = PyObject_RichCompare(__pyx_v_ntc, __pyx_t_4, Py_LT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_2 = PyObject_RichCompare(__pyx_v_ntc, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2196; __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 = 2190; __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 = 2196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_syms, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_syms, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = (!__pyx_f_3_sa_sym_isvar(__pyx_t_8)); __pyx_t_9 = __pyx_t_5; @@ -65270,67 +65651,66 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract } if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2191 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2197 * 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_2 = PyNumber_Add(__pyx_v_ntc, __pyx_int_1); 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_ntc, __pyx_int_1); 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_t_8 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_8)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_8)); 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_t_4 = __Pyx_PyObject_Append(__pyx_v_syms, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Append(__pyx_v_syms, __pyx_t_2); 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_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2192 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2198 * 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_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2192; __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 = 2198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_syms); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_syms); __Pyx_GIVEREF(__pyx_v_syms); - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_4), NULL); 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(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_XDECREF(((PyObject *)__pyx_v_f)); __pyx_v_f = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2193 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2199 * 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_2 = PyObject_RichCompare(__pyx_v_wc, __pyx_int_0, Py_GT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2193; __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[8]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 2199; __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 = 2199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2194 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2200 * 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 = 2194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_2 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_phrases, __pyx_n_s__add); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2194; __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 = 2200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_phrases, __pyx_n_s__add); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2194; __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 = 2200; __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)); @@ -65341,12 +65721,12 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract __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_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 = 2200; __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(__pyx_t_2, ((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(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); 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_2); __pyx_t_2 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; @@ -65355,19 +65735,19 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract } __pyx_L8:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2195 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2201 * 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_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2195; __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 = 2195; __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 = 2201; __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 = 2201; __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 = 2195; __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 = 2201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_f_i); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_f_i); @@ -65390,19 +65770,19 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract __Pyx_GIVEREF(__pyx_v_syms); __pyx_t_4 = 0; __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_2), NULL); 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(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2196 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2202 * 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_1 = __Pyx_PyObject_Pop(__pyx_v_syms); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Pop(__pyx_v_syms); 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_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L7; @@ -65430,7 +65810,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2166 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2172 * # (Used for EGivenFCoherent) * # Return set of (fphrase, lex_i, lex_j) * def get_f_phrases(self, f_words): # <<<<<<<<<<<<<< @@ -65466,7 +65846,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_37get_f_phrases(struct __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f_words); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f_words); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2168 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2174 * def get_f_phrases(self, f_words): * * f_len = len(f_words) # <<<<<<<<<<<<<< @@ -65475,64 +65855,64 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_37get_f_phrases(struct */ __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 = 2168; __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 = 2174; __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 = 2168; __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 = 2174; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2169 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2175 * * 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 = 2169; __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 = 2175; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2171 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2177 * 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_3_sa_23HieroCachingRuleFactory_13get_f_phrases_1extract, 0, ((PyObject*)__pyx_cur_scope), __pyx_n_s___sa, ((PyObject *)__pyx_k_codeobj_154)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_13get_f_phrases_1extract, 0, ((PyObject*)__pyx_cur_scope), __pyx_n_s___sa, ((PyObject *)__pyx_k_codeobj_155)); 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_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_extract = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2199 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2205 * * # 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 = 2199; __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 = 2205; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2200 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2206 * # 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 = 2200; __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 = 2206; __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 = 2200; __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 = 2206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2200; __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 = 2206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyTuple_New(7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_New(7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -65555,13 +65935,13 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_37get_f_phrases(struct __pyx_t_1 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2206; __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_5); __pyx_t_5 = 0; } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2202 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2208 * extract(f_i, f_i, f_len, -1, 0, 0, []) * * return phrases # <<<<<<<<<<<<<< @@ -65596,12 +65976,11 @@ static PyObject *__pyx_pw_3_sa_17span_check(PyObject *__pyx_self, PyObject *__py PyObject *__pyx_v_vec = 0; PyObject *__pyx_v_i = 0; PyObject *__pyx_v_j = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__vec,&__pyx_n_s__i,&__pyx_n_s__j,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("span_check (wrapper)", 0); - __pyx_self = __pyx_self; { + 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; @@ -65616,24 +65995,21 @@ static PyObject *__pyx_pw_3_sa_17span_check(PyObject *__pyx_self, PyObject *__py kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__vec); - if (likely(values[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: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__i); - if (likely(values[1])) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__i)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("span_check", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2205; __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: - values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__j); - if (likely(values[2])) 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 = 2205; __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 = 2205; __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; @@ -65648,7 +66024,7 @@ static PyObject *__pyx_pw_3_sa_17span_check(PyObject *__pyx_self, PyObject *__py } 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 = 2205; __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("_sa.span_check", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -65659,7 +66035,7 @@ static PyObject *__pyx_pw_3_sa_17span_check(PyObject *__pyx_self, PyObject *__py return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2205 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2211 * * # Spans are _inclusive_ on both ends [i, j] * def span_check(vec, i, j): # <<<<<<<<<<<<<< @@ -65678,7 +66054,7 @@ static PyObject *__pyx_pf_3_sa_16span_check(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_clineno = 0; __Pyx_RefNannySetupContext("span_check", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2206 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2212 * # Spans are _inclusive_ on both ends [i, j] * def span_check(vec, i, j): * k = i # <<<<<<<<<<<<<< @@ -65688,7 +66064,7 @@ static PyObject *__pyx_pf_3_sa_16span_check(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_INCREF(__pyx_v_i); __pyx_v_k = __pyx_v_i; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2207 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2213 * def span_check(vec, i, j): * k = i * while k <= j: # <<<<<<<<<<<<<< @@ -65696,26 +66072,25 @@ static PyObject *__pyx_pf_3_sa_16span_check(CYTHON_UNUSED PyObject *__pyx_self, * return False */ while (1) { - __pyx_t_1 = PyObject_RichCompare(__pyx_v_k, __pyx_v_j, Py_LE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2207; __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 = 2207; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2208 + /* "/home/pauldb/workspace/cdec/python/src/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 = 2208; __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 = 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 = 2214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2209 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2215 * while k <= j: * if vec[k]: * return False # <<<<<<<<<<<<<< @@ -65723,7 +66098,7 @@ static PyObject *__pyx_pf_3_sa_16span_check(CYTHON_UNUSED PyObject *__pyx_self, * 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 = 2209; __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; @@ -65732,21 +66107,21 @@ static PyObject *__pyx_pf_3_sa_16span_check(CYTHON_UNUSED PyObject *__pyx_self, } __pyx_L5:; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2210 + /* "/home/pauldb/workspace/cdec/python/src/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 = 2210; __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(__pyx_v_k); __pyx_v_k = __pyx_t_1; __pyx_t_1 = 0; } - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2211 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2217 * return False * k += 1 * return True # <<<<<<<<<<<<<< @@ -65754,7 +66129,7 @@ static PyObject *__pyx_pf_3_sa_16span_check(CYTHON_UNUSED PyObject *__pyx_self, * 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 = 2211; __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; @@ -65780,12 +66155,11 @@ static PyObject *__pyx_pw_3_sa_19span_inc(PyObject *__pyx_self, PyObject *__pyx_ PyObject *__pyx_v_vec = 0; PyObject *__pyx_v_i = 0; PyObject *__pyx_v_j = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__vec,&__pyx_n_s__i,&__pyx_n_s__j,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("span_inc (wrapper)", 0); - __pyx_self = __pyx_self; { + 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; @@ -65800,24 +66174,21 @@ static PyObject *__pyx_pw_3_sa_19span_inc(PyObject *__pyx_self, PyObject *__pyx_ kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__vec); - if (likely(values[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: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__i); - if (likely(values[1])) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__i)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("span_inc", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2213; __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: - values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__j); - if (likely(values[2])) 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 = 2213; __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 = 2213; __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; @@ -65832,7 +66203,7 @@ static PyObject *__pyx_pw_3_sa_19span_inc(PyObject *__pyx_self, PyObject *__pyx_ } 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 = 2213; __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("_sa.span_inc", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -65843,7 +66214,7 @@ static PyObject *__pyx_pw_3_sa_19span_inc(PyObject *__pyx_self, PyObject *__pyx_ return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2213 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2219 * return True * * def span_inc(vec, i, j): # <<<<<<<<<<<<<< @@ -65864,7 +66235,7 @@ static PyObject *__pyx_pf_3_sa_18span_inc(CYTHON_UNUSED PyObject *__pyx_self, Py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("span_inc", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2214 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2220 * * def span_inc(vec, i, j): * k = i # <<<<<<<<<<<<<< @@ -65874,7 +66245,7 @@ static PyObject *__pyx_pf_3_sa_18span_inc(CYTHON_UNUSED PyObject *__pyx_self, Py __Pyx_INCREF(__pyx_v_i); __pyx_v_k = __pyx_v_i; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2215 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2221 * def span_inc(vec, i, j): * k = i * while k <= j: # <<<<<<<<<<<<<< @@ -65882,13 +66253,12 @@ static PyObject *__pyx_pf_3_sa_18span_inc(CYTHON_UNUSED PyObject *__pyx_self, Py * k += 1 */ while (1) { - __pyx_t_1 = PyObject_RichCompare(__pyx_v_k, __pyx_v_j, Py_LE); 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_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2215; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2216 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2222 * k = i * while k <= j: * vec[k] += 1 # <<<<<<<<<<<<<< @@ -65897,23 +66267,23 @@ static PyObject *__pyx_pf_3_sa_18span_inc(CYTHON_UNUSED PyObject *__pyx_self, 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 = 2216; __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 = 2216; __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 = 2216; __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2217 + /* "/home/pauldb/workspace/cdec/python/src/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 = 2217; __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(__pyx_v_k); __pyx_v_k = __pyx_t_1; @@ -65942,12 +66312,11 @@ static PyObject *__pyx_pw_3_sa_21span_dec(PyObject *__pyx_self, PyObject *__pyx_ PyObject *__pyx_v_vec = 0; PyObject *__pyx_v_i = 0; PyObject *__pyx_v_j = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__vec,&__pyx_n_s__i,&__pyx_n_s__j,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("span_dec (wrapper)", 0); - __pyx_self = __pyx_self; { + 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; @@ -65962,24 +66331,21 @@ static PyObject *__pyx_pw_3_sa_21span_dec(PyObject *__pyx_self, PyObject *__pyx_ kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__vec); - if (likely(values[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: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__i); - if (likely(values[1])) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__i)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("span_dec", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2219; __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: - values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__j); - if (likely(values[2])) 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 = 2219; __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 = 2219; __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; @@ -65994,7 +66360,7 @@ static PyObject *__pyx_pw_3_sa_21span_dec(PyObject *__pyx_self, PyObject *__pyx_ } 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 = 2219; __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("_sa.span_dec", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -66005,7 +66371,7 @@ static PyObject *__pyx_pw_3_sa_21span_dec(PyObject *__pyx_self, PyObject *__pyx_ return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2219 +/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2225 * k += 1 * * def span_dec(vec, i, j): # <<<<<<<<<<<<<< @@ -66026,7 +66392,7 @@ static PyObject *__pyx_pf_3_sa_20span_dec(CYTHON_UNUSED PyObject *__pyx_self, Py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("span_dec", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2220 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2226 * * def span_dec(vec, i, j): * k = i # <<<<<<<<<<<<<< @@ -66036,7 +66402,7 @@ static PyObject *__pyx_pf_3_sa_20span_dec(CYTHON_UNUSED PyObject *__pyx_self, Py __Pyx_INCREF(__pyx_v_i); __pyx_v_k = __pyx_v_i; - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2221 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2227 * def span_dec(vec, i, j): * k = i * while k <= j: # <<<<<<<<<<<<<< @@ -66044,13 +66410,12 @@ static PyObject *__pyx_pf_3_sa_20span_dec(CYTHON_UNUSED PyObject *__pyx_self, Py * k += 1 */ while (1) { - __pyx_t_1 = PyObject_RichCompare(__pyx_v_k, __pyx_v_j, Py_LE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2221; __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 = 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 = 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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2222 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2228 * k = i * while k <= j: * vec[k] -= 1 # <<<<<<<<<<<<<< @@ -66058,21 +66423,21 @@ static PyObject *__pyx_pf_3_sa_20span_dec(CYTHON_UNUSED PyObject *__pyx_self, 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 = 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 = 2222; __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 = 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 = 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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2223 + /* "/home/pauldb/workspace/cdec/python/src/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 = 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 = 2229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_v_k); __pyx_v_k = __pyx_t_1; @@ -66108,7 +66473,7 @@ static int __pyx_pw_3_sa_13FeatureVector_1__cinit__(PyObject *__pyx_v_self, PyOb return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/features.pxi":7 +/* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":7 * * cdef class FeatureVector: * def __cinit__(self): # <<<<<<<<<<<<<< @@ -66127,7 +66492,7 @@ static int __pyx_pf_3_sa_13FeatureVector___cinit__(struct __pyx_obj_3_sa_Feature int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/features.pxi":8 + /* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":8 * cdef class FeatureVector: * def __cinit__(self): * self.names = IntList(INITIAL_CAPACITY, INCREMENT) # <<<<<<<<<<<<<< @@ -66155,7 +66520,7 @@ static int __pyx_pf_3_sa_13FeatureVector___cinit__(struct __pyx_obj_3_sa_Feature __pyx_v_self->names = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/features.pxi":9 + /* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":9 * def __cinit__(self): * self.names = IntList(INITIAL_CAPACITY, INCREMENT) * self.values = FloatList(INITIAL_CAPACITY, INCREMENT) # <<<<<<<<<<<<<< @@ -66201,11 +66566,11 @@ static PyObject *__pyx_pw_3_sa_13FeatureVector_3set(PyObject *__pyx_v_self, PyOb static PyObject *__pyx_pw_3_sa_13FeatureVector_3set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { unsigned int __pyx_v_name; float __pyx_v_value; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__name,&__pyx_n_s__value,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set (wrapper)", 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; @@ -66219,12 +66584,10 @@ static PyObject *__pyx_pw_3_sa_13FeatureVector_3set(PyObject *__pyx_v_self, PyOb kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__name); - if (likely(values[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: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value); - if (likely(values[1])) 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;} } @@ -66254,7 +66617,7 @@ static PyObject *__pyx_pw_3_sa_13FeatureVector_3set(PyObject *__pyx_v_self, PyOb return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/features.pxi":11 +/* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":11 * self.values = FloatList(INITIAL_CAPACITY, INCREMENT) * * def set(self, unsigned name, float value): # <<<<<<<<<<<<<< @@ -66272,7 +66635,7 @@ static PyObject *__pyx_pf_3_sa_13FeatureVector_2set(struct __pyx_obj_3_sa_Featur int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/features.pxi":12 + /* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":12 * * def set(self, unsigned name, float value): * self.names.append(name) # <<<<<<<<<<<<<< @@ -66286,7 +66649,7 @@ static PyObject *__pyx_pf_3_sa_13FeatureVector_2set(struct __pyx_obj_3_sa_Featur __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/features.pxi":13 + /* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":13 * def set(self, unsigned name, float value): * self.names.append(name) * self.values.append(value) # <<<<<<<<<<<<<< @@ -66325,7 +66688,7 @@ static PyObject *__pyx_pw_3_sa_13FeatureVector_5__iter__(PyObject *__pyx_v_self) return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/features.pxi":15 +/* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":15 * self.values.append(value) * * def __iter__(self): # <<<<<<<<<<<<<< @@ -66391,7 +66754,7 @@ static PyObject *__pyx_gb_3_sa_13FeatureVector_6generator5(__pyx_GeneratorObject __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/paulb/workspace/cdec/python/src/sa/features.pxi":17 + /* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":17 * def __iter__(self): * cdef unsigned i * for i in range(self.names.len): # <<<<<<<<<<<<<< @@ -66402,7 +66765,7 @@ static PyObject *__pyx_gb_3_sa_13FeatureVector_6generator5(__pyx_GeneratorObject 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/paulb/workspace/cdec/python/src/sa/features.pxi":18 + /* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":18 * cdef unsigned i * for i in range(self.names.len): * yield (FD.word(self.names[i]), self.values[i]) # <<<<<<<<<<<<<< @@ -66449,6 +66812,7 @@ static PyObject *__pyx_gb_3_sa_13FeatureVector_6generator5(__pyx_GeneratorObject __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_generator->resume_label = -1; + __Pyx_Generator_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return NULL; } @@ -66465,7 +66829,7 @@ static PyObject *__pyx_pw_3_sa_13FeatureVector_8__str__(PyObject *__pyx_v_self) } static PyObject *__pyx_gb_3_sa_13FeatureVector_7__str___2generator17(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "/home/paulb/workspace/cdec/python/src/sa/features.pxi":21 +/* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":21 * * def __str__(self): * return ' '.join('%s=%s' % feat for feat in self) # <<<<<<<<<<<<<< @@ -66540,10 +66904,18 @@ static PyObject *__pyx_gb_3_sa_13FeatureVector_7__str___2generator17(__pyx_Gener for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #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[13]; __pyx_lineno = 21; __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[13]; __pyx_lineno = 21; __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; - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #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[13]; __pyx_lineno = 21; __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[13]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { @@ -66560,7 +66932,7 @@ static PyObject *__pyx_gb_3_sa_13FeatureVector_7__str___2generator17(__pyx_Gener __Pyx_GIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_v_feat = __pyx_t_4; __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_155), __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_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 = 0; @@ -66591,11 +66963,12 @@ static PyObject *__pyx_gb_3_sa_13FeatureVector_7__str___2generator17(__pyx_Gener __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_generator->resume_label = -1; + __Pyx_Generator_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return NULL; } -/* "/home/paulb/workspace/cdec/python/src/sa/features.pxi":20 +/* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":20 * yield (FD.word(self.names[i]), self.values[i]) * * def __str__(self): # <<<<<<<<<<<<<< @@ -66624,7 +66997,7 @@ static PyObject *__pyx_pf_3_sa_13FeatureVector_7__str__(struct __pyx_obj_3_sa_Fe __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self); - /* "/home/paulb/workspace/cdec/python/src/sa/features.pxi":21 + /* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":21 * * def __str__(self): * return ' '.join('%s=%s' % feat for feat in self) # <<<<<<<<<<<<<< @@ -66680,7 +67053,7 @@ static int __pyx_pw_3_sa_6Scorer_1__init__(PyObject *__pyx_v_self, PyObject *__p return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/features.pxi":25 +/* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":25 * cdef class Scorer: * cdef models * def __init__(self, *models): # <<<<<<<<<<<<<< @@ -66703,7 +67076,7 @@ static int __pyx_pf_3_sa_6Scorer___init__(struct __pyx_obj_3_sa_Scorer *__pyx_v_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/features.pxi":26 + /* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":26 * cdef models * def __init__(self, *models): * names = [FD.index(model.__name__) for model in models] # <<<<<<<<<<<<<< @@ -66715,7 +67088,11 @@ static int __pyx_pf_3_sa_6Scorer___init__(struct __pyx_obj_3_sa_Scorer *__pyx_v_ __pyx_t_2 = ((PyObject *)__pyx_v_models); __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; for (;;) { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; + #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[13]; __pyx_lineno = 26; __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[13]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif __Pyx_XDECREF(__pyx_v_model); __pyx_v_model = __pyx_t_4; __pyx_t_4 = 0; @@ -66725,7 +67102,7 @@ static int __pyx_pf_3_sa_6Scorer___init__(struct __pyx_obj_3_sa_Scorer *__pyx_v_ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyInt_FromLong(((struct __pyx_vtabstruct_3_sa_StringMap *)__pyx_v_3_sa_FD->__pyx_vtab)->index(__pyx_v_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(PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_PyList_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; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -66733,7 +67110,7 @@ static int __pyx_pf_3_sa_6Scorer___init__(struct __pyx_obj_3_sa_Scorer *__pyx_v_ __pyx_v_names = __pyx_t_1; __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/features.pxi":27 + /* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":27 * def __init__(self, *models): * names = [FD.index(model.__name__) for model in models] * self.models = zip(names, models) # <<<<<<<<<<<<<< @@ -66772,7 +67149,7 @@ static int __pyx_pf_3_sa_6Scorer___init__(struct __pyx_obj_3_sa_Scorer *__pyx_v_ return __pyx_r; } -/* "/home/paulb/workspace/cdec/python/src/sa/features.pxi":29 +/* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":29 * self.models = zip(names, models) * * cdef FeatureVector score(self, ctx): # <<<<<<<<<<<<<< @@ -66799,7 +67176,7 @@ static struct __pyx_obj_3_sa_FeatureVector *__pyx_f_3_sa_6Scorer_score(struct __ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("score", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/features.pxi":30 + /* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":30 * * cdef FeatureVector score(self, ctx): * cdef FeatureVector scores = FeatureVector() # <<<<<<<<<<<<<< @@ -66811,7 +67188,7 @@ static struct __pyx_obj_3_sa_FeatureVector *__pyx_f_3_sa_6Scorer_score(struct __ __pyx_v_scores = ((struct __pyx_obj_3_sa_FeatureVector *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/features.pxi":31 + /* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":31 * cdef FeatureVector score(self, ctx): * cdef FeatureVector scores = FeatureVector() * for name, model in self.models: # <<<<<<<<<<<<<< @@ -66829,10 +67206,18 @@ static struct __pyx_obj_3_sa_FeatureVector *__pyx_f_3_sa_6Scorer_score(struct __ for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #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[13]; __pyx_lineno = 31; __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[13]; __pyx_lineno = 31; __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; - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #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[13]; __pyx_lineno = 31; __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[13]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { @@ -66846,27 +67231,33 @@ static struct __pyx_obj_3_sa_FeatureVector *__pyx_f_3_sa_6Scorer_score(struct __ } if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { PyObject* sequence = __pyx_t_4; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[13]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { - if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[13]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { - if (unlikely(PyList_GET_SIZE(sequence) != 2)) { - if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[13]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); + #else + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } else { + } else + { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); @@ -66877,12 +67268,13 @@ static struct __pyx_obj_3_sa_FeatureVector *__pyx_f_3_sa_6Scorer_score(struct __ index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); + __pyx_t_8 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[13]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L6_unpacking_done:; } @@ -66893,7 +67285,7 @@ static struct __pyx_obj_3_sa_FeatureVector *__pyx_f_3_sa_6Scorer_score(struct __ __pyx_v_model = __pyx_t_6; __pyx_t_6 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/features.pxi":32 + /* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":32 * cdef FeatureVector scores = FeatureVector() * for name, model in self.models: * scores.set(name, model(ctx)) # <<<<<<<<<<<<<< @@ -66925,7 +67317,7 @@ static struct __pyx_obj_3_sa_FeatureVector *__pyx_f_3_sa_6Scorer_score(struct __ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/features.pxi":33 + /* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":33 * for name, model in self.models: * scores.set(name, model(ctx)) * return scores # <<<<<<<<<<<<<< @@ -67371,7 +67763,7 @@ static PyTypeObject __pyx_type_3_sa_IntList = { #endif }; -static PyObject *__pyx_tp_new_3_sa_FeatureVector(PyTypeObject *t, PyObject *a, PyObject *k) { +static PyObject *__pyx_tp_new_3_sa_FeatureVector(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_3_sa_FeatureVector *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -67386,8 +67778,8 @@ static PyObject *__pyx_tp_new_3_sa_FeatureVector(PyTypeObject *t, PyObject *a, P static void __pyx_tp_dealloc_3_sa_FeatureVector(PyObject *o) { struct __pyx_obj_3_sa_FeatureVector *p = (struct __pyx_obj_3_sa_FeatureVector *)o; - Py_XDECREF(((PyObject *)p->names)); - Py_XDECREF(((PyObject *)p->values)); + Py_CLEAR(p->names); + Py_CLEAR(p->values); (*Py_TYPE(o)->tp_free)(o); } @@ -67607,7 +67999,7 @@ static PyObject *__pyx_sq_item_3_sa_Phrase(PyObject *o, Py_ssize_t i) { return r; } -static PyObject *__pyx_getprop_3_sa_6Phrase_words(PyObject *o, void *x) { +static PyObject *__pyx_getprop_3_sa_6Phrase_words(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_3_sa_6Phrase_5words_1__get__(o); } @@ -67799,10 +68191,10 @@ static PyObject *__pyx_tp_new_3_sa_Rule(PyTypeObject *t, PyObject *a, PyObject * static void __pyx_tp_dealloc_3_sa_Rule(PyObject *o) { struct __pyx_obj_3_sa_Rule *p = (struct __pyx_obj_3_sa_Rule *)o; - Py_XDECREF(((PyObject *)p->f)); - Py_XDECREF(((PyObject *)p->e)); - Py_XDECREF(((PyObject *)p->scores)); - Py_XDECREF(p->word_alignments); + Py_CLEAR(p->f); + Py_CLEAR(p->e); + Py_CLEAR(p->scores); + Py_CLEAR(p->word_alignments); (*Py_TYPE(o)->tp_free)(o); } @@ -67842,11 +68234,11 @@ static int __pyx_tp_clear_3_sa_Rule(PyObject *o) { return 0; } -static PyObject *__pyx_getprop_3_sa_4Rule_f(PyObject *o, void *x) { +static PyObject *__pyx_getprop_3_sa_4Rule_f(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_3_sa_4Rule_1f_1__get__(o); } -static PyObject *__pyx_getprop_3_sa_4Rule_e(PyObject *o, void *x) { +static PyObject *__pyx_getprop_3_sa_4Rule_e(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_3_sa_4Rule_1e_1__get__(o); } @@ -68018,7 +68410,7 @@ static PyTypeObject __pyx_type_3_sa_Rule = { }; static struct __pyx_vtabstruct_3_sa_StringMap __pyx_vtable_3_sa_StringMap; -static PyObject *__pyx_tp_new_3_sa_StringMap(PyTypeObject *t, PyObject *a, PyObject *k) { +static PyObject *__pyx_tp_new_3_sa_StringMap(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_3_sa_StringMap *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -68221,11 +68613,11 @@ static PyObject *__pyx_tp_new_3_sa_DataArray(PyTypeObject *t, PyObject *a, PyObj static void __pyx_tp_dealloc_3_sa_DataArray(PyObject *o) { struct __pyx_obj_3_sa_DataArray *p = (struct __pyx_obj_3_sa_DataArray *)o; - Py_XDECREF(p->word2id); - Py_XDECREF(p->id2word); - Py_XDECREF(((PyObject *)p->data)); - Py_XDECREF(((PyObject *)p->sent_id)); - Py_XDECREF(((PyObject *)p->sent_index)); + Py_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); } @@ -68278,11 +68670,11 @@ static PyObject *__pyx_sq_item_3_sa_DataArray(PyObject *o, Py_ssize_t i) { return r; } -static PyObject *__pyx_getprop_3_sa_9DataArray_word2id(PyObject *o, void *x) { +static PyObject *__pyx_getprop_3_sa_9DataArray_word2id(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_3_sa_9DataArray_7word2id_1__get__(o); } -static int __pyx_setprop_3_sa_9DataArray_word2id(PyObject *o, PyObject *v, void *x) { +static int __pyx_setprop_3_sa_9DataArray_word2id(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_3_sa_9DataArray_7word2id_3__set__(o, v); } @@ -68291,11 +68683,11 @@ static int __pyx_setprop_3_sa_9DataArray_word2id(PyObject *o, PyObject *v, void } } -static PyObject *__pyx_getprop_3_sa_9DataArray_id2word(PyObject *o, void *x) { +static PyObject *__pyx_getprop_3_sa_9DataArray_id2word(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_3_sa_9DataArray_7id2word_1__get__(o); } -static int __pyx_setprop_3_sa_9DataArray_id2word(PyObject *o, PyObject *v, void *x) { +static int __pyx_setprop_3_sa_9DataArray_id2word(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_3_sa_9DataArray_7id2word_3__set__(o, v); } @@ -68304,11 +68696,11 @@ static int __pyx_setprop_3_sa_9DataArray_id2word(PyObject *o, PyObject *v, void } } -static PyObject *__pyx_getprop_3_sa_9DataArray_data(PyObject *o, void *x) { +static PyObject *__pyx_getprop_3_sa_9DataArray_data(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_3_sa_9DataArray_4data_1__get__(o); } -static int __pyx_setprop_3_sa_9DataArray_data(PyObject *o, PyObject *v, void *x) { +static int __pyx_setprop_3_sa_9DataArray_data(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_3_sa_9DataArray_4data_3__set__(o, v); } @@ -68317,11 +68709,11 @@ static int __pyx_setprop_3_sa_9DataArray_data(PyObject *o, PyObject *v, void *x) } } -static PyObject *__pyx_getprop_3_sa_9DataArray_sent_id(PyObject *o, void *x) { +static PyObject *__pyx_getprop_3_sa_9DataArray_sent_id(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_3_sa_9DataArray_7sent_id_1__get__(o); } -static int __pyx_setprop_3_sa_9DataArray_sent_id(PyObject *o, PyObject *v, void *x) { +static int __pyx_setprop_3_sa_9DataArray_sent_id(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_3_sa_9DataArray_7sent_id_3__set__(o, v); } @@ -68330,11 +68722,11 @@ static int __pyx_setprop_3_sa_9DataArray_sent_id(PyObject *o, PyObject *v, void } } -static PyObject *__pyx_getprop_3_sa_9DataArray_sent_index(PyObject *o, void *x) { +static PyObject *__pyx_getprop_3_sa_9DataArray_sent_index(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_3_sa_9DataArray_10sent_index_1__get__(o); } -static int __pyx_setprop_3_sa_9DataArray_sent_index(PyObject *o, PyObject *v, void *x) { +static int __pyx_setprop_3_sa_9DataArray_sent_index(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_3_sa_9DataArray_10sent_index_3__set__(o, v); } @@ -68539,8 +68931,8 @@ static PyObject *__pyx_tp_new_3_sa_Alignment(PyTypeObject *t, PyObject *a, PyObj static void __pyx_tp_dealloc_3_sa_Alignment(PyObject *o) { struct __pyx_obj_3_sa_Alignment *p = (struct __pyx_obj_3_sa_Alignment *)o; - Py_XDECREF(((PyObject *)p->links)); - Py_XDECREF(((PyObject *)p->sent_index)); + Py_CLEAR(p->links); + Py_CLEAR(p->sent_index); (*Py_TYPE(o)->tp_free)(o); } @@ -68757,14 +69149,14 @@ static PyObject *__pyx_tp_new_3_sa_BiLex(PyTypeObject *t, PyObject *a, PyObject static void __pyx_tp_dealloc_3_sa_BiLex(PyObject *o) { struct __pyx_obj_3_sa_BiLex *p = (struct __pyx_obj_3_sa_BiLex *)o; - Py_XDECREF(((PyObject *)p->col1)); - Py_XDECREF(((PyObject *)p->col2)); - Py_XDECREF(((PyObject *)p->f_index)); - Py_XDECREF(((PyObject *)p->e_index)); - Py_XDECREF(p->id2eword); - Py_XDECREF(p->id2fword); - Py_XDECREF(p->eword2id); - Py_XDECREF(p->fword2id); + Py_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); } @@ -68994,7 +69386,7 @@ static PyTypeObject __pyx_type_3_sa_BiLex = { #endif }; -static PyObject *__pyx_tp_new_3_sa_BitSetIterator(PyTypeObject *t, PyObject *a, PyObject *k) { +static PyObject *__pyx_tp_new_3_sa_BitSetIterator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; return o; @@ -69163,7 +69555,7 @@ static PyTypeObject __pyx_type_3_sa_BitSetIterator = { #endif }; -static PyObject *__pyx_tp_new_3_sa_BitSet(PyTypeObject *t, PyObject *a, PyObject *k) { +static PyObject *__pyx_tp_new_3_sa_BitSet(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; if (__pyx_pw_3_sa_6BitSet_1__cinit__(o, __pyx_empty_tuple, NULL) < 0) { @@ -69347,7 +69739,7 @@ static PyTypeObject __pyx_type_3_sa_BitSet = { #endif }; -static PyObject *__pyx_tp_new_3_sa_VEBIterator(PyTypeObject *t, PyObject *a, PyObject *k) { +static PyObject *__pyx_tp_new_3_sa_VEBIterator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; return o; @@ -69717,8 +70109,8 @@ static PyObject *__pyx_tp_new_3_sa_LCP(PyTypeObject *t, PyObject *a, PyObject *k static void __pyx_tp_dealloc_3_sa_LCP(PyObject *o) { struct __pyx_obj_3_sa_LCP *p = (struct __pyx_obj_3_sa_LCP *)o; - Py_XDECREF(((PyObject *)p->sa)); - Py_XDECREF(((PyObject *)p->lcp)); + Py_CLEAR(p->sa); + Py_CLEAR(p->lcp); (*Py_TYPE(o)->tp_free)(o); } @@ -69906,7 +70298,7 @@ static PyTypeObject __pyx_type_3_sa_LCP = { }; static struct __pyx_vtabstruct_3_sa_Alphabet __pyx_vtable_3_sa_Alphabet; -static PyObject *__pyx_tp_new_3_sa_Alphabet(PyTypeObject *t, PyObject *a, PyObject *k) { +static PyObject *__pyx_tp_new_3_sa_Alphabet(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_3_sa_Alphabet *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -69932,9 +70324,9 @@ static void __pyx_tp_dealloc_3_sa_Alphabet(PyObject *o) { --Py_REFCNT(o); PyErr_Restore(etype, eval, etb); } - Py_XDECREF(((PyObject *)p->terminals)); - Py_XDECREF(((PyObject *)p->nonterminals)); - Py_XDECREF(((PyObject *)p->id2sym)); + Py_CLEAR(p->terminals); + Py_CLEAR(p->nonterminals); + Py_CLEAR(p->id2sym); (*Py_TYPE(o)->tp_free)(o); } @@ -69968,11 +70360,11 @@ static int __pyx_tp_clear_3_sa_Alphabet(PyObject *o) { return 0; } -static PyObject *__pyx_getprop_3_sa_8Alphabet_terminals(PyObject *o, void *x) { +static PyObject *__pyx_getprop_3_sa_8Alphabet_terminals(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_3_sa_8Alphabet_9terminals_1__get__(o); } -static PyObject *__pyx_getprop_3_sa_8Alphabet_nonterminals(PyObject *o, void *x) { +static PyObject *__pyx_getprop_3_sa_8Alphabet_nonterminals(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_3_sa_8Alphabet_12nonterminals_1__get__(o); } @@ -70344,8 +70736,8 @@ static PyObject *__pyx_tp_new_3_sa_Precomputation(PyTypeObject *t, PyObject *a, static void __pyx_tp_dealloc_3_sa_Precomputation(PyObject *o) { struct __pyx_obj_3_sa_Precomputation *p = (struct __pyx_obj_3_sa_Precomputation *)o; - Py_XDECREF(p->precomputed_index); - Py_XDECREF(p->precomputed_collocations); + Py_CLEAR(p->precomputed_index); + Py_CLEAR(p->precomputed_collocations); (*Py_TYPE(o)->tp_free)(o); } @@ -70552,9 +70944,9 @@ static PyObject *__pyx_tp_new_3_sa_SuffixArray(PyTypeObject *t, PyObject *a, PyO static void __pyx_tp_dealloc_3_sa_SuffixArray(PyObject *o) { struct __pyx_obj_3_sa_SuffixArray *p = (struct __pyx_obj_3_sa_SuffixArray *)o; - Py_XDECREF(((PyObject *)p->darray)); - Py_XDECREF(((PyObject *)p->sa)); - Py_XDECREF(((PyObject *)p->ha)); + Py_CLEAR(p->darray); + Py_CLEAR(p->sa); + Py_CLEAR(p->ha); (*Py_TYPE(o)->tp_free)(o); } @@ -70760,7 +71152,7 @@ static PyTypeObject __pyx_type_3_sa_SuffixArray = { #endif }; -static PyObject *__pyx_tp_new_3_sa_TrieNode(PyTypeObject *t, PyObject *a, PyObject *k) { +static PyObject *__pyx_tp_new_3_sa_TrieNode(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_3_sa_TrieNode *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -70774,7 +71166,7 @@ static PyObject *__pyx_tp_new_3_sa_TrieNode(PyTypeObject *t, PyObject *a, PyObje static void __pyx_tp_dealloc_3_sa_TrieNode(PyObject *o) { struct __pyx_obj_3_sa_TrieNode *p = (struct __pyx_obj_3_sa_TrieNode *)o; - Py_XDECREF(p->children); + Py_CLEAR(p->children); (*Py_TYPE(o)->tp_free)(o); } @@ -70796,11 +71188,11 @@ static int __pyx_tp_clear_3_sa_TrieNode(PyObject *o) { return 0; } -static PyObject *__pyx_getprop_3_sa_8TrieNode_children(PyObject *o, void *x) { +static PyObject *__pyx_getprop_3_sa_8TrieNode_children(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_3_sa_8TrieNode_8children_1__get__(o); } -static int __pyx_setprop_3_sa_8TrieNode_children(PyObject *o, PyObject *v, void *x) { +static int __pyx_setprop_3_sa_8TrieNode_children(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_3_sa_8TrieNode_8children_3__set__(o, v); } @@ -70988,9 +71380,9 @@ static PyObject *__pyx_tp_new_3_sa_ExtendedTrieNode(PyTypeObject *t, PyObject *a static void __pyx_tp_dealloc_3_sa_ExtendedTrieNode(PyObject *o) { struct __pyx_obj_3_sa_ExtendedTrieNode *p = (struct __pyx_obj_3_sa_ExtendedTrieNode *)o; - Py_XDECREF(p->phrase); - Py_XDECREF(p->phrase_location); - Py_XDECREF(p->suffix_link); + Py_CLEAR(p->phrase); + Py_CLEAR(p->phrase_location); + Py_CLEAR(p->suffix_link); __pyx_tp_dealloc_3_sa_TrieNode(o); } @@ -71026,11 +71418,11 @@ static int __pyx_tp_clear_3_sa_ExtendedTrieNode(PyObject *o) { return 0; } -static PyObject *__pyx_getprop_3_sa_16ExtendedTrieNode_phrase(PyObject *o, void *x) { +static PyObject *__pyx_getprop_3_sa_16ExtendedTrieNode_phrase(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_3_sa_16ExtendedTrieNode_6phrase_1__get__(o); } -static int __pyx_setprop_3_sa_16ExtendedTrieNode_phrase(PyObject *o, PyObject *v, void *x) { +static int __pyx_setprop_3_sa_16ExtendedTrieNode_phrase(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_3_sa_16ExtendedTrieNode_6phrase_3__set__(o, v); } @@ -71039,11 +71431,11 @@ static int __pyx_setprop_3_sa_16ExtendedTrieNode_phrase(PyObject *o, PyObject *v } } -static PyObject *__pyx_getprop_3_sa_16ExtendedTrieNode_phrase_location(PyObject *o, void *x) { +static PyObject *__pyx_getprop_3_sa_16ExtendedTrieNode_phrase_location(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_3_sa_16ExtendedTrieNode_15phrase_location_1__get__(o); } -static int __pyx_setprop_3_sa_16ExtendedTrieNode_phrase_location(PyObject *o, PyObject *v, void *x) { +static int __pyx_setprop_3_sa_16ExtendedTrieNode_phrase_location(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_3_sa_16ExtendedTrieNode_15phrase_location_3__set__(o, v); } @@ -71052,11 +71444,11 @@ static int __pyx_setprop_3_sa_16ExtendedTrieNode_phrase_location(PyObject *o, Py } } -static PyObject *__pyx_getprop_3_sa_16ExtendedTrieNode_suffix_link(PyObject *o, void *x) { +static PyObject *__pyx_getprop_3_sa_16ExtendedTrieNode_suffix_link(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_3_sa_16ExtendedTrieNode_11suffix_link_1__get__(o); } -static int __pyx_setprop_3_sa_16ExtendedTrieNode_suffix_link(PyObject *o, PyObject *v, void *x) { +static int __pyx_setprop_3_sa_16ExtendedTrieNode_suffix_link(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_3_sa_16ExtendedTrieNode_11suffix_link_3__set__(o, v); } @@ -71244,7 +71636,7 @@ static PyObject *__pyx_tp_new_3_sa_TrieTable(PyTypeObject *t, PyObject *a, PyObj static void __pyx_tp_dealloc_3_sa_TrieTable(PyObject *o) { struct __pyx_obj_3_sa_TrieTable *p = (struct __pyx_obj_3_sa_TrieTable *)o; - Py_XDECREF(p->root); + Py_CLEAR(p->root); (*Py_TYPE(o)->tp_free)(o); } @@ -71266,11 +71658,11 @@ static int __pyx_tp_clear_3_sa_TrieTable(PyObject *o) { return 0; } -static PyObject *__pyx_getprop_3_sa_9TrieTable_extended(PyObject *o, void *x) { +static PyObject *__pyx_getprop_3_sa_9TrieTable_extended(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_3_sa_9TrieTable_8extended_1__get__(o); } -static int __pyx_setprop_3_sa_9TrieTable_extended(PyObject *o, PyObject *v, void *x) { +static int __pyx_setprop_3_sa_9TrieTable_extended(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_3_sa_9TrieTable_8extended_3__set__(o, v); } @@ -71280,11 +71672,11 @@ static int __pyx_setprop_3_sa_9TrieTable_extended(PyObject *o, PyObject *v, void } } -static PyObject *__pyx_getprop_3_sa_9TrieTable_count(PyObject *o, void *x) { +static PyObject *__pyx_getprop_3_sa_9TrieTable_count(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_3_sa_9TrieTable_5count_1__get__(o); } -static int __pyx_setprop_3_sa_9TrieTable_count(PyObject *o, PyObject *v, void *x) { +static int __pyx_setprop_3_sa_9TrieTable_count(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_3_sa_9TrieTable_5count_3__set__(o, v); } @@ -71294,11 +71686,11 @@ static int __pyx_setprop_3_sa_9TrieTable_count(PyObject *o, PyObject *v, void *x } } -static PyObject *__pyx_getprop_3_sa_9TrieTable_root(PyObject *o, void *x) { +static PyObject *__pyx_getprop_3_sa_9TrieTable_root(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_3_sa_9TrieTable_4root_1__get__(o); } -static int __pyx_setprop_3_sa_9TrieTable_root(PyObject *o, PyObject *v, void *x) { +static int __pyx_setprop_3_sa_9TrieTable_root(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_3_sa_9TrieTable_4root_3__set__(o, v); } @@ -71488,7 +71880,7 @@ static PyObject *__pyx_tp_new_3_sa_PhraseLocation(PyTypeObject *t, PyObject *a, static void __pyx_tp_dealloc_3_sa_PhraseLocation(PyObject *o) { struct __pyx_obj_3_sa_PhraseLocation *p = (struct __pyx_obj_3_sa_PhraseLocation *)o; - Py_XDECREF(((PyObject *)p->arr)); + Py_CLEAR(p->arr); (*Py_TYPE(o)->tp_free)(o); } @@ -71682,7 +72074,7 @@ static PyObject *__pyx_tp_new_3_sa_Sampler(PyTypeObject *t, PyObject *a, PyObjec static void __pyx_tp_dealloc_3_sa_Sampler(PyObject *o) { struct __pyx_obj_3_sa_Sampler *p = (struct __pyx_obj_3_sa_Sampler *)o; - Py_XDECREF(((PyObject *)p->sa)); + Py_CLEAR(p->sa); (*Py_TYPE(o)->tp_free)(o); } @@ -71902,30 +72294,30 @@ static PyObject *__pyx_tp_new_3_sa_HieroCachingRuleFactory(PyTypeObject *t, PyOb static void __pyx_tp_dealloc_3_sa_HieroCachingRuleFactory(PyObject *o) { struct __pyx_obj_3_sa_HieroCachingRuleFactory *p = (struct __pyx_obj_3_sa_HieroCachingRuleFactory *)o; - Py_XDECREF(((PyObject *)p->rules)); - Py_XDECREF(((PyObject *)p->sampler)); - Py_XDECREF(((PyObject *)p->scorer)); - Py_XDECREF(p->precomputed_index); - Py_XDECREF(p->precomputed_collocations); - Py_XDECREF(p->precompute_file); - Py_XDECREF(p->max_rank); - Py_XDECREF(p->prev_norm_prefix); - Py_XDECREF(((PyObject *)p->fsa)); - Py_XDECREF(((PyObject *)p->fda)); - Py_XDECREF(((PyObject *)p->eda)); - Py_XDECREF(((PyObject *)p->alignment)); - Py_XDECREF(((PyObject *)p->eid2symid)); - Py_XDECREF(((PyObject *)p->fid2symid)); - Py_XDECREF(((PyObject *)p->findexes)); - Py_XDECREF(((PyObject *)p->findexes1)); - Py_XDECREF(p->samples_f); - Py_XDECREF(p->phrases_f); - Py_XDECREF(p->phrases_e); - Py_XDECREF(p->phrases_fe); - Py_XDECREF(p->phrases_al); - Py_XDECREF(p->bilex_f); - Py_XDECREF(p->bilex_e); - Py_XDECREF(p->bilex_fe); + 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->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->bilex_f); + Py_CLEAR(p->bilex_e); + Py_CLEAR(p->bilex_fe); (*Py_TYPE(o)->tp_free)(o); } @@ -72262,7 +72654,7 @@ static PyTypeObject __pyx_type_3_sa_HieroCachingRuleFactory = { }; static struct __pyx_vtabstruct_3_sa_Scorer __pyx_vtable_3_sa_Scorer; -static PyObject *__pyx_tp_new_3_sa_Scorer(PyTypeObject *t, PyObject *a, PyObject *k) { +static PyObject *__pyx_tp_new_3_sa_Scorer(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_3_sa_Scorer *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -72274,7 +72666,7 @@ static PyObject *__pyx_tp_new_3_sa_Scorer(PyTypeObject *t, PyObject *a, PyObject static void __pyx_tp_dealloc_3_sa_Scorer(PyObject *o) { struct __pyx_obj_3_sa_Scorer *p = (struct __pyx_obj_3_sa_Scorer *)o; - Py_XDECREF(p->models); + Py_CLEAR(p->models); (*Py_TYPE(o)->tp_free)(o); } @@ -72454,7 +72846,7 @@ static PyTypeObject __pyx_type_3_sa_Scorer = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct____iter__(PyTypeObject *t, PyObject *a, PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct____iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct____iter__ *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -72465,7 +72857,7 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct____iter__(PyTypeObject *t, static void __pyx_tp_dealloc_3_sa___pyx_scope_struct____iter__(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct____iter__ *p = (struct __pyx_obj_3_sa___pyx_scope_struct____iter__ *)o; - Py_XDECREF(((PyObject *)p->__pyx_v_self)); + Py_CLEAR(p->__pyx_v_self); (*Py_TYPE(o)->tp_free)(o); } @@ -72645,7 +73037,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct____iter__ = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_1_read_bitext(PyTypeObject *t, PyObject *a, PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_1_read_bitext(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_1_read_bitext *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -72656,7 +73048,7 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_1_read_bitext(PyTypeObject static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_1_read_bitext(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_1_read_bitext *p = (struct __pyx_obj_3_sa___pyx_scope_struct_1_read_bitext *)o; - Py_XDECREF(p->__pyx_v_fp); + Py_CLEAR(p->__pyx_v_fp); (*Py_TYPE(o)->tp_free)(o); } @@ -72836,7 +73228,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_1_read_bitext = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_2_genexpr(PyTypeObject *t, PyObject *a, PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_2_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_2_genexpr *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -72849,9 +73241,9 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_2_genexpr(PyTypeObject *t, static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_2_genexpr(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_3_sa___pyx_scope_struct_2_genexpr *)o; - Py_XDECREF(((PyObject *)p->__pyx_outer_scope)); - Py_XDECREF(p->__pyx_v_line); - Py_XDECREF(p->__pyx_t_0); + Py_CLEAR(p->__pyx_outer_scope); + Py_CLEAR(p->__pyx_v_line); + Py_CLEAR(p->__pyx_t_0); (*Py_TYPE(o)->tp_free)(o); } @@ -73043,7 +73435,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_2_genexpr = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_3_compute_stats(PyTypeObject *t, PyObject *a, PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_3_compute_stats(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_3_compute_stats *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -73059,12 +73451,12 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_3_compute_stats(PyTypeObje static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_3_compute_stats(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_3_compute_stats *p = (struct __pyx_obj_3_sa___pyx_scope_struct_3_compute_stats *)o; - Py_XDECREF(((PyObject *)p->__pyx_v_ngram)); - Py_XDECREF(((PyObject *)p->__pyx_v_ngram_start)); - Py_XDECREF(((PyObject *)p->__pyx_v_ngram_starts)); - Py_XDECREF(((PyObject *)p->__pyx_v_run_start)); - Py_XDECREF(((PyObject *)p->__pyx_v_self)); - Py_XDECREF(((PyObject *)p->__pyx_v_veb)); + 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); (*Py_TYPE(o)->tp_free)(o); } @@ -73274,7 +73666,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_3_compute_stats = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_4_make_lattice(PyTypeObject *t, PyObject *a, PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_4_make_lattice(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_4_make_lattice *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -73286,8 +73678,8 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_4_make_lattice(PyTypeObjec static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_4_make_lattice(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_4_make_lattice *p = (struct __pyx_obj_3_sa___pyx_scope_struct_4_make_lattice *)o; - Py_XDECREF(p->__pyx_v_word_ids); - Py_XDECREF(p->__pyx_v_words); + Py_CLEAR(p->__pyx_v_word_ids); + Py_CLEAR(p->__pyx_v_words); (*Py_TYPE(o)->tp_free)(o); } @@ -73473,7 +73865,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_4_make_lattice = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_5_genexpr(PyTypeObject *t, PyObject *a, PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_5_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_5_genexpr *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -73486,9 +73878,9 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_5_genexpr(PyTypeObject *t, static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_5_genexpr(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_3_sa___pyx_scope_struct_5_genexpr *)o; - Py_XDECREF(((PyObject *)p->__pyx_outer_scope)); - Py_XDECREF(p->__pyx_v_word); - Py_XDECREF(p->__pyx_t_0); + Py_CLEAR(p->__pyx_outer_scope); + Py_CLEAR(p->__pyx_v_word); + Py_CLEAR(p->__pyx_t_0); (*Py_TYPE(o)->tp_free)(o); } @@ -73680,7 +74072,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_5_genexpr = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_6_genexpr(PyTypeObject *t, PyObject *a, PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_6_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_6_genexpr *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -73693,9 +74085,9 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_6_genexpr(PyTypeObject *t, static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_6_genexpr(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_3_sa___pyx_scope_struct_6_genexpr *)o; - Py_XDECREF(((PyObject *)p->__pyx_outer_scope)); - Py_XDECREF(p->__pyx_v_word); - Py_XDECREF(p->__pyx_t_0); + Py_CLEAR(p->__pyx_outer_scope); + Py_CLEAR(p->__pyx_v_word); + Py_CLEAR(p->__pyx_t_0); (*Py_TYPE(o)->tp_free)(o); } @@ -73887,7 +74279,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_6_genexpr = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_7_decode_lattice(PyTypeObject *t, PyObject *a, PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_7_decode_lattice(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_7_decode_lattice *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -73898,7 +74290,7 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_7_decode_lattice(PyTypeObj static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_7_decode_lattice(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_7_decode_lattice *p = (struct __pyx_obj_3_sa___pyx_scope_struct_7_decode_lattice *)o; - Py_XDECREF(p->__pyx_v_lattice); + Py_CLEAR(p->__pyx_v_lattice); (*Py_TYPE(o)->tp_free)(o); } @@ -74078,7 +74470,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_7_decode_lattice = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_8_genexpr(PyTypeObject *t, PyObject *a, PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_8_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_8_genexpr *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -74097,15 +74489,15 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_8_genexpr(PyTypeObject *t, static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_8_genexpr(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_8_genexpr *p = (struct __pyx_obj_3_sa___pyx_scope_struct_8_genexpr *)o; - Py_XDECREF(((PyObject *)p->__pyx_outer_scope)); - Py_XDECREF(p->__pyx_v_arc); - Py_XDECREF(p->__pyx_v_dist); - Py_XDECREF(p->__pyx_v_node); - Py_XDECREF(p->__pyx_v_sym); - Py_XDECREF(p->__pyx_v_weight); - Py_XDECREF(p->__pyx_t_0); - Py_XDECREF(p->__pyx_t_3); - Py_XDECREF(p->__pyx_t_4); + 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); (*Py_TYPE(o)->tp_free)(o); } @@ -74333,7 +74725,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_8_genexpr = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_9_decode_sentence(PyTypeObject *t, PyObject *a, PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_9_decode_sentence(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_9_decode_sentence *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -74344,7 +74736,7 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_9_decode_sentence(PyTypeOb static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_9_decode_sentence(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_9_decode_sentence *p = (struct __pyx_obj_3_sa___pyx_scope_struct_9_decode_sentence *)o; - Py_XDECREF(p->__pyx_v_lattice); + Py_CLEAR(p->__pyx_v_lattice); (*Py_TYPE(o)->tp_free)(o); } @@ -74524,7 +74916,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_9_decode_sentence = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_10_genexpr(PyTypeObject *t, PyObject *a, PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_10_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_10_genexpr *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -74538,10 +74930,10 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_10_genexpr(PyTypeObject *t static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_10_genexpr(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_10_genexpr *p = (struct __pyx_obj_3_sa___pyx_scope_struct_10_genexpr *)o; - Py_XDECREF(((PyObject *)p->__pyx_outer_scope)); - Py_XDECREF(p->__pyx_v__); - Py_XDECREF(p->__pyx_v_sym); - Py_XDECREF(p->__pyx_t_0); + Py_CLEAR(p->__pyx_outer_scope); + Py_CLEAR(p->__pyx_v__); + Py_CLEAR(p->__pyx_v_sym); + Py_CLEAR(p->__pyx_t_0); (*Py_TYPE(o)->tp_free)(o); } @@ -74739,7 +75131,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_10_genexpr = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_11_encode_words(PyTypeObject *t, PyObject *a, PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_11_encode_words(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_11_encode_words *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -74750,7 +75142,7 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_11_encode_words(PyTypeObje static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_11_encode_words(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_11_encode_words *p = (struct __pyx_obj_3_sa___pyx_scope_struct_11_encode_words *)o; - Py_XDECREF(p->__pyx_v_words); + Py_CLEAR(p->__pyx_v_words); (*Py_TYPE(o)->tp_free)(o); } @@ -74930,7 +75322,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_11_encode_words = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_12_genexpr(PyTypeObject *t, PyObject *a, PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_12_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_12_genexpr *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -74943,9 +75335,9 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_12_genexpr(PyTypeObject *t static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_12_genexpr(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_12_genexpr *p = (struct __pyx_obj_3_sa___pyx_scope_struct_12_genexpr *)o; - Py_XDECREF(((PyObject *)p->__pyx_outer_scope)); - Py_XDECREF(p->__pyx_v_word); - Py_XDECREF(p->__pyx_t_0); + Py_CLEAR(p->__pyx_outer_scope); + Py_CLEAR(p->__pyx_v_word); + Py_CLEAR(p->__pyx_t_0); (*Py_TYPE(o)->tp_free)(o); } @@ -75137,7 +75529,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_12_genexpr = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_13_decode_words(PyTypeObject *t, PyObject *a, PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_13_decode_words(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_13_decode_words *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -75148,7 +75540,7 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_13_decode_words(PyTypeObje static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_13_decode_words(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_13_decode_words *p = (struct __pyx_obj_3_sa___pyx_scope_struct_13_decode_words *)o; - Py_XDECREF(p->__pyx_v_syms); + Py_CLEAR(p->__pyx_v_syms); (*Py_TYPE(o)->tp_free)(o); } @@ -75328,7 +75720,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_13_decode_words = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_14_genexpr(PyTypeObject *t, PyObject *a, PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_14_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_14_genexpr *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -75341,9 +75733,9 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_14_genexpr(PyTypeObject *t static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_14_genexpr(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_14_genexpr *p = (struct __pyx_obj_3_sa___pyx_scope_struct_14_genexpr *)o; - Py_XDECREF(((PyObject *)p->__pyx_outer_scope)); - Py_XDECREF(p->__pyx_v_sym); - Py_XDECREF(p->__pyx_t_0); + Py_CLEAR(p->__pyx_outer_scope); + Py_CLEAR(p->__pyx_v_sym); + Py_CLEAR(p->__pyx_t_0); (*Py_TYPE(o)->tp_free)(o); } @@ -75535,7 +75927,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_14_genexpr = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_15___iter__(PyTypeObject *t, PyObject *a, PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_15___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_15___iter__ *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -75546,7 +75938,7 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_15___iter__(PyTypeObject * static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_15___iter__(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_15___iter__ *p = (struct __pyx_obj_3_sa___pyx_scope_struct_15___iter__ *)o; - Py_XDECREF(((PyObject *)p->__pyx_v_self)); + Py_CLEAR(p->__pyx_v_self); (*Py_TYPE(o)->tp_free)(o); } @@ -75726,7 +76118,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_15___iter__ = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_16___str__(PyTypeObject *t, PyObject *a, PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_16___str__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_16___str__ *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -75737,7 +76129,7 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_16___str__(PyTypeObject *t static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_16___str__(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_16___str__ *p = (struct __pyx_obj_3_sa___pyx_scope_struct_16___str__ *)o; - Py_XDECREF(((PyObject *)p->__pyx_v_self)); + Py_CLEAR(p->__pyx_v_self); (*Py_TYPE(o)->tp_free)(o); } @@ -75917,7 +76309,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_16___str__ = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_17_genexpr(PyTypeObject *t, PyObject *a, PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_17_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_17_genexpr *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -75930,9 +76322,9 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_17_genexpr(PyTypeObject *t static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_17_genexpr(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_17_genexpr *p = (struct __pyx_obj_3_sa___pyx_scope_struct_17_genexpr *)o; - Py_XDECREF(((PyObject *)p->__pyx_outer_scope)); - Py_XDECREF(p->__pyx_v_a); - Py_XDECREF(p->__pyx_t_0); + Py_CLEAR(p->__pyx_outer_scope); + Py_CLEAR(p->__pyx_v_a); + Py_CLEAR(p->__pyx_t_0); (*Py_TYPE(o)->tp_free)(o); } @@ -76124,7 +76516,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_17_genexpr = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_18_alignments(PyTypeObject *t, PyObject *a, PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_18_alignments(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_18_alignments *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -76137,9 +76529,9 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_18_alignments(PyTypeObject static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_18_alignments(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_18_alignments *p = (struct __pyx_obj_3_sa___pyx_scope_struct_18_alignments *)o; - Py_XDECREF(p->__pyx_v_point); - Py_XDECREF(((PyObject *)p->__pyx_v_self)); - Py_XDECREF(p->__pyx_t_0); + Py_CLEAR(p->__pyx_v_point); + Py_CLEAR(p->__pyx_v_self); + Py_CLEAR(p->__pyx_t_0); (*Py_TYPE(o)->tp_free)(o); } @@ -76331,7 +76723,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_18_alignments = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_19_input(PyTypeObject *t, PyObject *a, PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_19_input(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_19_input *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -76390,71 +76782,71 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_19_input(PyTypeObject *t, p->__pyx_v_xcat_index = 0; p->__pyx_v_xnode = 0; p->__pyx_v_xroot = 0; - p->__pyx_t_2 = 0; p->__pyx_t_3 = 0; p->__pyx_t_4 = 0; + p->__pyx_t_5 = 0; return o; } static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_19_input(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_19_input *p = (struct __pyx_obj_3_sa___pyx_scope_struct_19_input *)o; - Py_XDECREF(p->__pyx_v_alignment); - Py_XDECREF(p->__pyx_v_als); - Py_XDECREF(p->__pyx_v_alslist); - Py_XDECREF(((PyObject *)p->__pyx_v_chunklen)); - Py_XDECREF(p->__pyx_v_count); - Py_XDECREF(p->__pyx_v_e); - Py_XDECREF(p->__pyx_v_elist); - Py_XDECREF(p->__pyx_v_extract); - Py_XDECREF(p->__pyx_v_extract_start); - Py_XDECREF(p->__pyx_v_extract_stop); - Py_XDECREF(((PyObject *)p->__pyx_v_extracts)); - Py_XDECREF(p->__pyx_v_f); - Py_XDECREF(((PyObject *)p->__pyx_v_f_syms)); - Py_XDECREF(p->__pyx_v_fcount); - Py_XDECREF(p->__pyx_v_fphrases); - Py_XDECREF(((PyObject *)p->__pyx_v_frontier)); - Py_XDECREF(p->__pyx_v_frontier_nodes); - Py_XDECREF(p->__pyx_v_fwords); - Py_XDECREF(p->__pyx_v_genexpr); - Py_XDECREF(((PyObject *)p->__pyx_v_hiero_phrase)); - Py_XDECREF(p->__pyx_v_input_match); - Py_XDECREF(p->__pyx_v_intersect_start_time); - Py_XDECREF(p->__pyx_v_intersect_stop_time); - Py_XDECREF(p->__pyx_v_is_shadow_path); - Py_XDECREF(((PyObject *)p->__pyx_v_key)); - Py_XDECREF(p->__pyx_v_lex_i); - Py_XDECREF(p->__pyx_v_lex_j); - Py_XDECREF(p->__pyx_v_loc); - Py_XDECREF(((PyObject *)p->__pyx_v_locs)); - Py_XDECREF(p->__pyx_v_max_locs); - Py_XDECREF(p->__pyx_v_meta); - Py_XDECREF(((PyObject *)p->__pyx_v_new_frontier)); - Py_XDECREF(p->__pyx_v_new_node); - Py_XDECREF(((PyObject *)p->__pyx_v_next_states)); - Py_XDECREF(p->__pyx_v_node); - Py_XDECREF(((PyObject *)p->__pyx_v_nodes_isteps_away_buffer)); - Py_XDECREF(p->__pyx_v_pathlen); - Py_XDECREF(p->__pyx_v_phrase); - Py_XDECREF(((PyObject *)p->__pyx_v_phrase_location)); - Py_XDECREF(p->__pyx_v_prefix); - Py_XDECREF(((PyObject *)p->__pyx_v_reachable_buffer)); - Py_XDECREF(p->__pyx_v_sa_range); - Py_XDECREF(((PyObject *)p->__pyx_v_sample)); - Py_XDECREF(((PyObject *)p->__pyx_v_scores)); - Py_XDECREF(((PyObject *)p->__pyx_v_seen_phrases)); - Py_XDECREF(((PyObject *)p->__pyx_v_self)); - Py_XDECREF(p->__pyx_v_spanlen); - Py_XDECREF(p->__pyx_v_stop_time); - Py_XDECREF(p->__pyx_v_suffix_link); - Py_XDECREF(p->__pyx_v_suffix_link_xcat_index); - Py_XDECREF(p->__pyx_v_word_id); - Py_XDECREF(p->__pyx_v_xcat_index); - Py_XDECREF(p->__pyx_v_xnode); - Py_XDECREF(p->__pyx_v_xroot); - Py_XDECREF(p->__pyx_t_2); - Py_XDECREF(p->__pyx_t_3); - Py_XDECREF(p->__pyx_t_4); + 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_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_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); (*Py_TYPE(o)->tp_free)(o); } @@ -76623,15 +77015,15 @@ static int __pyx_tp_traverse_3_sa___pyx_scope_struct_19_input(PyObject *o, visit if (p->__pyx_v_xroot) { e = (*v)(p->__pyx_v_xroot, a); if (e) return e; } - if (p->__pyx_t_2) { - e = (*v)(p->__pyx_t_2, a); if (e) return e; - } if (p->__pyx_t_3) { e = (*v)(p->__pyx_t_3, a); if (e) return e; } if (p->__pyx_t_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; } @@ -76800,15 +77192,15 @@ static int __pyx_tp_clear_3_sa___pyx_scope_struct_19_input(PyObject *o) { tmp = ((PyObject*)p->__pyx_v_xroot); p->__pyx_v_xroot = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_t_2); - p->__pyx_t_2 = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_t_3); p->__pyx_t_3 = Py_None; Py_INCREF(Py_None); 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; } @@ -76970,7 +77362,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_19_input = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_20_genexpr(PyTypeObject *t, PyObject *a, PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_20_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_20_genexpr *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -76983,9 +77375,9 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_20_genexpr(PyTypeObject *t static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_20_genexpr(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_20_genexpr *p = (struct __pyx_obj_3_sa___pyx_scope_struct_20_genexpr *)o; - Py_XDECREF(((PyObject *)p->__pyx_outer_scope)); - Py_XDECREF(p->__pyx_v_word); - Py_XDECREF(p->__pyx_t_0); + Py_CLEAR(p->__pyx_outer_scope); + Py_CLEAR(p->__pyx_v_word); + Py_CLEAR(p->__pyx_t_0); (*Py_TYPE(o)->tp_free)(o); } @@ -77177,7 +77569,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_20_genexpr = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_21_add_instance(PyTypeObject *t, PyObject *a, PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_21_add_instance(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_21_add_instance *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -77198,17 +77590,17 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_21_add_instance(PyTypeObje static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_21_add_instance(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_21_add_instance *p = (struct __pyx_obj_3_sa___pyx_scope_struct_21_add_instance *)o; - Py_XDECREF(p->__pyx_v_al); - Py_XDECREF(p->__pyx_v_cover); - Py_XDECREF(p->__pyx_v_e_nt_cover); - Py_XDECREF(p->__pyx_v_e_words); - Py_XDECREF(p->__pyx_v_ef_span); - Py_XDECREF(p->__pyx_v_extract); - Py_XDECREF(p->__pyx_v_f_len); - Py_XDECREF(p->__pyx_v_f_words); - Py_XDECREF(p->__pyx_v_fe_span); - Py_XDECREF(p->__pyx_v_rules); - Py_XDECREF(((PyObject *)p->__pyx_v_self)); + 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); (*Py_TYPE(o)->tp_free)(o); } @@ -77448,7 +77840,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_21_add_instance = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_22_form_rule(PyTypeObject *t, PyObject *a, PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_22_form_rule(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_22_form_rule *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -77460,8 +77852,8 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_22_form_rule(PyTypeObject static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_22_form_rule(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_22_form_rule *p = (struct __pyx_obj_3_sa___pyx_scope_struct_22_form_rule *)o; - Py_XDECREF(p->__pyx_v_links); - Py_XDECREF(((PyObject *)p->__pyx_v_self)); + Py_CLEAR(p->__pyx_v_links); + Py_CLEAR(p->__pyx_v_self); (*Py_TYPE(o)->tp_free)(o); } @@ -77647,7 +78039,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_22_form_rule = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_23_genexpr(PyTypeObject *t, PyObject *a, PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_23_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_23_genexpr *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -77661,10 +78053,10 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_23_genexpr(PyTypeObject *t static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_23_genexpr(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_23_genexpr *p = (struct __pyx_obj_3_sa___pyx_scope_struct_23_genexpr *)o; - Py_XDECREF(((PyObject *)p->__pyx_outer_scope)); - Py_XDECREF(p->__pyx_v_i); - Py_XDECREF(p->__pyx_v_j); - Py_XDECREF(p->__pyx_t_0); + Py_CLEAR(p->__pyx_outer_scope); + Py_CLEAR(p->__pyx_v_i); + Py_CLEAR(p->__pyx_v_j); + Py_CLEAR(p->__pyx_t_0); (*Py_TYPE(o)->tp_free)(o); } @@ -77862,7 +78254,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_23_genexpr = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_24_fmt_rule(PyTypeObject *t, PyObject *a, PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_24_fmt_rule(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_24_fmt_rule *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -77874,8 +78266,8 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_24_fmt_rule(PyTypeObject * static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_24_fmt_rule(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_24_fmt_rule *p = (struct __pyx_obj_3_sa___pyx_scope_struct_24_fmt_rule *)o; - Py_XDECREF(p->__pyx_v_a); - Py_XDECREF(((PyObject *)p->__pyx_v_self)); + Py_CLEAR(p->__pyx_v_a); + Py_CLEAR(p->__pyx_v_self); (*Py_TYPE(o)->tp_free)(o); } @@ -78061,7 +78453,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_24_fmt_rule = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_25_genexpr(PyTypeObject *t, PyObject *a, PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_25_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_25_genexpr *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -78074,9 +78466,9 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_25_genexpr(PyTypeObject *t static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_25_genexpr(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_25_genexpr *p = (struct __pyx_obj_3_sa___pyx_scope_struct_25_genexpr *)o; - Py_XDECREF(((PyObject *)p->__pyx_outer_scope)); - Py_XDECREF(p->__pyx_v_packed); - Py_XDECREF(p->__pyx_t_0); + Py_CLEAR(p->__pyx_outer_scope); + Py_CLEAR(p->__pyx_v_packed); + Py_CLEAR(p->__pyx_t_0); (*Py_TYPE(o)->tp_free)(o); } @@ -78268,7 +78660,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_25_genexpr = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_26_get_f_phrases(PyTypeObject *t, PyObject *a, PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_26_get_f_phrases(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_26_get_f_phrases *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -78283,11 +78675,11 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_26_get_f_phrases(PyTypeObj static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_26_get_f_phrases(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_26_get_f_phrases *p = (struct __pyx_obj_3_sa___pyx_scope_struct_26_get_f_phrases *)o; - Py_XDECREF(p->__pyx_v_extract); - Py_XDECREF(p->__pyx_v_f_len); - Py_XDECREF(p->__pyx_v_f_words); - Py_XDECREF(p->__pyx_v_phrases); - Py_XDECREF(((PyObject *)p->__pyx_v_self)); + 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); (*Py_TYPE(o)->tp_free)(o); } @@ -78491,7 +78883,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_26_get_f_phrases = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_27___iter__(PyTypeObject *t, PyObject *a, PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_27___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_27___iter__ *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -78502,7 +78894,7 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_27___iter__(PyTypeObject * static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_27___iter__(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_27___iter__ *p = (struct __pyx_obj_3_sa___pyx_scope_struct_27___iter__ *)o; - Py_XDECREF(((PyObject *)p->__pyx_v_self)); + Py_CLEAR(p->__pyx_v_self); (*Py_TYPE(o)->tp_free)(o); } @@ -78682,7 +79074,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_27___iter__ = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_28___str__(PyTypeObject *t, PyObject *a, PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_28___str__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_28___str__ *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -78693,7 +79085,7 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_28___str__(PyTypeObject *t static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_28___str__(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_28___str__ *p = (struct __pyx_obj_3_sa___pyx_scope_struct_28___str__ *)o; - Py_XDECREF(((PyObject *)p->__pyx_v_self)); + Py_CLEAR(p->__pyx_v_self); (*Py_TYPE(o)->tp_free)(o); } @@ -78873,7 +79265,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_28___str__ = { #endif }; -static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_29_genexpr(PyTypeObject *t, PyObject *a, PyObject *k) { +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_29_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_3_sa___pyx_scope_struct_29_genexpr *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; @@ -78886,9 +79278,9 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_29_genexpr(PyTypeObject *t static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_29_genexpr(PyObject *o) { struct __pyx_obj_3_sa___pyx_scope_struct_29_genexpr *p = (struct __pyx_obj_3_sa___pyx_scope_struct_29_genexpr *)o; - Py_XDECREF(((PyObject *)p->__pyx_outer_scope)); - Py_XDECREF(p->__pyx_v_feat); - Py_XDECREF(p->__pyx_t_0); + Py_CLEAR(p->__pyx_outer_scope); + Py_CLEAR(p->__pyx_v_feat); + Py_CLEAR(p->__pyx_t_0); (*Py_TYPE(o)->tp_free)(o); } @@ -79119,8 +79511,8 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_119, __pyx_k_119, sizeof(__pyx_k_119), 0, 0, 1, 1}, {&__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_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_kp_s_123, __pyx_k_123, sizeof(__pyx_k_123), 0, 0, 1, 0}, + {&__pyx_n_s_124, __pyx_k_124, sizeof(__pyx_k_124), 0, 0, 1, 1}, {&__pyx_kp_s_125, __pyx_k_125, sizeof(__pyx_k_125), 0, 0, 1, 0}, {&__pyx_kp_s_126, __pyx_k_126, sizeof(__pyx_k_126), 0, 0, 1, 0}, {&__pyx_kp_s_127, __pyx_k_127, sizeof(__pyx_k_127), 0, 0, 1, 0}, @@ -79132,18 +79524,19 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__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_137, __pyx_k_137, sizeof(__pyx_k_137), 0, 0, 1, 0}, + {&__pyx_kp_s_135, __pyx_k_135, sizeof(__pyx_k_135), 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_142, __pyx_k_142, sizeof(__pyx_k_142), 0, 0, 1, 0}, - {&__pyx_kp_s_146, __pyx_k_146, sizeof(__pyx_k_146), 0, 0, 1, 0}, - {&__pyx_n_s_152, __pyx_k_152, sizeof(__pyx_k_152), 0, 0, 1, 1}, - {&__pyx_kp_s_155, __pyx_k_155, sizeof(__pyx_k_155), 0, 0, 1, 0}, - {&__pyx_kp_s_157, __pyx_k_157, sizeof(__pyx_k_157), 0, 0, 1, 0}, - {&__pyx_kp_s_160, __pyx_k_160, sizeof(__pyx_k_160), 0, 0, 1, 0}, - {&__pyx_kp_s_164, __pyx_k_164, sizeof(__pyx_k_164), 0, 0, 1, 0}, + {&__pyx_kp_s_141, __pyx_k_141, sizeof(__pyx_k_141), 0, 0, 1, 0}, + {&__pyx_kp_s_143, __pyx_k_143, sizeof(__pyx_k_143), 0, 0, 1, 0}, + {&__pyx_kp_s_147, __pyx_k_147, sizeof(__pyx_k_147), 0, 0, 1, 0}, + {&__pyx_n_s_153, __pyx_k_153, sizeof(__pyx_k_153), 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_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 0, 1, 0}, {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0}, {&__pyx_kp_s_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 0, 1, 0}, @@ -79420,10 +79813,12 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__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__stderr, __pyx_k__stderr, sizeof(__pyx_k__stderr), 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__sys, __pyx_k__sys, sizeof(__pyx_k__sys), 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__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}, @@ -79460,8 +79855,8 @@ static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_zip = __Pyx_GetName(__pyx_b, __pyx_n_s__zip); if (!__pyx_builtin_zip) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_StopIteration = __Pyx_GetName(__pyx_b, __pyx_n_s__StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_cmp = __Pyx_GetName(__pyx_b, __pyx_n_s__cmp); if (!__pyx_builtin_cmp) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_sorted = __Pyx_GetName(__pyx_b, __pyx_n_s__sorted); if (!__pyx_builtin_sorted) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_max = __Pyx_GetName(__pyx_b, __pyx_n_s__max); if (!__pyx_builtin_max) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_sorted = __Pyx_GetName(__pyx_b, __pyx_n_s__sorted); if (!__pyx_builtin_sorted) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_max = __Pyx_GetName(__pyx_b, __pyx_n_s__max); if (!__pyx_builtin_max) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; @@ -79471,7 +79866,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":20 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -79488,7 +79883,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_int_1000); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_10)); - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":21 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":21 * self.id2word = ["END_OF_FILE", "END_OF_LINE"] * self.data = IntList(1000,1000) * self.sent_id = IntList(1000,1000) # <<<<<<<<<<<<<< @@ -79505,7 +79900,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_int_1000); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_11)); - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":22 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":22 * self.data = IntList(1000,1000) * self.sent_id = IntList(1000,1000) * self.sent_index = IntList(1000,1000) # <<<<<<<<<<<<<< @@ -79522,7 +79917,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_int_1000); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_12)); - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":66 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":66 * f.write("%s " % self.get_word(w_id)) * if w_id == 1: * f.write("\n") # <<<<<<<<<<<<<< @@ -79536,7 +79931,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_15)); - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":61 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":61 * * def write_text(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -79556,7 +79951,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(Py_None); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_16)); - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":69 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":69 * * def read_text(self, char* filename): * with gzip_or_text(filename) as fp: # <<<<<<<<<<<<<< @@ -79576,7 +79971,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(Py_None); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_17)); - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":74 + /* "/home/pauldb/workspace/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -79590,7 +79985,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_18)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_19)); - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":73 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":73 * * def read_bitext(self, char* filename, int side): * with gzip_or_text(filename) as fp: # <<<<<<<<<<<<<< @@ -79610,7 +80005,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(Py_None); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_20)); - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":144 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":144 * for i in self.data: * f.write("%d " %i) * f.write("\n") # <<<<<<<<<<<<<< @@ -79624,7 +80019,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_22)); - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":147 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":147 * for i in self.sent_index: * f.write("%d " %i) * f.write("\n") # <<<<<<<<<<<<<< @@ -79638,7 +80033,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_23)); - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":150 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":150 * for i in self.sent_id: * f.write("%d " %i) * f.write("\n") # <<<<<<<<<<<<<< @@ -79652,7 +80047,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_24)); - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":153 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":153 * for word in self.id2word: * f.write("%s %d " % (word, self.word2id[word])) * f.write("\n") # <<<<<<<<<<<<<< @@ -79666,7 +80061,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_26)); - /* "/home/paulb/workspace/cdec/python/src/sa/data_array.pxi":156 + /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":156 * * def write_enhanced(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -79685,7 +80080,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(Py_None); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_28)); - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":46 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":46 * * def __cinit__(self, from_binary=None, from_text=None): * self.links = IntList(1000,1000) # <<<<<<<<<<<<<< @@ -79702,7 +80097,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_int_1000); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_29)); - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":47 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":47 * def __cinit__(self, from_binary=None, from_text=None): * self.links = IntList(1000,1000) * self.sent_index = IntList(1000,1000) # <<<<<<<<<<<<<< @@ -79719,7 +80114,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_int_1000); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_30)); - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":59 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":59 * pairs = line.split() * for pair in pairs: * (i, j) = map(int, pair.split('-')) # <<<<<<<<<<<<<< @@ -79733,7 +80128,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_31)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_32)); - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":54 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":54 * * def read_text(self, char* filename): * with gzip_or_text(filename) as f: # <<<<<<<<<<<<<< @@ -79753,7 +80148,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(Py_None); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_33)); - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":75 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":75 * for i, link in enumerate(self.links): * while i >= self.sent_index[sent_num]: * f.write("\n") # <<<<<<<<<<<<<< @@ -79767,7 +80162,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_34)); - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":78 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":78 * sent_num = sent_num + 1 * f.write("%d-%d " % self.unlink(link)) * f.write("\n") # <<<<<<<<<<<<<< @@ -79781,7 +80176,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_36)); - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":71 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":71 * * def write_text(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -79801,7 +80196,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(Py_None); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_37)); - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":92 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":92 * for link in self.links: * f.write("%d " % link) * f.write("\n") # <<<<<<<<<<<<<< @@ -79815,7 +80210,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_38)); - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":95 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":95 * for i in self.sent_index: * f.write("%d " % i) * f.write("\n") # <<<<<<<<<<<<<< @@ -79829,7 +80224,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_39)); - /* "/home/paulb/workspace/cdec/python/src/sa/alignment.pxi":88 + /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":88 * * def write_enhanced(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -79849,7 +80244,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(Py_None); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_40)); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":297 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":297 * * # Re-read file, placing words into buckets * f.seek(0) # <<<<<<<<<<<<<< @@ -79863,7 +80258,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_int_0); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_43)); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":273 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":273 * * fcount = IntList() * with gzip_or_text(filename) as f: # <<<<<<<<<<<<<< @@ -79883,7 +80278,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(Py_None); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_44)); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":339 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":339 * * if i > j: * raise Exception("Sort error in CLex") # <<<<<<<<<<<<<< @@ -79897,7 +80292,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_46)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_47)); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":362 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":362 * for i in self.f_index: * f.write("%d " % i) * f.write("\n") # <<<<<<<<<<<<<< @@ -79911,7 +80306,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_49)); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":365 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":365 * for i, s1, s2 in zip(self.e_index, self.col1, self.col2): * f.write("%d %f %f " % (i, s1, s2)) * f.write("\n") # <<<<<<<<<<<<<< @@ -79925,7 +80320,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_51)); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":368 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":368 * for i, w in enumerate(self.id2fword): * f.write("%d %s " % (i, w)) * f.write("\n") # <<<<<<<<<<<<<< @@ -79939,7 +80334,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_53)); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":371 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":371 * for i, w in enumerate(self.id2eword): * f.write("%d %s " % (i, w)) * f.write("\n") # <<<<<<<<<<<<<< @@ -79953,7 +80348,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_54)); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":359 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":359 * * def write_enhanced(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -79973,7 +80368,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(Py_None); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_55)); - /* "/home/paulb/workspace/cdec/python/src/sa/bilex.pxi":404 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":404 * cdef i, N, e_id, f_id * * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -79993,7 +80388,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(Py_None); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_57)); - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":13 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":13 * cdef IntList rank * * logger.info("Constructing LCP array") # <<<<<<<<<<<<<< @@ -80007,7 +80402,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_60)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_61)); - /* "/home/paulb/workspace/cdec/python/src/sa/lcp.pxi":34 + /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":34 * if h > 0: * h = h-1 * logger.info("LCP array completed") # <<<<<<<<<<<<<< @@ -80021,7 +80416,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_62)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_63)); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":297 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":297 * pattern_rank = {} * * logger.info("Precomputing frequent intersections") # <<<<<<<<<<<<<< @@ -80035,7 +80430,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_72)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_73)); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":314 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":314 * queue = IntList(increment=1000) * * logger.info(" Computing inverted indexes...") # <<<<<<<<<<<<<< @@ -80049,7 +80444,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_74)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_75)); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":329 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":329 * trie_node_data_append(node, i) * * logger.info(" Computing collocations...") # <<<<<<<<<<<<<< @@ -80063,7 +80458,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_76)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_77)); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":393 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":393 * for pattern2 in J_set: * if len(pattern1) + len(pattern2) + 1 < self.max_length: * combined_pattern = pattern1 + (-1,) + pattern2 # <<<<<<<<<<<<<< @@ -80077,7 +80472,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_int_neg_1); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_79)); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":400 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":400 * x = x+1 * if len(pattern1) + len(pattern2) + 1 <= self.max_length: * combined_pattern = pattern1 + (-1,) + pattern2 # <<<<<<<<<<<<<< @@ -80091,7 +80486,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_int_neg_1); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_80)); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":407 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":407 * x = x+2 * if len(pattern1) + len(pattern2) + 1<= self.max_length: * combined_pattern = pattern1 + (-1,) + pattern2 # <<<<<<<<<<<<<< @@ -80105,7 +80500,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_int_neg_1); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_81)); - /* "/home/paulb/workspace/cdec/python/src/sa/precomputation.pxi":409 + /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":409 * combined_pattern = pattern1 + (-1,) + pattern2 * IJ_set.add(combined_pattern) * combined_pattern = pattern2 + (-1,) + pattern1 # <<<<<<<<<<<<<< @@ -80119,7 +80514,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_int_neg_1); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_82)); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":94 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":94 * * '''Step 3: read off suffix array from inverse suffix array''' * logger.info(" Finalizing sort...") # <<<<<<<<<<<<<< @@ -80133,7 +80528,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_92)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_93)); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":193 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":193 * for a_i in self.sa: * f.write("%d " % a_i) * f.write("\n") # <<<<<<<<<<<<<< @@ -80147,7 +80542,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_96)); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":196 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":196 * for w_i in self.ha: * f.write("%d " % w_i) * f.write("\n") # <<<<<<<<<<<<<< @@ -80161,7 +80556,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_97)); - /* "/home/paulb/workspace/cdec/python/src/sa/suffix_array.pxi":189 + /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":189 * * def write_enhanced(self, char* filename): * with open(filename, "w") as f: # <<<<<<<<<<<<<< @@ -80181,284 +80576,284 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(Py_None); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_98)); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":119 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":120 * 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_102 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_102)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_102 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_102)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_102); __Pyx_INCREF(((PyObject *)__pyx_kp_s_101)); PyTuple_SET_ITEM(__pyx_k_tuple_102, 0, ((PyObject *)__pyx_kp_s_101)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_101)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_102)); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":339 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":334 * self.rules.root = ExtendedTrieNode(phrase_location=PhraseLocation()) * if alignment is None: * raise Exception("Must specify an alignment object") # <<<<<<<<<<<<<< * self.alignment = alignment * */ - __pyx_k_tuple_107 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_107)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_107 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_107)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_107); __Pyx_INCREF(((PyObject *)__pyx_kp_s_106)); PyTuple_SET_ITEM(__pyx_k_tuple_107, 0, ((PyObject *)__pyx_kp_s_106)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_106)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_107)); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1064 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1062 * else: * #ERROR: We never get here * raise Exception("Keyword trie error") # <<<<<<<<<<<<<< * # checking whether lookup_required * if lookup_required: */ - __pyx_k_tuple_122 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_122)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_122 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_122)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_122); __Pyx_INCREF(((PyObject *)__pyx_kp_s_121)); PyTuple_SET_ITEM(__pyx_k_tuple_122, 0, ((PyObject *)__pyx_kp_s_121)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_121)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_122)); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":1918 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1924 * # 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_135 = PyTuple_New(19); if (unlikely(!__pyx_k_tuple_135)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_135); + __pyx_k_tuple_136 = PyTuple_New(19); if (unlikely(!__pyx_k_tuple_136)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_k_tuple_136); __Pyx_INCREF(((PyObject *)__pyx_n_s__f_i)); - PyTuple_SET_ITEM(__pyx_k_tuple_135, 0, ((PyObject *)__pyx_n_s__f_i)); + PyTuple_SET_ITEM(__pyx_k_tuple_136, 0, ((PyObject *)__pyx_n_s__f_i)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__f_i)); __Pyx_INCREF(((PyObject *)__pyx_n_s__f_j)); - PyTuple_SET_ITEM(__pyx_k_tuple_135, 1, ((PyObject *)__pyx_n_s__f_j)); + PyTuple_SET_ITEM(__pyx_k_tuple_136, 1, ((PyObject *)__pyx_n_s__f_j)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__f_j)); __Pyx_INCREF(((PyObject *)__pyx_n_s__e_i)); - PyTuple_SET_ITEM(__pyx_k_tuple_135, 2, ((PyObject *)__pyx_n_s__e_i)); + PyTuple_SET_ITEM(__pyx_k_tuple_136, 2, ((PyObject *)__pyx_n_s__e_i)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__e_i)); __Pyx_INCREF(((PyObject *)__pyx_n_s__e_j)); - PyTuple_SET_ITEM(__pyx_k_tuple_135, 3, ((PyObject *)__pyx_n_s__e_j)); + PyTuple_SET_ITEM(__pyx_k_tuple_136, 3, ((PyObject *)__pyx_n_s__e_j)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__e_j)); __Pyx_INCREF(((PyObject *)__pyx_n_s__min_bound)); - PyTuple_SET_ITEM(__pyx_k_tuple_135, 4, ((PyObject *)__pyx_n_s__min_bound)); + PyTuple_SET_ITEM(__pyx_k_tuple_136, 4, ((PyObject *)__pyx_n_s__min_bound)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__min_bound)); __Pyx_INCREF(((PyObject *)__pyx_n_s__wc)); - PyTuple_SET_ITEM(__pyx_k_tuple_135, 5, ((PyObject *)__pyx_n_s__wc)); + PyTuple_SET_ITEM(__pyx_k_tuple_136, 5, ((PyObject *)__pyx_n_s__wc)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__wc)); __Pyx_INCREF(((PyObject *)__pyx_n_s__links)); - PyTuple_SET_ITEM(__pyx_k_tuple_135, 6, ((PyObject *)__pyx_n_s__links)); + PyTuple_SET_ITEM(__pyx_k_tuple_136, 6, ((PyObject *)__pyx_n_s__links)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__links)); __Pyx_INCREF(((PyObject *)__pyx_n_s__nt)); - PyTuple_SET_ITEM(__pyx_k_tuple_135, 7, ((PyObject *)__pyx_n_s__nt)); + PyTuple_SET_ITEM(__pyx_k_tuple_136, 7, ((PyObject *)__pyx_n_s__nt)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__nt)); __Pyx_INCREF(((PyObject *)__pyx_n_s__nt_open)); - PyTuple_SET_ITEM(__pyx_k_tuple_135, 8, ((PyObject *)__pyx_n_s__nt_open)); + PyTuple_SET_ITEM(__pyx_k_tuple_136, 8, ((PyObject *)__pyx_n_s__nt_open)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__nt_open)); __Pyx_INCREF(((PyObject *)__pyx_n_s__link_i)); - PyTuple_SET_ITEM(__pyx_k_tuple_135, 9, ((PyObject *)__pyx_n_s__link_i)); + PyTuple_SET_ITEM(__pyx_k_tuple_136, 9, ((PyObject *)__pyx_n_s__link_i)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__link_i)); __Pyx_INCREF(((PyObject *)__pyx_n_s__link_j)); - PyTuple_SET_ITEM(__pyx_k_tuple_135, 10, ((PyObject *)__pyx_n_s__link_j)); + PyTuple_SET_ITEM(__pyx_k_tuple_136, 10, ((PyObject *)__pyx_n_s__link_j)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__link_j)); __Pyx_INCREF(((PyObject *)__pyx_n_s__new_e_i)); - PyTuple_SET_ITEM(__pyx_k_tuple_135, 11, ((PyObject *)__pyx_n_s__new_e_i)); + PyTuple_SET_ITEM(__pyx_k_tuple_136, 11, ((PyObject *)__pyx_n_s__new_e_i)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__new_e_i)); __Pyx_INCREF(((PyObject *)__pyx_n_s__new_e_j)); - PyTuple_SET_ITEM(__pyx_k_tuple_135, 12, ((PyObject *)__pyx_n_s__new_e_j)); + PyTuple_SET_ITEM(__pyx_k_tuple_136, 12, ((PyObject *)__pyx_n_s__new_e_j)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__new_e_j)); __Pyx_INCREF(((PyObject *)__pyx_n_s__new_min_bound)); - PyTuple_SET_ITEM(__pyx_k_tuple_135, 13, ((PyObject *)__pyx_n_s__new_min_bound)); + PyTuple_SET_ITEM(__pyx_k_tuple_136, 13, ((PyObject *)__pyx_n_s__new_min_bound)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__new_min_bound)); __Pyx_INCREF(((PyObject *)__pyx_n_s__i)); - PyTuple_SET_ITEM(__pyx_k_tuple_135, 14, ((PyObject *)__pyx_n_s__i)); + PyTuple_SET_ITEM(__pyx_k_tuple_136, 14, ((PyObject *)__pyx_n_s__i)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i)); __Pyx_INCREF(((PyObject *)__pyx_n_s__nt_collision)); - PyTuple_SET_ITEM(__pyx_k_tuple_135, 15, ((PyObject *)__pyx_n_s__nt_collision)); + PyTuple_SET_ITEM(__pyx_k_tuple_136, 15, ((PyObject *)__pyx_n_s__nt_collision)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__nt_collision)); __Pyx_INCREF(((PyObject *)__pyx_n_s__link)); - PyTuple_SET_ITEM(__pyx_k_tuple_135, 16, ((PyObject *)__pyx_n_s__link)); + PyTuple_SET_ITEM(__pyx_k_tuple_136, 16, ((PyObject *)__pyx_n_s__link)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__link)); __Pyx_INCREF(((PyObject *)__pyx_n_s__plus_links)); - PyTuple_SET_ITEM(__pyx_k_tuple_135, 17, ((PyObject *)__pyx_n_s__plus_links)); + PyTuple_SET_ITEM(__pyx_k_tuple_136, 17, ((PyObject *)__pyx_n_s__plus_links)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__plus_links)); __Pyx_INCREF(((PyObject *)__pyx_n_s__old_last_nt)); - PyTuple_SET_ITEM(__pyx_k_tuple_135, 18, ((PyObject *)__pyx_n_s__old_last_nt)); + PyTuple_SET_ITEM(__pyx_k_tuple_136, 18, ((PyObject *)__pyx_n_s__old_last_nt)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__old_last_nt)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_135)); - __pyx_k_codeobj_136 = (PyObject*)__Pyx_PyCode_New(9, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_135, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_137, __pyx_n_s__extract, 1918, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_136)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_136)); + __pyx_k_codeobj_137 = (PyObject*)__Pyx_PyCode_New(9, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_136, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_138, __pyx_n_s__extract, 1924, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_137)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2125 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2131 * # Debugging * def dump_online_stats(self): * logger.info('------------------------------') # <<<<<<<<<<<<<< * logger.info(' Online Stats ') * logger.info('------------------------------') */ - __pyx_k_tuple_141 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_141)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_141); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_140)); - PyTuple_SET_ITEM(__pyx_k_tuple_141, 0, ((PyObject *)__pyx_kp_s_140)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_140)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_141)); + __pyx_k_tuple_142 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_142)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_k_tuple_142); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_141)); + PyTuple_SET_ITEM(__pyx_k_tuple_142, 0, ((PyObject *)__pyx_kp_s_141)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_141)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_142)); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2126 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2132 * def dump_online_stats(self): * logger.info('------------------------------') * logger.info(' Online Stats ') # <<<<<<<<<<<<<< * logger.info('------------------------------') * logger.info('f') */ - __pyx_k_tuple_143 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_143)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_143); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_142)); - PyTuple_SET_ITEM(__pyx_k_tuple_143, 0, ((PyObject *)__pyx_kp_s_142)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_142)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_143)); + __pyx_k_tuple_144 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_144)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_k_tuple_144); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_143)); + PyTuple_SET_ITEM(__pyx_k_tuple_144, 0, ((PyObject *)__pyx_kp_s_143)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_143)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_144)); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2127 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2133 * logger.info('------------------------------') * logger.info(' Online Stats ') * logger.info('------------------------------') # <<<<<<<<<<<<<< * logger.info('f') * for w in self.bilex_f: */ - __pyx_k_tuple_144 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_144)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_144); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_140)); - PyTuple_SET_ITEM(__pyx_k_tuple_144, 0, ((PyObject *)__pyx_kp_s_140)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_140)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_144)); + __pyx_k_tuple_145 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_145)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_k_tuple_145); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_141)); + PyTuple_SET_ITEM(__pyx_k_tuple_145, 0, ((PyObject *)__pyx_kp_s_141)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_141)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_145)); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2128 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2134 * logger.info(' Online Stats ') * logger.info('------------------------------') * logger.info('f') # <<<<<<<<<<<<<< * for w in self.bilex_f: * logger.info(sym_tostring(w) + ' : ' + str(self.bilex_f[w])) */ - __pyx_k_tuple_145 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_145)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_145); + __pyx_k_tuple_146 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_146)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_k_tuple_146); __Pyx_INCREF(((PyObject *)__pyx_n_s__f)); - PyTuple_SET_ITEM(__pyx_k_tuple_145, 0, ((PyObject *)__pyx_n_s__f)); + PyTuple_SET_ITEM(__pyx_k_tuple_146, 0, ((PyObject *)__pyx_n_s__f)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__f)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_145)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_146)); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2131 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2137 * for w in self.bilex_f: * logger.info(sym_tostring(w) + ' : ' + str(self.bilex_f[w])) * logger.info('e') # <<<<<<<<<<<<<< * for w in self.bilex_e: * logger.info(sym_tostring(w) + ' : ' + str(self.bilex_e[w])) */ - __pyx_k_tuple_147 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_147)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_147); + __pyx_k_tuple_148 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_148)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_k_tuple_148); __Pyx_INCREF(((PyObject *)__pyx_n_s__e)); - PyTuple_SET_ITEM(__pyx_k_tuple_147, 0, ((PyObject *)__pyx_n_s__e)); + PyTuple_SET_ITEM(__pyx_k_tuple_148, 0, ((PyObject *)__pyx_n_s__e)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__e)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_147)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_148)); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2134 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2140 * for w in self.bilex_e: * logger.info(sym_tostring(w) + ' : ' + str(self.bilex_e[w])) * logger.info('fe') # <<<<<<<<<<<<<< * for w in self.bilex_fe: * for w2 in self.bilex_fe[w]: */ - __pyx_k_tuple_148 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_148)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_148); + __pyx_k_tuple_149 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_149)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_k_tuple_149); __Pyx_INCREF(((PyObject *)__pyx_n_s__fe)); - PyTuple_SET_ITEM(__pyx_k_tuple_148, 0, ((PyObject *)__pyx_n_s__fe)); + PyTuple_SET_ITEM(__pyx_k_tuple_149, 0, ((PyObject *)__pyx_n_s__fe)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__fe)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_148)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_149)); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2138 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2144 * for w2 in self.bilex_fe[w]: * logger.info(sym_tostring(w) + ' : ' + sym_tostring(w2) + ' : ' + str(self.bilex_fe[w][w2])) * logger.info('F') # <<<<<<<<<<<<<< * for ph in self.phrases_f: * logger.info(str(ph) + ' ||| ' + str(self.phrases_f[ph])) */ - __pyx_k_tuple_149 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_149)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_149); + __pyx_k_tuple_150 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_150)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_k_tuple_150); __Pyx_INCREF(((PyObject *)__pyx_n_s__F)); - PyTuple_SET_ITEM(__pyx_k_tuple_149, 0, ((PyObject *)__pyx_n_s__F)); + PyTuple_SET_ITEM(__pyx_k_tuple_150, 0, ((PyObject *)__pyx_n_s__F)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__F)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_149)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_150)); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2141 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2147 * for ph in self.phrases_f: * logger.info(str(ph) + ' ||| ' + str(self.phrases_f[ph])) * logger.info('E') # <<<<<<<<<<<<<< * for ph in self.phrases_e: * logger.info(str(ph) + ' ||| ' + str(self.phrases_e[ph])) */ - __pyx_k_tuple_150 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_150)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_150); + __pyx_k_tuple_151 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_151)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_k_tuple_151); __Pyx_INCREF(((PyObject *)__pyx_n_s__E)); - PyTuple_SET_ITEM(__pyx_k_tuple_150, 0, ((PyObject *)__pyx_n_s__E)); + PyTuple_SET_ITEM(__pyx_k_tuple_151, 0, ((PyObject *)__pyx_n_s__E)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__E)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_150)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_151)); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2144 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2150 * for ph in self.phrases_e: * logger.info(str(ph) + ' ||| ' + str(self.phrases_e[ph])) * logger.info('FE') # <<<<<<<<<<<<<< * self.dump_online_rules() * */ - __pyx_k_tuple_151 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_151)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_151); + __pyx_k_tuple_152 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_152)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_k_tuple_152); __Pyx_INCREF(((PyObject *)__pyx_n_s__FE)); - PyTuple_SET_ITEM(__pyx_k_tuple_151, 0, ((PyObject *)__pyx_n_s__FE)); + PyTuple_SET_ITEM(__pyx_k_tuple_152, 0, ((PyObject *)__pyx_n_s__FE)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__FE)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_151)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_152)); - /* "/home/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2171 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2177 * 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_New(10); if (unlikely(!__pyx_k_tuple_153)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_153); + __pyx_k_tuple_154 = PyTuple_New(10); if (unlikely(!__pyx_k_tuple_154)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_k_tuple_154); __Pyx_INCREF(((PyObject *)__pyx_n_s__f_i)); - PyTuple_SET_ITEM(__pyx_k_tuple_153, 0, ((PyObject *)__pyx_n_s__f_i)); + PyTuple_SET_ITEM(__pyx_k_tuple_154, 0, ((PyObject *)__pyx_n_s__f_i)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__f_i)); __Pyx_INCREF(((PyObject *)__pyx_n_s__f_j)); - PyTuple_SET_ITEM(__pyx_k_tuple_153, 1, ((PyObject *)__pyx_n_s__f_j)); + PyTuple_SET_ITEM(__pyx_k_tuple_154, 1, ((PyObject *)__pyx_n_s__f_j)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__f_j)); __Pyx_INCREF(((PyObject *)__pyx_n_s__lex_i)); - PyTuple_SET_ITEM(__pyx_k_tuple_153, 2, ((PyObject *)__pyx_n_s__lex_i)); + PyTuple_SET_ITEM(__pyx_k_tuple_154, 2, ((PyObject *)__pyx_n_s__lex_i)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__lex_i)); __Pyx_INCREF(((PyObject *)__pyx_n_s__lex_j)); - PyTuple_SET_ITEM(__pyx_k_tuple_153, 3, ((PyObject *)__pyx_n_s__lex_j)); + PyTuple_SET_ITEM(__pyx_k_tuple_154, 3, ((PyObject *)__pyx_n_s__lex_j)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__lex_j)); __Pyx_INCREF(((PyObject *)__pyx_n_s__wc)); - PyTuple_SET_ITEM(__pyx_k_tuple_153, 4, ((PyObject *)__pyx_n_s__wc)); + PyTuple_SET_ITEM(__pyx_k_tuple_154, 4, ((PyObject *)__pyx_n_s__wc)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__wc)); __Pyx_INCREF(((PyObject *)__pyx_n_s__ntc)); - PyTuple_SET_ITEM(__pyx_k_tuple_153, 5, ((PyObject *)__pyx_n_s__ntc)); + PyTuple_SET_ITEM(__pyx_k_tuple_154, 5, ((PyObject *)__pyx_n_s__ntc)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ntc)); __Pyx_INCREF(((PyObject *)__pyx_n_s__syms)); - PyTuple_SET_ITEM(__pyx_k_tuple_153, 6, ((PyObject *)__pyx_n_s__syms)); + PyTuple_SET_ITEM(__pyx_k_tuple_154, 6, ((PyObject *)__pyx_n_s__syms)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__syms)); __Pyx_INCREF(((PyObject *)__pyx_n_s__f)); - PyTuple_SET_ITEM(__pyx_k_tuple_153, 7, ((PyObject *)__pyx_n_s__f)); + PyTuple_SET_ITEM(__pyx_k_tuple_154, 7, ((PyObject *)__pyx_n_s__f)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__f)); __Pyx_INCREF(((PyObject *)__pyx_n_s__new_lex_i)); - PyTuple_SET_ITEM(__pyx_k_tuple_153, 8, ((PyObject *)__pyx_n_s__new_lex_i)); + PyTuple_SET_ITEM(__pyx_k_tuple_154, 8, ((PyObject *)__pyx_n_s__new_lex_i)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__new_lex_i)); __Pyx_INCREF(((PyObject *)__pyx_n_s__new_lex_j)); - PyTuple_SET_ITEM(__pyx_k_tuple_153, 9, ((PyObject *)__pyx_n_s__new_lex_j)); + PyTuple_SET_ITEM(__pyx_k_tuple_154, 9, ((PyObject *)__pyx_n_s__new_lex_j)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__new_lex_j)); - __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_137, __pyx_n_s__extract, 2171, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_154)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_154)); + __pyx_k_codeobj_155 = (PyObject*)__Pyx_PyCode_New(7, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_154, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_138, __pyx_n_s__extract, 2177, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_155)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "_sa.pyx":5 * import gzip @@ -80467,7 +80862,7 @@ static int __Pyx_InitCachedConstants(void) { * return (resource.getrusage(resource.RUSAGE_SELF).ru_utime+ * resource.getrusage(resource.RUSAGE_SELF).ru_stime) */ - __pyx_k_codeobj_156 = (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_157, __pyx_n_s__monitor_cpu, 5, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_156)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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;} /* "_sa.pyx":9 * resource.getrusage(resource.RUSAGE_SELF).ru_stime) @@ -80476,16 +80871,16 @@ static int __Pyx_InitCachedConstants(void) { * if filename.endswith('.gz'): * return gzip.GzipFile(filename) */ - __pyx_k_tuple_158 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_158)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_158); + __pyx_k_tuple_159 = PyTuple_New(2); 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_INCREF(((PyObject *)__pyx_n_s__filename)); - PyTuple_SET_ITEM(__pyx_k_tuple_158, 0, ((PyObject *)__pyx_n_s__filename)); + PyTuple_SET_ITEM(__pyx_k_tuple_159, 0, ((PyObject *)__pyx_n_s__filename)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__filename)); __Pyx_INCREF(((PyObject *)__pyx_n_s__filename)); - PyTuple_SET_ITEM(__pyx_k_tuple_158, 1, ((PyObject *)__pyx_n_s__filename)); + PyTuple_SET_ITEM(__pyx_k_tuple_159, 1, ((PyObject *)__pyx_n_s__filename)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__filename)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_158)); - __pyx_k_codeobj_159 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_158, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_157, __pyx_n_s__gzip_or_text, 9, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_159)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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;} /* "_sa.pyx":15 * return open(filename) @@ -80494,209 +80889,209 @@ static int __Pyx_InitCachedConstants(void) { * * include "float_list.pxi" */ - __pyx_k_tuple_161 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_161)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_161); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_160)); - PyTuple_SET_ITEM(__pyx_k_tuple_161, 0, ((PyObject *)__pyx_kp_s_160)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_160)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_161)); + __pyx_k_tuple_162 = PyTuple_New(1); 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_INCREF(((PyObject *)__pyx_kp_s_161)); + PyTuple_SET_ITEM(__pyx_k_tuple_162, 0, ((PyObject *)__pyx_kp_s_161)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_161)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_162)); - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":107 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":107 * return ALPHABET.fromstring(string, terminal) * * def isvar(sym): # <<<<<<<<<<<<<< * return sym_isvar(sym) * */ - __pyx_k_tuple_162 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_162)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_162); + __pyx_k_tuple_163 = PyTuple_New(1); 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_INCREF(((PyObject *)__pyx_n_s__sym)); - PyTuple_SET_ITEM(__pyx_k_tuple_162, 0, ((PyObject *)__pyx_n_s__sym)); + PyTuple_SET_ITEM(__pyx_k_tuple_163, 0, ((PyObject *)__pyx_n_s__sym)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__sym)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_162)); - __pyx_k_codeobj_163 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_162, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_164, __pyx_n_s__isvar, 107, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_163)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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;} - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":110 + /* "/home/pauldb/workspace/cdec/python/src/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_165 = PyTuple_New(5); if (unlikely(!__pyx_k_tuple_165)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_165); + __pyx_k_tuple_166 = PyTuple_New(5); 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_INCREF(((PyObject *)__pyx_n_s__words)); - PyTuple_SET_ITEM(__pyx_k_tuple_165, 0, ((PyObject *)__pyx_n_s__words)); + PyTuple_SET_ITEM(__pyx_k_tuple_166, 0, ((PyObject *)__pyx_n_s__words)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__words)); __Pyx_INCREF(((PyObject *)__pyx_n_s__word_ids)); - PyTuple_SET_ITEM(__pyx_k_tuple_165, 1, ((PyObject *)__pyx_n_s__word_ids)); + PyTuple_SET_ITEM(__pyx_k_tuple_166, 1, ((PyObject *)__pyx_n_s__word_ids)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__word_ids)); __Pyx_INCREF(((PyObject *)__pyx_n_s__genexpr)); - PyTuple_SET_ITEM(__pyx_k_tuple_165, 2, ((PyObject *)__pyx_n_s__genexpr)); + PyTuple_SET_ITEM(__pyx_k_tuple_166, 2, ((PyObject *)__pyx_n_s__genexpr)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__genexpr)); __Pyx_INCREF(((PyObject *)__pyx_n_s__genexpr)); - PyTuple_SET_ITEM(__pyx_k_tuple_165, 3, ((PyObject *)__pyx_n_s__genexpr)); + PyTuple_SET_ITEM(__pyx_k_tuple_166, 3, ((PyObject *)__pyx_n_s__genexpr)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__genexpr)); __Pyx_INCREF(((PyObject *)__pyx_n_s__genexpr)); - PyTuple_SET_ITEM(__pyx_k_tuple_165, 4, ((PyObject *)__pyx_n_s__genexpr)); + PyTuple_SET_ITEM(__pyx_k_tuple_166, 4, ((PyObject *)__pyx_n_s__genexpr)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__genexpr)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_165)); - __pyx_k_codeobj_166 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_165, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_164, __pyx_n_s__make_lattice, 110, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_166)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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;} - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":114 + /* "/home/pauldb/workspace/cdec/python/src/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_167 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_167)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_167); + __pyx_k_tuple_168 = PyTuple_New(3); 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_INCREF(((PyObject *)__pyx_n_s__lattice)); - PyTuple_SET_ITEM(__pyx_k_tuple_167, 0, ((PyObject *)__pyx_n_s__lattice)); + PyTuple_SET_ITEM(__pyx_k_tuple_168, 0, ((PyObject *)__pyx_n_s__lattice)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__lattice)); __Pyx_INCREF(((PyObject *)__pyx_n_s__genexpr)); - PyTuple_SET_ITEM(__pyx_k_tuple_167, 1, ((PyObject *)__pyx_n_s__genexpr)); + PyTuple_SET_ITEM(__pyx_k_tuple_168, 1, ((PyObject *)__pyx_n_s__genexpr)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__genexpr)); __Pyx_INCREF(((PyObject *)__pyx_n_s__genexpr)); - PyTuple_SET_ITEM(__pyx_k_tuple_167, 2, ((PyObject *)__pyx_n_s__genexpr)); + PyTuple_SET_ITEM(__pyx_k_tuple_168, 2, ((PyObject *)__pyx_n_s__genexpr)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__genexpr)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_167)); - __pyx_k_codeobj_168 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_167, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_164, __pyx_n_s__decode_lattice, 114, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_168)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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;} - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":118 + /* "/home/pauldb/workspace/cdec/python/src/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_169 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_169)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_169); + __pyx_k_tuple_170 = PyTuple_New(3); 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_INCREF(((PyObject *)__pyx_n_s__lattice)); - PyTuple_SET_ITEM(__pyx_k_tuple_169, 0, ((PyObject *)__pyx_n_s__lattice)); + PyTuple_SET_ITEM(__pyx_k_tuple_170, 0, ((PyObject *)__pyx_n_s__lattice)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__lattice)); __Pyx_INCREF(((PyObject *)__pyx_n_s__genexpr)); - PyTuple_SET_ITEM(__pyx_k_tuple_169, 1, ((PyObject *)__pyx_n_s__genexpr)); + PyTuple_SET_ITEM(__pyx_k_tuple_170, 1, ((PyObject *)__pyx_n_s__genexpr)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__genexpr)); __Pyx_INCREF(((PyObject *)__pyx_n_s__genexpr)); - PyTuple_SET_ITEM(__pyx_k_tuple_169, 2, ((PyObject *)__pyx_n_s__genexpr)); + PyTuple_SET_ITEM(__pyx_k_tuple_170, 2, ((PyObject *)__pyx_n_s__genexpr)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__genexpr)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_169)); - __pyx_k_codeobj_170 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_169, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_164, __pyx_n_s__decode_sentence, 118, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_170)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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;} - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":121 + /* "/home/pauldb/workspace/cdec/python/src/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_171 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_171)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_171); + __pyx_k_tuple_172 = PyTuple_New(3); 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_INCREF(((PyObject *)__pyx_n_s__words)); - PyTuple_SET_ITEM(__pyx_k_tuple_171, 0, ((PyObject *)__pyx_n_s__words)); + PyTuple_SET_ITEM(__pyx_k_tuple_172, 0, ((PyObject *)__pyx_n_s__words)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__words)); __Pyx_INCREF(((PyObject *)__pyx_n_s__genexpr)); - PyTuple_SET_ITEM(__pyx_k_tuple_171, 1, ((PyObject *)__pyx_n_s__genexpr)); + PyTuple_SET_ITEM(__pyx_k_tuple_172, 1, ((PyObject *)__pyx_n_s__genexpr)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__genexpr)); __Pyx_INCREF(((PyObject *)__pyx_n_s__genexpr)); - PyTuple_SET_ITEM(__pyx_k_tuple_171, 2, ((PyObject *)__pyx_n_s__genexpr)); + PyTuple_SET_ITEM(__pyx_k_tuple_172, 2, ((PyObject *)__pyx_n_s__genexpr)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__genexpr)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_171)); - __pyx_k_codeobj_172 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_171, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_164, __pyx_n_s__encode_words, 121, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_172)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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;} - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":124 + /* "/home/pauldb/workspace/cdec/python/src/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_173 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_173)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_173); + __pyx_k_tuple_174 = PyTuple_New(3); 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_INCREF(((PyObject *)__pyx_n_s__syms)); - PyTuple_SET_ITEM(__pyx_k_tuple_173, 0, ((PyObject *)__pyx_n_s__syms)); + PyTuple_SET_ITEM(__pyx_k_tuple_174, 0, ((PyObject *)__pyx_n_s__syms)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__syms)); __Pyx_INCREF(((PyObject *)__pyx_n_s__genexpr)); - PyTuple_SET_ITEM(__pyx_k_tuple_173, 1, ((PyObject *)__pyx_n_s__genexpr)); + PyTuple_SET_ITEM(__pyx_k_tuple_174, 1, ((PyObject *)__pyx_n_s__genexpr)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__genexpr)); __Pyx_INCREF(((PyObject *)__pyx_n_s__genexpr)); - PyTuple_SET_ITEM(__pyx_k_tuple_173, 2, ((PyObject *)__pyx_n_s__genexpr)); + PyTuple_SET_ITEM(__pyx_k_tuple_174, 2, ((PyObject *)__pyx_n_s__genexpr)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__genexpr)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_173)); - __pyx_k_codeobj_174 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_173, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_164, __pyx_n_s__decode_words, 124, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_174)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2205 + /* "/home/pauldb/workspace/cdec/python/src/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_176 = PyTuple_New(4); if (unlikely(!__pyx_k_tuple_176)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_176); + __pyx_k_tuple_177 = PyTuple_New(4); 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_INCREF(((PyObject *)__pyx_n_s__vec)); - PyTuple_SET_ITEM(__pyx_k_tuple_176, 0, ((PyObject *)__pyx_n_s__vec)); + PyTuple_SET_ITEM(__pyx_k_tuple_177, 0, ((PyObject *)__pyx_n_s__vec)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__vec)); __Pyx_INCREF(((PyObject *)__pyx_n_s__i)); - PyTuple_SET_ITEM(__pyx_k_tuple_176, 1, ((PyObject *)__pyx_n_s__i)); + PyTuple_SET_ITEM(__pyx_k_tuple_177, 1, ((PyObject *)__pyx_n_s__i)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i)); __Pyx_INCREF(((PyObject *)__pyx_n_s__j)); - PyTuple_SET_ITEM(__pyx_k_tuple_176, 2, ((PyObject *)__pyx_n_s__j)); + PyTuple_SET_ITEM(__pyx_k_tuple_177, 2, ((PyObject *)__pyx_n_s__j)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__j)); __Pyx_INCREF(((PyObject *)__pyx_n_s__k)); - PyTuple_SET_ITEM(__pyx_k_tuple_176, 3, ((PyObject *)__pyx_n_s__k)); + PyTuple_SET_ITEM(__pyx_k_tuple_177, 3, ((PyObject *)__pyx_n_s__k)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__k)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_176)); - __pyx_k_codeobj_177 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_176, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_137, __pyx_n_s__span_check, 2205, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_177)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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_138, __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2213 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2219 * return True * * def span_inc(vec, i, j): # <<<<<<<<<<<<<< * k = i * while k <= j: */ - __pyx_k_tuple_178 = PyTuple_New(4); if (unlikely(!__pyx_k_tuple_178)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_178); + __pyx_k_tuple_179 = PyTuple_New(4); 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_INCREF(((PyObject *)__pyx_n_s__vec)); - PyTuple_SET_ITEM(__pyx_k_tuple_178, 0, ((PyObject *)__pyx_n_s__vec)); + PyTuple_SET_ITEM(__pyx_k_tuple_179, 0, ((PyObject *)__pyx_n_s__vec)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__vec)); __Pyx_INCREF(((PyObject *)__pyx_n_s__i)); - PyTuple_SET_ITEM(__pyx_k_tuple_178, 1, ((PyObject *)__pyx_n_s__i)); + PyTuple_SET_ITEM(__pyx_k_tuple_179, 1, ((PyObject *)__pyx_n_s__i)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i)); __Pyx_INCREF(((PyObject *)__pyx_n_s__j)); - PyTuple_SET_ITEM(__pyx_k_tuple_178, 2, ((PyObject *)__pyx_n_s__j)); + PyTuple_SET_ITEM(__pyx_k_tuple_179, 2, ((PyObject *)__pyx_n_s__j)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__j)); __Pyx_INCREF(((PyObject *)__pyx_n_s__k)); - PyTuple_SET_ITEM(__pyx_k_tuple_178, 3, ((PyObject *)__pyx_n_s__k)); + PyTuple_SET_ITEM(__pyx_k_tuple_179, 3, ((PyObject *)__pyx_n_s__k)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__k)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_178)); - __pyx_k_codeobj_179 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_178, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_137, __pyx_n_s__span_inc, 2213, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_179)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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_138, __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/paulb/workspace/cdec/python/src/sa/rulefactory.pxi":2219 + /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2225 * k += 1 * * def span_dec(vec, i, j): # <<<<<<<<<<<<<< * k = i * while k <= j: */ - __pyx_k_tuple_180 = PyTuple_New(4); if (unlikely(!__pyx_k_tuple_180)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_180); + __pyx_k_tuple_181 = PyTuple_New(4); 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_INCREF(((PyObject *)__pyx_n_s__vec)); - PyTuple_SET_ITEM(__pyx_k_tuple_180, 0, ((PyObject *)__pyx_n_s__vec)); + PyTuple_SET_ITEM(__pyx_k_tuple_181, 0, ((PyObject *)__pyx_n_s__vec)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__vec)); __Pyx_INCREF(((PyObject *)__pyx_n_s__i)); - PyTuple_SET_ITEM(__pyx_k_tuple_180, 1, ((PyObject *)__pyx_n_s__i)); + PyTuple_SET_ITEM(__pyx_k_tuple_181, 1, ((PyObject *)__pyx_n_s__i)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i)); __Pyx_INCREF(((PyObject *)__pyx_n_s__j)); - PyTuple_SET_ITEM(__pyx_k_tuple_180, 2, ((PyObject *)__pyx_n_s__j)); + PyTuple_SET_ITEM(__pyx_k_tuple_181, 2, ((PyObject *)__pyx_n_s__j)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__j)); __Pyx_INCREF(((PyObject *)__pyx_n_s__k)); - PyTuple_SET_ITEM(__pyx_k_tuple_180, 3, ((PyObject *)__pyx_n_s__k)); + PyTuple_SET_ITEM(__pyx_k_tuple_181, 3, ((PyObject *)__pyx_n_s__k)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__k)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_180)); - __pyx_k_codeobj_181 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_180, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_137, __pyx_n_s__span_dec, 2219, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_181)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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_138, __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:; @@ -80764,16 +81159,15 @@ PyMODINIT_FUNC PyInit__sa(void) #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4(__Pyx_NAMESTR("_sa"), __pyx_methods, 0, 0, PYTHON_API_VERSION); + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("_sa"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif - if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - #if PY_MAJOR_VERSION < 3 - Py_INCREF(__pyx_m); + if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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); #endif - __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); - if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -80918,24 +81312,24 @@ PyMODINIT_FUNC PyInit__sa(void) if (__Pyx_SetVtable(__pyx_type_3_sa_SuffixArray.tp_dict, __pyx_vtabptr_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_3_sa_SuffixArray) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_3_sa_SuffixArray = &__pyx_type_3_sa_SuffixArray; - if (PyType_Ready(&__pyx_type_3_sa_TrieNode) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "TrieNode", (PyObject *)&__pyx_type_3_sa_TrieNode) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_3_sa_TrieNode) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "TrieNode", (PyObject *)&__pyx_type_3_sa_TrieNode) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_3_sa_TrieNode = &__pyx_type_3_sa_TrieNode; __pyx_type_3_sa_ExtendedTrieNode.tp_base = __pyx_ptype_3_sa_TrieNode; - if (PyType_Ready(&__pyx_type_3_sa_ExtendedTrieNode) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "ExtendedTrieNode", (PyObject *)&__pyx_type_3_sa_ExtendedTrieNode) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_3_sa_ExtendedTrieNode) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "ExtendedTrieNode", (PyObject *)&__pyx_type_3_sa_ExtendedTrieNode) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_3_sa_ExtendedTrieNode = &__pyx_type_3_sa_ExtendedTrieNode; - if (PyType_Ready(&__pyx_type_3_sa_TrieTable) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "TrieTable", (PyObject *)&__pyx_type_3_sa_TrieTable) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_3_sa_TrieTable) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "TrieTable", (PyObject *)&__pyx_type_3_sa_TrieTable) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_3_sa_TrieTable = &__pyx_type_3_sa_TrieTable; __pyx_vtabptr_3_sa_PhraseLocation = &__pyx_vtable_3_sa_PhraseLocation; __pyx_vtable_3_sa_PhraseLocation.contains = (int (*)(struct __pyx_obj_3_sa_PhraseLocation *, int))__pyx_f_3_sa_14PhraseLocation_contains; - if (PyType_Ready(&__pyx_type_3_sa_PhraseLocation) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_3_sa_PhraseLocation.tp_dict, __pyx_vtabptr_3_sa_PhraseLocation) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "PhraseLocation", (PyObject *)&__pyx_type_3_sa_PhraseLocation) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_3_sa_PhraseLocation) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_3_sa_PhraseLocation.tp_dict, __pyx_vtabptr_3_sa_PhraseLocation) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "PhraseLocation", (PyObject *)&__pyx_type_3_sa_PhraseLocation) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_3_sa_PhraseLocation = &__pyx_type_3_sa_PhraseLocation; - if (PyType_Ready(&__pyx_type_3_sa_Sampler) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "Sampler", (PyObject *)&__pyx_type_3_sa_Sampler) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_3_sa_Sampler) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "Sampler", (PyObject *)&__pyx_type_3_sa_Sampler) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_3_sa_Sampler = &__pyx_type_3_sa_Sampler; __pyx_vtabptr_3_sa_HieroCachingRuleFactory = &__pyx_vtable_3_sa_HieroCachingRuleFactory; __pyx_vtable_3_sa_HieroCachingRuleFactory.set_idmap = (PyObject *(*)(struct __pyx_obj_3_sa_HieroCachingRuleFactory *, struct __pyx_obj_3_sa_DataArray *))__pyx_f_3_sa_23HieroCachingRuleFactory_set_idmap; @@ -80953,9 +81347,9 @@ PyMODINIT_FUNC PyInit__sa(void) __pyx_vtable_3_sa_HieroCachingRuleFactory.extract_phrases = (PyObject *(*)(struct __pyx_obj_3_sa_HieroCachingRuleFactory *, int, int, int *, int *, int *, int, int, int, int *, int *, int *, int, int, int))__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases; __pyx_vtable_3_sa_HieroCachingRuleFactory.create_alignments = (struct __pyx_obj_3_sa_IntList *(*)(struct __pyx_obj_3_sa_HieroCachingRuleFactory *, int *, int, PyObject *, PyObject *))__pyx_f_3_sa_23HieroCachingRuleFactory_create_alignments; __pyx_vtable_3_sa_HieroCachingRuleFactory.extract = (PyObject *(*)(struct __pyx_obj_3_sa_HieroCachingRuleFactory *, struct __pyx_obj_3_sa_Phrase *, struct __pyx_t_3_sa_Matching *, int *, int))__pyx_f_3_sa_23HieroCachingRuleFactory_extract; - if (PyType_Ready(&__pyx_type_3_sa_HieroCachingRuleFactory) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_3_sa_HieroCachingRuleFactory.tp_dict, __pyx_vtabptr_3_sa_HieroCachingRuleFactory) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "HieroCachingRuleFactory", (PyObject *)&__pyx_type_3_sa_HieroCachingRuleFactory) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_3_sa_HieroCachingRuleFactory) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_3_sa_HieroCachingRuleFactory.tp_dict, __pyx_vtabptr_3_sa_HieroCachingRuleFactory) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "HieroCachingRuleFactory", (PyObject *)&__pyx_type_3_sa_HieroCachingRuleFactory) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_3_sa_HieroCachingRuleFactory = &__pyx_type_3_sa_HieroCachingRuleFactory; __pyx_vtabptr_3_sa_Scorer = &__pyx_vtable_3_sa_Scorer; __pyx_vtable_3_sa_Scorer.score = (struct __pyx_obj_3_sa_FeatureVector *(*)(struct __pyx_obj_3_sa_Scorer *, PyObject *))__pyx_f_3_sa_6Scorer_score; @@ -81001,21 +81395,21 @@ PyMODINIT_FUNC PyInit__sa(void) __pyx_ptype_3_sa___pyx_scope_struct_17_genexpr = &__pyx_type_3_sa___pyx_scope_struct_17_genexpr; if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_18_alignments) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_3_sa___pyx_scope_struct_18_alignments = &__pyx_type_3_sa___pyx_scope_struct_18_alignments; - if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_19_input) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_19_input) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_3_sa___pyx_scope_struct_19_input = &__pyx_type_3_sa___pyx_scope_struct_19_input; - if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_20_genexpr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_20_genexpr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_3_sa___pyx_scope_struct_20_genexpr = &__pyx_type_3_sa___pyx_scope_struct_20_genexpr; - if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_21_add_instance) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_21_add_instance) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_3_sa___pyx_scope_struct_21_add_instance = &__pyx_type_3_sa___pyx_scope_struct_21_add_instance; - if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_22_form_rule) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_22_form_rule) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_3_sa___pyx_scope_struct_22_form_rule = &__pyx_type_3_sa___pyx_scope_struct_22_form_rule; - if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_23_genexpr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_23_genexpr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_3_sa___pyx_scope_struct_23_genexpr = &__pyx_type_3_sa___pyx_scope_struct_23_genexpr; - if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_24_fmt_rule) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_24_fmt_rule) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_3_sa___pyx_scope_struct_24_fmt_rule = &__pyx_type_3_sa___pyx_scope_struct_24_fmt_rule; - if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_25_genexpr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_25_genexpr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_3_sa___pyx_scope_struct_25_genexpr = &__pyx_type_3_sa___pyx_scope_struct_25_genexpr; - if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_26_get_f_phrases) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_26_get_f_phrases) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_3_sa___pyx_scope_struct_26_get_f_phrases = &__pyx_type_3_sa___pyx_scope_struct_26_get_f_phrases; if (PyType_Ready(&__pyx_type_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_3_sa___pyx_scope_struct_27___iter__ = &__pyx_type_3_sa___pyx_scope_struct_27___iter__; @@ -81097,13 +81491,13 @@ PyMODINIT_FUNC PyInit__sa(void) __pyx_t_2 = PyObject_GetAttr(__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_161), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyObject_SetAttr(__pyx_m, __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/paulb/workspace/cdec/python/src/sa/bilex.pxi":54 + /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":54 * cdef id2eword, id2fword, eword2id, fword2id * * def __cinit__(self, from_text=None, from_data=False, from_binary=None, # <<<<<<<<<<<<<< @@ -81116,7 +81510,7 @@ PyMODINIT_FUNC PyInit__sa(void) __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":17 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":17 * from libc.string cimport memset * * cdef int MIN_BOTTOM_SIZE = 32 # <<<<<<<<<<<<<< @@ -81125,7 +81519,7 @@ PyMODINIT_FUNC PyInit__sa(void) */ __pyx_v_3_sa_MIN_BOTTOM_SIZE = 32; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":18 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":18 * * cdef int MIN_BOTTOM_SIZE = 32 * cdef int MIN_BOTTOM_BITS = 5 # <<<<<<<<<<<<<< @@ -81134,7 +81528,7 @@ PyMODINIT_FUNC PyInit__sa(void) */ __pyx_v_3_sa_MIN_BOTTOM_BITS = 5; - /* "/home/paulb/workspace/cdec/python/src/sa/veb.pxi":28 + /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":28 * LOWER_MASK[i] = mask * * _init_lower_mask() # <<<<<<<<<<<<<< @@ -81143,7 +81537,7 @@ PyMODINIT_FUNC PyInit__sa(void) */ __pyx_f_3_sa__init_lower_mask(); - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":4 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":4 * from libc.stdlib cimport malloc, realloc, strtol * * cdef int INDEX_SHIFT = 3 # <<<<<<<<<<<<<< @@ -81152,7 +81546,7 @@ PyMODINIT_FUNC PyInit__sa(void) */ __pyx_v_3_sa_INDEX_SHIFT = 3; - /* "/home/paulb/workspace/cdec/python/src/sa/sym.pxi":5 + /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":5 * * cdef int INDEX_SHIFT = 3 * cdef int INDEX_MASK = (1<= 3 - if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) && - PyUnicode_Compare(**name, key) == 0) break; - #else - if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) && - _PyString_Eq(**name, key)) break; - #endif - } - if (*name) { + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { values[name-argnames] = value; - } else { - for (name=argnames; name != first_kw_arg; name++) { - if (**name == key) goto arg_passed_twice; - #if PY_MAJOR_VERSION >= 3 - if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) && - PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice; - #else - if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) && - _PyString_Eq(**name, key)) goto arg_passed_twice; - #endif - } - if (kwds2) { - if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; - } else { - goto invalid_keyword; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; } } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; } } return 0; arg_passed_twice: - __Pyx_RaiseDoubleKeywordsError(function_name, **name); + __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, @@ -81733,7 +82163,7 @@ static void __Pyx_RaiseArgtupleInvalid( more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, - "%s() takes %s %"PY_FORMAT_SIZE_T"d positional argument%s (%"PY_FORMAT_SIZE_T"d given)", + "%s() takes %s %" CYTHON_FORMAT_SSIZE_T "d positional argument%s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } @@ -81773,33 +82203,38 @@ static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyOb static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { Py_XINCREF(type); - Py_XINCREF(value); - Py_XINCREF(tb); - if (tb == Py_None) { - Py_DECREF(tb); - tb = 0; - } - else if (tb != NULL && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } - if (value == NULL) { - value = Py_None; + if (!value || value == Py_None) + value = NULL; + else Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } } #if PY_VERSION_HEX < 0x02050000 - if (!PyClass_Check(type)) + if (PyClass_Check(type)) { #else - if (!PyType_Check(type)) + if (PyType_Check(type)) { #endif - { - if (value != Py_None) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } - Py_DECREF(value); value = type; #if PY_VERSION_HEX < 0x02050000 if (PyInstance_Check(type)) { @@ -81832,6 +82267,7 @@ raise_error: } #else /* Python 3+ */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { @@ -81849,12 +82285,36 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject } value = type; type = (PyObject*) Py_TYPE(value); - } else if (!PyExceptionClass_Check(type)) { + } 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; + } + } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } - if (cause) { + if (cause && cause != Py_None) { PyObject *fixed_cause; if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); @@ -81871,9 +82331,6 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject "BaseException"); goto bad; } - if (!value) { - value = PyObject_CallObject(type, NULL); - } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); @@ -81887,6 +82344,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject } } bad: + Py_XDECREF(owned_instance); return; } #endif @@ -81910,13 +82368,17 @@ static CYTHON_INLINE int __Pyx_CheckKeywordStrings( { PyObject* key = 0; Py_ssize_t pos = 0; +#if CPYTHON_COMPILING_IN_PYPY + if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) + goto invalid_keyword; + return 1; +#else while (PyDict_Next(kwdict, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) - #else - if (unlikely(!PyUnicode_Check(key))) #endif - goto invalid_keyword_type; + if (unlikely(!PyUnicode_Check(key))) + goto invalid_keyword_type; } if ((!kw_allowed) && unlikely(key)) goto invalid_keyword; @@ -81925,6 +82387,7 @@ invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%s() keywords must be strings", function_name); return 0; +#endif invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 @@ -81937,10 +82400,9 @@ invalid_keyword: return 0; } - - static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { PyObject *local_type, *local_value, *local_tb; +#if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); local_type = tstate->curexc_type; @@ -81949,19 +82411,27 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_COMPILING_IN_CPYTHON if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif goto bad; #if PY_MAJOR_VERSION >= 3 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; #endif - *type = local_type; - *value = local_value; - *tb = local_tb; Py_INCREF(local_type); Py_INCREF(local_value); Py_INCREF(local_tb); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_COMPILING_IN_CPYTHON tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; @@ -81969,10 +82439,13 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) tstate->exc_value = local_value; tstate->exc_traceback = local_tb; /* Make sure tstate is in a consistent state when we XDECREF - these objects (XDECREF may run arbitrary code). */ + these objects (DECREF may run arbitrary code). */ Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif return 0; bad: *type = 0; @@ -82001,23 +82474,40 @@ static CYTHON_INLINE long __Pyx_mod_long(long a, long b) { return r; } -static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, - "need more than %"PY_FORMAT_SIZE_T"d value%s to unpack", - index, (index == 1) ? "" : "s"); + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, - "too many values to unpack (expected %"PY_FORMAT_SIZE_T"d)", expected); + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%s to unpack", + index, (index == 1) ? "" : "s"); } -static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { - if (unlikely(retval)) { - Py_DECREF(retval); - __Pyx_RaiseTooManyValuesError(expected); - return -1; - } else if (PyErr_Occurred()) { +static CYTHON_INLINE int __Pyx_IterFinish(void) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + PyObject* exc_type = tstate->curexc_type; + if (unlikely(exc_type)) { + if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { + PyObject *exc_value, *exc_tb; + exc_value = tstate->curexc_value; + exc_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + Py_DECREF(exc_type); + Py_XDECREF(exc_value); + Py_XDECREF(exc_tb); + return 0; + } else { + return -1; + } + } + return 0; +#else + if (unlikely(PyErr_Occurred())) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { PyErr_Clear(); return 0; @@ -82026,12 +82516,25 @@ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { } } return 0; +#endif } - +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + if (unlikely(retval)) { + Py_DECREF(retval); + __Pyx_RaiseTooManyValuesError(expected); + return -1; + } else { + return __Pyx_IterFinish(); + } + return 0; +} static double __Pyx__PyObject_AsDouble(PyObject* obj) { PyObject* float_value; +#if CYTHON_COMPILING_IN_PYPY + float_value = PyNumber_Float(obj); +#else if (Py_TYPE(obj)->tp_as_number && Py_TYPE(obj)->tp_as_number->nb_float) { return PyFloat_AsDouble(obj); } else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) { @@ -82048,6 +82551,7 @@ static double __Pyx__PyObject_AsDouble(PyObject* obj) { PyTuple_SET_ITEM(args, 0, 0); Py_DECREF(args); } +#endif if (likely(float_value)) { double value = PyFloat_AS_DOUBLE(float_value); Py_DECREF(float_value); @@ -82081,8 +82585,158 @@ static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed return 0; } -static CYTHON_INLINE void __Pyx_RaiseNoneIndexingError(void) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is unsubscriptable"); +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); +} + +static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { + if (t == Py_None) { + __Pyx_RaiseNoneNotIterableError(); + } else if (PyTuple_GET_SIZE(t) < index) { + __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); + } else { + __Pyx_RaiseTooManyValuesError(index); + } +} + +static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, + int is_tuple, int has_known_size, int decref_tuple) { + Py_ssize_t index; + PyObject *value1 = NULL, *value2 = NULL, *iter = NULL; + if (!is_tuple && unlikely(!PyTuple_Check(tuple))) { + iternextfunc iternext; + iter = PyObject_GetIter(tuple); + if (unlikely(!iter)) goto bad; + if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; } + iternext = Py_TYPE(iter)->tp_iternext; + value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; } + value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; } + if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad; + Py_DECREF(iter); + } else { + if (!has_known_size && unlikely(PyTuple_GET_SIZE(tuple) != 2)) { + __Pyx_UnpackTupleError(tuple, 2); + goto bad; + } +#if CYTHON_COMPILING_IN_PYPY + value1 = PySequence_ITEM(tuple, 0); + if (unlikely(!value1)) goto bad; + value2 = PySequence_ITEM(tuple, 1); + if (unlikely(!value2)) goto bad; +#else + value1 = PyTuple_GET_ITEM(tuple, 0); + value2 = PyTuple_GET_ITEM(tuple, 1); + Py_INCREF(value1); + Py_INCREF(value2); +#endif + if (decref_tuple) { Py_DECREF(tuple); } + } + *pvalue1 = value1; + *pvalue2 = value2; + return 0; +unpacking_failed: + if (!has_known_size && __Pyx_IterFinish() == 0) + __Pyx_RaiseNeedMoreValuesError(index); +bad: + Py_XDECREF(iter); + Py_XDECREF(value1); + Py_XDECREF(value2); + if (decref_tuple) { Py_XDECREF(tuple); } + return -1; +} + +static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, + Py_ssize_t* p_orig_length, int* p_source_is_dict) { + is_dict = is_dict || likely(PyDict_CheckExact(iterable)); + *p_source_is_dict = is_dict; +#if !CYTHON_COMPILING_IN_PYPY + if (is_dict) { + *p_orig_length = PyDict_Size(iterable); + Py_INCREF(iterable); + return iterable; + } +#endif + *p_orig_length = 0; + if (method_name) { + PyObject* iter; + iterable = PyObject_CallMethodObjArgs(iterable, method_name, NULL); + if (!iterable) + return NULL; +#if !CYTHON_COMPILING_IN_PYPY + if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable)) + return iterable; +#endif + iter = PyObject_GetIter(iterable); + Py_DECREF(iterable); + return iter; + } + return PyObject_GetIter(iterable); +} +static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* iter_obj, Py_ssize_t orig_length, Py_ssize_t* ppos, + PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) { + PyObject* next_item; +#if !CYTHON_COMPILING_IN_PYPY + if (source_is_dict) { + PyObject *key, *value; + if (unlikely(orig_length != PyDict_Size(iter_obj))) { + PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration"); + return -1; + } + if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) { + return 0; + } + if (pitem) { + PyObject* tuple = PyTuple_New(2); + if (unlikely(!tuple)) { + return -1; + } + Py_INCREF(key); + Py_INCREF(value); + PyTuple_SET_ITEM(tuple, 0, key); + PyTuple_SET_ITEM(tuple, 1, value); + *pitem = tuple; + } else { + if (pkey) { + Py_INCREF(key); + *pkey = key; + } + if (pvalue) { + Py_INCREF(value); + *pvalue = value; + } + } + return 1; + } else if (PyTuple_CheckExact(iter_obj)) { + Py_ssize_t pos = *ppos; + if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0; + *ppos = pos + 1; + next_item = PyTuple_GET_ITEM(iter_obj, pos); + Py_INCREF(next_item); + } else if (PyList_CheckExact(iter_obj)) { + Py_ssize_t pos = *ppos; + if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0; + *ppos = pos + 1; + next_item = PyList_GET_ITEM(iter_obj, pos); + Py_INCREF(next_item); + } else +#endif + { + next_item = PyIter_Next(iter_obj); + if (unlikely(!next_item)) { + return __Pyx_IterFinish(); + } + } + if (pitem) { + *pitem = next_item; + } else if (pkey && pvalue) { + if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1)) + return -1; + } else if (pkey) { + *pkey = next_item; + } else { + *pvalue = next_item; + } + return 1; } static CYTHON_INLINE int __Pyx_div_int(int a, int b) { @@ -82093,6 +82747,7 @@ static CYTHON_INLINE int __Pyx_div_int(int a, int b) { } static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); *type = tstate->exc_type; *value = tstate->exc_value; @@ -82100,8 +82755,12 @@ static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); +#else + PyErr_GetExcInfo(type, value, tb); +#endif } static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->exc_type; @@ -82113,6 +82772,9 @@ static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(type, value, tb); +#endif } static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level) { @@ -82193,78 +82855,6 @@ static CYTHON_INLINE void __Pyx_RaiseImportError(PyObject *name) { #endif } -static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { - if (s1 == s2) { - return (equals == Py_EQ); - } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { - if (PyBytes_GET_SIZE(s1) != PyBytes_GET_SIZE(s2)) { - return (equals == Py_NE); - } else if (PyBytes_GET_SIZE(s1) == 1) { - if (equals == Py_EQ) - return (PyBytes_AS_STRING(s1)[0] == PyBytes_AS_STRING(s2)[0]); - else - return (PyBytes_AS_STRING(s1)[0] != PyBytes_AS_STRING(s2)[0]); - } else { - int result = memcmp(PyBytes_AS_STRING(s1), PyBytes_AS_STRING(s2), (size_t)PyBytes_GET_SIZE(s1)); - 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; - } -} - -static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { - if (s1 == s2) { - return (equals == Py_EQ); - } else if (PyUnicode_CheckExact(s1) & PyUnicode_CheckExact(s2)) { - #if CYTHON_PEP393_ENABLED - if ((PyUnicode_READY(s1) < 0) || (PyUnicode_READY(s2) < 0)) - return -1; - if (PyUnicode_GET_LENGTH(s1) != PyUnicode_GET_LENGTH(s2)) { - return (equals == Py_NE); - } else if (PyUnicode_GET_LENGTH(s1) == 1) { - Py_UCS4 ch1 = PyUnicode_READ_CHAR(s1, 0); - Py_UCS4 ch2 = PyUnicode_READ_CHAR(s2, 0); - return (equals == Py_EQ) ? (ch1 == ch2) : (ch1 != ch2); - #else - if (PyUnicode_GET_SIZE(s1) != PyUnicode_GET_SIZE(s2)) { - return (equals == Py_NE); - } else if (PyUnicode_GET_SIZE(s1) == 1) { - Py_UNICODE ch1 = PyUnicode_AS_UNICODE(s1)[0]; - Py_UNICODE ch2 = PyUnicode_AS_UNICODE(s2)[0]; - return (equals == Py_EQ) ? (ch1 == ch2) : (ch1 != ch2); - #endif - } else { - int result = PyUnicode_Compare(s1, s2); - if ((result == -1) && unlikely(PyErr_Occurred())) - return -1; - return (equals == Py_EQ) ? (result == 0) : (result != 0); - } - } else if ((s1 == Py_None) & PyUnicode_CheckExact(s2)) { - return (equals == Py_NE); - } else if ((s2 == Py_None) & PyUnicode_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; - } -} - static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) { @@ -82545,6 +83135,56 @@ __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) PyString_AsString(func_name), (void *)op); #endif } +#if CYTHON_COMPILING_IN_PYPY +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + Py_ssize_t size; + switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) { + case METH_VARARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 0) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 1) + return (*meth)(self, PyTuple_GET_ITEM(arg, 0)); + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +#else +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return PyCFunction_Call(func, arg, kw); +} +#endif static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __Pyx_NAMESTR("cython_function_or_method"), /*tp_name*/ @@ -82564,7 +83204,7 @@ static PyTypeObject __pyx_CyFunctionType_type = { 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ - __Pyx_PyCFunction_Call, /*tp_call*/ + __Pyx_CyFunction_Call, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ @@ -82600,15 +83240,16 @@ static PyTypeObject __pyx_CyFunctionType_type = { 0, /*tp_version_tag*/ #endif }; -static int __Pyx_CyFunction_init(void) -{ +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) return -1; __pyx_CyFunctionType = &__pyx_CyFunctionType_type; return 0; } -void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) -{ +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyMem_Malloc(size); if (!m->defaults) @@ -82617,13 +83258,112 @@ void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) m->defaults_pyobjects = pyobjects; return m->defaults; } -static void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) -{ +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } +#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 +static PyObject *__Pyx_GetStdout(void) { + PyObject *f = PySys_GetObject((char *)"stdout"); + if (!f) { + PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout"); + } + return f; +} +static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) { + int i; + if (!f) { + if (!(f = __Pyx_GetStdout())) + return -1; + } + Py_INCREF(f); + for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) { + PyObject* v; + if (PyFile_SoftSpace(f, 1)) { + if (PyFile_WriteString(" ", f) < 0) + goto error; + } + v = PyTuple_GET_ITEM(arg_tuple, i); + if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0) + goto error; + if (PyString_Check(v)) { + char *s = PyString_AsString(v); + Py_ssize_t len = PyString_Size(v); + if (len > 0 && + isspace(Py_CHARMASK(s[len-1])) && + s[len-1] != ' ') + PyFile_SoftSpace(f, 0); + } + } + if (newline) { + if (PyFile_WriteString("\n", f) < 0) + goto error; + PyFile_SoftSpace(f, 0); + } + Py_DECREF(f); + return 0; +error: + Py_DECREF(f); + return -1; +} +#else /* Python 3 has a print function */ +static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) { + PyObject* kwargs = 0; + PyObject* result = 0; + PyObject* end_string; + if (unlikely(!__pyx_print)) { + __pyx_print = __Pyx_GetAttrString(__pyx_b, "print"); + if (!__pyx_print) + return -1; + } + if (stream) { + kwargs = PyDict_New(); + if (unlikely(!kwargs)) + return -1; + if (unlikely(PyDict_SetItemString(kwargs, "file", stream) < 0)) + goto bad; + if (!newline) { + end_string = PyUnicode_FromStringAndSize(" ", 1); + if (unlikely(!end_string)) + goto bad; + if (PyDict_SetItemString(kwargs, "end", end_string) < 0) { + Py_DECREF(end_string); + goto bad; + } + Py_DECREF(end_string); + } + } else if (!newline) { + if (unlikely(!__pyx_print_kwargs)) { + __pyx_print_kwargs = PyDict_New(); + if (unlikely(!__pyx_print_kwargs)) + return -1; + end_string = PyUnicode_FromStringAndSize(" ", 1); + if (unlikely(!end_string)) + return -1; + if (PyDict_SetItemString(__pyx_print_kwargs, "end", end_string) < 0) { + Py_DECREF(end_string); + return -1; + } + Py_DECREF(end_string); + } + kwargs = __pyx_print_kwargs; + } + result = PyObject_Call(__pyx_print, arg_tuple, kwargs); + if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs)) + Py_DECREF(kwargs); + if (!result) + return -1; + Py_DECREF(result); + return 0; +bad: + if (kwargs != __pyx_print_kwargs) + Py_XDECREF(kwargs); + return -1; +} +#endif + 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; @@ -83024,8 +83764,8 @@ static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* } } -static void __Pyx_WriteUnraisable(const char *name, int clineno, - int lineno, const char *filename) { +static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename) { PyObject *old_exc, *old_val, *old_tb; PyObject *ctx; __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); @@ -83045,6 +83785,7 @@ static void __Pyx_WriteUnraisable(const char *name, int clineno, static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; +#if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; @@ -83052,6 +83793,10 @@ static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, tstate->exc_type = *type; tstate->exc_value = *value; tstate->exc_traceback = *tb; +#else + PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); + PyErr_SetExcInfo(*type, *value, *tb); +#endif *type = tmp_type; *value = tmp_value; *tb = tmp_tb; @@ -83061,9 +83806,70 @@ static PyObject *__Pyx_Generator_Next(PyObject *self); static PyObject *__Pyx_Generator_Send(PyObject *self, PyObject *value); static PyObject *__Pyx_Generator_Close(PyObject *self); static PyObject *__Pyx_Generator_Throw(PyObject *gen, PyObject *args); +static PyTypeObject *__pyx_GeneratorType = 0; +#define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType) +#define __Pyx_Generator_Undelegate(gen) Py_CLEAR((gen)->yieldfrom) +#if 1 || PY_VERSION_HEX < 0x030300B0 +static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue) { + PyObject *et, *ev, *tb; + PyObject *value = NULL; + __Pyx_ErrFetch(&et, &ev, &tb); + if (!et) { + Py_XDECREF(tb); + Py_XDECREF(ev); + Py_INCREF(Py_None); + *pvalue = Py_None; + return 0; + } + if (unlikely(et != PyExc_StopIteration) && + unlikely(!PyErr_GivenExceptionMatches(et, PyExc_StopIteration))) { + __Pyx_ErrRestore(et, ev, tb); + return -1; + } + if (likely(et == PyExc_StopIteration)) { + if (likely(!ev) || !PyObject_IsInstance(ev, PyExc_StopIteration)) { + if (!ev) { + Py_INCREF(Py_None); + ev = Py_None; + } + Py_XDECREF(tb); + Py_DECREF(et); + *pvalue = ev; + return 0; + } + } + PyErr_NormalizeException(&et, &ev, &tb); + if (unlikely(!PyObject_IsInstance(ev, PyExc_StopIteration))) { + __Pyx_ErrRestore(et, ev, tb); + return -1; + } + Py_XDECREF(tb); + Py_DECREF(et); +#if PY_VERSION_HEX >= 0x030300A0 + value = ((PyStopIterationObject *)ev)->value; + Py_INCREF(value); + Py_DECREF(ev); +#else + { + PyObject* args = PyObject_GetAttrString(ev, "args"); + Py_DECREF(ev); + if (likely(args)) { + value = PyObject_GetItem(args, 0); + Py_DECREF(args); + } + if (unlikely(!value)) { + __Pyx_ErrRestore(NULL, NULL, NULL); + Py_INCREF(Py_None); + value = Py_None; + } + } +#endif + *pvalue = value; + return 0; +} +#endif static CYTHON_INLINE -void __Pyx_Generator_ExceptionClear(__pyx_GeneratorObject *self) -{ +void __Pyx_Generator_ExceptionClear(__pyx_GeneratorObject *self) { PyObject *exc_type = self->exc_type; PyObject *exc_value = self->exc_value; PyObject *exc_traceback = self->exc_traceback; @@ -83075,14 +83881,18 @@ void __Pyx_Generator_ExceptionClear(__pyx_GeneratorObject *self) Py_XDECREF(exc_traceback); } static CYTHON_INLINE -PyObject *__Pyx_Generator_SendEx(__pyx_GeneratorObject *self, PyObject *value) -{ - PyObject *retval; - if (unlikely(self->is_running)) { +int __Pyx_Generator_CheckRunning(__pyx_GeneratorObject *gen) { + if (unlikely(gen->is_running)) { PyErr_SetString(PyExc_ValueError, "generator already executing"); - return NULL; + return 1; } + return 0; +} +static CYTHON_INLINE +PyObject *__Pyx_Generator_SendEx(__pyx_GeneratorObject *self, PyObject *value) { + PyObject *retval; + assert(!self->is_running); if (unlikely(self->resume_label == 0)) { if (unlikely(value && value != Py_None)) { PyErr_SetString(PyExc_TypeError, @@ -83095,81 +83905,240 @@ PyObject *__Pyx_Generator_SendEx(__pyx_GeneratorObject *self, PyObject *value) PyErr_SetNone(PyExc_StopIteration); return NULL; } - if (value) - __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value, &self->exc_traceback); - else + if (value) { +#if CYTHON_COMPILING_IN_PYPY +#else + /* Generators always return to their most recent caller, not + * necessarily their creator. */ + if (self->exc_traceback) { + PyThreadState *tstate = PyThreadState_GET(); + PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback; + PyFrameObject *f = tb->tb_frame; + Py_XINCREF(tstate->frame); + assert(f->f_back == NULL); + f->f_back = tstate->frame; + } +#endif + __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value, + &self->exc_traceback); + } else { __Pyx_Generator_ExceptionClear(self); + } self->is_running = 1; retval = self->body((PyObject *) self, value); self->is_running = 0; - if (retval) - __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value, &self->exc_traceback); - else + if (retval) { + __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value, + &self->exc_traceback); +#if CYTHON_COMPILING_IN_PYPY +#else + /* Don't keep the reference to f_back any longer than necessary. It + * may keep a chain of frames alive or it could create a reference + * cycle. */ + if (self->exc_traceback) { + PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback; + PyFrameObject *f = tb->tb_frame; + Py_CLEAR(f->f_back); + } +#endif + } else { __Pyx_Generator_ExceptionClear(self); + } return retval; } -static PyObject *__Pyx_Generator_Next(PyObject *self) -{ - return __Pyx_Generator_SendEx((__pyx_GeneratorObject *) self, Py_None); +static CYTHON_INLINE +PyObject *__Pyx_Generator_FinishDelegation(__pyx_GeneratorObject *gen) { + PyObject *ret; + PyObject *val = NULL; + __Pyx_Generator_Undelegate(gen); + __Pyx_PyGen_FetchStopIterationValue(&val); + ret = __Pyx_Generator_SendEx(gen, val); + Py_XDECREF(val); + return ret; +} +static PyObject *__Pyx_Generator_Next(PyObject *self) { + __pyx_GeneratorObject *gen = (__pyx_GeneratorObject*) self; + PyObject *yf = gen->yieldfrom; + if (unlikely(__Pyx_Generator_CheckRunning(gen))) + return NULL; + if (yf) { + PyObject *ret; + gen->is_running = 1; + ret = Py_TYPE(yf)->tp_iternext(yf); + gen->is_running = 0; + if (likely(ret)) { + return ret; + } + return __Pyx_Generator_FinishDelegation(gen); + } + return __Pyx_Generator_SendEx(gen, Py_None); } -static PyObject *__Pyx_Generator_Send(PyObject *self, PyObject *value) -{ - return __Pyx_Generator_SendEx((__pyx_GeneratorObject *) self, value); +static PyObject *__Pyx_Generator_Send(PyObject *self, PyObject *value) { + __pyx_GeneratorObject *gen = (__pyx_GeneratorObject*) self; + PyObject *yf = gen->yieldfrom; + if (unlikely(__Pyx_Generator_CheckRunning(gen))) + return NULL; + if (yf) { + PyObject *ret; + gen->is_running = 1; + if (__Pyx_Generator_CheckExact(yf)) { + ret = __Pyx_Generator_Send(yf, value); + } else { + if (value == Py_None) + ret = PyIter_Next(yf); + else + ret = PyObject_CallMethod(yf, (char*)"send", (char*)"O", value); + } + gen->is_running = 0; + if (likely(ret)) { + return ret; + } + return __Pyx_Generator_FinishDelegation(gen); + } + return __Pyx_Generator_SendEx(gen, value); } -static PyObject *__Pyx_Generator_Close(PyObject *self) -{ - __pyx_GeneratorObject *generator = (__pyx_GeneratorObject *) self; - PyObject *retval; +static int __Pyx_Generator_CloseIter(__pyx_GeneratorObject *gen, PyObject *yf) { + PyObject *retval = NULL; + int err = 0; + if (__Pyx_Generator_CheckExact(yf)) { + retval = __Pyx_Generator_Close(yf); + if (!retval) + return -1; + } else { + PyObject *meth; + gen->is_running = 1; + meth = PyObject_GetAttrString(yf, "close"); + if (unlikely(!meth)) { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_WriteUnraisable(yf); + } + PyErr_Clear(); + } else { + retval = PyObject_CallFunction(meth, NULL); + Py_DECREF(meth); + if (!retval) + err = -1; + } + gen->is_running = 0; + } + Py_XDECREF(retval); + return err; +} +static PyObject *__Pyx_Generator_Close(PyObject *self) { + __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self; + PyObject *retval, *raised_exception; + PyObject *yf = gen->yieldfrom; + int err = 0; + if (unlikely(__Pyx_Generator_CheckRunning(gen))) + return NULL; + if (yf) { + Py_INCREF(yf); + err = __Pyx_Generator_CloseIter(gen, yf); + __Pyx_Generator_Undelegate(gen); + Py_DECREF(yf); + } + if (err == 0) #if PY_VERSION_HEX < 0x02050000 - PyErr_SetNone(PyExc_StopIteration); + PyErr_SetNone(PyExc_StopIteration); #else - PyErr_SetNone(PyExc_GeneratorExit); + PyErr_SetNone(PyExc_GeneratorExit); #endif - retval = __Pyx_Generator_SendEx(generator, NULL); + retval = __Pyx_Generator_SendEx(gen, NULL); if (retval) { Py_DECREF(retval); PyErr_SetString(PyExc_RuntimeError, "generator ignored GeneratorExit"); return NULL; } -#if PY_VERSION_HEX < 0x02050000 - if (PyErr_ExceptionMatches(PyExc_StopIteration)) -#else - if (PyErr_ExceptionMatches(PyExc_StopIteration) - || PyErr_ExceptionMatches(PyExc_GeneratorExit)) + raised_exception = PyErr_Occurred(); + if (!raised_exception + || raised_exception == PyExc_StopIteration +#if PY_VERSION_HEX >= 0x02050000 + || raised_exception == PyExc_GeneratorExit + || PyErr_GivenExceptionMatches(raised_exception, PyExc_GeneratorExit) #endif + || PyErr_GivenExceptionMatches(raised_exception, PyExc_StopIteration)) { - PyErr_Clear(); /* ignore these errors */ + if (raised_exception) PyErr_Clear(); /* ignore these errors */ Py_INCREF(Py_None); return Py_None; } return NULL; } -static PyObject *__Pyx_Generator_Throw(PyObject *self, PyObject *args) -{ - __pyx_GeneratorObject *generator = (__pyx_GeneratorObject *) self; +static PyObject *__Pyx_Generator_Throw(PyObject *self, PyObject *args) { + __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self; PyObject *typ; PyObject *tb = NULL; PyObject *val = NULL; + PyObject *yf = gen->yieldfrom; if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb)) return NULL; + if (unlikely(__Pyx_Generator_CheckRunning(gen))) + return NULL; + if (yf) { + PyObject *ret; + Py_INCREF(yf); +#if PY_VERSION_HEX >= 0x02050000 + if (PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit)) { + int err = __Pyx_Generator_CloseIter(gen, yf); + Py_DECREF(yf); + __Pyx_Generator_Undelegate(gen); + if (err < 0) + return __Pyx_Generator_SendEx(gen, NULL); + goto throw_here; + } +#endif + gen->is_running = 1; + if (__Pyx_Generator_CheckExact(yf)) { + ret = __Pyx_Generator_Throw(yf, args); + } else { + PyObject *meth = PyObject_GetAttrString(yf, "throw"); + if (unlikely(!meth)) { + Py_DECREF(yf); + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) { + gen->is_running = 0; + return NULL; + } + PyErr_Clear(); + __Pyx_Generator_Undelegate(gen); + gen->is_running = 0; + goto throw_here; + } + ret = PyObject_CallObject(meth, args); + Py_DECREF(meth); + } + gen->is_running = 0; + Py_DECREF(yf); + if (!ret) { + ret = __Pyx_Generator_FinishDelegation(gen); + } + return ret; + } +throw_here: __Pyx_Raise(typ, val, tb, NULL); - return __Pyx_Generator_SendEx(generator, NULL); + return __Pyx_Generator_SendEx(gen, NULL); } -static int -__Pyx_Generator_traverse(PyObject *self, visitproc visit, void *arg) -{ +static int __Pyx_Generator_traverse(PyObject *self, visitproc visit, void *arg) { __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self; Py_VISIT(gen->closure); Py_VISIT(gen->classobj); + Py_VISIT(gen->yieldfrom); Py_VISIT(gen->exc_type); Py_VISIT(gen->exc_value); Py_VISIT(gen->exc_traceback); return 0; } -static void -__Pyx_Generator_dealloc(PyObject *self) -{ +static int __Pyx_Generator_clear(PyObject *self) { + __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self; + Py_CLEAR(gen->closure); + Py_CLEAR(gen->classobj); + Py_CLEAR(gen->yieldfrom); + Py_CLEAR(gen->exc_type); + Py_CLEAR(gen->exc_value); + Py_CLEAR(gen->exc_traceback); + return 0; +} +static void __Pyx_Generator_dealloc(PyObject *self) { __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self; PyObject_GC_UnTrack(gen); if (gen->gi_weakreflist != NULL) @@ -83181,16 +84150,10 @@ __Pyx_Generator_dealloc(PyObject *self) return; /* resurrected. :( */ } PyObject_GC_UnTrack(self); - Py_CLEAR(gen->closure); - Py_CLEAR(gen->classobj); - Py_CLEAR(gen->exc_type); - Py_CLEAR(gen->exc_value); - Py_CLEAR(gen->exc_traceback); + __Pyx_Generator_clear(self); PyObject_GC_Del(gen); } -static void -__Pyx_Generator_del(PyObject *self) -{ +static void __Pyx_Generator_del(PyObject *self) { PyObject *res; PyObject *error_type, *error_value, *error_traceback; __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self; @@ -83219,11 +84182,13 @@ __Pyx_Generator_del(PyObject *self) _Py_NewReference(self); self->ob_refcnt = refcnt; } +#if CYTHON_COMPILING_FOR_CPYTHON assert(PyType_IS_GC(self->ob_type) && _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED); /* If Py_REF_DEBUG, _Py_NewReference bumped _Py_RefTotal, so * we need to undo that. */ _Py_DEC_REFTOTAL; +#endif /* If Py_TRACE_REFS, _Py_NewReference re-added self to the object * chain, so no more to do there. * If COUNT_ALLOCS, the original decref bumped tp_frees, and @@ -83231,13 +84196,17 @@ __Pyx_Generator_del(PyObject *self) * undone. */ #ifdef COUNT_ALLOCS - --self->ob_type->tp_frees; - --self->ob_type->tp_allocs; + --Py_TYPE(self)->tp_frees; + --Py_TYPE(self)->tp_allocs; #endif } static PyMemberDef __pyx_Generator_memberlist[] = { {(char *) "gi_running", - T_INT, +#if PY_VERSION_HEX >= 0x02060000 + T_BOOL, +#else + T_BYTE, +#endif offsetof(__pyx_GeneratorObject, is_running), READONLY, NULL}, @@ -83249,7 +84218,7 @@ static PyMethodDef __pyx_Generator_methods[] = { {__Pyx_NAMESTR("close"), (PyCFunction) __Pyx_Generator_Close, METH_NOARGS, 0}, {0, 0, 0, 0} }; -static PyTypeObject __pyx_GeneratorType = { +static PyTypeObject __pyx_GeneratorType_type = { PyVarObject_HEAD_INIT(0, 0) __Pyx_NAMESTR("generator"), /*tp_name*/ sizeof(__pyx_GeneratorObject), /*tp_basicsize*/ @@ -83270,7 +84239,7 @@ static PyTypeObject __pyx_GeneratorType = { 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ - PyObject_GenericGetAttr, /*tp_getattro*/ + 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags*/ @@ -83279,7 +84248,7 @@ static PyTypeObject __pyx_GeneratorType = { 0, /*tp_clear*/ 0, /*tp_richcompare*/ offsetof(__pyx_GeneratorObject, gi_weakreflist), /* tp_weaklistoffse */ - PyObject_SelfIter, /*tp_iter*/ + 0, /*tp_iter*/ (iternextfunc) __Pyx_Generator_Next, /*tp_iternext*/ __pyx_Generator_methods, /*tp_methods*/ __pyx_Generator_memberlist, /*tp_members*/ @@ -83304,12 +84273,10 @@ static PyTypeObject __pyx_GeneratorType = { 0, /*tp_version_tag*/ #endif }; -static -__pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body, - PyObject *closure) -{ +static __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body, + PyObject *closure) { __pyx_GeneratorObject *gen = - PyObject_GC_New(__pyx_GeneratorObject, &__pyx_GeneratorType); + PyObject_GC_New(__pyx_GeneratorObject, &__pyx_GeneratorType_type); if (gen == NULL) return NULL; gen->body = body; @@ -83318,6 +84285,7 @@ __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body, gen->is_running = 0; gen->resume_label = 0; gen->classobj = NULL; + gen->yieldfrom = NULL; gen->exc_type = NULL; gen->exc_value = NULL; gen->exc_traceback = NULL; @@ -83325,9 +84293,14 @@ __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body, PyObject_GC_Track(gen); return gen; } -static int __pyx_Generator_init(void) -{ - return PyType_Ready(&__pyx_GeneratorType); +static int __pyx_Generator_init(void) { + __pyx_GeneratorType_type.tp_getattro = PyObject_GenericGetAttr; + __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter; + if (PyType_Ready(&__pyx_GeneratorType_type)) { + return -1; + } + __pyx_GeneratorType = &__pyx_GeneratorType_type; + return 0; } static int __Pyx_check_binary_version(void) { diff --git a/python/src/sa/rulefactory.pxi b/python/src/sa/rulefactory.pxi index d7fca750..559e8396 100644 --- a/python/src/sa/rulefactory.pxi +++ b/python/src/sa/rulefactory.pxi @@ -1695,12 +1695,12 @@ cdef class HieroCachingRuleFactory: met_constraints = 0 if (met_constraints and - self.find_fixpoint(f_x_low, f_back_high, + (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, f_sent_len, e_sent_len, self.train_max_initial_size, self.train_max_initial_size, - 1, 1, 1, 1, 0, 1, 0) and + 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, -- cgit v1.2.3