summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Chahuneau <vchahune@cs.cmu.edu>2012-09-06 15:08:55 +0100
committerVictor Chahuneau <vchahune@cs.cmu.edu>2012-09-06 15:08:55 +0100
commit8bc09e198e53da911fd625ae2cb26c38b53fb36a (patch)
tree3ce19c06867918b2a06cc91ab1677a1ef6696b96
parent5cffab2b8e200aa47a382f19327cc021ec64723b (diff)
[cdec.sa] Fix the list of matching training source sentence
-rw-r--r--python/src/sa/_sa.c2832
-rw-r--r--python/src/sa/data_array.pxi7
-rw-r--r--python/src/sa/rulefactory.pxi5
3 files changed, 1455 insertions, 1389 deletions
diff --git a/python/src/sa/_sa.c b/python/src/sa/_sa.c
index 68205b2e..d1cc55c0 100644
--- a/python/src/sa/_sa.c
+++ b/python/src/sa/_sa.c
@@ -1,4 +1,4 @@
-/* Generated by Cython 0.17 on Thu Sep 6 11:14:53 2012 */
+/* Generated by Cython 0.17 on Thu Sep 6 14:37:00 2012 */
#define PY_SSIZE_T_CLEAN
#include "Python.h"
@@ -837,7 +837,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_6_genexpr {
};
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":76
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":73
* def read_bitext(self, char* filename, int side):
* with gzip_or_text(filename) as fp:
* data = (line.split(' ||| ')[side] for line in fp) # <<<<<<<<<<<<<<
@@ -889,7 +889,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_16___iter__ {
};
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":74
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":71
* self.read_text_data(fp)
*
* def read_bitext(self, char* filename, int side): # <<<<<<<<<<<<<<
@@ -2304,21 +2304,23 @@ static int __pyx_pf_3_sa_9StringMap___cinit__(struct __pyx_obj_3_sa_StringMap *_
static void __pyx_pf_3_sa_9StringMap_2__dealloc__(struct __pyx_obj_3_sa_StringMap *__pyx_v_self); /* proto */
static int __pyx_pf_3_sa_9DataArray___cinit__(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_from_binary, PyObject *__pyx_v_from_text, PyObject *__pyx_v_side, int __pyx_v_use_sent_id); /* proto */
static Py_ssize_t __pyx_pf_3_sa_9DataArray_2__len__(struct __pyx_obj_3_sa_DataArray *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_3_sa_9DataArray_4get_data(struct __pyx_obj_3_sa_DataArray *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_3_sa_9DataArray_6get_sentence_id(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_i); /* proto */
-static PyObject *__pyx_pf_3_sa_9DataArray_8get_sentence(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_i); /* proto */
-static PyObject *__pyx_pf_3_sa_9DataArray_10get_sentence_position(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_loc); /* proto */
-static PyObject *__pyx_pf_3_sa_9DataArray_12get_id(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_word); /* proto */
-static PyObject *__pyx_pf_3_sa_9DataArray_14get_word(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_id); /* proto */
-static PyObject *__pyx_pf_3_sa_9DataArray_16write_text(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, char *__pyx_v_filename); /* proto */
-static PyObject *__pyx_pf_3_sa_9DataArray_18read_text(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, char *__pyx_v_filename); /* proto */
+static PyObject *__pyx_pf_3_sa_9DataArray_4get_sentence_id(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_i); /* proto */
+static PyObject *__pyx_pf_3_sa_9DataArray_6get_sentence(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_i); /* proto */
+static PyObject *__pyx_pf_3_sa_9DataArray_8get_sentence_position(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_loc); /* proto */
+static PyObject *__pyx_pf_3_sa_9DataArray_10get_id(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_word); /* proto */
+static PyObject *__pyx_pf_3_sa_9DataArray_12get_word(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_id); /* proto */
+static PyObject *__pyx_pf_3_sa_9DataArray_14write_text(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, char *__pyx_v_filename); /* proto */
+static PyObject *__pyx_pf_3_sa_9DataArray_16read_text(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, char *__pyx_v_filename); /* proto */
static PyObject *__pyx_pf_3_sa_9DataArray_11read_bitext_genexpr(PyObject *__pyx_self); /* proto */
-static PyObject *__pyx_pf_3_sa_9DataArray_20read_bitext(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, char *__pyx_v_filename, int __pyx_v_side); /* proto */
-static PyObject *__pyx_pf_3_sa_9DataArray_22read_text_data(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_data); /* proto */
-static PyObject *__pyx_pf_3_sa_9DataArray_24read_binary(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, char *__pyx_v_filename); /* proto */
-static PyObject *__pyx_pf_3_sa_9DataArray_26write_binary(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, char *__pyx_v_filename); /* proto */
-static PyObject *__pyx_pf_3_sa_9DataArray_28write_enhanced_handle(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_f); /* proto */
-static PyObject *__pyx_pf_3_sa_9DataArray_30write_enhanced(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, char *__pyx_v_filename); /* proto */
+static PyObject *__pyx_pf_3_sa_9DataArray_18read_bitext(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, char *__pyx_v_filename, int __pyx_v_side); /* proto */
+static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_data); /* proto */
+static PyObject *__pyx_pf_3_sa_9DataArray_22read_binary(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, char *__pyx_v_filename); /* proto */
+static PyObject *__pyx_pf_3_sa_9DataArray_24write_binary(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, char *__pyx_v_filename); /* proto */
+static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_f); /* proto */
+static PyObject *__pyx_pf_3_sa_9DataArray_28write_enhanced(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, char *__pyx_v_filename); /* proto */
+static PyObject *__pyx_pf_3_sa_9DataArray_4data___get__(struct __pyx_obj_3_sa_DataArray *__pyx_v_self); /* proto */
+static int __pyx_pf_3_sa_9DataArray_4data_2__set__(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
+static int __pyx_pf_3_sa_9DataArray_4data_4__del__(struct __pyx_obj_3_sa_DataArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3_sa_9Alignment_unlink(CYTHON_UNUSED struct __pyx_obj_3_sa_Alignment *__pyx_v_self, PyObject *__pyx_v_link); /* proto */
static PyObject *__pyx_pf_3_sa_9Alignment_2get_sent_links(struct __pyx_obj_3_sa_Alignment *__pyx_v_self, int __pyx_v_sent_id); /* proto */
static int __pyx_pf_3_sa_9Alignment_4__cinit__(struct __pyx_obj_3_sa_Alignment *__pyx_v_self, PyObject *__pyx_v_from_binary, PyObject *__pyx_v_from_text); /* proto */
@@ -2725,6 +2727,7 @@ static char __pyx_k__make_lattice[] = "make_lattice";
static char __pyx_k__min_gap_size[] = "min_gap_size";
static char __pyx_k__StopIteration[] = "StopIteration";
static char __pyx_k__alphabet_size[] = "alphabet_size";
+static char __pyx_k__from_iterable[] = "from_iterable";
static char __pyx_k__fsample_count[] = "fsample_count";
static char __pyx_k__test_sentence[] = "test_sentence";
static char __pyx_k__tight_phrases[] = "tight_phrases";
@@ -2900,6 +2903,7 @@ static PyObject *__pyx_n_s__filename;
static PyObject *__pyx_n_s__fphrase;
static PyObject *__pyx_n_s__from_binary;
static PyObject *__pyx_n_s__from_data;
+static PyObject *__pyx_n_s__from_iterable;
static PyObject *__pyx_n_s__from_stats;
static PyObject *__pyx_n_s__from_text;
static PyObject *__pyx_n_s__frontier;
@@ -7185,7 +7189,7 @@ static Py_ssize_t __pyx_pf_3_sa_9DataArray_2__len__(struct __pyx_obj_3_sa_DataAr
* def __len__(self):
* return len(self.data) # <<<<<<<<<<<<<<
*
- * def get_data(self):
+ * def get_sentence_id(self, i):
*/
__pyx_t_1 = ((PyObject *)__pyx_v_self->data);
__Pyx_INCREF(__pyx_t_1);
@@ -7206,12 +7210,12 @@ static Py_ssize_t __pyx_pf_3_sa_9DataArray_2__len__(struct __pyx_obj_3_sa_DataAr
}
/* Python wrapper */
-static PyObject *__pyx_pw_3_sa_9DataArray_5get_data(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static PyObject *__pyx_pw_3_sa_9DataArray_5get_data(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+static PyObject *__pyx_pw_3_sa_9DataArray_5get_sentence_id(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
+static PyObject *__pyx_pw_3_sa_9DataArray_5get_sentence_id(PyObject *__pyx_v_self, PyObject *__pyx_v_i) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("get_data (wrapper)", 0);
- __pyx_r = __pyx_pf_3_sa_9DataArray_4get_data(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self));
+ __Pyx_RefNannySetupContext("get_sentence_id (wrapper)", 0);
+ __pyx_r = __pyx_pf_3_sa_9DataArray_4get_sentence_id(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self), ((PyObject *)__pyx_v_i));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
@@ -7219,55 +7223,12 @@ static PyObject *__pyx_pw_3_sa_9DataArray_5get_data(PyObject *__pyx_v_self, CYTH
/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":35
* return len(self.data)
*
- * def get_data(self): # <<<<<<<<<<<<<<
- * return self.data
- *
- */
-
-static PyObject *__pyx_pf_3_sa_9DataArray_4get_data(struct __pyx_obj_3_sa_DataArray *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("get_data", 0);
-
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":36
- *
- * def get_data(self):
- * return self.data # <<<<<<<<<<<<<<
- *
- * def get_sentence_id(self, i):
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(((PyObject *)__pyx_v_self->data));
- __pyx_r = ((PyObject *)__pyx_v_self->data);
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_3_sa_9DataArray_7get_sentence_id(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
-static PyObject *__pyx_pw_3_sa_9DataArray_7get_sentence_id(PyObject *__pyx_v_self, PyObject *__pyx_v_i) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("get_sentence_id (wrapper)", 0);
- __pyx_r = __pyx_pf_3_sa_9DataArray_6get_sentence_id(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self), ((PyObject *)__pyx_v_i));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":38
- * return self.data
- *
* def get_sentence_id(self, i): # <<<<<<<<<<<<<<
* return self.sent_id.arr[i]
*
*/
-static PyObject *__pyx_pf_3_sa_9DataArray_6get_sentence_id(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_i) {
+static PyObject *__pyx_pf_3_sa_9DataArray_4get_sentence_id(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_i) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
Py_ssize_t __pyx_t_1;
@@ -7277,7 +7238,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_6get_sentence_id(struct __pyx_obj_3_sa
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("get_sentence_id", 0);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":39
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":36
*
* def get_sentence_id(self, i):
* return self.sent_id.arr[i] # <<<<<<<<<<<<<<
@@ -7285,8 +7246,8 @@ static PyObject *__pyx_pf_3_sa_9DataArray_6get_sentence_id(struct __pyx_obj_3_sa
* def get_sentence(self, i):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = PyInt_FromLong((__pyx_v_self->sent_id->arr[__pyx_t_1])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromLong((__pyx_v_self->sent_id->arr[__pyx_t_1])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
@@ -7305,17 +7266,17 @@ static PyObject *__pyx_pf_3_sa_9DataArray_6get_sentence_id(struct __pyx_obj_3_sa
}
/* Python wrapper */
-static PyObject *__pyx_pw_3_sa_9DataArray_9get_sentence(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
-static PyObject *__pyx_pw_3_sa_9DataArray_9get_sentence(PyObject *__pyx_v_self, PyObject *__pyx_v_i) {
+static PyObject *__pyx_pw_3_sa_9DataArray_7get_sentence(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
+static PyObject *__pyx_pw_3_sa_9DataArray_7get_sentence(PyObject *__pyx_v_self, PyObject *__pyx_v_i) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("get_sentence (wrapper)", 0);
- __pyx_r = __pyx_pf_3_sa_9DataArray_8get_sentence(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self), ((PyObject *)__pyx_v_i));
+ __pyx_r = __pyx_pf_3_sa_9DataArray_6get_sentence(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self), ((PyObject *)__pyx_v_i));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":41
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":38
* return self.sent_id.arr[i]
*
* def get_sentence(self, i): # <<<<<<<<<<<<<<
@@ -7323,7 +7284,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_9get_sentence(PyObject *__pyx_v_self,
* sent = []
*/
-static PyObject *__pyx_pf_3_sa_9DataArray_8get_sentence(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_i) {
+static PyObject *__pyx_pf_3_sa_9DataArray_6get_sentence(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_i) {
int __pyx_v_start;
int __pyx_v_stop;
PyObject *__pyx_v_sent = NULL;
@@ -7340,42 +7301,42 @@ static PyObject *__pyx_pf_3_sa_9DataArray_8get_sentence(struct __pyx_obj_3_sa_Da
__Pyx_RefNannySetupContext("get_sentence", 0);
__Pyx_INCREF(__pyx_v_i);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":43
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":40
* def get_sentence(self, i):
* cdef int j, start, stop
* sent = [] # <<<<<<<<<<<<<<
* start = self.sent_index.arr[i]
* stop = self.sent_index.arr[i+1]
*/
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_sent = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":44
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":41
* cdef int j, start, stop
* sent = []
* start = self.sent_index.arr[i] # <<<<<<<<<<<<<<
* stop = self.sent_index.arr[i+1]
* for i from start <= i < stop:
*/
- __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_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]);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":45
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":42
* sent = []
* start = self.sent_index.arr[i]
* stop = self.sent_index.arr[i+1] # <<<<<<<<<<<<<<
* for i from start <= i < stop:
* sent.append(self.id2word[self.data.arr[i]])
*/
- __pyx_t_1 = PyNumber_Add(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Add(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_stop = (__pyx_v_self->sent_index->arr[__pyx_t_2]);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":46
+ /* "/Users/vchahun/Sandbox/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: # <<<<<<<<<<<<<<
@@ -7384,41 +7345,41 @@ static PyObject *__pyx_pf_3_sa_9DataArray_8get_sentence(struct __pyx_obj_3_sa_Da
*/
__pyx_t_3 = __pyx_v_stop;
for (__pyx_t_4 = __pyx_v_start; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
- __pyx_t_1 = PyInt_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_v_i);
__pyx_v_i = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":47
+ /* "/Users/vchahun/Sandbox/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]]) # <<<<<<<<<<<<<<
* return sent
*
*/
- __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 = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->id2word, (__pyx_v_self->data->arr[__pyx_t_2]), sizeof(int), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->id2word, (__pyx_v_self->data->arr[__pyx_t_2]), sizeof(int), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyList_Append(__pyx_v_sent, __pyx_t_1); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyList_Append(__pyx_v_sent, __pyx_t_1); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_v_i); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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;}
}
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":46
+ /* "/Users/vchahun/Sandbox/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: # <<<<<<<<<<<<<<
* sent.append(self.id2word[self.data.arr[i]])
* return sent
*/
- __pyx_t_1 = PyInt_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_v_i);
__pyx_v_i = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":48
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":45
* for i from start <= i < stop:
* sent.append(self.id2word[self.data.arr[i]])
* return sent # <<<<<<<<<<<<<<
@@ -7445,17 +7406,17 @@ static PyObject *__pyx_pf_3_sa_9DataArray_8get_sentence(struct __pyx_obj_3_sa_Da
}
/* Python wrapper */
-static PyObject *__pyx_pw_3_sa_9DataArray_11get_sentence_position(PyObject *__pyx_v_self, PyObject *__pyx_v_loc); /*proto*/
-static PyObject *__pyx_pw_3_sa_9DataArray_11get_sentence_position(PyObject *__pyx_v_self, PyObject *__pyx_v_loc) {
+static PyObject *__pyx_pw_3_sa_9DataArray_9get_sentence_position(PyObject *__pyx_v_self, PyObject *__pyx_v_loc); /*proto*/
+static PyObject *__pyx_pw_3_sa_9DataArray_9get_sentence_position(PyObject *__pyx_v_self, PyObject *__pyx_v_loc) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("get_sentence_position (wrapper)", 0);
- __pyx_r = __pyx_pf_3_sa_9DataArray_10get_sentence_position(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self), ((PyObject *)__pyx_v_loc));
+ __pyx_r = __pyx_pf_3_sa_9DataArray_8get_sentence_position(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self), ((PyObject *)__pyx_v_loc));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":50
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":47
* return sent
*
* def get_sentence_position(self, loc): # <<<<<<<<<<<<<<
@@ -7463,7 +7424,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_11get_sentence_position(PyObject *__py
*
*/
-static PyObject *__pyx_pf_3_sa_9DataArray_10get_sentence_position(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_loc) {
+static PyObject *__pyx_pf_3_sa_9DataArray_8get_sentence_position(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_loc) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
Py_ssize_t __pyx_t_1;
@@ -7474,7 +7435,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_10get_sentence_position(struct __pyx_o
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("get_sentence_position", 0);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":51
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":48
*
* def get_sentence_position(self, loc):
* return loc - self.sent_index.arr[self.sent_id.arr[loc]] # <<<<<<<<<<<<<<
@@ -7482,10 +7443,10 @@ static PyObject *__pyx_pf_3_sa_9DataArray_10get_sentence_position(struct __pyx_o
* def get_id(self, word):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_loc); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = PyInt_FromLong((__pyx_v_self->sent_index->arr[(__pyx_v_self->sent_id->arr[__pyx_t_1])])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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 = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromLong((__pyx_v_self->sent_index->arr[(__pyx_v_self->sent_id->arr[__pyx_t_1])])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyNumber_Subtract(__pyx_v_loc, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_Subtract(__pyx_v_loc, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_3;
@@ -7506,17 +7467,17 @@ static PyObject *__pyx_pf_3_sa_9DataArray_10get_sentence_position(struct __pyx_o
}
/* Python wrapper */
-static PyObject *__pyx_pw_3_sa_9DataArray_13get_id(PyObject *__pyx_v_self, PyObject *__pyx_v_word); /*proto*/
-static PyObject *__pyx_pw_3_sa_9DataArray_13get_id(PyObject *__pyx_v_self, PyObject *__pyx_v_word) {
+static PyObject *__pyx_pw_3_sa_9DataArray_11get_id(PyObject *__pyx_v_self, PyObject *__pyx_v_word); /*proto*/
+static PyObject *__pyx_pw_3_sa_9DataArray_11get_id(PyObject *__pyx_v_self, PyObject *__pyx_v_word) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("get_id (wrapper)", 0);
- __pyx_r = __pyx_pf_3_sa_9DataArray_12get_id(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self), ((PyObject *)__pyx_v_word));
+ __pyx_r = __pyx_pf_3_sa_9DataArray_10get_id(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self), ((PyObject *)__pyx_v_word));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":53
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":50
* return loc - self.sent_index.arr[self.sent_id.arr[loc]]
*
* def get_id(self, word): # <<<<<<<<<<<<<<
@@ -7524,7 +7485,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_13get_id(PyObject *__pyx_v_self, PyObj
* self.word2id[word] = len(self.id2word)
*/
-static PyObject *__pyx_pf_3_sa_9DataArray_12get_id(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_word) {
+static PyObject *__pyx_pf_3_sa_9DataArray_10get_id(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_word) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
@@ -7536,18 +7497,18 @@ static PyObject *__pyx_pf_3_sa_9DataArray_12get_id(struct __pyx_obj_3_sa_DataArr
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("get_id", 0);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":54
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":51
*
* 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 = 54; __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 = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_2 = (!__pyx_t_1);
if (__pyx_t_2) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":55
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":52
* def get_id(self, word):
* if not word in self.word2id:
* self.word2id[word] = len(self.id2word) # <<<<<<<<<<<<<<
@@ -7556,28 +7517,28 @@ static PyObject *__pyx_pf_3_sa_9DataArray_12get_id(struct __pyx_obj_3_sa_DataArr
*/
__pyx_t_3 = __pyx_v_self->id2word;
__Pyx_INCREF(__pyx_t_3);
- __pyx_t_4 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- if (PyObject_SetItem(__pyx_v_self->word2id, __pyx_v_word, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetItem(__pyx_v_self->word2id, __pyx_v_word, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":56
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":53
* if not word in self.word2id:
* self.word2id[word] = len(self.id2word)
* self.id2word.append(word) # <<<<<<<<<<<<<<
* return self.word2id[word]
*
*/
- __pyx_t_3 = __Pyx_PyObject_Append(__pyx_v_self->id2word, __pyx_v_word); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Append(__pyx_v_self->id2word, __pyx_v_word); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
goto __pyx_L3;
}
__pyx_L3:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":57
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":54
* self.word2id[word] = len(self.id2word)
* self.id2word.append(word)
* return self.word2id[word] # <<<<<<<<<<<<<<
@@ -7585,7 +7546,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_12get_id(struct __pyx_obj_3_sa_DataArr
* def get_word(self, id):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = PyObject_GetItem(__pyx_v_self->word2id, __pyx_v_word); if (!__pyx_t_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetItem(__pyx_v_self->word2id, __pyx_v_word); if (!__pyx_t_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
@@ -7604,17 +7565,17 @@ static PyObject *__pyx_pf_3_sa_9DataArray_12get_id(struct __pyx_obj_3_sa_DataArr
}
/* Python wrapper */
-static PyObject *__pyx_pw_3_sa_9DataArray_15get_word(PyObject *__pyx_v_self, PyObject *__pyx_v_id); /*proto*/
-static PyObject *__pyx_pw_3_sa_9DataArray_15get_word(PyObject *__pyx_v_self, PyObject *__pyx_v_id) {
+static PyObject *__pyx_pw_3_sa_9DataArray_13get_word(PyObject *__pyx_v_self, PyObject *__pyx_v_id); /*proto*/
+static PyObject *__pyx_pw_3_sa_9DataArray_13get_word(PyObject *__pyx_v_self, PyObject *__pyx_v_id) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("get_word (wrapper)", 0);
- __pyx_r = __pyx_pf_3_sa_9DataArray_14get_word(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self), ((PyObject *)__pyx_v_id));
+ __pyx_r = __pyx_pf_3_sa_9DataArray_12get_word(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self), ((PyObject *)__pyx_v_id));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":59
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":56
* return self.word2id[word]
*
* def get_word(self, id): # <<<<<<<<<<<<<<
@@ -7622,7 +7583,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_15get_word(PyObject *__pyx_v_self, PyO
*
*/
-static PyObject *__pyx_pf_3_sa_9DataArray_14get_word(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_id) {
+static PyObject *__pyx_pf_3_sa_9DataArray_12get_word(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_id) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
@@ -7631,7 +7592,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_14get_word(struct __pyx_obj_3_sa_DataA
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("get_word", 0);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":60
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":57
*
* def get_word(self, id):
* return self.id2word[id] # <<<<<<<<<<<<<<
@@ -7639,7 +7600,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_14get_word(struct __pyx_obj_3_sa_DataA
* def write_text(self, char* filename):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyObject_GetItem(__pyx_v_self->id2word, __pyx_v_id); if (!__pyx_t_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetItem(__pyx_v_self->id2word, __pyx_v_id); if (!__pyx_t_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -7658,14 +7619,14 @@ static PyObject *__pyx_pf_3_sa_9DataArray_14get_word(struct __pyx_obj_3_sa_DataA
}
/* Python wrapper */
-static PyObject *__pyx_pw_3_sa_9DataArray_17write_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/
-static PyObject *__pyx_pw_3_sa_9DataArray_17write_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) {
+static PyObject *__pyx_pw_3_sa_9DataArray_15write_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/
+static PyObject *__pyx_pw_3_sa_9DataArray_15write_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) {
char *__pyx_v_filename;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("write_text (wrapper)", 0);
assert(__pyx_arg_filename); {
- __pyx_v_filename = PyBytes_AsString(__pyx_arg_filename); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_filename = PyBytes_AsString(__pyx_arg_filename); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
@@ -7673,12 +7634,12 @@ static PyObject *__pyx_pw_3_sa_9DataArray_17write_text(PyObject *__pyx_v_self, P
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_3_sa_9DataArray_16write_text(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self), ((char *)__pyx_v_filename));
+ __pyx_r = __pyx_pf_3_sa_9DataArray_14write_text(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self), ((char *)__pyx_v_filename));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":62
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":59
* return self.id2word[id]
*
* def write_text(self, char* filename): # <<<<<<<<<<<<<<
@@ -7686,7 +7647,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_17write_text(PyObject *__pyx_v_self, P
* for w_id in self.data:
*/
-static PyObject *__pyx_pf_3_sa_9DataArray_16write_text(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, char *__pyx_v_filename) {
+static PyObject *__pyx_pf_3_sa_9DataArray_14write_text(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, char *__pyx_v_filename) {
PyObject *__pyx_v_f = NULL;
PyObject *__pyx_v_w_id = NULL;
PyObject *__pyx_r = NULL;
@@ -7710,7 +7671,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_16write_text(struct __pyx_obj_3_sa_Dat
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("write_text", 0);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":63
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":60
*
* def write_text(self, char* filename):
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -7718,9 +7679,9 @@ static PyObject *__pyx_pf_3_sa_9DataArray_16write_text(struct __pyx_obj_3_sa_Dat
* if w_id > 1:
*/
/*with:*/ {
- __pyx_t_1 = PyBytes_FromString(__pyx_v_filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyBytes_FromString(__pyx_v_filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1));
__Pyx_GIVEREF(((PyObject *)__pyx_t_1));
@@ -7728,14 +7689,14 @@ static PyObject *__pyx_pf_3_sa_9DataArray_16write_text(struct __pyx_obj_3_sa_Dat
PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_n_s__w));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__w));
__pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_builtin_open, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_builtin_open, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____exit__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____exit__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____enter__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____enter__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -7750,7 +7711,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_16write_text(struct __pyx_obj_3_sa_Dat
__pyx_v_f = __pyx_t_4;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":64
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":61
* def write_text(self, char* filename):
* with open(filename, "w") as f:
* for w_id in self.data: # <<<<<<<<<<<<<<
@@ -7761,7 +7722,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_16write_text(struct __pyx_obj_3_sa_Dat
__pyx_t_4 = ((PyObject *)__pyx_v_self->data); __Pyx_INCREF(__pyx_t_4); __pyx_t_8 = 0;
__pyx_t_9 = NULL;
} else {
- __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(((PyObject *)__pyx_v_self->data)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(((PyObject *)__pyx_v_self->data)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_9 = Py_TYPE(__pyx_t_4)->tp_iternext;
}
@@ -7769,23 +7730,23 @@ static PyObject *__pyx_pf_3_sa_9DataArray_16write_text(struct __pyx_obj_3_sa_Dat
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 = 64; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __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 = 61; __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 = 64; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __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 = 61; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
#endif
} else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_4)) {
if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __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 = 61; __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 = 64; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __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 = 61; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
#endif
} else {
__pyx_t_1 = __pyx_t_9(__pyx_t_4);
if (unlikely(!__pyx_t_1)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[3]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ else {__pyx_filename = __pyx_f[3]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
}
break;
}
@@ -7795,47 +7756,47 @@ static PyObject *__pyx_pf_3_sa_9DataArray_16write_text(struct __pyx_obj_3_sa_Dat
__pyx_v_w_id = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":65
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":62
* 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 = 65; __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 = 65; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __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 = 62; __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 = 62; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_10) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":66
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":63
* for w_id in self.data:
* if w_id > 1:
* f.write("%s " % self.get_word(w_id)) # <<<<<<<<<<<<<<
* if w_id == 1:
* f.write("\n")
*/
- __pyx_t_1 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __pyx_t_1 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_word); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_word); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_INCREF(__pyx_v_w_id);
PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_w_id);
__Pyx_GIVEREF(__pyx_v_w_id);
- __pyx_t_12 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __pyx_t_12 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
- __pyx_t_11 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_13), __pyx_t_12); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __pyx_t_11 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_13), __pyx_t_12); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_11));
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(__pyx_t_12);
PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)__pyx_t_11));
__Pyx_GIVEREF(((PyObject *)__pyx_t_11));
__pyx_t_11 = 0;
- __pyx_t_11 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __pyx_t_11 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
@@ -7844,28 +7805,28 @@ static PyObject *__pyx_pf_3_sa_9DataArray_16write_text(struct __pyx_obj_3_sa_Dat
}
__pyx_L18:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":67
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":64
* 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 = 67; __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 = 67; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __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 = 64; __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 = 64; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
if (__pyx_t_10) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":68
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":65
* f.write("%s " % self.get_word(w_id))
* if w_id == 1:
* f.write("\n") # <<<<<<<<<<<<<<
*
* def read_text(self, char* filename):
*/
- __pyx_t_11 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __pyx_t_11 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__write); 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_12 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_k_tuple_15), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __pyx_t_12 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_k_tuple_15), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
@@ -7886,7 +7847,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_16write_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;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":63
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":60
*
* def write_text(self, char* filename):
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -7895,11 +7856,11 @@ static PyObject *__pyx_pf_3_sa_9DataArray_16write_text(struct __pyx_obj_3_sa_Dat
*/
/*except:*/ {
__Pyx_AddTraceback("_sa.DataArray.write_text", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_12, &__pyx_t_11) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
+ if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_12, &__pyx_t_11) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GOTREF(__pyx_t_12);
__Pyx_GOTREF(__pyx_t_11);
- __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
+ __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
@@ -7912,11 +7873,11 @@ static PyObject *__pyx_pf_3_sa_9DataArray_16write_text(struct __pyx_obj_3_sa_Dat
__Pyx_GIVEREF(__pyx_t_11);
__pyx_t_13 = PyObject_Call(__pyx_t_3, __pyx_t_1, NULL);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
+ if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
__Pyx_GOTREF(__pyx_t_13);
__pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_13);
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
+ if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
__pyx_t_14 = (!__pyx_t_10);
if (__pyx_t_14) {
__Pyx_GIVEREF(__pyx_t_4);
@@ -7924,7 +7885,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_16write_text(struct __pyx_obj_3_sa_Dat
__Pyx_GIVEREF(__pyx_t_11);
__Pyx_ErrRestore(__pyx_t_4, __pyx_t_12, __pyx_t_11);
__pyx_t_4 = 0; __pyx_t_12 = 0; __pyx_t_11 = 0;
- {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
+ {__pyx_filename = __pyx_f[3]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
goto __pyx_L22;
}
__pyx_L22:;
@@ -7952,11 +7913,11 @@ static PyObject *__pyx_pf_3_sa_9DataArray_16write_text(struct __pyx_obj_3_sa_Dat
if (__pyx_t_3) {
__pyx_t_7 = PyObject_Call(__pyx_t_3, __pyx_k_tuple_16, NULL);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_7);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
}
goto __pyx_L23;
@@ -7985,14 +7946,14 @@ static PyObject *__pyx_pf_3_sa_9DataArray_16write_text(struct __pyx_obj_3_sa_Dat
}
/* Python wrapper */
-static PyObject *__pyx_pw_3_sa_9DataArray_19read_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/
-static PyObject *__pyx_pw_3_sa_9DataArray_19read_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) {
+static PyObject *__pyx_pw_3_sa_9DataArray_17read_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/
+static PyObject *__pyx_pw_3_sa_9DataArray_17read_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) {
char *__pyx_v_filename;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("read_text (wrapper)", 0);
assert(__pyx_arg_filename); {
- __pyx_v_filename = PyBytes_AsString(__pyx_arg_filename); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_filename = PyBytes_AsString(__pyx_arg_filename); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
@@ -8000,12 +7961,12 @@ static PyObject *__pyx_pw_3_sa_9DataArray_19read_text(PyObject *__pyx_v_self, Py
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_3_sa_9DataArray_18read_text(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self), ((char *)__pyx_v_filename));
+ __pyx_r = __pyx_pf_3_sa_9DataArray_16read_text(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self), ((char *)__pyx_v_filename));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":70
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":67
* f.write("\n")
*
* def read_text(self, char* filename): # <<<<<<<<<<<<<<
@@ -8013,7 +7974,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_19read_text(PyObject *__pyx_v_self, Py
* self.read_text_data(fp)
*/
-static PyObject *__pyx_pf_3_sa_9DataArray_18read_text(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, char *__pyx_v_filename) {
+static PyObject *__pyx_pf_3_sa_9DataArray_16read_text(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, char *__pyx_v_filename) {
PyObject *__pyx_v_fp = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
@@ -8033,7 +7994,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_18read_text(struct __pyx_obj_3_sa_Data
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("read_text", 0);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":71
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":68
*
* def read_text(self, char* filename):
* with gzip_or_text(filename) as fp: # <<<<<<<<<<<<<<
@@ -8041,24 +8002,24 @@ static PyObject *__pyx_pf_3_sa_9DataArray_18read_text(struct __pyx_obj_3_sa_Data
*
*/
/*with:*/ {
- __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__gzip_or_text); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__gzip_or_text); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyBytes_FromString(__pyx_v_filename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyBytes_FromString(__pyx_v_filename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2));
__Pyx_GIVEREF(((PyObject *)__pyx_t_2));
__pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 71; __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[3]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s____exit__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s____exit__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s____enter__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s____enter__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -8073,21 +8034,21 @@ static PyObject *__pyx_pf_3_sa_9DataArray_18read_text(struct __pyx_obj_3_sa_Data
__pyx_v_fp = __pyx_t_1;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":72
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":69
* def read_text(self, char* filename):
* with gzip_or_text(filename) as fp:
* self.read_text_data(fp) # <<<<<<<<<<<<<<
*
* def read_bitext(self, char* filename, int side):
*/
- __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__read_text_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__read_text_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_v_fp);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_fp);
__Pyx_GIVEREF(__pyx_v_fp);
- __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
@@ -8102,7 +8063,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_18read_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;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":71
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":68
*
* def read_text(self, char* filename):
* with gzip_or_text(filename) as fp: # <<<<<<<<<<<<<<
@@ -8111,11 +8072,11 @@ static PyObject *__pyx_pf_3_sa_9DataArray_18read_text(struct __pyx_obj_3_sa_Data
*/
/*except:*/ {
__Pyx_AddTraceback("_sa.DataArray.read_text", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
+ if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
+ __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_INCREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
@@ -8128,11 +8089,11 @@ static PyObject *__pyx_pf_3_sa_9DataArray_18read_text(struct __pyx_obj_3_sa_Data
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_10 = PyObject_Call(__pyx_t_4, __pyx_t_8, NULL);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
+ if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
__Pyx_GOTREF(__pyx_t_10);
__pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_10);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
+ if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
__pyx_t_11 = (!__pyx_t_9);
if (__pyx_t_11) {
__Pyx_GIVEREF(__pyx_t_3);
@@ -8140,7 +8101,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_18read_text(struct __pyx_obj_3_sa_Data
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_ErrRestore(__pyx_t_3, __pyx_t_2, __pyx_t_1);
__pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0;
- {__pyx_filename = __pyx_f[3]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
+ {__pyx_filename = __pyx_f[3]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
goto __pyx_L18;
}
__pyx_L18:;
@@ -8168,11 +8129,11 @@ static PyObject *__pyx_pf_3_sa_9DataArray_18read_text(struct __pyx_obj_3_sa_Data
if (__pyx_t_4) {
__pyx_t_7 = PyObject_Call(__pyx_t_4, __pyx_k_tuple_17, NULL);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_7);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
}
goto __pyx_L19;
@@ -8199,8 +8160,8 @@ static PyObject *__pyx_pf_3_sa_9DataArray_18read_text(struct __pyx_obj_3_sa_Data
}
/* Python wrapper */
-static PyObject *__pyx_pw_3_sa_9DataArray_21read_bitext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyObject *__pyx_pw_3_sa_9DataArray_21read_bitext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_3_sa_9DataArray_19read_bitext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+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;
PyObject *__pyx_r = 0;
@@ -8226,11 +8187,11 @@ static PyObject *__pyx_pw_3_sa_9DataArray_21read_bitext(PyObject *__pyx_v_self,
case 1:
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 = 74; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("read_bitext", 1, 2, 2, 1); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_bitext") < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_bitext") < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
@@ -8238,24 +8199,24 @@ static PyObject *__pyx_pw_3_sa_9DataArray_21read_bitext(PyObject *__pyx_v_self,
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
- __pyx_v_filename = PyBytes_AsString(values[0]); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_side = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_side == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_filename = PyBytes_AsString(values[0]); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_side = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_side == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("read_bitext", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("read_bitext", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("_sa.DataArray.read_bitext", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_3_sa_9DataArray_20read_bitext(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self), __pyx_v_filename, __pyx_v_side);
+ __pyx_r = __pyx_pf_3_sa_9DataArray_18read_bitext(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self), __pyx_v_filename, __pyx_v_side);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_gb_3_sa_9DataArray_11read_bitext_2generator6(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":76
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":73
* def read_bitext(self, char* filename, int side):
* with gzip_or_text(filename) as fp:
* data = (line.split(' ||| ')[side] for line in fp) # <<<<<<<<<<<<<<
@@ -8281,7 +8242,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_11read_bitext_genexpr(PyObject *__pyx_
__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_9DataArray_11read_bitext_2generator6, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_3_sa_9DataArray_11read_bitext_2generator6, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_cur_scope);
__Pyx_RefNannyFinishContext();
return (PyObject *) gen;
@@ -8318,13 +8279,13 @@ static PyObject *__pyx_gb_3_sa_9DataArray_11read_bitext_2generator6(__pyx_Genera
return NULL;
}
__pyx_L3_first_run:;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_fp)) { __Pyx_RaiseClosureNameError("fp"); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_fp)) { __Pyx_RaiseClosureNameError("fp"); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
if (PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_fp) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_fp)) {
__pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_fp; __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_fp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_fp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -8332,23 +8293,23 @@ static PyObject *__pyx_gb_3_sa_9DataArray_11read_bitext_2generator6(__pyx_Genera
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 = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __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 = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __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 = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __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[3]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -8359,12 +8320,12 @@ static PyObject *__pyx_gb_3_sa_9DataArray_11read_bitext_2generator6(__pyx_Genera
__Pyx_GIVEREF(__pyx_t_4);
__pyx_cur_scope->__pyx_v_line = __pyx_t_4;
__pyx_t_4 = 0;
- __pyx_t_4 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_line, __pyx_n_s__split); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_line, __pyx_n_s__split); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_19), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_19), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_5, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_side, sizeof(int), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_5, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_side, sizeof(int), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_r = __pyx_t_4;
@@ -8384,7 +8345,7 @@ static PyObject *__pyx_gb_3_sa_9DataArray_11read_bitext_2generator6(__pyx_Genera
__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[3]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyErr_SetNone(PyExc_StopIteration);
@@ -8402,7 +8363,7 @@ static PyObject *__pyx_gb_3_sa_9DataArray_11read_bitext_2generator6(__pyx_Genera
return NULL;
}
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":74
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":71
* self.read_text_data(fp)
*
* def read_bitext(self, char* filename, int side): # <<<<<<<<<<<<<<
@@ -8410,7 +8371,7 @@ static PyObject *__pyx_gb_3_sa_9DataArray_11read_bitext_2generator6(__pyx_Genera
* data = (line.split(' ||| ')[side] for line in fp)
*/
-static PyObject *__pyx_pf_3_sa_9DataArray_20read_bitext(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, char *__pyx_v_filename, int __pyx_v_side) {
+static PyObject *__pyx_pf_3_sa_9DataArray_18read_bitext(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, char *__pyx_v_filename, int __pyx_v_side) {
struct __pyx_obj_3_sa___pyx_scope_struct_1_read_bitext *__pyx_cur_scope;
PyObject *__pyx_v_data = NULL;
PyObject *__pyx_r = NULL;
@@ -8438,7 +8399,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_bitext(struct __pyx_obj_3_sa_Da
__Pyx_GOTREF(__pyx_cur_scope);
__pyx_cur_scope->__pyx_v_side = __pyx_v_side;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":75
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":72
*
* def read_bitext(self, char* filename, int side):
* with gzip_or_text(filename) as fp: # <<<<<<<<<<<<<<
@@ -8446,24 +8407,24 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_bitext(struct __pyx_obj_3_sa_Da
* self.read_text_data(data)
*/
/*with:*/ {
- __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__gzip_or_text); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__gzip_or_text); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyBytes_FromString(__pyx_v_filename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyBytes_FromString(__pyx_v_filename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2));
__Pyx_GIVEREF(((PyObject *)__pyx_t_2));
__pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 75; __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[3]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s____exit__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s____exit__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s____enter__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s____enter__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -8479,33 +8440,33 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_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;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":76
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":73
* def read_bitext(self, char* filename, int side):
* with gzip_or_text(filename) as fp:
* data = (line.split(' ||| ')[side] for line in fp) # <<<<<<<<<<<<<<
* self.read_text_data(data)
*
*/
- __pyx_t_1 = __pyx_pf_3_sa_9DataArray_11read_bitext_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __pyx_t_1 = __pyx_pf_3_sa_9DataArray_11read_bitext_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_data = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":77
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":74
* with gzip_or_text(filename) as fp:
* data = (line.split(' ||| ')[side] for line in fp)
* self.read_text_data(data) # <<<<<<<<<<<<<<
*
* def read_text_data(self, data):
*/
- __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__read_text_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__read_text_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_v_data);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_data);
__Pyx_GIVEREF(__pyx_v_data);
- __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
@@ -8520,7 +8481,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_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;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":75
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":72
*
* def read_bitext(self, char* filename, int side):
* with gzip_or_text(filename) as fp: # <<<<<<<<<<<<<<
@@ -8529,11 +8490,11 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_bitext(struct __pyx_obj_3_sa_Da
*/
/*except:*/ {
__Pyx_AddTraceback("_sa.DataArray.read_bitext", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
+ if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
+ __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_INCREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
@@ -8546,11 +8507,11 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_bitext(struct __pyx_obj_3_sa_Da
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_10 = PyObject_Call(__pyx_t_4, __pyx_t_8, NULL);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
+ if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
__Pyx_GOTREF(__pyx_t_10);
__pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_10);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
+ if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
__pyx_t_11 = (!__pyx_t_9);
if (__pyx_t_11) {
__Pyx_GIVEREF(__pyx_t_3);
@@ -8558,7 +8519,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_bitext(struct __pyx_obj_3_sa_Da
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_ErrRestore(__pyx_t_3, __pyx_t_2, __pyx_t_1);
__pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0;
- {__pyx_filename = __pyx_f[3]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
+ {__pyx_filename = __pyx_f[3]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
goto __pyx_L18;
}
__pyx_L18:;
@@ -8586,11 +8547,11 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_bitext(struct __pyx_obj_3_sa_Da
if (__pyx_t_4) {
__pyx_t_7 = PyObject_Call(__pyx_t_4, __pyx_k_tuple_20, NULL);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_7);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
}
goto __pyx_L19;
@@ -8618,17 +8579,17 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_bitext(struct __pyx_obj_3_sa_Da
}
/* Python wrapper */
-static PyObject *__pyx_pw_3_sa_9DataArray_23read_text_data(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
-static PyObject *__pyx_pw_3_sa_9DataArray_23read_text_data(PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
+static PyObject *__pyx_pw_3_sa_9DataArray_21read_text_data(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
+static PyObject *__pyx_pw_3_sa_9DataArray_21read_text_data(PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("read_text_data (wrapper)", 0);
- __pyx_r = __pyx_pf_3_sa_9DataArray_22read_text_data(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self), ((PyObject *)__pyx_v_data));
+ __pyx_r = __pyx_pf_3_sa_9DataArray_20read_text_data(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self), ((PyObject *)__pyx_v_data));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":79
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":76
* self.read_text_data(data)
*
* def read_text_data(self, data): # <<<<<<<<<<<<<<
@@ -8636,7 +8597,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_23read_text_data(PyObject *__pyx_v_sel
* for line_num, line in enumerate(data):
*/
-static PyObject *__pyx_pf_3_sa_9DataArray_22read_text_data(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_data) {
+static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_data) {
int __pyx_v_word_count;
PyObject *__pyx_v_line_num = NULL;
PyObject *__pyx_v_line = NULL;
@@ -8658,7 +8619,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_22read_text_data(struct __pyx_obj_3_sa
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("read_text_data", 0);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":80
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":77
*
* def read_text_data(self, data):
* cdef int word_count = 0 # <<<<<<<<<<<<<<
@@ -8667,7 +8628,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_22read_text_data(struct __pyx_obj_3_sa
*/
__pyx_v_word_count = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":81
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":78
* def read_text_data(self, data):
* cdef int word_count = 0
* for line_num, line in enumerate(data): # <<<<<<<<<<<<<<
@@ -8680,7 +8641,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_22read_text_data(struct __pyx_obj_3_sa
__pyx_t_2 = __pyx_v_data; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
__pyx_t_4 = NULL;
} else {
- __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_data); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_data); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
}
@@ -8688,23 +8649,23 @@ static PyObject *__pyx_pf_3_sa_9DataArray_22read_text_data(struct __pyx_obj_3_sa
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 = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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 = 78; __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 = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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 = 78; __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 = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_5 = __pyx_t_4(__pyx_t_2);
if (unlikely(!__pyx_t_5)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[3]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -8716,43 +8677,43 @@ static PyObject *__pyx_pf_3_sa_9DataArray_22read_text_data(struct __pyx_obj_3_sa
__Pyx_INCREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_v_line_num);
__pyx_v_line_num = __pyx_t_1;
- __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1);
__pyx_t_1 = __pyx_t_5;
__pyx_t_5 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":82
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":79
* cdef int word_count = 0
* for line_num, line in enumerate(data):
* self.sent_index.append(word_count) # <<<<<<<<<<<<<<
* for word in line.split():
* self.data.append(self.get_id(word))
*/
- __pyx_t_5 = PyInt_FromLong(__pyx_v_word_count); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyInt_FromLong(__pyx_v_word_count); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->sent_index), __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->sent_index), __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":83
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":80
* for line_num, line in enumerate(data):
* self.sent_index.append(word_count)
* for word in line.split(): # <<<<<<<<<<<<<<
* self.data.append(self.get_id(word))
* if self.use_sent_id:
*/
- __pyx_t_6 = PyObject_GetAttr(__pyx_v_line, __pyx_n_s__split); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_GetAttr(__pyx_v_line, __pyx_n_s__split); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (PyList_CheckExact(__pyx_t_5) || PyTuple_CheckExact(__pyx_t_5)) {
__pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
} else {
- __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_8 = Py_TYPE(__pyx_t_6)->tp_iternext;
}
@@ -8761,23 +8722,23 @@ static PyObject *__pyx_pf_3_sa_9DataArray_22read_text_data(struct __pyx_obj_3_sa
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 = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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 = 80; __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 = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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 = 80; __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;
#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 = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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 = 80; __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 = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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 = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_5 = __pyx_t_8(__pyx_t_6);
if (unlikely(!__pyx_t_5)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[3]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[3]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -8787,30 +8748,30 @@ static PyObject *__pyx_pf_3_sa_9DataArray_22read_text_data(struct __pyx_obj_3_sa
__pyx_v_word = __pyx_t_5;
__pyx_t_5 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":84
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":81
* self.sent_index.append(word_count)
* for word in line.split():
* self.data.append(self.get_id(word)) # <<<<<<<<<<<<<<
* if self.use_sent_id:
* self.sent_id.append(line_num)
*/
- __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_id); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_id); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_INCREF(__pyx_v_word);
PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_word);
__Pyx_GIVEREF(__pyx_v_word);
- __pyx_t_10 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
- __pyx_t_9 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->data), __pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->data), __pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":85
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":82
* for word in line.split():
* self.data.append(self.get_id(word))
* if self.use_sent_id: # <<<<<<<<<<<<<<
@@ -8819,21 +8780,21 @@ static PyObject *__pyx_pf_3_sa_9DataArray_22read_text_data(struct __pyx_obj_3_sa
*/
if (__pyx_v_self->use_sent_id) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":86
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":83
* self.data.append(self.get_id(word))
* if self.use_sent_id:
* self.sent_id.append(line_num) # <<<<<<<<<<<<<<
* word_count = word_count + 1
* self.data.append(1)
*/
- __pyx_t_9 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->sent_id), __pyx_v_line_num); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->sent_id), __pyx_v_line_num); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
goto __pyx_L7;
}
__pyx_L7:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":87
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":84
* if self.use_sent_id:
* self.sent_id.append(line_num)
* word_count = word_count + 1 # <<<<<<<<<<<<<<
@@ -8844,18 +8805,18 @@ static PyObject *__pyx_pf_3_sa_9DataArray_22read_text_data(struct __pyx_obj_3_sa
}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":88
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":85
* self.sent_id.append(line_num)
* word_count = word_count + 1
* self.data.append(1) # <<<<<<<<<<<<<<
* if self.use_sent_id:
* self.sent_id.append(line_num)
*/
- __pyx_t_6 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->data), __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->data), __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":89
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":86
* word_count = word_count + 1
* self.data.append(1)
* if self.use_sent_id: # <<<<<<<<<<<<<<
@@ -8864,21 +8825,21 @@ static PyObject *__pyx_pf_3_sa_9DataArray_22read_text_data(struct __pyx_obj_3_sa
*/
if (__pyx_v_self->use_sent_id) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":90
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":87
* self.data.append(1)
* if self.use_sent_id:
* self.sent_id.append(line_num) # <<<<<<<<<<<<<<
* word_count = word_count + 1
* self.data.append(0)
*/
- __pyx_t_6 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->sent_id), __pyx_v_line_num); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->sent_id), __pyx_v_line_num); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
goto __pyx_L8;
}
__pyx_L8:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":91
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":88
* if self.use_sent_id:
* self.sent_id.append(line_num)
* word_count = word_count + 1 # <<<<<<<<<<<<<<
@@ -8890,27 +8851,27 @@ static PyObject *__pyx_pf_3_sa_9DataArray_22read_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;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":92
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":89
* self.sent_id.append(line_num)
* word_count = word_count + 1
* self.data.append(0) # <<<<<<<<<<<<<<
* self.sent_index.append(word_count)
*
*/
- __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->data), __pyx_int_0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->data), __pyx_int_0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":93
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":90
* word_count = word_count + 1
* self.data.append(0)
* self.sent_index.append(word_count) # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_1 = PyInt_FromLong(__pyx_v_word_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong(__pyx_v_word_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->sent_index), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->sent_index), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 90; __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;
@@ -8936,14 +8897,14 @@ static PyObject *__pyx_pf_3_sa_9DataArray_22read_text_data(struct __pyx_obj_3_sa
}
/* Python wrapper */
-static PyObject *__pyx_pw_3_sa_9DataArray_25read_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/
-static PyObject *__pyx_pw_3_sa_9DataArray_25read_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) {
+static PyObject *__pyx_pw_3_sa_9DataArray_23read_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/
+static PyObject *__pyx_pw_3_sa_9DataArray_23read_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) {
char *__pyx_v_filename;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("read_binary (wrapper)", 0);
assert(__pyx_arg_filename); {
- __pyx_v_filename = PyBytes_AsString(__pyx_arg_filename); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_filename = PyBytes_AsString(__pyx_arg_filename); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
@@ -8951,12 +8912,12 @@ static PyObject *__pyx_pw_3_sa_9DataArray_25read_binary(PyObject *__pyx_v_self,
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_3_sa_9DataArray_24read_binary(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self), ((char *)__pyx_v_filename));
+ __pyx_r = __pyx_pf_3_sa_9DataArray_22read_binary(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self), ((char *)__pyx_v_filename));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":96
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":93
*
*
* def read_binary(self, char* filename): # <<<<<<<<<<<<<<
@@ -8964,13 +8925,13 @@ static PyObject *__pyx_pw_3_sa_9DataArray_25read_binary(PyObject *__pyx_v_self,
* f = fopen(filename, "r")
*/
-static PyObject *__pyx_pf_3_sa_9DataArray_24read_binary(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, char *__pyx_v_filename) {
+static PyObject *__pyx_pf_3_sa_9DataArray_22read_binary(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, char *__pyx_v_filename) {
FILE *__pyx_v_f;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("read_binary", 0);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":98
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":95
* def read_binary(self, char* filename):
* cdef FILE* f
* f = fopen(filename, "r") # <<<<<<<<<<<<<<
@@ -8979,7 +8940,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_24read_binary(struct __pyx_obj_3_sa_Da
*/
__pyx_v_f = fopen(__pyx_v_filename, __pyx_k__r);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":99
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":96
* cdef FILE* f
* f = fopen(filename, "r")
* self.read_handle(f) # <<<<<<<<<<<<<<
@@ -8988,7 +8949,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_24read_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);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":100
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":97
* f = fopen(filename, "r")
* self.read_handle(f)
* fclose(f) # <<<<<<<<<<<<<<
@@ -9003,7 +8964,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_24read_binary(struct __pyx_obj_3_sa_Da
return __pyx_r;
}
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":102
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":99
* fclose(f)
*
* cdef void read_handle(self, FILE* f): # <<<<<<<<<<<<<<
@@ -9028,7 +8989,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);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":107
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":104
* cdef char* word
*
* self.data.read_handle(f) # <<<<<<<<<<<<<<
@@ -9037,7 +8998,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);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":108
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":105
*
* self.data.read_handle(f)
* self.sent_index.read_handle(f) # <<<<<<<<<<<<<<
@@ -9046,7 +9007,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);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":109
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":106
* self.data.read_handle(f)
* self.sent_index.read_handle(f)
* self.sent_id.read_handle(f) # <<<<<<<<<<<<<<
@@ -9055,7 +9016,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);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":110
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":107
* self.sent_index.read_handle(f)
* self.sent_id.read_handle(f)
* fread(&(num_words), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -9064,7 +9025,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);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":111
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":108
* self.sent_id.read_handle(f)
* fread(&(num_words), sizeof(int), 1, f)
* for i in range(num_words): # <<<<<<<<<<<<<<
@@ -9075,7 +9036,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;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":112
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":109
* fread(&(num_words), sizeof(int), 1, f)
* for i in range(num_words):
* fread(&(word_len), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -9084,7 +9045,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);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":113
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":110
* for i in range(num_words):
* fread(&(word_len), sizeof(int), 1, f)
* word = <char*> malloc (word_len * sizeof(char)) # <<<<<<<<<<<<<<
@@ -9093,7 +9054,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)))));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":114
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":111
* fread(&(word_len), sizeof(int), 1, f)
* word = <char*> malloc (word_len * sizeof(char))
* fread(word, sizeof(char), word_len, f) # <<<<<<<<<<<<<<
@@ -9102,7 +9063,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);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":115
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":112
* word = <char*> malloc (word_len * sizeof(char))
* fread(word, sizeof(char), word_len, f)
* self.word2id[word] = len(self.id2word) # <<<<<<<<<<<<<<
@@ -9111,31 +9072,31 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray
*/
__pyx_t_3 = __pyx_v_self->id2word;
__Pyx_INCREF(__pyx_t_3);
- __pyx_t_4 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyBytes_FromString(__pyx_v_word); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyBytes_FromString(__pyx_v_word); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_5));
- if (PyObject_SetItem(__pyx_v_self->word2id, ((PyObject *)__pyx_t_5), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetItem(__pyx_v_self->word2id, ((PyObject *)__pyx_t_5), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":116
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":113
* fread(word, sizeof(char), word_len, f)
* self.word2id[word] = len(self.id2word)
* self.id2word.append(word) # <<<<<<<<<<<<<<
* free(word)
* if len(self.sent_id) == 0:
*/
- __pyx_t_3 = PyBytes_FromString(__pyx_v_word); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyBytes_FromString(__pyx_v_word); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_3));
- __pyx_t_5 = __Pyx_PyObject_Append(__pyx_v_self->id2word, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Append(__pyx_v_self->id2word, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":117
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":114
* self.word2id[word] = len(self.id2word)
* self.id2word.append(word)
* free(word) # <<<<<<<<<<<<<<
@@ -9145,7 +9106,7 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray
free(__pyx_v_word);
}
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":118
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":115
* self.id2word.append(word)
* free(word)
* if len(self.sent_id) == 0: # <<<<<<<<<<<<<<
@@ -9154,12 +9115,12 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray
*/
__pyx_t_5 = ((PyObject *)__pyx_v_self->sent_id);
__Pyx_INCREF(__pyx_t_5);
- __pyx_t_4 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_6 = (__pyx_t_4 == 0);
if (__pyx_t_6) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":119
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":116
* free(word)
* if len(self.sent_id) == 0:
* self.use_sent_id = False # <<<<<<<<<<<<<<
@@ -9171,7 +9132,7 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray
}
/*else*/ {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":121
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":118
* self.use_sent_id = False
* else:
* self.use_sent_id = True # <<<<<<<<<<<<<<
@@ -9191,7 +9152,7 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray
__Pyx_RefNannyFinishContext();
}
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":123
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":120
* self.use_sent_id = True
*
* cdef void write_handle(self, FILE* f): # <<<<<<<<<<<<<<
@@ -9215,7 +9176,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);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":127
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":124
* cdef int num_words
*
* self.data.write_handle(f) # <<<<<<<<<<<<<<
@@ -9224,7 +9185,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);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":128
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":125
*
* self.data.write_handle(f)
* self.sent_index.write_handle(f) # <<<<<<<<<<<<<<
@@ -9233,7 +9194,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);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":129
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":126
* self.data.write_handle(f)
* self.sent_index.write_handle(f)
* self.sent_id.write_handle(f) # <<<<<<<<<<<<<<
@@ -9242,7 +9203,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);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":130
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":127
* self.sent_index.write_handle(f)
* self.sent_id.write_handle(f)
* num_words = len(self.id2word) - 2 # <<<<<<<<<<<<<<
@@ -9251,11 +9212,11 @@ static void __pyx_f_3_sa_9DataArray_write_handle(struct __pyx_obj_3_sa_DataArray
*/
__pyx_t_1 = __pyx_v_self->id2word;
__Pyx_INCREF(__pyx_t_1);
- __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __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[3]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_num_words = (__pyx_t_2 - 2);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":131
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":128
* self.sent_id.write_handle(f)
* num_words = len(self.id2word) - 2
* fwrite(&(num_words), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -9264,20 +9225,20 @@ 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);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":132
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":129
* num_words = len(self.id2word) - 2
* fwrite(&(num_words), sizeof(int), 1, f)
* for word in self.id2word[2:]: # <<<<<<<<<<<<<<
* word_len = len(word) + 1
* fwrite(&(word_len), sizeof(int), 1, f)
*/
- __pyx_t_1 = __Pyx_PySequence_GetSlice(__pyx_v_self->id2word, 2, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PySequence_GetSlice(__pyx_v_self->id2word, 2, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
__pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = 0;
__pyx_t_4 = NULL;
} else {
- __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext;
}
@@ -9286,23 +9247,23 @@ static void __pyx_f_3_sa_9DataArray_write_handle(struct __pyx_obj_3_sa_DataArray
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 = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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 = 129; __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 = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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 = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_3)) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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 = 129; __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 = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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 = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_1 = __pyx_t_4(__pyx_t_3);
if (unlikely(!__pyx_t_1)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[3]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[3]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -9312,17 +9273,17 @@ 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;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":133
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":130
* fwrite(&(num_words), sizeof(int), 1, f)
* for word in self.id2word[2:]:
* word_len = len(word) + 1 # <<<<<<<<<<<<<<
* fwrite(&(word_len), sizeof(int), 1, f)
* fwrite(<char *>word, sizeof(char), word_len, f)
*/
- __pyx_t_5 = PyObject_Length(__pyx_v_word); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Length(__pyx_v_word); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_word_len = (__pyx_t_5 + 1);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":134
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":131
* for word in self.id2word[2:]:
* word_len = len(word) + 1
* fwrite(&(word_len), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -9331,14 +9292,14 @@ 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);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":135
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":132
* word_len = len(word) + 1
* fwrite(&(word_len), sizeof(int), 1, f)
* fwrite(<char *>word, sizeof(char), word_len, f) # <<<<<<<<<<<<<<
*
* def write_binary(self, char* filename):
*/
- __pyx_t_6 = PyBytes_AsString(__pyx_v_word); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyBytes_AsString(__pyx_v_word); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
fwrite(((char *)__pyx_t_6), (sizeof(char)), __pyx_v_word_len, __pyx_v_f);
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -9354,14 +9315,14 @@ static void __pyx_f_3_sa_9DataArray_write_handle(struct __pyx_obj_3_sa_DataArray
}
/* Python wrapper */
-static PyObject *__pyx_pw_3_sa_9DataArray_27write_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/
-static PyObject *__pyx_pw_3_sa_9DataArray_27write_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) {
+static PyObject *__pyx_pw_3_sa_9DataArray_25write_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/
+static PyObject *__pyx_pw_3_sa_9DataArray_25write_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) {
char *__pyx_v_filename;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("write_binary (wrapper)", 0);
assert(__pyx_arg_filename); {
- __pyx_v_filename = PyBytes_AsString(__pyx_arg_filename); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_filename = PyBytes_AsString(__pyx_arg_filename); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
@@ -9369,12 +9330,12 @@ static PyObject *__pyx_pw_3_sa_9DataArray_27write_binary(PyObject *__pyx_v_self,
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_3_sa_9DataArray_26write_binary(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self), ((char *)__pyx_v_filename));
+ __pyx_r = __pyx_pf_3_sa_9DataArray_24write_binary(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self), ((char *)__pyx_v_filename));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":137
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":134
* fwrite(<char *>word, sizeof(char), word_len, f)
*
* def write_binary(self, char* filename): # <<<<<<<<<<<<<<
@@ -9382,13 +9343,13 @@ static PyObject *__pyx_pw_3_sa_9DataArray_27write_binary(PyObject *__pyx_v_self,
* f = fopen(filename, "w")
*/
-static PyObject *__pyx_pf_3_sa_9DataArray_26write_binary(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, char *__pyx_v_filename) {
+static PyObject *__pyx_pf_3_sa_9DataArray_24write_binary(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, char *__pyx_v_filename) {
FILE *__pyx_v_f;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("write_binary", 0);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":139
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":136
* def write_binary(self, char* filename):
* cdef FILE* f
* f = fopen(filename, "w") # <<<<<<<<<<<<<<
@@ -9397,7 +9358,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_binary(struct __pyx_obj_3_sa_D
*/
__pyx_v_f = fopen(__pyx_v_filename, __pyx_k__w);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":140
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":137
* cdef FILE* f
* f = fopen(filename, "w")
* self.write_handle(f) # <<<<<<<<<<<<<<
@@ -9406,7 +9367,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_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);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":141
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":138
* f = fopen(filename, "w")
* self.write_handle(f)
* fclose(f) # <<<<<<<<<<<<<<
@@ -9422,17 +9383,17 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_binary(struct __pyx_obj_3_sa_D
}
/* Python wrapper */
-static PyObject *__pyx_pw_3_sa_9DataArray_29write_enhanced_handle(PyObject *__pyx_v_self, PyObject *__pyx_v_f); /*proto*/
-static PyObject *__pyx_pw_3_sa_9DataArray_29write_enhanced_handle(PyObject *__pyx_v_self, PyObject *__pyx_v_f) {
+static PyObject *__pyx_pw_3_sa_9DataArray_27write_enhanced_handle(PyObject *__pyx_v_self, PyObject *__pyx_v_f); /*proto*/
+static PyObject *__pyx_pw_3_sa_9DataArray_27write_enhanced_handle(PyObject *__pyx_v_self, PyObject *__pyx_v_f) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("write_enhanced_handle (wrapper)", 0);
- __pyx_r = __pyx_pf_3_sa_9DataArray_28write_enhanced_handle(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self), ((PyObject *)__pyx_v_f));
+ __pyx_r = __pyx_pf_3_sa_9DataArray_26write_enhanced_handle(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self), ((PyObject *)__pyx_v_f));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":143
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":140
* fclose(f)
*
* def write_enhanced_handle(self, f): # <<<<<<<<<<<<<<
@@ -9440,7 +9401,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_29write_enhanced_handle(PyObject *__py
* f.write("%d " %i)
*/
-static PyObject *__pyx_pf_3_sa_9DataArray_28write_enhanced_handle(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_f) {
+static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_f) {
PyObject *__pyx_v_i = NULL;
PyObject *__pyx_v_word = NULL;
PyObject *__pyx_r = NULL;
@@ -9456,7 +9417,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_28write_enhanced_handle(struct __pyx_o
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("write_enhanced_handle", 0);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":144
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":141
*
* def write_enhanced_handle(self, f):
* for i in self.data: # <<<<<<<<<<<<<<
@@ -9467,7 +9428,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_28write_enhanced_handle(struct __pyx_o
__pyx_t_1 = ((PyObject *)__pyx_v_self->data); __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
__pyx_t_3 = NULL;
} else {
- __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(((PyObject *)__pyx_v_self->data)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(((PyObject *)__pyx_v_self->data)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -9475,23 +9436,23 @@ static PyObject *__pyx_pf_3_sa_9DataArray_28write_enhanced_handle(struct __pyx_o
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 = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 141; __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 = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 141; __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 = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 141; __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[3]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[3]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -9501,23 +9462,23 @@ static PyObject *__pyx_pf_3_sa_9DataArray_28write_enhanced_handle(struct __pyx_o
__pyx_v_i = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":145
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":142
* def write_enhanced_handle(self, f):
* for i in self.data:
* f.write("%d " %i) # <<<<<<<<<<<<<<
* f.write("\n")
* for i in self.sent_index:
*/
- __pyx_t_4 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_21), __pyx_v_i); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_21), __pyx_v_i); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_5));
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_5));
__Pyx_GIVEREF(((PyObject *)__pyx_t_5));
__pyx_t_5 = 0;
- __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
@@ -9525,21 +9486,21 @@ static PyObject *__pyx_pf_3_sa_9DataArray_28write_enhanced_handle(struct __pyx_o
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":146
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":143
* for i in self.data:
* f.write("%d " %i)
* f.write("\n") # <<<<<<<<<<<<<<
* for i in self.sent_index:
* f.write("%d " %i)
*/
- __pyx_t_1 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_22), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_22), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":147
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":144
* f.write("%d " %i)
* f.write("\n")
* for i in self.sent_index: # <<<<<<<<<<<<<<
@@ -9550,7 +9511,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_28write_enhanced_handle(struct __pyx_o
__pyx_t_5 = ((PyObject *)__pyx_v_self->sent_index); __Pyx_INCREF(__pyx_t_5); __pyx_t_2 = 0;
__pyx_t_3 = NULL;
} else {
- __pyx_t_2 = -1; __pyx_t_5 = PyObject_GetIter(((PyObject *)__pyx_v_self->sent_index)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = -1; __pyx_t_5 = PyObject_GetIter(((PyObject *)__pyx_v_self->sent_index)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_3 = Py_TYPE(__pyx_t_5)->tp_iternext;
}
@@ -9558,23 +9519,23 @@ static PyObject *__pyx_pf_3_sa_9DataArray_28write_enhanced_handle(struct __pyx_o
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 = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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 = 144; __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 = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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 = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_5)) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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 = 144; __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 = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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 = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_1 = __pyx_t_3(__pyx_t_5);
if (unlikely(!__pyx_t_1)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[3]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[3]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -9584,23 +9545,23 @@ static PyObject *__pyx_pf_3_sa_9DataArray_28write_enhanced_handle(struct __pyx_o
__pyx_v_i = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":148
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":145
* f.write("\n")
* for i in self.sent_index:
* f.write("%d " %i) # <<<<<<<<<<<<<<
* f.write("\n")
* for i in self.sent_id:
*/
- __pyx_t_1 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_21), __pyx_v_i); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_21), __pyx_v_i); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_6));
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_6));
__Pyx_GIVEREF(((PyObject *)__pyx_t_6));
__pyx_t_6 = 0;
- __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
@@ -9608,21 +9569,21 @@ static PyObject *__pyx_pf_3_sa_9DataArray_28write_enhanced_handle(struct __pyx_o
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":149
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":146
* for i in self.sent_index:
* f.write("%d " %i)
* f.write("\n") # <<<<<<<<<<<<<<
* for i in self.sent_id:
* f.write("%d " %i)
*/
- __pyx_t_5 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_23), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_23), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":150
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":147
* f.write("%d " %i)
* f.write("\n")
* for i in self.sent_id: # <<<<<<<<<<<<<<
@@ -9633,7 +9594,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_28write_enhanced_handle(struct __pyx_o
__pyx_t_6 = ((PyObject *)__pyx_v_self->sent_id); __Pyx_INCREF(__pyx_t_6); __pyx_t_2 = 0;
__pyx_t_3 = NULL;
} else {
- __pyx_t_2 = -1; __pyx_t_6 = PyObject_GetIter(((PyObject *)__pyx_v_self->sent_id)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = -1; __pyx_t_6 = PyObject_GetIter(((PyObject *)__pyx_v_self->sent_id)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_3 = Py_TYPE(__pyx_t_6)->tp_iternext;
}
@@ -9641,23 +9602,23 @@ static PyObject *__pyx_pf_3_sa_9DataArray_28write_enhanced_handle(struct __pyx_o
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 = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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 = 147; __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 = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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 = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_6)) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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 = 147; __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 = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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 = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_5 = __pyx_t_3(__pyx_t_6);
if (unlikely(!__pyx_t_5)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[3]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[3]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -9667,23 +9628,23 @@ static PyObject *__pyx_pf_3_sa_9DataArray_28write_enhanced_handle(struct __pyx_o
__pyx_v_i = __pyx_t_5;
__pyx_t_5 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":151
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":148
* f.write("\n")
* for i in self.sent_id:
* f.write("%d " %i) # <<<<<<<<<<<<<<
* f.write("\n")
* for word in self.id2word:
*/
- __pyx_t_5 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_21), __pyx_v_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_21), __pyx_v_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_4));
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 148; __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_5, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
@@ -9691,21 +9652,21 @@ static PyObject *__pyx_pf_3_sa_9DataArray_28write_enhanced_handle(struct __pyx_o
}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":152
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":149
* for i in self.sent_id:
* f.write("%d " %i)
* f.write("\n") # <<<<<<<<<<<<<<
* for word in self.id2word:
* f.write("%s %d " % (word, self.word2id[word]))
*/
- __pyx_t_6 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_k_tuple_24), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_k_tuple_24), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":153
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":150
* f.write("%d " %i)
* f.write("\n")
* for word in self.id2word: # <<<<<<<<<<<<<<
@@ -9716,7 +9677,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_28write_enhanced_handle(struct __pyx_o
__pyx_t_4 = __pyx_v_self->id2word; __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = 0;
__pyx_t_3 = NULL;
} else {
- __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_self->id2word); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_self->id2word); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = Py_TYPE(__pyx_t_4)->tp_iternext;
}
@@ -9724,23 +9685,23 @@ static PyObject *__pyx_pf_3_sa_9DataArray_28write_enhanced_handle(struct __pyx_o
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 = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 150; __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 = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_4)) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 150; __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 = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_6 = __pyx_t_3(__pyx_t_4);
if (unlikely(!__pyx_t_6)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[3]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[3]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -9750,18 +9711,18 @@ static PyObject *__pyx_pf_3_sa_9DataArray_28write_enhanced_handle(struct __pyx_o
__pyx_v_word = __pyx_t_6;
__pyx_t_6 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":154
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":151
* f.write("\n")
* for word in self.id2word:
* f.write("%s %d " % (word, self.word2id[word])) # <<<<<<<<<<<<<<
* f.write("\n")
*
*/
- __pyx_t_6 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_1 = PyObject_GetItem(__pyx_v_self->word2id, __pyx_v_word); if (!__pyx_t_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetItem(__pyx_v_self->word2id, __pyx_v_word); if (!__pyx_t_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(__pyx_v_word);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_word);
@@ -9769,15 +9730,15 @@ static PyObject *__pyx_pf_3_sa_9DataArray_28write_enhanced_handle(struct __pyx_o
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_1 = 0;
- __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_25), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_25), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_1));
__Pyx_GIVEREF(((PyObject *)__pyx_t_1));
__pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
@@ -9785,16 +9746,16 @@ static PyObject *__pyx_pf_3_sa_9DataArray_28write_enhanced_handle(struct __pyx_o
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":155
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":152
* for word in self.id2word:
* f.write("%s %d " % (word, self.word2id[word]))
* f.write("\n") # <<<<<<<<<<<<<<
*
* def write_enhanced(self, char* filename):
*/
- __pyx_t_4 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_26), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_26), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -9817,14 +9778,14 @@ static PyObject *__pyx_pf_3_sa_9DataArray_28write_enhanced_handle(struct __pyx_o
}
/* Python wrapper */
-static PyObject *__pyx_pw_3_sa_9DataArray_31write_enhanced(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/
-static PyObject *__pyx_pw_3_sa_9DataArray_31write_enhanced(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) {
+static PyObject *__pyx_pw_3_sa_9DataArray_29write_enhanced(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/
+static PyObject *__pyx_pw_3_sa_9DataArray_29write_enhanced(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) {
char *__pyx_v_filename;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("write_enhanced (wrapper)", 0);
assert(__pyx_arg_filename); {
- __pyx_v_filename = PyBytes_AsString(__pyx_arg_filename); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_filename = PyBytes_AsString(__pyx_arg_filename); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
@@ -9832,12 +9793,12 @@ static PyObject *__pyx_pw_3_sa_9DataArray_31write_enhanced(PyObject *__pyx_v_sel
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_3_sa_9DataArray_30write_enhanced(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self), ((char *)__pyx_v_filename));
+ __pyx_r = __pyx_pf_3_sa_9DataArray_28write_enhanced(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self), ((char *)__pyx_v_filename));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":157
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":154
* f.write("\n")
*
* def write_enhanced(self, char* filename): # <<<<<<<<<<<<<<
@@ -9845,7 +9806,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_31write_enhanced(PyObject *__pyx_v_sel
* self.write_enhanced_handle(self, f)
*/
-static PyObject *__pyx_pf_3_sa_9DataArray_30write_enhanced(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, char *__pyx_v_filename) {
+static PyObject *__pyx_pf_3_sa_9DataArray_28write_enhanced(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, char *__pyx_v_filename) {
PyObject *__pyx_v_f = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
@@ -9865,16 +9826,16 @@ static PyObject *__pyx_pf_3_sa_9DataArray_30write_enhanced(struct __pyx_obj_3_sa
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("write_enhanced", 0);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":158
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":155
*
* def write_enhanced(self, char* filename):
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
* self.write_enhanced_handle(self, f)
*/
/*with:*/ {
- __pyx_t_1 = PyBytes_FromString(__pyx_v_filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyBytes_FromString(__pyx_v_filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1));
__Pyx_GIVEREF(((PyObject *)__pyx_t_1));
@@ -9882,14 +9843,14 @@ static PyObject *__pyx_pf_3_sa_9DataArray_30write_enhanced(struct __pyx_obj_3_sa
PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_n_s__w));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__w));
__pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_builtin_open, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_builtin_open, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____exit__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____exit__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____enter__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____enter__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -9904,14 +9865,14 @@ static PyObject *__pyx_pf_3_sa_9DataArray_30write_enhanced(struct __pyx_obj_3_sa
__pyx_v_f = __pyx_t_4;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":159
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":156
* def write_enhanced(self, char* filename):
* with open(filename, "w") as f:
* self.write_enhanced_handle(self, f) # <<<<<<<<<<<<<<
*/
- __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_27); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_27); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
@@ -9919,7 +9880,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_30write_enhanced(struct __pyx_obj_3_sa
__Pyx_INCREF(__pyx_v_f);
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_f);
__Pyx_GIVEREF(__pyx_v_f);
- __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
@@ -9934,7 +9895,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_30write_enhanced(struct __pyx_obj_3_sa
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":158
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":155
*
* def write_enhanced(self, char* filename):
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -9942,11 +9903,11 @@ static PyObject *__pyx_pf_3_sa_9DataArray_30write_enhanced(struct __pyx_obj_3_sa
*/
/*except:*/ {
__Pyx_AddTraceback("_sa.DataArray.write_enhanced", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
+ if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
+ __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_INCREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2);
@@ -9959,11 +9920,11 @@ static PyObject *__pyx_pf_3_sa_9DataArray_30write_enhanced(struct __pyx_obj_3_sa
__Pyx_GIVEREF(__pyx_t_4);
__pyx_t_10 = PyObject_Call(__pyx_t_3, __pyx_t_8, NULL);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
+ if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
__Pyx_GOTREF(__pyx_t_10);
__pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_10);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
+ if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
__pyx_t_11 = (!__pyx_t_9);
if (__pyx_t_11) {
__Pyx_GIVEREF(__pyx_t_2);
@@ -9971,7 +9932,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_30write_enhanced(struct __pyx_obj_3_sa
__Pyx_GIVEREF(__pyx_t_4);
__Pyx_ErrRestore(__pyx_t_2, __pyx_t_1, __pyx_t_4);
__pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_4 = 0;
- {__pyx_filename = __pyx_f[3]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
+ {__pyx_filename = __pyx_f[3]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
goto __pyx_L18;
}
__pyx_L18:;
@@ -9999,11 +9960,11 @@ static PyObject *__pyx_pf_3_sa_9DataArray_30write_enhanced(struct __pyx_obj_3_sa
if (__pyx_t_3) {
__pyx_t_7 = PyObject_Call(__pyx_t_3, __pyx_k_tuple_28, NULL);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_7);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
}
goto __pyx_L19;
@@ -10029,14 +9990,102 @@ static PyObject *__pyx_pf_3_sa_9DataArray_30write_enhanced(struct __pyx_obj_3_sa
return __pyx_r;
}
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/alignment.pxi":12
+/* Python wrapper */
+static PyObject *__pyx_pw_3_sa_9DataArray_4data_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_3_sa_9DataArray_4data_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_3_sa_9DataArray_4data___get__(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self));
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":12
+ * cdef word2id
+ * cdef id2word
+ * cdef public IntList data # <<<<<<<<<<<<<<
+ * cdef IntList sent_id
* cdef IntList sent_index
- *
- * cdef int link(self, int i, int j): # <<<<<<<<<<<<<<
- * """Integerizes an alignment link pair"""
- * return i*65536 + j
*/
+static PyObject *__pyx_pf_3_sa_9DataArray_4data___get__(struct __pyx_obj_3_sa_DataArray *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(((PyObject *)__pyx_v_self->data));
+ __pyx_r = ((PyObject *)__pyx_v_self->data);
+ goto __pyx_L0;
+
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_3_sa_9DataArray_4data_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_pw_3_sa_9DataArray_4data_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_3_sa_9DataArray_4data_2__set__(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_pf_3_sa_9DataArray_4data_2__set__(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_value) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__set__", 0);
+ if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_3_sa_IntList))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_INCREF(__pyx_v_value);
+ __Pyx_GIVEREF(__pyx_v_value);
+ __Pyx_GOTREF(__pyx_v_self->data);
+ __Pyx_DECREF(((PyObject *)__pyx_v_self->data));
+ __pyx_v_self->data = ((struct __pyx_obj_3_sa_IntList *)__pyx_v_value);
+
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_AddTraceback("_sa.DataArray.data.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_3_sa_9DataArray_4data_5__del__(PyObject *__pyx_v_self); /*proto*/
+static int __pyx_pw_3_sa_9DataArray_4data_5__del__(PyObject *__pyx_v_self) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_3_sa_9DataArray_4data_4__del__(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self));
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_pf_3_sa_9DataArray_4data_4__del__(struct __pyx_obj_3_sa_DataArray *__pyx_v_self) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__del__", 0);
+ __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(Py_None);
+ __Pyx_GOTREF(__pyx_v_self->data);
+ __Pyx_DECREF(((PyObject *)__pyx_v_self->data));
+ __pyx_v_self->data = ((struct __pyx_obj_3_sa_IntList *)Py_None);
+
+ __pyx_r = 0;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
static int __pyx_f_3_sa_9Alignment_link(CYTHON_UNUSED struct __pyx_obj_3_sa_Alignment *__pyx_v_self, int __pyx_v_i, int __pyx_v_j) {
int __pyx_r;
__Pyx_RefNannyDeclarations
@@ -45617,8 +45666,8 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_5input_1lambda3(PyObjec
* 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(alslist.itervalues()))
- * # count = len(locs) # Should be?
+ * locs = tuple(itertools.chain.from_iterable(alslist.itervalues()))
+ * count = len(locs)
*/
static PyObject *__pyx_lambda_funcdef_lambda3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) {
@@ -47931,7 +47980,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
* 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(alslist.itervalues()))
+ * locs = tuple(itertools.chain.from_iterable(alslist.itervalues()))
*/
__pyx_t_23 = 0;
if (unlikely(__pyx_cur_scope->__pyx_v_elist == Py_None)) {
@@ -47964,8 +48013,8 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
* 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(alslist.itervalues()))
- * # count = len(locs) # Should be?
+ * locs = tuple(itertools.chain.from_iterable(alslist.itervalues()))
+ * count = len(locs)
*/
__pyx_t_14 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_alslist, __pyx_n_s__iteritems); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
@@ -48050,52 +48099,55 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1104
* for e, alslist in elist.iteritems():
* alignment, max_locs = max(alslist.iteritems(), key=lambda x: len(x[1]))
- * locs = tuple(itertools.chain(alslist.itervalues())) # <<<<<<<<<<<<<<
- * # count = len(locs) # Should be?
- * count = len(max_locs) # Was
+ * locs = tuple(itertools.chain.from_iterable(alslist.itervalues())) # <<<<<<<<<<<<<<
+ * count = len(locs)
+ * scores = self.scorer.score(FeatureContext(
*/
__pyx_t_13 = __Pyx_GetName(__pyx_m, __pyx_n_s__itertools); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_13);
__pyx_t_14 = PyObject_GetAttr(__pyx_t_13, __pyx_n_s__chain); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __pyx_t_13 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_alslist, __pyx_n_s__itervalues); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PyObject_GetAttr(__pyx_t_14, __pyx_n_s__from_iterable); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_13);
- __pyx_t_9 = PyObject_Call(__pyx_t_13, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __pyx_t_14 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_alslist, __pyx_n_s__itervalues); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_14);
+ __pyx_t_9 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
- PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_9);
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_14);
+ PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_9);
__Pyx_GIVEREF(__pyx_t_9);
__pyx_t_9 = 0;
- __pyx_t_9 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_t_13), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyObject_Call(__pyx_t_13, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
- __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
- PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_9);
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
+ __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_14);
+ PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_9);
__Pyx_GIVEREF(__pyx_t_9);
__pyx_t_9 = 0;
- __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_13), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
__Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_locs));
__Pyx_XDECREF(((PyObject *)__pyx_cur_scope->__pyx_v_locs));
__Pyx_GIVEREF(__pyx_t_9);
__pyx_cur_scope->__pyx_v_locs = ((PyObject*)__pyx_t_9);
__pyx_t_9 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1106
- * locs = tuple(itertools.chain(alslist.itervalues()))
- * # count = len(locs) # Should be?
- * count = len(max_locs) # Was # <<<<<<<<<<<<<<
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1105
+ * 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 = PyObject_Length(__pyx_cur_scope->__pyx_v_max_locs); if (unlikely(__pyx_t_25 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_25); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_25 = PyTuple_GET_SIZE(((PyObject *)__pyx_cur_scope->__pyx_v_locs)); if (unlikely(__pyx_t_25 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_25); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_count);
__Pyx_XDECREF(__pyx_cur_scope->__pyx_v_count);
@@ -48103,43 +48155,43 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_cur_scope->__pyx_v_count = __pyx_t_9;
__pyx_t_9 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1107
- * # count = len(locs) # Should be?
- * count = len(max_locs) # Was
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1106
+ * 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, fwords, self.fda, self.eda
*/
- __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__FeatureContext); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__FeatureContext); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1108
- * count = len(max_locs) # Was
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1107
+ * count = len(locs)
* scores = self.scorer.score(FeatureContext(
* f, e, count, fcount[f], num_samples, # <<<<<<<<<<<<<<
* (k,i+spanlen), locs, fwords, self.fda, self.eda
* ))
*/
- __pyx_t_13 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fcount, __pyx_cur_scope->__pyx_v_f); if (!__pyx_t_13) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_14 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_num_samples); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fcount, __pyx_cur_scope->__pyx_v_f); if (!__pyx_t_14) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
+ __pyx_t_13 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_num_samples); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_13);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1109
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1108
* scores = self.scorer.score(FeatureContext(
* f, e, count, fcount[f], num_samples,
* (k,i+spanlen), locs, fwords, self.fda, self.eda # <<<<<<<<<<<<<<
* ))
* yield Rule(self.category, f, e, scores, alignment)
*/
- __pyx_t_7 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_15 = PyNumber_Add(__pyx_t_2, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyNumber_Add(__pyx_t_2, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1109; __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 = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7);
__Pyx_GIVEREF(__pyx_t_7);
@@ -48147,7 +48199,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__Pyx_GIVEREF(__pyx_t_15);
__pyx_t_7 = 0;
__pyx_t_15 = 0;
- __pyx_t_15 = PyTuple_New(10); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyTuple_New(10); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_f);
PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_cur_scope->__pyx_v_f);
@@ -48158,10 +48210,10 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_count);
PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_cur_scope->__pyx_v_count);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_count);
- PyTuple_SET_ITEM(__pyx_t_15, 3, __pyx_t_13);
- __Pyx_GIVEREF(__pyx_t_13);
- PyTuple_SET_ITEM(__pyx_t_15, 4, __pyx_t_14);
+ PyTuple_SET_ITEM(__pyx_t_15, 3, __pyx_t_14);
__Pyx_GIVEREF(__pyx_t_14);
+ PyTuple_SET_ITEM(__pyx_t_15, 4, __pyx_t_13);
+ __Pyx_GIVEREF(__pyx_t_13);
PyTuple_SET_ITEM(__pyx_t_15, 5, ((PyObject *)__pyx_t_2));
__Pyx_GIVEREF(((PyObject *)__pyx_t_2));
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_locs));
@@ -48176,14 +48228,14 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->eda));
PyTuple_SET_ITEM(__pyx_t_15, 9, ((PyObject *)__pyx_cur_scope->__pyx_v_self->eda));
__Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->eda));
- __pyx_t_13 = 0;
__pyx_t_14 = 0;
+ __pyx_t_13 = 0;
__pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
- __pyx_t_15 = ((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_2)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = ((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_2)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_scores));
@@ -48192,16 +48244,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_15);
__pyx_t_15 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1111
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1110
* (k,i+spanlen), locs, fwords, self.fda, self.eda
* ))
* 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_15 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->category); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->category); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_15);
__Pyx_GIVEREF(__pyx_t_15);
@@ -48218,7 +48270,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_cur_scope->__pyx_v_alignment);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_alignment);
__pyx_t_15 = 0;
- __pyx_t_15 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Rule)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Rule)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__pyx_r = __pyx_t_15;
@@ -48258,7 +48310,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_t_22 = __pyx_cur_scope->__pyx_t_7;
__pyx_t_23 = __pyx_cur_scope->__pyx_t_8;
__pyx_t_24 = __pyx_cur_scope->__pyx_t_9;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
@@ -48273,38 +48325,38 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
}
__pyx_L32:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1113
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1112
* 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, alt_id, pathlen + 1, node, phrase, is_shadow_path))
*/
- __pyx_t_22 = PyObject_Length(__pyx_cur_scope->__pyx_v_phrase); if (unlikely(__pyx_t_22 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_22 = PyObject_Length(__pyx_cur_scope->__pyx_v_phrase); if (unlikely(__pyx_t_22 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_19 = (__pyx_t_22 < __pyx_cur_scope->__pyx_v_self->max_length);
if (__pyx_t_19) {
- __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1113; __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 = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_3 = PyNumber_Add(__pyx_t_10, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_Add(__pyx_t_10, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_22 = PyObject_Length(__pyx_cur_scope->__pyx_v_fwords); if (unlikely(__pyx_t_22 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_10 = PyInt_FromSsize_t(__pyx_t_22); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_22 = PyObject_Length(__pyx_cur_scope->__pyx_v_fwords); if (unlikely(__pyx_t_22 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyInt_FromSsize_t(__pyx_t_22); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_15 = PyObject_RichCompare(__pyx_t_3, __pyx_t_10, Py_LT); __Pyx_XGOTREF(__pyx_t_15); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyObject_RichCompare(__pyx_t_3, __pyx_t_10, Py_LT); __Pyx_XGOTREF(__pyx_t_15); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
if (__pyx_t_8) {
- __pyx_t_15 = PyNumber_Add(__pyx_cur_scope->__pyx_v_pathlen, __pyx_int_1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1113; __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 = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- __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 = 1113; __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 = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_3 = PyObject_RichCompare(__pyx_t_15, __pyx_t_10, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_RichCompare(__pyx_t_15, __pyx_t_10, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_26 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_26 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_26 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_26 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_27 = __pyx_t_26;
} else {
@@ -48316,45 +48368,45 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
}
if (__pyx_t_8) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1114
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1113
*
* if len(phrase) < self.max_length and i+spanlen < len(fwords) and pathlen+1 <= self.max_initial_size:
* for alt_id in range(len(fwords[i+spanlen])): # <<<<<<<<<<<<<<
* new_frontier.append((k, i+spanlen, alt_id, pathlen + 1, node, phrase, is_shadow_path))
* num_subpatterns = arity
*/
- __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __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 = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_10 = PyNumber_Add(__pyx_t_3, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyNumber_Add(__pyx_t_3, __pyx_cur_scope->__pyx_v_spanlen); 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_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fwords, __pyx_t_10); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fwords, __pyx_t_10); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_22 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_22 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_22 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_22 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_22; __pyx_t_18+=1) {
__pyx_cur_scope->__pyx_v_alt_id = __pyx_t_18;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1115
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1114
* if len(phrase) < self.max_length and i+spanlen < len(fwords) and pathlen+1 <= self.max_initial_size:
* for alt_id in range(len(fwords[i+spanlen])):
* new_frontier.append((k, i+spanlen, alt_id, pathlen + 1, node, phrase, is_shadow_path)) # <<<<<<<<<<<<<<
* num_subpatterns = arity
* if not is_shadow_path:
*/
- __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1115; __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 = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_15 = PyNumber_Add(__pyx_t_10, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyNumber_Add(__pyx_t_10, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__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 = 1115; __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 = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_2 = PyNumber_Add(__pyx_cur_scope->__pyx_v_pathlen, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Add(__pyx_cur_scope->__pyx_v_pathlen, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_9 = PyTuple_New(7); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyTuple_New(7); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
@@ -48377,11 +48429,11 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_t_15 = 0;
__pyx_t_10 = 0;
__pyx_t_2 = 0;
- __pyx_t_11 = PyList_Append(__pyx_cur_scope->__pyx_v_new_frontier, ((PyObject *)__pyx_t_9)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyList_Append(__pyx_cur_scope->__pyx_v_new_frontier, ((PyObject *)__pyx_t_9)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
}
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1116
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1115
* for alt_id in range(len(fwords[i+spanlen])):
* new_frontier.append((k, i+spanlen, alt_id, pathlen + 1, node, phrase, is_shadow_path))
* num_subpatterns = arity # <<<<<<<<<<<<<<
@@ -48390,18 +48442,18 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
*/
__pyx_cur_scope->__pyx_v_num_subpatterns = __pyx_cur_scope->__pyx_v_arity;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1117
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1116
* new_frontier.append((k, i+spanlen, alt_id, pathlen + 1, node, phrase, is_shadow_path))
* num_subpatterns = arity
* if not is_shadow_path: # <<<<<<<<<<<<<<
* num_subpatterns = num_subpatterns + 1
* if len(phrase)+1 < self.max_length and arity < self.max_nonterminals and num_subpatterns < self.max_chunks:
*/
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_19 = (!__pyx_t_8);
if (__pyx_t_19) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1118
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1117
* num_subpatterns = arity
* if not is_shadow_path:
* num_subpatterns = num_subpatterns + 1 # <<<<<<<<<<<<<<
@@ -48413,14 +48465,14 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
}
__pyx_L64:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1119
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1118
* 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_22 = PyObject_Length(__pyx_cur_scope->__pyx_v_phrase); if (unlikely(__pyx_t_22 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_22 = PyObject_Length(__pyx_cur_scope->__pyx_v_phrase); if (unlikely(__pyx_t_22 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_19 = ((__pyx_t_22 + 1) < __pyx_cur_scope->__pyx_v_self->max_length);
if (__pyx_t_19) {
__pyx_t_8 = (__pyx_cur_scope->__pyx_v_arity < __pyx_cur_scope->__pyx_v_self->max_nonterminals);
@@ -48436,7 +48488,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
}
if (__pyx_t_8) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1120
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1119
* 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) # <<<<<<<<<<<<<<
@@ -48445,16 +48497,16 @@ 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));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1121
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1120
* 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_9 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_9, __pyx_cur_scope->__pyx_v_xcat, sizeof(int), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_9, __pyx_cur_scope->__pyx_v_xcat, sizeof(int), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_xnode);
@@ -48463,18 +48515,18 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_cur_scope->__pyx_v_xnode = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1123
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1122
* xnode = node.children[xcat]
* # I put spanlen=1 below
* key = tuple([self.min_gap_size, i, 1, pathlen]) # <<<<<<<<<<<<<<
* frontier_nodes = []
* if (key in nodes_isteps_away_buffer):
*/
- __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->min_gap_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->min_gap_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_9 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
- __pyx_t_10 = PyList_New(4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyList_New(4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
PyList_SET_ITEM(__pyx_t_10, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
@@ -48488,7 +48540,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_pathlen);
__pyx_t_2 = 0;
__pyx_t_9 = 0;
- __pyx_t_9 = ((PyObject *)PyList_AsTuple(__pyx_t_10)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = ((PyObject *)PyList_AsTuple(__pyx_t_10)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_9));
__Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
__Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_key));
@@ -48497,14 +48549,14 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_cur_scope->__pyx_v_key = __pyx_t_9;
__pyx_t_9 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1124
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1123
* # 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_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_frontier_nodes);
__Pyx_XDECREF(__pyx_cur_scope->__pyx_v_frontier_nodes);
@@ -48512,24 +48564,24 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_cur_scope->__pyx_v_frontier_nodes = ((PyObject *)__pyx_t_9);
__pyx_t_9 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1125
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1124
* key = tuple([self.min_gap_size, i, 1, pathlen])
* frontier_nodes = []
* if (key in nodes_isteps_away_buffer): # <<<<<<<<<<<<<<
* frontier_nodes = nodes_isteps_away_buffer[key]
* else:
*/
- __pyx_t_8 = (__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_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = (__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_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_8) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1126
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1125
* 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_9 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_nodes_isteps_away_buffer), ((PyObject *)__pyx_cur_scope->__pyx_v_key)); if (!__pyx_t_9) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_nodes_isteps_away_buffer), ((PyObject *)__pyx_cur_scope->__pyx_v_key)); if (!__pyx_t_9) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_GOTREF(__pyx_cur_scope->__pyx_v_frontier_nodes);
__Pyx_DECREF(__pyx_cur_scope->__pyx_v_frontier_nodes);
@@ -48540,20 +48592,20 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
}
/*else*/ {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1128
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1127
* 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_9 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_124); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_124); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
- __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 = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->min_gap_size); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_15 = PyTuple_New(7); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyTuple_New(7); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_10);
__Pyx_GIVEREF(__pyx_t_10);
@@ -48576,7 +48628,7 @@ 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_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
@@ -48586,18 +48638,18 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_cur_scope->__pyx_v_frontier_nodes = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1129
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1128
* 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 = 1129; __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 = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_L66:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1131
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1130
* nodes_isteps_away_buffer[key] = frontier_nodes
*
* for (i, alt, pathlen) in frontier_nodes: # <<<<<<<<<<<<<<
@@ -48608,7 +48660,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_t_2 = __pyx_cur_scope->__pyx_v_frontier_nodes; __Pyx_INCREF(__pyx_t_2); __pyx_t_22 = 0;
__pyx_t_20 = NULL;
} else {
- __pyx_t_22 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_frontier_nodes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_22 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_frontier_nodes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_20 = Py_TYPE(__pyx_t_2)->tp_iternext;
}
@@ -48616,23 +48668,23 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
if (!__pyx_t_20 && PyList_CheckExact(__pyx_t_2)) {
if (__pyx_t_22 >= PyList_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_15 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_22); __Pyx_INCREF(__pyx_t_15); __pyx_t_22++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_22); __Pyx_INCREF(__pyx_t_15); __pyx_t_22++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_15 = PySequence_ITEM(__pyx_t_2, __pyx_t_22); __pyx_t_22++; if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PySequence_ITEM(__pyx_t_2, __pyx_t_22); __pyx_t_22++; if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_20 && PyTuple_CheckExact(__pyx_t_2)) {
if (__pyx_t_22 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_15 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_22); __Pyx_INCREF(__pyx_t_15); __pyx_t_22++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_22); __Pyx_INCREF(__pyx_t_15); __pyx_t_22++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_15 = PySequence_ITEM(__pyx_t_2, __pyx_t_22); __pyx_t_22++; if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PySequence_ITEM(__pyx_t_2, __pyx_t_22); __pyx_t_22++; if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_15 = __pyx_t_20(__pyx_t_2);
if (unlikely(!__pyx_t_15)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -48648,7 +48700,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
@@ -48664,38 +48716,38 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__Pyx_INCREF(__pyx_t_10);
__Pyx_INCREF(__pyx_t_3);
#else
- __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1131; __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 = 1131; __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 = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1130; __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 = 1130; __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 = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
} else
{
Py_ssize_t index = -1;
- __pyx_t_14 = PyObject_GetIter(__pyx_t_15); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_14);
+ __pyx_t_13 = PyObject_GetIter(__pyx_t_15); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_13);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- __pyx_t_17 = Py_TYPE(__pyx_t_14)->tp_iternext;
- index = 0; __pyx_t_9 = __pyx_t_17(__pyx_t_14); if (unlikely(!__pyx_t_9)) goto __pyx_L69_unpacking_failed;
+ __pyx_t_17 = Py_TYPE(__pyx_t_13)->tp_iternext;
+ index = 0; __pyx_t_9 = __pyx_t_17(__pyx_t_13); if (unlikely(!__pyx_t_9)) goto __pyx_L69_unpacking_failed;
__Pyx_GOTREF(__pyx_t_9);
- index = 1; __pyx_t_10 = __pyx_t_17(__pyx_t_14); if (unlikely(!__pyx_t_10)) goto __pyx_L69_unpacking_failed;
+ index = 1; __pyx_t_10 = __pyx_t_17(__pyx_t_13); if (unlikely(!__pyx_t_10)) goto __pyx_L69_unpacking_failed;
__Pyx_GOTREF(__pyx_t_10);
- index = 2; __pyx_t_3 = __pyx_t_17(__pyx_t_14); if (unlikely(!__pyx_t_3)) goto __pyx_L69_unpacking_failed;
+ index = 2; __pyx_t_3 = __pyx_t_17(__pyx_t_13); if (unlikely(!__pyx_t_3)) goto __pyx_L69_unpacking_failed;
__Pyx_GOTREF(__pyx_t_3);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_14), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_13), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_17 = NULL;
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
goto __pyx_L70_unpacking_done;
__pyx_L69_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
__pyx_t_17 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L70_unpacking_done:;
}
- __pyx_t_18 = __Pyx_PyInt_AsInt(__pyx_t_9); if (unlikely((__pyx_t_18 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = __Pyx_PyInt_AsInt(__pyx_t_9); if (unlikely((__pyx_t_18 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_10); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_10); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_cur_scope->__pyx_v_i = __pyx_t_18;
__pyx_cur_scope->__pyx_v_alt = __pyx_t_6;
@@ -48705,54 +48757,54 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_cur_scope->__pyx_v_pathlen = __pyx_t_3;
__pyx_t_3 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1132
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1131
*
* for (i, alt, pathlen) in frontier_nodes:
* new_frontier.append((k, i, alt, pathlen, xnode, phrase +(xcat,), is_shadow_path)) # <<<<<<<<<<<<<<
* frontier = new_frontier
*
*/
- __pyx_t_15 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1132; __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 = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_alt); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_alt); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_9 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_xcat); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_xcat); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
- __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_14);
- PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_9);
+ __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_13);
+ PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_9);
__Pyx_GIVEREF(__pyx_t_9);
__pyx_t_9 = 0;
- __pyx_t_9 = PyNumber_Add(__pyx_cur_scope->__pyx_v_phrase, ((PyObject *)__pyx_t_14)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyNumber_Add(__pyx_cur_scope->__pyx_v_phrase, ((PyObject *)__pyx_t_13)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
- __pyx_t_14 = PyTuple_New(7); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_14);
- PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_15);
+ __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
+ __pyx_t_13 = PyTuple_New(7); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_13);
+ PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_15);
__Pyx_GIVEREF(__pyx_t_15);
- PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_10);
+ PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_10);
__Pyx_GIVEREF(__pyx_t_10);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_pathlen);
- PyTuple_SET_ITEM(__pyx_t_14, 3, __pyx_cur_scope->__pyx_v_pathlen);
+ PyTuple_SET_ITEM(__pyx_t_13, 3, __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_14, 4, __pyx_cur_scope->__pyx_v_xnode);
+ PyTuple_SET_ITEM(__pyx_t_13, 4, __pyx_cur_scope->__pyx_v_xnode);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_xnode);
- PyTuple_SET_ITEM(__pyx_t_14, 5, __pyx_t_9);
+ PyTuple_SET_ITEM(__pyx_t_13, 5, __pyx_t_9);
__Pyx_GIVEREF(__pyx_t_9);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_is_shadow_path);
- PyTuple_SET_ITEM(__pyx_t_14, 6, __pyx_cur_scope->__pyx_v_is_shadow_path);
+ PyTuple_SET_ITEM(__pyx_t_13, 6, __pyx_cur_scope->__pyx_v_is_shadow_path);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_is_shadow_path);
__pyx_t_15 = 0;
__pyx_t_3 = 0;
__pyx_t_10 = 0;
__pyx_t_9 = 0;
- __pyx_t_11 = PyList_Append(__pyx_cur_scope->__pyx_v_new_frontier, ((PyObject *)__pyx_t_14)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
+ __pyx_t_11 = PyList_Append(__pyx_cur_scope->__pyx_v_new_frontier, ((PyObject *)__pyx_t_13)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
goto __pyx_L65;
@@ -48765,7 +48817,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
}
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1133
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1132
* for (i, alt, pathlen) in frontier_nodes:
* new_frontier.append((k, i, alt, pathlen, xnode, phrase +(xcat,), is_shadow_path))
* frontier = new_frontier # <<<<<<<<<<<<<<
@@ -48779,94 +48831,94 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_cur_scope->__pyx_v_frontier = __pyx_cur_scope->__pyx_v_new_frontier;
}
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1135
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1134
* frontier = new_frontier
*
* stop_time = monitor_cpu() # <<<<<<<<<<<<<<
* logger.info("Total time for rule lookup, extraction, and scoring = %f seconds", (stop_time - start_time))
* gc.collect()
*/
- __pyx_t_12 = PyFloat_FromDouble(__pyx_f_3_sa_monitor_cpu()); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyFloat_FromDouble(__pyx_f_3_sa_monitor_cpu()); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
__Pyx_GIVEREF(__pyx_t_12);
__pyx_cur_scope->__pyx_v_stop_time = __pyx_t_12;
__pyx_t_12 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1136
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1135
*
* 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 = 1136; __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 = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
- __pyx_t_2 = PyObject_GetAttr(__pyx_t_12, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_GetAttr(__pyx_t_12, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__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 = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_start_time); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
- __pyx_t_14 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_stop_time, __pyx_t_12); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_14);
+ __pyx_t_13 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_stop_time, __pyx_t_12); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_13);
__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 = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_125));
PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)__pyx_kp_s_125));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_125));
- PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_14);
- __Pyx_GIVEREF(__pyx_t_14);
- __pyx_t_14 = 0;
- __pyx_t_14 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_14);
+ PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_13);
+ __Pyx_GIVEREF(__pyx_t_13);
+ __pyx_t_13 = 0;
+ __pyx_t_13 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_13);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1137
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1136
* stop_time = monitor_cpu()
* logger.info("Total time for rule lookup, extraction, and scoring = %f seconds", (stop_time - start_time))
* gc.collect() # <<<<<<<<<<<<<<
* logger.info(" Extract time = %f seconds", self.extract_time)
*
*/
- __pyx_t_14 = __Pyx_GetName(__pyx_m, __pyx_n_s__gc); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_14);
- __pyx_t_12 = PyObject_GetAttr(__pyx_t_14, __pyx_n_s__collect); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = __Pyx_GetName(__pyx_m, __pyx_n_s__gc); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_13);
+ __pyx_t_12 = PyObject_GetAttr(__pyx_t_13, __pyx_n_s__collect); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- __pyx_t_14 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_14);
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __pyx_t_13 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_13);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1138
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1137
* logger.info("Total time for rule lookup, extraction, and scoring = %f seconds", (stop_time - start_time))
* gc.collect()
* logger.info(" Extract time = %f seconds", self.extract_time) # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_14 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_14);
- __pyx_t_12 = PyObject_GetAttr(__pyx_t_14, __pyx_n_s__info); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_13);
+ __pyx_t_12 = PyObject_GetAttr(__pyx_t_13, __pyx_n_s__info); 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_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- __pyx_t_14 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->extract_time); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_14);
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __pyx_t_13 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->extract_time); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_13);
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_126));
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_126));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_126));
- PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_14);
- __Pyx_GIVEREF(__pyx_t_14);
- __pyx_t_14 = 0;
- __pyx_t_14 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_14);
+ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_13);
+ __Pyx_GIVEREF(__pyx_t_13);
+ __pyx_t_13 = 0;
+ __pyx_t_13 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_13);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
PyErr_SetNone(PyExc_StopIteration);
goto __pyx_L0;
__pyx_L1_error:;
@@ -48889,7 +48941,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
return NULL;
}
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1141
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1140
*
*
* cdef int find_fixpoint(self, # <<<<<<<<<<<<<<
@@ -48919,7 +48971,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("find_fixpoint", 0);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1156
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1155
* 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 # <<<<<<<<<<<<<<
@@ -48928,7 +48980,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
*/
(__pyx_v_e_low[0]) = __pyx_v_e_in_low;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1157
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1156
*
* e_low[0] = e_in_low
* e_high[0] = e_in_high # <<<<<<<<<<<<<<
@@ -48937,19 +48989,19 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
*/
(__pyx_v_e_high[0]) = __pyx_v_e_in_high;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1158
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1157
* 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 = 1158; __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 = 1158; __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 = 1157; __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 = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1159
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1158
* 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: # <<<<<<<<<<<<<<
@@ -48959,7 +49011,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1165
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1164
* # rule X -> X_1 w X_2 / X_1 X_2. This is probably
* # not worth the bother, though.
* return 0 # <<<<<<<<<<<<<<
@@ -48971,7 +49023,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
goto __pyx_L3;
}
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1166
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1165
* # not worth the bother, though.
* return 0
* elif e_in_low != -1 and e_low[0] != e_in_low: # <<<<<<<<<<<<<<
@@ -48987,7 +49039,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
if (__pyx_t_5) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1167
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1166
* return 0
* elif e_in_low != -1 and e_low[0] != e_in_low:
* if e_in_low - e_low[0] < min_ex_size: # <<<<<<<<<<<<<<
@@ -48997,7 +49049,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1168
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1167
* 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 # <<<<<<<<<<<<<<
@@ -49006,7 +49058,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);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1169
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1168
* if e_in_low - e_low[0] < min_ex_size:
* e_low[0] = e_in_low - min_ex_size
* if e_low[0] < 0: # <<<<<<<<<<<<<<
@@ -49016,7 +49068,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1170
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1169
* e_low[0] = e_in_low - min_ex_size
* if e_low[0] < 0:
* return 0 # <<<<<<<<<<<<<<
@@ -49035,7 +49087,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
__pyx_L3:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1172
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1171
* return 0
*
* if e_high[0] - e_low[0] > max_e_len: # <<<<<<<<<<<<<<
@@ -49045,7 +49097,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1173
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1172
*
* if e_high[0] - e_low[0] > max_e_len:
* return 0 # <<<<<<<<<<<<<<
@@ -49057,7 +49109,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
goto __pyx_L6;
}
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1174
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1173
* if e_high[0] - e_low[0] > max_e_len:
* return 0
* elif e_in_high != -1 and e_high[0] != e_in_high: # <<<<<<<<<<<<<<
@@ -49073,7 +49125,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
if (__pyx_t_4) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1175
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1174
* return 0
* elif e_in_high != -1 and e_high[0] != e_in_high:
* if e_high[0] - e_in_high < min_ex_size: # <<<<<<<<<<<<<<
@@ -49083,7 +49135,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1176
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1175
* 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 # <<<<<<<<<<<<<<
@@ -49092,7 +49144,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);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1177
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1176
* 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: # <<<<<<<<<<<<<<
@@ -49102,7 +49154,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1178
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1177
* e_high[0] = e_in_high + min_ex_size
* if e_high[0] > e_sent_len:
* return 0 # <<<<<<<<<<<<<<
@@ -49121,7 +49173,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
__pyx_L6:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1180
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1179
* return 0
*
* f_back_low[0] = -1 # <<<<<<<<<<<<<<
@@ -49130,7 +49182,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
*/
(__pyx_v_f_back_low[0]) = -1;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1181
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1180
*
* f_back_low[0] = -1
* f_back_high[0] = -1 # <<<<<<<<<<<<<<
@@ -49139,7 +49191,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
*/
(__pyx_v_f_back_high[0]) = -1;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1182
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1181
* f_back_low[0] = -1
* f_back_high[0] = -1
* f_low_prev = f_low # <<<<<<<<<<<<<<
@@ -49148,17 +49200,17 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
*/
__pyx_v_f_low_prev = __pyx_v_f_low;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1183
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1182
* 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 = 1183; __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 = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_f_high_prev = __pyx_t_1;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1184
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1183
* f_low_prev = f_low
* f_high_prev = f_high
* new_x = 0 # <<<<<<<<<<<<<<
@@ -49167,7 +49219,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
*/
__pyx_v_new_x = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1185
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1184
* f_high_prev = f_high
* new_x = 0
* new_low_x = 0 # <<<<<<<<<<<<<<
@@ -49176,7 +49228,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
*/
__pyx_v_new_low_x = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1186
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1185
* new_x = 0
* new_low_x = 0
* new_high_x = 0 # <<<<<<<<<<<<<<
@@ -49185,7 +49237,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
*/
__pyx_v_new_high_x = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1188
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1187
* new_high_x = 0
*
* while True: # <<<<<<<<<<<<<<
@@ -49195,7 +49247,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
while (1) {
if (!1) break;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1190
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1189
* while True:
*
* if f_back_low[0] == -1: # <<<<<<<<<<<<<<
@@ -49205,45 +49257,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1191
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1190
*
* 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 = 1191; __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 = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
goto __pyx_L11;
}
/*else*/ {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1193
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1192
* 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 = 1193; __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 = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1194
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1193
* 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 = 1194; __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 = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
}
__pyx_L11:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1196
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1195
* 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: # <<<<<<<<<<<<<<
@@ -49253,7 +49305,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1197
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1196
*
* if f_back_low[0] > f_low:
* f_back_low[0] = f_low # <<<<<<<<<<<<<<
@@ -49265,35 +49317,35 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
__pyx_L12:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1199
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1198
* 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 = 1199; __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 = 1198; __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 = 1199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_v_f_high, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1198; __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 = 1199; __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 = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (__pyx_t_4) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1200
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1199
*
* 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 = 1200; __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 = 1199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
(__pyx_v_f_back_high[0]) = __pyx_t_1;
goto __pyx_L13;
}
__pyx_L13:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1202
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1201
* f_back_high[0] = f_high
*
* if f_back_low[0] == f_low_prev and f_back_high[0] == f_high_prev: # <<<<<<<<<<<<<<
@@ -49309,7 +49361,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
if (__pyx_t_3) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1203
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1202
*
* if f_back_low[0] == f_low_prev and f_back_high[0] == f_high_prev:
* return 1 # <<<<<<<<<<<<<<
@@ -49322,7 +49374,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
__pyx_L14:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1205
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1204
* return 1
*
* if allow_low_x == 0 and f_back_low[0] < f_low: # <<<<<<<<<<<<<<
@@ -49338,7 +49390,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
if (__pyx_t_5) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1207
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1206
* if allow_low_x == 0 and f_back_low[0] < f_low:
* # FAIL: f phrase is not tight
* return 0 # <<<<<<<<<<<<<<
@@ -49351,7 +49403,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
__pyx_L15:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1209
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1208
* return 0
*
* if f_back_high[0] - f_back_low[0] > max_f_len: # <<<<<<<<<<<<<<
@@ -49361,7 +49413,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1211
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1210
* if f_back_high[0] - f_back_low[0] > max_f_len:
* # FAIL: f back projection is too wide
* return 0 # <<<<<<<<<<<<<<
@@ -49374,7 +49426,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
__pyx_L16:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1213
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1212
* return 0
*
* if allow_high_x == 0 and f_back_high[0] > f_high: # <<<<<<<<<<<<<<
@@ -49383,11 +49435,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 = 1213; __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 = 1212; __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 = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_v_f_high, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1212; __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 = 1213; __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 = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_4 = __pyx_t_3;
} else {
@@ -49395,7 +49447,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
if (__pyx_t_4) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1215
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1214
* if allow_high_x == 0 and f_back_high[0] > f_high:
* # FAIL: extension on high side not allowed
* return 0 # <<<<<<<<<<<<<<
@@ -49408,7 +49460,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
__pyx_L17:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1217
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1216
* return 0
*
* if f_low != f_back_low[0]: # <<<<<<<<<<<<<<
@@ -49418,7 +49470,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1218
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1217
*
* if f_low != f_back_low[0]:
* if new_low_x == 0: # <<<<<<<<<<<<<<
@@ -49428,7 +49480,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1219
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1218
* if f_low != f_back_low[0]:
* if new_low_x == 0:
* if new_x >= max_new_x: # <<<<<<<<<<<<<<
@@ -49438,7 +49490,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1221
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1220
* if new_x >= max_new_x:
* # FAIL: extension required on low side violates max # of gaps
* return 0 # <<<<<<<<<<<<<<
@@ -49451,7 +49503,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
/*else*/ {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1223
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1222
* return 0
* else:
* new_x = new_x + 1 # <<<<<<<<<<<<<<
@@ -49460,7 +49512,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
*/
__pyx_v_new_x = (__pyx_v_new_x + 1);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1224
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1223
* else:
* new_x = new_x + 1
* new_low_x = 1 # <<<<<<<<<<<<<<
@@ -49474,7 +49526,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
__pyx_L19:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1225
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1224
* new_x = new_x + 1
* new_low_x = 1
* if f_low - f_back_low[0] < min_fx_size: # <<<<<<<<<<<<<<
@@ -49484,7 +49536,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1226
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1225
* new_low_x = 1
* if f_low - f_back_low[0] < min_fx_size:
* f_back_low[0] = f_low - min_fx_size # <<<<<<<<<<<<<<
@@ -49493,7 +49545,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);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1227
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1226
* 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: # <<<<<<<<<<<<<<
@@ -49503,7 +49555,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1229
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1228
* if f_back_high[0] - f_back_low[0] > max_f_len:
* # FAIL: extension required on low side violates max initial length
* return 0 # <<<<<<<<<<<<<<
@@ -49516,7 +49568,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
__pyx_L22:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1230
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1229
* # FAIL: extension required on low side violates max initial length
* return 0
* if f_back_low[0] < 0: # <<<<<<<<<<<<<<
@@ -49526,7 +49578,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1232
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1231
* if f_back_low[0] < 0:
* # FAIL: extension required on low side violates sentence boundary
* return 0 # <<<<<<<<<<<<<<
@@ -49545,22 +49597,22 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
__pyx_L18:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1234
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1233
* 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 = 1234; __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 = 1233; __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 = 1234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_RichCompare(__pyx_v_f_high, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1233; __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 = 1234; __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 = 1233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (__pyx_t_4) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1235
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1234
*
* if f_high != f_back_high[0]:
* if new_high_x == 0: # <<<<<<<<<<<<<<
@@ -49570,7 +49622,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1236
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1235
* if f_high != f_back_high[0]:
* if new_high_x == 0:
* if new_x >= max_new_x: # <<<<<<<<<<<<<<
@@ -49580,7 +49632,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1238
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1237
* if new_x >= max_new_x:
* # FAIL: extension required on high side violates max # of gaps
* return 0 # <<<<<<<<<<<<<<
@@ -49593,7 +49645,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
/*else*/ {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1240
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1239
* return 0
* else:
* new_x = new_x + 1 # <<<<<<<<<<<<<<
@@ -49602,7 +49654,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
*/
__pyx_v_new_x = (__pyx_v_new_x + 1);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1241
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1240
* else:
* new_x = new_x + 1
* new_high_x = 1 # <<<<<<<<<<<<<<
@@ -49616,44 +49668,44 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
__pyx_L25:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1242
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1241
* 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 = 1242; __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 = 1241; __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 = 1242; __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 = 1241; __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 = 1242; __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 = 1241; __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 = 1242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_RichCompare(__pyx_t_2, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1241; __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 = 1242; __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 = 1241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (__pyx_t_4) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1243
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1242
* 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 = 1243; __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 = 1242; __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 = 1243; __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 = 1242; __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 = 1243; __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 = 1242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
(__pyx_v_f_back_high[0]) = __pyx_t_1;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1244
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1243
* 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: # <<<<<<<<<<<<<<
@@ -49663,7 +49715,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1246
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1245
* if f_back_high[0] - f_back_low[0] > max_f_len:
* # FAIL: extension required on high side violates max initial length
* return 0 # <<<<<<<<<<<<<<
@@ -49676,7 +49728,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
__pyx_L28:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1247
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1246
* # FAIL: extension required on high side violates max initial length
* return 0
* if f_back_high[0] > f_sent_len: # <<<<<<<<<<<<<<
@@ -49686,7 +49738,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1249
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1248
* if f_back_high[0] > f_sent_len:
* # FAIL: extension required on high side violates sentence boundary
* return 0 # <<<<<<<<<<<<<<
@@ -49705,7 +49757,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
__pyx_L24:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1251
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1250
* return 0
*
* e_low_prev = e_low[0] # <<<<<<<<<<<<<<
@@ -49714,7 +49766,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
*/
__pyx_v_e_low_prev = (__pyx_v_e_low[0]);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1252
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1251
*
* e_low_prev = e_low[0]
* e_high_prev = e_high[0] # <<<<<<<<<<<<<<
@@ -49723,29 +49775,29 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
*/
__pyx_v_e_high_prev = (__pyx_v_e_high[0]);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1254
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1253
* 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 = 1254; __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 = 1253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1255
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1254
*
* 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 = 1255; __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 = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1256
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1255
* 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: # <<<<<<<<<<<<<<
@@ -49761,7 +49813,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
if (__pyx_t_3) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1257
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1256
* 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 # <<<<<<<<<<<<<<
@@ -49774,7 +49826,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
__pyx_L30:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1258
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1257
* if e_low[0] == e_low_prev and e_high[0] == e_high_prev:
* return 1
* if allow_arbitrary_x == 0: # <<<<<<<<<<<<<<
@@ -49784,7 +49836,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1260
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1259
* if allow_arbitrary_x == 0:
* # FAIL: arbitrary expansion not permitted
* return 0 # <<<<<<<<<<<<<<
@@ -49797,7 +49849,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
__pyx_L31:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1261
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1260
* # FAIL: arbitrary expansion not permitted
* return 0
* if e_high[0] - e_low[0] > max_e_len: # <<<<<<<<<<<<<<
@@ -49807,7 +49859,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1263
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1262
* if e_high[0] - e_low[0] > max_e_len:
* # FAIL: re-projection violates sentence max phrase length
* return 0 # <<<<<<<<<<<<<<
@@ -49820,7 +49872,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
__pyx_L32:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1264
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1263
* # FAIL: re-projection violates sentence max phrase length
* return 0
* f_low_prev = f_back_low[0] # <<<<<<<<<<<<<<
@@ -49829,7 +49881,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
*/
__pyx_v_f_low_prev = (__pyx_v_f_back_low[0]);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1265
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1264
* return 0
* f_low_prev = f_back_low[0]
* f_high_prev = f_back_high[0] # <<<<<<<<<<<<<<
@@ -49852,7 +49904,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
return __pyx_r;
}
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1268
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1267
*
*
* cdef find_projection(self, int in_low, int in_high, int* in_links_low, int* in_links_high, # <<<<<<<<<<<<<<
@@ -49870,7 +49922,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_find_projection(CYTHON_U
int __pyx_t_4;
__Pyx_RefNannySetupContext("find_projection", 0);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1271
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1270
* int* out_low, int* out_high):
* cdef int i
* for i from in_low <= i < in_high: # <<<<<<<<<<<<<<
@@ -49880,7 +49932,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++) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1272
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1271
* cdef int i
* for i from in_low <= i < in_high:
* if in_links_low[i] != -1: # <<<<<<<<<<<<<<
@@ -49890,7 +49942,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1273
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1272
* 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]: # <<<<<<<<<<<<<<
@@ -49906,7 +49958,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_find_projection(CYTHON_U
}
if (__pyx_t_4) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1274
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1273
* 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] # <<<<<<<<<<<<<<
@@ -49918,7 +49970,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_find_projection(CYTHON_U
}
__pyx_L6:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1275
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1274
* 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]: # <<<<<<<<<<<<<<
@@ -49934,7 +49986,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_find_projection(CYTHON_U
}
if (__pyx_t_3) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1276
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1275
* 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] # <<<<<<<<<<<<<<
@@ -49956,7 +50008,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_find_projection(CYTHON_U
return __pyx_r;
}
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1279
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1278
*
*
* cdef int* int_arr_extend(self, int* arr, int* arr_len, int* data, int data_len): # <<<<<<<<<<<<<<
@@ -49970,7 +50022,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTHON_UNUSED
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("int_arr_extend", 0);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1281
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1280
* 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 # <<<<<<<<<<<<<<
@@ -49979,7 +50031,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);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1282
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1281
* cdef int new_len
* new_len = arr_len[0] + data_len
* arr = <int*> realloc(arr, new_len*sizeof(int)) # <<<<<<<<<<<<<<
@@ -49988,7 +50040,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)))));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1283
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1282
* new_len = arr_len[0] + data_len
* arr = <int*> realloc(arr, new_len*sizeof(int))
* memcpy(arr+arr_len[0], data, data_len*sizeof(int)) # <<<<<<<<<<<<<<
@@ -49997,7 +50049,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))));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1284
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1283
* arr = <int*> realloc(arr, new_len*sizeof(int))
* memcpy(arr+arr_len[0], data, data_len*sizeof(int))
* arr_len[0] = new_len # <<<<<<<<<<<<<<
@@ -50006,7 +50058,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTHON_UNUSED
*/
(__pyx_v_arr_len[0]) = __pyx_v_new_len;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1285
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1284
* memcpy(arr+arr_len[0], data, data_len*sizeof(int))
* arr_len[0] = new_len
* return arr # <<<<<<<<<<<<<<
@@ -50022,7 +50074,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTHON_UNUSED
return __pyx_r;
}
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1288
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1287
*
*
* 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, # <<<<<<<<<<<<<<
@@ -50068,19 +50120,19 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("extract_phrases", 0);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1296
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1295
* cdef result
*
* result = [] # <<<<<<<<<<<<<<
* len1 = 0
* e_gaps1 = <int*> malloc(0)
*/
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1296; __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 = 1295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_result = ((PyObject *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1297
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1296
*
* result = []
* len1 = 0 # <<<<<<<<<<<<<<
@@ -50089,7 +50141,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_len1 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1298
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1297
* result = []
* len1 = 0
* e_gaps1 = <int*> malloc(0) # <<<<<<<<<<<<<<
@@ -50098,19 +50150,19 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_e_gaps1 = ((int *)malloc(0));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1299
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1298
* len1 = 0
* e_gaps1 = <int*> malloc(0)
* ephr_arr = IntList() # <<<<<<<<<<<<<<
*
* e_gap_order = <int*> malloc(num_gaps*sizeof(int))
*/
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1299; __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 = 1298; __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;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1301
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1300
* ephr_arr = IntList()
*
* e_gap_order = <int*> malloc(num_gaps*sizeof(int)) # <<<<<<<<<<<<<<
@@ -50119,7 +50171,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_e_gap_order = ((int *)malloc((__pyx_v_num_gaps * (sizeof(int)))));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1302
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1301
*
* e_gap_order = <int*> malloc(num_gaps*sizeof(int))
* if num_gaps > 0: # <<<<<<<<<<<<<<
@@ -50129,7 +50181,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_t_2 = (__pyx_v_num_gaps > 0);
if (__pyx_t_2) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1303
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1302
* e_gap_order = <int*> malloc(num_gaps*sizeof(int))
* if num_gaps > 0:
* e_gap_order[0] = 0 # <<<<<<<<<<<<<<
@@ -50138,7 +50190,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
(__pyx_v_e_gap_order[0]) = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1304
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1303
* if num_gaps > 0:
* e_gap_order[0] = 0
* for i from 1 <= i < num_gaps: # <<<<<<<<<<<<<<
@@ -50148,7 +50200,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++) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1305
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1304
* e_gap_order[0] = 0
* for i from 1 <= i < num_gaps:
* for j from 0 <= j < i: # <<<<<<<<<<<<<<
@@ -50158,7 +50210,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++) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1306
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1305
* for i from 1 <= i < num_gaps:
* for j from 0 <= j < i:
* if e_gap_low[i] < e_gap_low[j]: # <<<<<<<<<<<<<<
@@ -50168,7 +50220,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1307
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1306
* for j from 0 <= j < i:
* if e_gap_low[i] < e_gap_low[j]:
* for k from j <= k < i: # <<<<<<<<<<<<<<
@@ -50178,7 +50230,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++) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1308
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1307
* if e_gap_low[i] < e_gap_low[j]:
* for k from j <= k < i:
* e_gap_order[k+1] = e_gap_order[k] # <<<<<<<<<<<<<<
@@ -50188,7 +50240,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]);
}
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1309
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1308
* for k from j <= k < i:
* e_gap_order[k+1] = e_gap_order[k]
* e_gap_order[j] = i # <<<<<<<<<<<<<<
@@ -50197,7 +50249,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
(__pyx_v_e_gap_order[__pyx_v_j]) = __pyx_v_i;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1310
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1309
* e_gap_order[k+1] = e_gap_order[k]
* e_gap_order[j] = i
* break # <<<<<<<<<<<<<<
@@ -50211,7 +50263,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
}
/*else*/ {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1312
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1311
* break
* else:
* e_gap_order[i] = i # <<<<<<<<<<<<<<
@@ -50226,7 +50278,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
}
__pyx_L3:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1314
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1313
* e_gap_order[i] = i
*
* e_x_low = e_low # <<<<<<<<<<<<<<
@@ -50235,7 +50287,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_e_x_low = __pyx_v_e_low;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1315
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1314
*
* e_x_low = e_low
* e_x_high = e_high # <<<<<<<<<<<<<<
@@ -50244,7 +50296,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_e_x_high = __pyx_v_e_high;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1316
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1315
* e_x_low = e_low
* e_x_high = e_high
* if self.tight_phrases == 0: # <<<<<<<<<<<<<<
@@ -50254,7 +50306,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_t_2 = (__pyx_v_self->tight_phrases == 0);
if (__pyx_t_2) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1317
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1316
* e_x_high = e_high
* if self.tight_phrases == 0:
* while e_x_low > 0 and e_high - e_x_low < self.train_max_initial_size and e_links_low[e_x_low-1] == -1: # <<<<<<<<<<<<<<
@@ -50277,7 +50329,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
}
if (!__pyx_t_6) break;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1318
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1317
* if self.tight_phrases == 0:
* while e_x_low > 0 and e_high - e_x_low < self.train_max_initial_size and e_links_low[e_x_low-1] == -1:
* e_x_low = e_x_low - 1 # <<<<<<<<<<<<<<
@@ -50287,7 +50339,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_v_e_x_low = (__pyx_v_e_x_low - 1);
}
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1319
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1318
* 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: # <<<<<<<<<<<<<<
@@ -50310,7 +50362,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
}
if (!__pyx_t_2) break;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1320
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1319
* 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 # <<<<<<<<<<<<<<
@@ -50323,7 +50375,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
}
__pyx_L11:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1322
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1321
* e_x_high = e_x_high + 1
*
* for i from e_x_low <= i <= e_low: # <<<<<<<<<<<<<<
@@ -50333,7 +50385,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++) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1323
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1322
*
* for i from e_x_low <= i <= e_low:
* e_gaps1 = self.int_arr_extend(e_gaps1, &len1, &i, 1) # <<<<<<<<<<<<<<
@@ -50343,7 +50395,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);
}
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1325
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1324
* e_gaps1 = self.int_arr_extend(e_gaps1, &len1, &i, 1)
*
* for i from 0 <= i < num_gaps: # <<<<<<<<<<<<<<
@@ -50353,7 +50405,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++) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1326
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1325
*
* for i from 0 <= i < num_gaps:
* e_gaps2 = <int*> malloc(0) # <<<<<<<<<<<<<<
@@ -50362,7 +50414,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_e_gaps2 = ((int *)malloc(0));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1327
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1326
* for i from 0 <= i < num_gaps:
* e_gaps2 = <int*> malloc(0)
* len2 = 0 # <<<<<<<<<<<<<<
@@ -50371,7 +50423,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_len2 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1329
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1328
* len2 = 0
*
* j = e_gap_order[i] # <<<<<<<<<<<<<<
@@ -50380,7 +50432,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_j = (__pyx_v_e_gap_order[__pyx_v_i]);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1330
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1329
*
* j = e_gap_order[i]
* e_x_gap_low = e_gap_low[j] # <<<<<<<<<<<<<<
@@ -50389,7 +50441,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]);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1331
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1330
* j = e_gap_order[i]
* e_x_gap_low = e_gap_low[j]
* e_x_gap_high = e_gap_high[j] # <<<<<<<<<<<<<<
@@ -50398,7 +50450,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]);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1332
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1331
* e_x_gap_low = e_gap_low[j]
* e_x_gap_high = e_gap_high[j]
* if self.tight_phrases == 0: # <<<<<<<<<<<<<<
@@ -50408,7 +50460,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_t_2 = (__pyx_v_self->tight_phrases == 0);
if (__pyx_t_2) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1333
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1332
* e_x_gap_high = e_gap_high[j]
* if self.tight_phrases == 0:
* while e_x_gap_low > e_x_low and e_links_low[e_x_gap_low-1] == -1: # <<<<<<<<<<<<<<
@@ -50425,7 +50477,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
}
if (!__pyx_t_7) break;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1334
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1333
* if self.tight_phrases == 0:
* while e_x_gap_low > e_x_low and e_links_low[e_x_gap_low-1] == -1:
* e_x_gap_low = e_x_gap_low - 1 # <<<<<<<<<<<<<<
@@ -50435,7 +50487,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_v_e_x_gap_low = (__pyx_v_e_x_gap_low - 1);
}
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1335
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1334
* 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: # <<<<<<<<<<<<<<
@@ -50452,7 +50504,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
}
if (!__pyx_t_6) break;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1336
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1335
* 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 # <<<<<<<<<<<<<<
@@ -50465,7 +50517,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
}
__pyx_L20:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1338
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1337
* e_x_gap_high = e_x_gap_high + 1
*
* k = 0 # <<<<<<<<<<<<<<
@@ -50474,7 +50526,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_k = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1339
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1338
*
* k = 0
* step = 1+(i*2) # <<<<<<<<<<<<<<
@@ -50483,7 +50535,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_step = (1 + (__pyx_v_i * 2));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1340
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1339
* k = 0
* step = 1+(i*2)
* while k < len1: # <<<<<<<<<<<<<<
@@ -50494,7 +50546,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;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1341
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1340
* step = 1+(i*2)
* while k < len1:
* for m from e_x_gap_low <= m <= e_gap_low[j]: # <<<<<<<<<<<<<<
@@ -50504,7 +50556,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++) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1342
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1341
* while k < len1:
* for m from e_x_gap_low <= m <= e_gap_low[j]:
* if m >= e_gaps1[k+step-1]: # <<<<<<<<<<<<<<
@@ -50514,7 +50566,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1343
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1342
* 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: # <<<<<<<<<<<<<<
@@ -50524,7 +50576,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++) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1344
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1343
* 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 # <<<<<<<<<<<<<<
@@ -50534,7 +50586,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1345
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1344
* 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) # <<<<<<<<<<<<<<
@@ -50543,7 +50595,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);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1346
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1345
* 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) # <<<<<<<<<<<<<<
@@ -50552,7 +50604,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);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1347
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1346
* 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) # <<<<<<<<<<<<<<
@@ -50569,7 +50621,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_L29:;
}
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1348
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1347
* 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 # <<<<<<<<<<<<<<
@@ -50579,7 +50631,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_v_k = (__pyx_v_k + __pyx_v_step);
}
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1349
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1348
* e_gaps2 = self.int_arr_extend(e_gaps2, &len2, &n, 1)
* k = k + step
* free(e_gaps1) # <<<<<<<<<<<<<<
@@ -50588,7 +50640,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
free(__pyx_v_e_gaps1);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1350
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1349
* k = k + step
* free(e_gaps1)
* e_gaps1 = e_gaps2 # <<<<<<<<<<<<<<
@@ -50597,7 +50649,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_e_gaps1 = __pyx_v_e_gaps2;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1351
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1350
* free(e_gaps1)
* e_gaps1 = e_gaps2
* len1 = len2 # <<<<<<<<<<<<<<
@@ -50607,7 +50659,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_v_len1 = __pyx_v_len2;
}
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1353
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1352
* len1 = len2
*
* step = 1+(num_gaps*2) # <<<<<<<<<<<<<<
@@ -50616,7 +50668,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_step = (1 + (__pyx_v_num_gaps * 2));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1354
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1353
*
* step = 1+(num_gaps*2)
* e_gaps2 = <int*> malloc(0) # <<<<<<<<<<<<<<
@@ -50625,7 +50677,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_e_gaps2 = ((int *)malloc(0));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1355
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1354
* step = 1+(num_gaps*2)
* e_gaps2 = <int*> malloc(0)
* len2 = 0 # <<<<<<<<<<<<<<
@@ -50634,7 +50686,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_len2 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1356
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1355
* e_gaps2 = <int*> malloc(0)
* len2 = 0
* for i from e_high <= i <= e_x_high: # <<<<<<<<<<<<<<
@@ -50644,7 +50696,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++) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1357
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1356
* len2 = 0
* for i from e_high <= i <= e_x_high:
* j = 0 # <<<<<<<<<<<<<<
@@ -50653,7 +50705,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_j = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1358
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1357
* for i from e_high <= i <= e_x_high:
* j = 0
* while j < len1: # <<<<<<<<<<<<<<
@@ -50664,7 +50716,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;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1359
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1358
* j = 0
* while j < len1:
* if i - e_gaps1[j] <= self.train_max_initial_size and i >= e_gaps1[j+step-1]: # <<<<<<<<<<<<<<
@@ -50680,7 +50732,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
}
if (__pyx_t_2) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1360
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1359
* 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) # <<<<<<<<<<<<<<
@@ -50689,7 +50741,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);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1361
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1360
* 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) # <<<<<<<<<<<<<<
@@ -50701,7 +50753,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
}
__pyx_L37:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1362
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1361
* 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 # <<<<<<<<<<<<<<
@@ -50712,7 +50764,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
}
}
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1363
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1362
* e_gaps2 = self.int_arr_extend(e_gaps2, &len2, &i, 1)
* j = j + step
* free(e_gaps1) # <<<<<<<<<<<<<<
@@ -50721,7 +50773,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
free(__pyx_v_e_gaps1);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1364
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1363
* j = j + step
* free(e_gaps1)
* e_gaps1 = e_gaps2 # <<<<<<<<<<<<<<
@@ -50730,7 +50782,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_e_gaps1 = __pyx_v_e_gaps2;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1365
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1364
* free(e_gaps1)
* e_gaps1 = e_gaps2
* len1 = len2 # <<<<<<<<<<<<<<
@@ -50739,7 +50791,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_len1 = __pyx_v_len2;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1367
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1366
* len1 = len2
*
* step = (num_gaps+1)*2 # <<<<<<<<<<<<<<
@@ -50748,7 +50800,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_step = ((__pyx_v_num_gaps + 1) * 2);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1368
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1367
*
* step = (num_gaps+1)*2
* i = 0 # <<<<<<<<<<<<<<
@@ -50757,7 +50809,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_i = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1370
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1369
* i = 0
*
* while i < len1: # <<<<<<<<<<<<<<
@@ -50768,7 +50820,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;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1371
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1370
*
* while i < len1:
* ephr_arr._clear() # <<<<<<<<<<<<<<
@@ -50777,7 +50829,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);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1372
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1371
* while i < len1:
* ephr_arr._clear()
* num_chunks = 0 # <<<<<<<<<<<<<<
@@ -50786,20 +50838,20 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_num_chunks = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1373
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1372
* 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 = 1373; __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 = 1372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_XDECREF(((PyObject *)__pyx_v_indexes));
__pyx_v_indexes = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1374
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1373
* num_chunks = 0
* indexes = []
* for j from 0 <= j < num_gaps+1: # <<<<<<<<<<<<<<
@@ -50809,7 +50861,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++) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1375
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1374
* indexes = []
* for j from 0 <= j < num_gaps+1:
* if e_gaps1[i+2*j] < e_gaps1[i+(2*j)+1]: # <<<<<<<<<<<<<<
@@ -50819,7 +50871,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1376
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1375
* 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 # <<<<<<<<<<<<<<
@@ -50831,7 +50883,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
}
__pyx_L42:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1377
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1376
* 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]: # <<<<<<<<<<<<<<
@@ -50841,19 +50893,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++) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1378
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1377
* 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 = 1378; __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 = 1377; __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 = 1378; __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 = 1377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1379
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1378
* 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]]) # <<<<<<<<<<<<<<
@@ -50861,14 +50913,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 = 1379; __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 = 1378; __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 = 1379; __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 = 1378; __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);
}
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1380
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1379
* indexes.append(k)
* ephr_arr._append(self.eid2symid[self.eda.data.arr[e_sent_start+k]])
* if j < num_gaps: # <<<<<<<<<<<<<<
@@ -50878,19 +50930,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1381
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1380
* 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 = 1381; __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 = 1380; __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 = 1381; __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 = 1380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1382
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1381
* 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)) # <<<<<<<<<<<<<<
@@ -50903,7 +50955,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_L45:;
}
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1383
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1382
* 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 # <<<<<<<<<<<<<<
@@ -50912,7 +50964,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_i = (__pyx_v_i + __pyx_v_step);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1384
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1383
* 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: # <<<<<<<<<<<<<<
@@ -50928,22 +50980,22 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
}
if (__pyx_t_7) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1385
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1384
* 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 = 1385; __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 = 1384; __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 = 1385; __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 = 1384; __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 = 1385; __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 = 1384; __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);
@@ -50951,7 +51003,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 = 1385; __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 = 1384; __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;
@@ -50960,7 +51012,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_L46:;
}
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1387
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1386
* result.append((Phrase(ephr_arr),indexes))
*
* free(e_gaps1) # <<<<<<<<<<<<<<
@@ -50969,7 +51021,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
free(__pyx_v_e_gaps1);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1388
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1387
*
* free(e_gaps1)
* free(e_gap_order) # <<<<<<<<<<<<<<
@@ -50978,7 +51030,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
free(__pyx_v_e_gap_order);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1389
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1388
* free(e_gaps1)
* free(e_gap_order)
* return result # <<<<<<<<<<<<<<
@@ -51006,7 +51058,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
return __pyx_r;
}
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1391
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1390
* return result
*
* cdef IntList create_alignments(self, int* sent_links, int num_links, findexes, eindexes): # <<<<<<<<<<<<<<
@@ -51034,55 +51086,55 @@ static struct __pyx_obj_3_sa_IntList *__pyx_f_3_sa_23HieroCachingRuleFactory_cre
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("create_alignments", 0);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1393
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1392
* 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 = 1393; __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 = 1392; __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;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1394
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1393
* 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 = 1394; __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 = 1393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1395
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1394
* 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 = 1395; __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 = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_v_s);
__pyx_v_s = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1396
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1395
* 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 = 1396; __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 = 1396; __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 = 1395; __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 = 1395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_4) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1397
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1396
* s = findexes[i]
* if (s<0):
* continue # <<<<<<<<<<<<<<
@@ -51094,7 +51146,7 @@ static struct __pyx_obj_3_sa_IntList *__pyx_f_3_sa_23HieroCachingRuleFactory_cre
}
__pyx_L5:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1398
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1397
* if (s<0):
* continue
* idx = 0 # <<<<<<<<<<<<<<
@@ -51105,7 +51157,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;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1399
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1398
* continue
* idx = 0
* while (idx < num_links*2): # <<<<<<<<<<<<<<
@@ -51113,51 +51165,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 = 1399; __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 = 1398; __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 = 1399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_RichCompare(__pyx_v_idx, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1398; __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 = 1399; __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 = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (!__pyx_t_4) break;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1400
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1399
* 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 = 1400; __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 = 1400; __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 = 1399; __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 = 1399; __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 = 1400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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 = 1399; __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 = 1400; __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 = 1399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_4) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1401
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1400
* 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 = 1401; __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 = 1400; __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 = 1401; __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 = 1400; __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 = 1401; __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 = 1400; __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 = 1401; __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 = 1400; __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 = 1401; __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 = 1400; __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 = 1401; __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 = 1400; __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;
@@ -51165,19 +51217,19 @@ static struct __pyx_obj_3_sa_IntList *__pyx_f_3_sa_23HieroCachingRuleFactory_cre
__pyx_v_j = __pyx_t_5;
__pyx_t_5 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1402
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1401
* 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 = 1402; __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 = 1401; __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 = 1402; __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 = 1401; __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 = 1402; __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 = 1401; __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;
@@ -51185,14 +51237,14 @@ static struct __pyx_obj_3_sa_IntList *__pyx_f_3_sa_23HieroCachingRuleFactory_cre
}
__pyx_L8:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1403
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1402
* 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 = 1403; __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 = 1402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_v_idx);
__pyx_v_idx = __pyx_t_5;
@@ -51201,7 +51253,7 @@ static struct __pyx_obj_3_sa_IntList *__pyx_f_3_sa_23HieroCachingRuleFactory_cre
__pyx_L3_continue:;
}
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1404
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1403
* ret.append(i*65536+j)
* idx += 2
* return ret # <<<<<<<<<<<<<<
@@ -51231,7 +51283,7 @@ static struct __pyx_obj_3_sa_IntList *__pyx_f_3_sa_23HieroCachingRuleFactory_cre
return __pyx_r;
}
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1406
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1405
* return ret
*
* cdef extract(self, Phrase phrase, Matching* matching, int* chunklen, int num_chunks): # <<<<<<<<<<<<<<
@@ -51325,19 +51377,19 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("extract", 0);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1419
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1418
* 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 = 1419; __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 = 1418; __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;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1420
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1419
*
* fphr_arr = IntList()
* phrase_len = phrase.n # <<<<<<<<<<<<<<
@@ -51346,19 +51398,19 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_phrase_len = __pyx_v_phrase->n;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1421
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1420
* 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 = 1421; __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 = 1420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_extracts = ((PyObject *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1422
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1421
* phrase_len = phrase.n
* extracts = []
* sent_links = self.alignment._get_sent_links(matching.sent_id, &num_links) # <<<<<<<<<<<<<<
@@ -51367,7 +51419,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));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1424
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1423
* sent_links = self.alignment._get_sent_links(matching.sent_id, &num_links)
*
* e_sent_start = self.eda.sent_index.arr[matching.sent_id] # <<<<<<<<<<<<<<
@@ -51376,7 +51428,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]);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1425
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1424
*
* e_sent_start = self.eda.sent_index.arr[matching.sent_id]
* e_sent_end = self.eda.sent_index.arr[matching.sent_id+1] # <<<<<<<<<<<<<<
@@ -51385,7 +51437,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)]);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1426
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1425
* 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 # <<<<<<<<<<<<<<
@@ -51394,7 +51446,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);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1427
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1426
* 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] # <<<<<<<<<<<<<<
@@ -51403,7 +51455,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]);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1428
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1427
* 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] # <<<<<<<<<<<<<<
@@ -51412,7 +51464,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)]);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1429
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1428
* 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 # <<<<<<<<<<<<<<
@@ -51421,21 +51473,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);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1431
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1430
* 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 = 1431; __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 = 1430; __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 = 1431; __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 = 1430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1432
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1431
*
* self.findexes1.reset()
* sofar = 0 # <<<<<<<<<<<<<<
@@ -51445,7 +51497,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_INCREF(__pyx_int_0);
__pyx_v_sofar = __pyx_int_0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1433
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1432
* self.findexes1.reset()
* sofar = 0
* for i in range(num_chunks): # <<<<<<<<<<<<<<
@@ -51456,7 +51508,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;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1434
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1433
* sofar = 0
* for i in range(num_chunks):
* for j in range(chunklen[i]): # <<<<<<<<<<<<<<
@@ -51467,35 +51519,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;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1435
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1434
* for i in range(num_chunks):
* for j in range(chunklen[i]):
* self.findexes1.append(matching.arr[matching.start+i]+j-f_sent_start); # <<<<<<<<<<<<<<
* sofar += 1
* if (i+1<num_chunks):
*/
- __pyx_t_2 = PyInt_FromLong((((__pyx_v_matching->arr[(__pyx_v_matching->start + __pyx_v_i)]) + __pyx_v_j) - __pyx_v_f_sent_start)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1435; __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 = 1434; __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 = 1435; __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 = 1434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1436
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1435
* for j in range(chunklen[i]):
* self.findexes1.append(matching.arr[matching.start+i]+j-f_sent_start);
* sofar += 1 # <<<<<<<<<<<<<<
* if (i+1<num_chunks):
* self.findexes1.append(phrase[sofar])
*/
- __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_sofar, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_sofar, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_v_sofar);
__pyx_v_sofar = __pyx_t_1;
__pyx_t_1 = 0;
}
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1437
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1436
* self.findexes1.append(matching.arr[matching.start+i]+j-f_sent_start);
* sofar += 1
* if (i+1<num_chunks): # <<<<<<<<<<<<<<
@@ -51505,28 +51557,28 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_7 = ((__pyx_v_i + 1) < __pyx_v_num_chunks);
if (__pyx_t_7) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1438
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1437
* sofar += 1
* if (i+1<num_chunks):
* self.findexes1.append(phrase[sofar]) # <<<<<<<<<<<<<<
* sofar += 1
*
*/
- __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_phrase), __pyx_v_sofar); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_phrase), __pyx_v_sofar); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes1), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1438; __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 = 1437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1439
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1438
* if (i+1<num_chunks):
* self.findexes1.append(phrase[sofar])
* sofar += 1 # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_sofar, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_sofar, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_v_sofar);
__pyx_v_sofar = __pyx_t_2;
@@ -51536,7 +51588,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_L7:;
}
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1442
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1441
*
*
* e_links_low = <int*> malloc(e_sent_len*sizeof(int)) # <<<<<<<<<<<<<<
@@ -51545,7 +51597,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)))));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1443
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1442
*
* e_links_low = <int*> malloc(e_sent_len*sizeof(int))
* e_links_high = <int*> malloc(e_sent_len*sizeof(int)) # <<<<<<<<<<<<<<
@@ -51554,7 +51606,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)))));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1444
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1443
* e_links_low = <int*> malloc(e_sent_len*sizeof(int))
* e_links_high = <int*> malloc(e_sent_len*sizeof(int))
* f_links_low = <int*> malloc(f_sent_len*sizeof(int)) # <<<<<<<<<<<<<<
@@ -51563,7 +51615,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)))));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1445
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1444
* e_links_high = <int*> malloc(e_sent_len*sizeof(int))
* f_links_low = <int*> malloc(f_sent_len*sizeof(int))
* f_links_high = <int*> malloc(f_sent_len*sizeof(int)) # <<<<<<<<<<<<<<
@@ -51572,7 +51624,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)))));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1446
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1445
* f_links_low = <int*> malloc(f_sent_len*sizeof(int))
* f_links_high = <int*> malloc(f_sent_len*sizeof(int))
* f_gap_low = <int*> malloc((num_chunks+1)*sizeof(int)) # <<<<<<<<<<<<<<
@@ -51581,7 +51633,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)))));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1447
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1446
* f_links_high = <int*> malloc(f_sent_len*sizeof(int))
* f_gap_low = <int*> malloc((num_chunks+1)*sizeof(int))
* f_gap_high = <int*> malloc((num_chunks+1)*sizeof(int)) # <<<<<<<<<<<<<<
@@ -51590,7 +51642,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)))));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1448
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1447
* f_gap_low = <int*> malloc((num_chunks+1)*sizeof(int))
* f_gap_high = <int*> malloc((num_chunks+1)*sizeof(int))
* e_gap_low = <int*> malloc((num_chunks+1)*sizeof(int)) # <<<<<<<<<<<<<<
@@ -51599,7 +51651,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)))));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1449
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1448
* f_gap_high = <int*> malloc((num_chunks+1)*sizeof(int))
* e_gap_low = <int*> malloc((num_chunks+1)*sizeof(int))
* e_gap_high = <int*> malloc((num_chunks+1)*sizeof(int)) # <<<<<<<<<<<<<<
@@ -51608,7 +51660,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)))));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1450
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1449
* e_gap_low = <int*> malloc((num_chunks+1)*sizeof(int))
* e_gap_high = <int*> malloc((num_chunks+1)*sizeof(int))
* memset(f_gap_low, 0, (num_chunks+1)*sizeof(int)) # <<<<<<<<<<<<<<
@@ -51617,7 +51669,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))));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1451
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1450
* e_gap_high = <int*> malloc((num_chunks+1)*sizeof(int))
* memset(f_gap_low, 0, (num_chunks+1)*sizeof(int))
* memset(f_gap_high, 0, (num_chunks+1)*sizeof(int)) # <<<<<<<<<<<<<<
@@ -51626,7 +51678,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))));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1452
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1451
* 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)) # <<<<<<<<<<<<<<
@@ -51635,7 +51687,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))));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1453
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1452
* 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)) # <<<<<<<<<<<<<<
@@ -51644,7 +51696,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))));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1455
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1454
* memset(e_gap_high, 0, (num_chunks+1)*sizeof(int))
*
* reason_for_failure = "" # <<<<<<<<<<<<<<
@@ -51654,7 +51706,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);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1457
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1456
* reason_for_failure = ""
*
* for i from 0 <= i < e_sent_len: # <<<<<<<<<<<<<<
@@ -51664,7 +51716,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++) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1458
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1457
*
* for i from 0 <= i < e_sent_len:
* e_links_low[i] = -1 # <<<<<<<<<<<<<<
@@ -51673,7 +51725,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
(__pyx_v_e_links_low[__pyx_v_i]) = -1;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1459
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1458
* for i from 0 <= i < e_sent_len:
* e_links_low[i] = -1
* e_links_high[i] = -1 # <<<<<<<<<<<<<<
@@ -51683,7 +51735,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
(__pyx_v_e_links_high[__pyx_v_i]) = -1;
}
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1460
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1459
* e_links_low[i] = -1
* e_links_high[i] = -1
* for i from 0 <= i < f_sent_len: # <<<<<<<<<<<<<<
@@ -51693,7 +51745,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++) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1461
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1460
* e_links_high[i] = -1
* for i from 0 <= i < f_sent_len:
* f_links_low[i] = -1 # <<<<<<<<<<<<<<
@@ -51702,7 +51754,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
(__pyx_v_f_links_low[__pyx_v_i]) = -1;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1462
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1461
* for i from 0 <= i < f_sent_len:
* f_links_low[i] = -1
* f_links_high[i] = -1 # <<<<<<<<<<<<<<
@@ -51712,7 +51764,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
(__pyx_v_f_links_high[__pyx_v_i]) = -1;
}
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1468
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1467
* # links that we care about (but then how to look up
* # when we want to check something on the e side?)
* i = 0 # <<<<<<<<<<<<<<
@@ -51721,7 +51773,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_i = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1469
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1468
* # when we want to check something on the e side?)
* i = 0
* while i < num_links*2: # <<<<<<<<<<<<<<
@@ -51732,7 +51784,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;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1470
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1469
* i = 0
* while i < num_links*2:
* f_i = sent_links[i] # <<<<<<<<<<<<<<
@@ -51741,7 +51793,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_f_i = (__pyx_v_sent_links[__pyx_v_i]);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1471
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1470
* while i < num_links*2:
* f_i = sent_links[i]
* e_i = sent_links[i+1] # <<<<<<<<<<<<<<
@@ -51750,7 +51802,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_e_i = (__pyx_v_sent_links[(__pyx_v_i + 1)]);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1472
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1471
* 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: # <<<<<<<<<<<<<<
@@ -51766,7 +51818,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_9) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1473
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1472
* 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 # <<<<<<<<<<<<<<
@@ -51778,7 +51830,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L14:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1474
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1473
* 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: # <<<<<<<<<<<<<<
@@ -51794,7 +51846,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_8) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1475
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1474
* 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 # <<<<<<<<<<<<<<
@@ -51806,7 +51858,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L15:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1476
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1475
* 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: # <<<<<<<<<<<<<<
@@ -51822,7 +51874,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_7) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1477
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1476
* 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 # <<<<<<<<<<<<<<
@@ -51834,7 +51886,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L16:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1478
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1477
* 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: # <<<<<<<<<<<<<<
@@ -51850,7 +51902,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_9) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1479
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1478
* 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 # <<<<<<<<<<<<<<
@@ -51862,7 +51914,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L17:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1480
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1479
* 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 # <<<<<<<<<<<<<<
@@ -51872,19 +51924,19 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_v_i = (__pyx_v_i + 2);
}
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1482
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1481
* 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 = 1482; __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 = 1481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_als = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1483
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1482
*
* als = []
* for x in range(matching.start,matching.end): # <<<<<<<<<<<<<<
@@ -51895,18 +51947,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;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1484
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1483
* 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 = 1484; __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 = 1483; __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 = 1484; __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 = 1483; __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 = 1484; __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 = 1483; __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);
@@ -51918,17 +51970,17 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_v_al = __pyx_t_10;
__pyx_t_10 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1485
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1484
* 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 = 1485; __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 = 1484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1487
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1486
* als.append(al)
* # check all source-side alignment constraints
* met_constraints = 1 # <<<<<<<<<<<<<<
@@ -51937,7 +51989,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_met_constraints = 1;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1488
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1487
* # check all source-side alignment constraints
* met_constraints = 1
* if self.require_aligned_terminal: # <<<<<<<<<<<<<<
@@ -51946,7 +51998,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
if (__pyx_v_self->require_aligned_terminal) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1489
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1488
* met_constraints = 1
* if self.require_aligned_terminal:
* num_aligned_chunks = 0 # <<<<<<<<<<<<<<
@@ -51955,7 +52007,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_num_aligned_chunks = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1490
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1489
* if self.require_aligned_terminal:
* num_aligned_chunks = 0
* for i from 0 <= i < num_chunks: # <<<<<<<<<<<<<<
@@ -51965,7 +52017,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++) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1491
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1490
* num_aligned_chunks = 0
* for i from 0 <= i < num_chunks:
* for j from 0 <= j < chunklen[i]: # <<<<<<<<<<<<<<
@@ -51975,7 +52027,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++) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1492
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1491
* 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: # <<<<<<<<<<<<<<
@@ -51985,7 +52037,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1493
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1492
* 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 # <<<<<<<<<<<<<<
@@ -51994,7 +52046,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_num_aligned_chunks = (__pyx_v_num_aligned_chunks + 1);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1494
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1493
* if f_links_low[matching.arr[matching.start+i]+j-f_sent_start] > -1:
* num_aligned_chunks = num_aligned_chunks + 1
* break # <<<<<<<<<<<<<<
@@ -52009,7 +52061,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_L24_break:;
}
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1495
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1494
* num_aligned_chunks = num_aligned_chunks + 1
* break
* if num_aligned_chunks == 0: # <<<<<<<<<<<<<<
@@ -52019,7 +52071,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1496
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1495
* break
* if num_aligned_chunks == 0:
* reason_for_failure = "No aligned terminals" # <<<<<<<<<<<<<<
@@ -52030,7 +52082,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);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1497
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1496
* if num_aligned_chunks == 0:
* reason_for_failure = "No aligned terminals"
* met_constraints = 0 # <<<<<<<<<<<<<<
@@ -52042,7 +52094,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L26:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1498
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1497
* reason_for_failure = "No aligned terminals"
* met_constraints = 0
* if self.require_aligned_chunks and num_aligned_chunks < num_chunks: # <<<<<<<<<<<<<<
@@ -52057,7 +52109,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_7) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1499
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1498
* met_constraints = 0
* if self.require_aligned_chunks and num_aligned_chunks < num_chunks:
* reason_for_failure = "Unaligned chunk" # <<<<<<<<<<<<<<
@@ -52068,7 +52120,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);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1500
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1499
* if self.require_aligned_chunks and num_aligned_chunks < num_chunks:
* reason_for_failure = "Unaligned chunk"
* met_constraints = 0 # <<<<<<<<<<<<<<
@@ -52083,7 +52135,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L20:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1502
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1501
* met_constraints = 0
*
* if met_constraints and self.tight_phrases: # <<<<<<<<<<<<<<
@@ -52097,7 +52149,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_7) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1504
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1503
* if met_constraints and self.tight_phrases:
* # outside edge constraints are checked later
* for i from 0 <= i < num_chunks-1: # <<<<<<<<<<<<<<
@@ -52107,7 +52159,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++) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1505
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1504
* # 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: # <<<<<<<<<<<<<<
@@ -52117,7 +52169,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_7 = ((__pyx_v_f_links_low[(((__pyx_v_matching->arr[(__pyx_v_matching->start + __pyx_v_i)]) + (__pyx_v_chunklen[__pyx_v_i])) - __pyx_v_f_sent_start)]) == -1);
if (__pyx_t_7) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1506
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1505
* 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" # <<<<<<<<<<<<<<
@@ -52128,7 +52180,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);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1507
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1506
* 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 # <<<<<<<<<<<<<<
@@ -52137,7 +52189,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_met_constraints = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1508
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1507
* reason_for_failure = "Gaps are not tight phrases"
* met_constraints = 0
* break # <<<<<<<<<<<<<<
@@ -52149,7 +52201,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L31:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1509
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1508
* met_constraints = 0
* break
* if f_links_low[matching.arr[matching.start+i+1]-1-f_sent_start] == -1: # <<<<<<<<<<<<<<
@@ -52159,7 +52211,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_7 = ((__pyx_v_f_links_low[(((__pyx_v_matching->arr[((__pyx_v_matching->start + __pyx_v_i) + 1)]) - 1) - __pyx_v_f_sent_start)]) == -1);
if (__pyx_t_7) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1510
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1509
* break
* if f_links_low[matching.arr[matching.start+i+1]-1-f_sent_start] == -1:
* reason_for_failure = "Gaps are not tight phrases" # <<<<<<<<<<<<<<
@@ -52170,7 +52222,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);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1511
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1510
* 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 # <<<<<<<<<<<<<<
@@ -52179,7 +52231,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_met_constraints = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1512
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1511
* reason_for_failure = "Gaps are not tight phrases"
* met_constraints = 0
* break # <<<<<<<<<<<<<<
@@ -52196,7 +52248,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L28:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1514
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1513
* break
*
* f_low = matching.arr[matching.start] - f_sent_start # <<<<<<<<<<<<<<
@@ -52205,7 +52257,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);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1515
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1514
*
* 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 # <<<<<<<<<<<<<<
@@ -52214,7 +52266,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);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1516
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1515
* 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: # <<<<<<<<<<<<<<
@@ -52223,17 +52275,17 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
if (__pyx_v_met_constraints) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1518
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1517
* 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 = 1518; __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 = 1517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1522
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1521
* 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): # <<<<<<<<<<<<<<
@@ -52244,7 +52296,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1523
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1522
* self.train_min_gap_size, 0,
* self.max_nonterminals - num_chunks + 1, 1, 1, 0, 0):
* gap_error = 0 # <<<<<<<<<<<<<<
@@ -52253,7 +52305,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_gap_error = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1524
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1523
* self.max_nonterminals - num_chunks + 1, 1, 1, 0, 0):
* gap_error = 0
* num_gaps = 0 # <<<<<<<<<<<<<<
@@ -52262,7 +52314,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_num_gaps = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1526
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1525
* num_gaps = 0
*
* if f_back_low < f_low: # <<<<<<<<<<<<<<
@@ -52272,7 +52324,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1527
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1526
*
* if f_back_low < f_low:
* f_gap_low[0] = f_back_low # <<<<<<<<<<<<<<
@@ -52281,7 +52333,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
(__pyx_v_f_gap_low[0]) = __pyx_v_f_back_low;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1528
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1527
* if f_back_low < f_low:
* f_gap_low[0] = f_back_low
* f_gap_high[0] = f_low # <<<<<<<<<<<<<<
@@ -52290,7 +52342,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
(__pyx_v_f_gap_high[0]) = __pyx_v_f_low;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1529
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1528
* f_gap_low[0] = f_back_low
* f_gap_high[0] = f_low
* num_gaps = 1 # <<<<<<<<<<<<<<
@@ -52299,7 +52351,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_num_gaps = 1;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1530
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1529
* f_gap_high[0] = f_low
* num_gaps = 1
* gap_start = 0 # <<<<<<<<<<<<<<
@@ -52308,7 +52360,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_gap_start = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1531
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1530
* num_gaps = 1
* gap_start = 0
* phrase_len = phrase_len+1 # <<<<<<<<<<<<<<
@@ -52317,7 +52369,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_phrase_len = (__pyx_v_phrase_len + 1);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1532
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1531
* gap_start = 0
* phrase_len = phrase_len+1
* if phrase_len > self.max_length: # <<<<<<<<<<<<<<
@@ -52327,7 +52379,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1533
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1532
* phrase_len = phrase_len+1
* if phrase_len > self.max_length:
* gap_error = 1 # <<<<<<<<<<<<<<
@@ -52339,7 +52391,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L36:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1534
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1533
* if phrase_len > self.max_length:
* gap_error = 1
* if self.tight_phrases: # <<<<<<<<<<<<<<
@@ -52348,7 +52400,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
if (__pyx_v_self->tight_phrases) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1535
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1534
* gap_error = 1
* if self.tight_phrases:
* if f_links_low[f_back_low] == -1 or f_links_low[f_low-1] == -1: # <<<<<<<<<<<<<<
@@ -52364,7 +52416,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_8) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1536
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1535
* if self.tight_phrases:
* if f_links_low[f_back_low] == -1 or f_links_low[f_low-1] == -1:
* gap_error = 1 # <<<<<<<<<<<<<<
@@ -52373,7 +52425,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_gap_error = 1;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1537
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1536
* 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" # <<<<<<<<<<<<<<
@@ -52393,7 +52445,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
/*else*/ {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1539
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1538
* reason_for_failure = "Inside edges of preceding subphrase are not tight"
* else:
* gap_start = 1 # <<<<<<<<<<<<<<
@@ -52402,7 +52454,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_gap_start = 1;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1540
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1539
* else:
* gap_start = 1
* if self.tight_phrases and f_links_low[f_low] == -1: # <<<<<<<<<<<<<<
@@ -52417,7 +52469,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_7) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1543
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1542
* # 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 # <<<<<<<<<<<<<<
@@ -52431,7 +52483,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L35:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1545
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1544
* met_constraints = 0
*
* for i from 0 <= i < matching.size - 1: # <<<<<<<<<<<<<<
@@ -52441,7 +52493,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++) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1546
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1545
*
* for i from 0 <= i < matching.size - 1:
* f_gap_low[1+i] = matching.arr[matching.start+i] + chunklen[i] - f_sent_start # <<<<<<<<<<<<<<
@@ -52450,7 +52502,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);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1547
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1546
* 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 # <<<<<<<<<<<<<<
@@ -52459,7 +52511,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);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1548
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1547
* 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 # <<<<<<<<<<<<<<
@@ -52469,7 +52521,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_v_num_gaps = (__pyx_v_num_gaps + 1);
}
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1550
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1549
* num_gaps = num_gaps + 1
*
* if f_high < f_back_high: # <<<<<<<<<<<<<<
@@ -52479,7 +52531,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_7 = (__pyx_v_f_high < __pyx_v_f_back_high);
if (__pyx_t_7) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1551
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1550
*
* if f_high < f_back_high:
* f_gap_low[gap_start+num_gaps] = f_high # <<<<<<<<<<<<<<
@@ -52488,7 +52540,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;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1552
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1551
* 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 # <<<<<<<<<<<<<<
@@ -52497,7 +52549,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;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1553
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1552
* f_gap_low[gap_start+num_gaps] = f_high
* f_gap_high[gap_start+num_gaps] = f_back_high
* num_gaps = num_gaps + 1 # <<<<<<<<<<<<<<
@@ -52506,7 +52558,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_num_gaps = (__pyx_v_num_gaps + 1);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1554
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1553
* f_gap_high[gap_start+num_gaps] = f_back_high
* num_gaps = num_gaps + 1
* phrase_len = phrase_len+1 # <<<<<<<<<<<<<<
@@ -52515,7 +52567,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_phrase_len = (__pyx_v_phrase_len + 1);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1555
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1554
* num_gaps = num_gaps + 1
* phrase_len = phrase_len+1
* if phrase_len > self.max_length: # <<<<<<<<<<<<<<
@@ -52525,7 +52577,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1556
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1555
* phrase_len = phrase_len+1
* if phrase_len > self.max_length:
* gap_error = 1 # <<<<<<<<<<<<<<
@@ -52537,7 +52589,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L43:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1557
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1556
* if phrase_len > self.max_length:
* gap_error = 1
* if self.tight_phrases: # <<<<<<<<<<<<<<
@@ -52546,7 +52598,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
if (__pyx_v_self->tight_phrases) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1558
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1557
* gap_error = 1
* if self.tight_phrases:
* if f_links_low[f_back_high-1] == -1 or f_links_low[f_high] == -1: # <<<<<<<<<<<<<<
@@ -52562,7 +52614,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_9) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1559
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1558
* if self.tight_phrases:
* if f_links_low[f_back_high-1] == -1 or f_links_low[f_high] == -1:
* gap_error = 1 # <<<<<<<<<<<<<<
@@ -52571,7 +52623,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_gap_error = 1;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1560
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1559
* 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" # <<<<<<<<<<<<<<
@@ -52591,7 +52643,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
/*else*/ {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1562
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1561
* reason_for_failure = "Inside edges of following subphrase are not tight"
* else:
* if self.tight_phrases and f_links_low[f_high-1] == -1: # <<<<<<<<<<<<<<
@@ -52606,7 +52658,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_7) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1563
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1562
* else:
* if self.tight_phrases and f_links_low[f_high-1] == -1:
* met_constraints = 0 # <<<<<<<<<<<<<<
@@ -52620,7 +52672,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L42:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1565
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1564
* met_constraints = 0
*
* if gap_error == 0: # <<<<<<<<<<<<<<
@@ -52630,7 +52682,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_7 = (__pyx_v_gap_error == 0);
if (__pyx_t_7) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1566
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1565
*
* if gap_error == 0:
* e_word_count = e_high - e_low # <<<<<<<<<<<<<<
@@ -52639,7 +52691,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);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1567
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1566
* if gap_error == 0:
* e_word_count = e_high - e_low
* for i from 0 <= i < num_gaps: # check integrity of subphrases # <<<<<<<<<<<<<<
@@ -52649,17 +52701,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++) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1568
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1567
* 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 = 1568; __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 = 1567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1573
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1572
* 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, # <<<<<<<<<<<<<<
@@ -52670,7 +52722,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
if (__pyx_t_7) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1575
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1574
* self.train_max_initial_size, self.train_max_initial_size,
* 0, 0, 0, 0, 0, 0, 0) == 0:
* gap_error = 1 # <<<<<<<<<<<<<<
@@ -52679,18 +52731,18 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_gap_error = 1;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1576
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1575
* 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 = 1576; __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 = 1575; __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 = 1576; __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 = 1575; __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 = 1576; __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 = 1575; __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);
@@ -52698,14 +52750,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 = 1576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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 = 1575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_v_reason_for_failure);
__pyx_v_reason_for_failure = ((PyObject *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1577
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1576
* 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 # <<<<<<<<<<<<<<
@@ -52722,7 +52774,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L47:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1579
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1578
* break
*
* if gap_error == 0: # <<<<<<<<<<<<<<
@@ -52732,7 +52784,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_7 = (__pyx_v_gap_error == 0);
if (__pyx_t_7) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1580
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1579
*
* if gap_error == 0:
* i = 1 # <<<<<<<<<<<<<<
@@ -52741,21 +52793,21 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_i = 1;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1581
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1580
* 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 = 1581; __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 = 1580; __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 = 1581; __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 = 1580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1582
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1581
* i = 1
* self.findexes.reset()
* if f_back_low < f_low: # <<<<<<<<<<<<<<
@@ -52765,7 +52817,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1583
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1582
* self.findexes.reset()
* if f_back_low < f_low:
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -52774,7 +52826,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));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1584
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1583
* if f_back_low < f_low:
* fphr_arr._append(sym_setindex(self.category, i))
* i = i+1 # <<<<<<<<<<<<<<
@@ -52783,16 +52835,16 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_i = (__pyx_v_i + 1);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1585
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1584
* 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 = 1585; __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 = 1584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_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 = 1584; __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;
@@ -52800,27 +52852,27 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L52:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1586
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1585
* 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 = 1586; __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 = 1585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1585; __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 = 1586; __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 = 1585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1587
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1586
* self.findexes.append(sym_setindex(self.category, i))
* self.findexes.extend(self.findexes1)
* for j from 0 <= j < phrase.n: # <<<<<<<<<<<<<<
@@ -52830,7 +52882,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++) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1588
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1587
* self.findexes.extend(self.findexes1)
* for j from 0 <= j < phrase.n:
* if sym_isvar(phrase.syms[j]): # <<<<<<<<<<<<<<
@@ -52840,7 +52892,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1589
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1588
* for j from 0 <= j < phrase.n:
* if sym_isvar(phrase.syms[j]):
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -52849,7 +52901,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));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1590
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1589
* if sym_isvar(phrase.syms[j]):
* fphr_arr._append(sym_setindex(self.category, i))
* i = i + 1 # <<<<<<<<<<<<<<
@@ -52861,7 +52913,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
/*else*/ {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1592
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1591
* i = i + 1
* else:
* fphr_arr._append(phrase.syms[j]) # <<<<<<<<<<<<<<
@@ -52873,7 +52925,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_L55:;
}
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1593
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1592
* else:
* fphr_arr._append(phrase.syms[j])
* if f_back_high > f_high: # <<<<<<<<<<<<<<
@@ -52883,7 +52935,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1594
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1593
* fphr_arr._append(phrase.syms[j])
* if f_back_high > f_high:
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -52892,16 +52944,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));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1595
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1594
* 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 = 1595; __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 = 1594; __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 = 1595; __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 = 1594; __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;
@@ -52909,25 +52961,25 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L56:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1597
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1596
* 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 = 1597; __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 = 1596; __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 = 1597; __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 = 1596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__pyx_v_fphr = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_10);
__pyx_t_10 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1598
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1597
*
* fphr = Phrase(fphr_arr)
* if met_constraints: # <<<<<<<<<<<<<<
@@ -52936,47 +52988,47 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
if (__pyx_v_met_constraints) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1601
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1600
* 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 = 1599; __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 = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__pyx_v_phrase_list = __pyx_t_10;
__pyx_t_10 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1602
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1601
* 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 = 1602; __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 = 1601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_7 = (__pyx_t_13 > 0);
if (__pyx_t_7) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1603
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1602
* 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 = 1603; __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 = 1602; __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 = 1603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_v_pair_count = (1.0 / __pyx_t_13);
goto __pyx_L58;
}
/*else*/ {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1605
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1604
* pair_count = 1.0 / len(phrase_list)
* else:
* pair_count = 0 # <<<<<<<<<<<<<<
@@ -52985,22 +53037,22 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_pair_count = 0.0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1606
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1605
* 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 = 1606; __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 = 1605; __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 = 1606; __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 = 1605; __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 = 1606; __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 = 1605; __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 = 1606; __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 = 1605; __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 = 1606; __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 = 1605; __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);
@@ -53014,7 +53066,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 = 1606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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 = 1605; __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);
@@ -53023,7 +53075,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L58:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1607
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1606
* 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: # <<<<<<<<<<<<<<
@@ -53034,7 +53086,7 @@ 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 = 1607; __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 = 1606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__pyx_t_16 = Py_TYPE(__pyx_t_14)->tp_iternext;
}
@@ -53042,23 +53094,23 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
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 = 1607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_15); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1606; __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 = 1607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PySequence_ITEM(__pyx_t_14, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_14)) {
if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_14)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_15 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_15); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_15); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1606; __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 = 1607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PySequence_ITEM(__pyx_t_14, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1606; __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 = 1607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -53074,7 +53126,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
@@ -53087,14 +53139,14 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__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 = 1607; __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 = 1607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1606; __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 = 1606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
} else
{
Py_ssize_t index = -1;
- __pyx_t_10 = PyObject_GetIter(__pyx_t_15); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1607; __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 = 1606; __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;
@@ -53102,7 +53154,7 @@ 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 = 1607; __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 = 1606; __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;
@@ -53110,7 +53162,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_17 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L62_unpacking_done:;
}
__Pyx_XDECREF(__pyx_v_phrase2);
@@ -53120,7 +53172,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_v_eindexes = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1608
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1607
* 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) # <<<<<<<<<<<<<<
@@ -53129,31 +53181,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 = 1608; __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 = 1607; __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;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1609
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1608
* for (phrase2,eindexes) in phrase_list:
* als1 = self.create_alignments(sent_links,num_links,self.findexes,eindexes)
* extracts.append((fphr, phrase2, pair_count, tuple(als1))) # <<<<<<<<<<<<<<
*
* if (num_gaps < self.max_nonterminals and
*/
- __pyx_t_2 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1609; __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 = 1608; __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 = 1609; __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 = 1608; __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 = 1609; __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 = 1608; __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 = 1609; __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 = 1608; __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));
@@ -53167,7 +53219,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 = 1609; __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 = 1608; __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;
@@ -53177,7 +53229,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L57:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1611
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1610
* extracts.append((fphr, phrase2, pair_count, tuple(als1)))
*
* if (num_gaps < self.max_nonterminals and # <<<<<<<<<<<<<<
@@ -53187,7 +53239,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_7 = (__pyx_v_num_gaps < __pyx_v_self->max_nonterminals);
if (__pyx_t_7) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1612
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1611
*
* if (num_gaps < self.max_nonterminals and
* phrase_len < self.max_length and # <<<<<<<<<<<<<<
@@ -53197,7 +53249,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1613
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1612
* 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): # <<<<<<<<<<<<<<
@@ -53215,7 +53267,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_9) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1614
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1613
* 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 # <<<<<<<<<<<<<<
@@ -53225,7 +53277,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1615
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1614
* 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 # <<<<<<<<<<<<<<
@@ -53235,7 +53287,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_7 = (__pyx_v_f_low >= __pyx_v_self->train_min_gap_size);
if (__pyx_t_7) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1616
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1615
* 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))): # <<<<<<<<<<<<<<
@@ -53265,7 +53317,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_7) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1617
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1616
* 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 # <<<<<<<<<<<<<<
@@ -53274,7 +53326,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);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1618
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1617
* ((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 # <<<<<<<<<<<<<<
@@ -53283,7 +53335,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_met_constraints = 1;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1619
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1618
* f_x_low = f_low-self.train_min_gap_size
* met_constraints = 1
* if self.tight_phrases: # <<<<<<<<<<<<<<
@@ -53292,7 +53344,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
if (__pyx_v_self->tight_phrases) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1620
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1619
* met_constraints = 1
* if self.tight_phrases:
* while f_x_low >= 0 and f_links_low[f_x_low] == -1: # <<<<<<<<<<<<<<
@@ -53309,7 +53361,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (!__pyx_t_18) break;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1621
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1620
* if self.tight_phrases:
* while f_x_low >= 0 and f_links_low[f_x_low] == -1:
* f_x_low = f_x_low - 1 # <<<<<<<<<<<<<<
@@ -53322,7 +53374,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L65:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1622
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1621
* 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: # <<<<<<<<<<<<<<
@@ -53338,7 +53390,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_9) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1623
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1622
* 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 # <<<<<<<<<<<<<<
@@ -53350,7 +53402,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L68:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1625
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1624
* met_constraints = 0
*
* if (met_constraints and # <<<<<<<<<<<<<<
@@ -53359,17 +53411,17 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
if (__pyx_v_met_constraints) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1626
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1625
*
* if (met_constraints and
* self.find_fixpoint(f_x_low, f_back_high, # <<<<<<<<<<<<<<
* f_links_low, f_links_high, e_links_low, e_links_high,
* e_low, e_high, &e_x_low, &e_x_high, &f_x_low, &f_x_high,
*/
- __pyx_t_14 = PyInt_FromLong(__pyx_v_f_back_high); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1626; __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 = 1625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1630
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1629
* 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, # <<<<<<<<<<<<<<
@@ -53379,7 +53431,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;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1632
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1631
* 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 # <<<<<<<<<<<<<<
@@ -53395,17 +53447,17 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_7) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1633
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1632
* 1, 1, 1, 1, 0, 1, 0) and
* ((not self.tight_phrases) or f_links_low[f_x_low] != -1) and
* self.find_fixpoint(f_x_low, f_low, # check integrity of new subphrase # <<<<<<<<<<<<<<
* f_links_low, f_links_high, e_links_low, e_links_high,
* -1, -1, e_gap_low, e_gap_high, f_gap_low, f_gap_high,
*/
- __pyx_t_1 = PyInt_FromLong(__pyx_v_f_low); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1633; __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 = 1632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1637
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1636
* -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, # <<<<<<<<<<<<<<
@@ -53428,7 +53480,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_9) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1639
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1638
* self.train_max_initial_size, self.train_max_initial_size,
* 0, 0, 0, 0, 0, 0, 0)):
* fphr_arr._clear() # <<<<<<<<<<<<<<
@@ -53437,7 +53489,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);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1640
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1639
* 0, 0, 0, 0, 0, 0, 0)):
* fphr_arr._clear()
* i = 1 # <<<<<<<<<<<<<<
@@ -53446,35 +53498,35 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_i = 1;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1641
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1640
* 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 = 1641; __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 = 1640; __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 = 1641; __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 = 1640; __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;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1642
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1641
* 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 = 1642; __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 = 1641; __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 = 1642; __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 = 1641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1643
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1642
* self.findexes.reset()
* self.findexes.append(sym_setindex(self.category, i))
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -53483,7 +53535,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));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1644
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1643
* self.findexes.append(sym_setindex(self.category, i))
* fphr_arr._append(sym_setindex(self.category, i))
* i = i+1 # <<<<<<<<<<<<<<
@@ -53492,27 +53544,27 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_i = (__pyx_v_i + 1);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1645
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1644
* fphr_arr._append(sym_setindex(self.category, i))
* 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 = 1645; __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 = 1644; __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 = 1645; __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 = 1644; __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 = 1645; __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 = 1644; __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;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1646
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1645
* i = i+1
* self.findexes.extend(self.findexes1)
* for j from 0 <= j < phrase.n: # <<<<<<<<<<<<<<
@@ -53522,7 +53574,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++) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1647
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1646
* self.findexes.extend(self.findexes1)
* for j from 0 <= j < phrase.n:
* if sym_isvar(phrase.syms[j]): # <<<<<<<<<<<<<<
@@ -53532,7 +53584,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1648
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1647
* for j from 0 <= j < phrase.n:
* if sym_isvar(phrase.syms[j]):
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -53541,7 +53593,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));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1649
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1648
* if sym_isvar(phrase.syms[j]):
* fphr_arr._append(sym_setindex(self.category, i))
* i = i + 1 # <<<<<<<<<<<<<<
@@ -53553,7 +53605,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
/*else*/ {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1651
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1650
* i = i + 1
* else:
* fphr_arr._append(phrase.syms[j]) # <<<<<<<<<<<<<<
@@ -53565,7 +53617,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_L72:;
}
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1652
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1651
* else:
* fphr_arr._append(phrase.syms[j])
* if f_back_high > f_high: # <<<<<<<<<<<<<<
@@ -53575,7 +53627,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1653
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1652
* fphr_arr._append(phrase.syms[j])
* if f_back_high > f_high:
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -53584,16 +53636,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));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1654
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1653
* 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 = 1654; __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 = 1653; __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 = 1654; __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 = 1653; __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;
@@ -53601,67 +53653,67 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L73:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1655
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1654
* 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 = 1655; __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 = 1654; __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 = 1655; __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 = 1654; __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;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1658
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1657
* 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 = 1656; __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 = 1655; __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;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1659
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1658
* 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 = 1659; __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 = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_9 = (__pyx_t_13 > 0);
if (__pyx_t_9) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1660
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1659
* 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 = 1660; __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 = 1659; __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 = 1660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_v_pair_count = (1.0 / __pyx_t_13);
goto __pyx_L74;
}
/*else*/ {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1662
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1661
* pair_count = 1.0 / len(phrase_list)
* else:
* pair_count = 0 # <<<<<<<<<<<<<<
@@ -53672,7 +53724,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L74:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1663
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1662
* else:
* pair_count = 0
* for phrase2,eindexes in phrase_list: # <<<<<<<<<<<<<<
@@ -53683,7 +53735,7 @@ 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 = 1663; __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 = 1662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__pyx_t_16 = Py_TYPE(__pyx_t_15)->tp_iternext;
}
@@ -53691,23 +53743,23 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
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 = 1663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_GET_ITEM(__pyx_t_15, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1662; __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 = 1663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_15, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_15)) {
if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_15)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_15, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_15, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1662; __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 = 1663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_15, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1662; __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 = 1663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -53723,7 +53775,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
@@ -53736,14 +53788,14 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__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 = 1663; __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 = 1663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1662; __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 = 1662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
} else
{
Py_ssize_t index = -1;
- __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1663; __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 = 1662; __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;
@@ -53751,7 +53803,7 @@ 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 = 1663; __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 = 1662; __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;
@@ -53759,7 +53811,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_17 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L78_unpacking_done:;
}
__Pyx_XDECREF(__pyx_v_phrase2);
@@ -53769,7 +53821,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_v_eindexes = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1664
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1663
* pair_count = 0
* for phrase2,eindexes in phrase_list:
* als2 = self.create_alignments(sent_links,num_links,self.findexes,eindexes) # <<<<<<<<<<<<<<
@@ -53778,31 +53830,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 = 1664; __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 = 1663; __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;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1665
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1664
* 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 = 1665; __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 = 1664; __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 = 1665; __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 = 1664; __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 = 1665; __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 = 1664; __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 = 1665; __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 = 1664; __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));
@@ -53816,7 +53868,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 = 1665; __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 = 1664; __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;
@@ -53829,7 +53881,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L64:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1667
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1666
* extracts.append((fphr, phrase2, pair_count, tuple(als2)))
*
* if (f_back_high == f_high and # <<<<<<<<<<<<<<
@@ -53839,7 +53891,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1668
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1667
*
* if (f_back_high == f_high and
* f_sent_len - f_high >= self.train_min_gap_size and # <<<<<<<<<<<<<<
@@ -53849,7 +53901,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_7 = ((__pyx_v_f_sent_len - __pyx_v_f_high) >= __pyx_v_self->train_min_gap_size);
if (__pyx_t_7) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1669
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1668
* 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))): # <<<<<<<<<<<<<<
@@ -53879,7 +53931,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_7) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1670
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1669
* 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 # <<<<<<<<<<<<<<
@@ -53888,7 +53940,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);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1671
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1670
* ((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 # <<<<<<<<<<<<<<
@@ -53897,7 +53949,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_met_constraints = 1;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1672
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1671
* f_x_high = f_high+self.train_min_gap_size
* met_constraints = 1
* if self.tight_phrases: # <<<<<<<<<<<<<<
@@ -53906,7 +53958,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
if (__pyx_v_self->tight_phrases) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1673
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1672
* met_constraints = 1
* if self.tight_phrases:
* while f_x_high <= f_sent_len and f_links_low[f_x_high-1] == -1: # <<<<<<<<<<<<<<
@@ -53923,7 +53975,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (!__pyx_t_18) break;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1674
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1673
* 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 # <<<<<<<<<<<<<<
@@ -53936,7 +53988,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L80:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1675
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1674
* 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: # <<<<<<<<<<<<<<
@@ -53952,7 +54004,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_9) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1676
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1675
* 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 # <<<<<<<<<<<<<<
@@ -53964,7 +54016,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L83:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1678
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1677
* met_constraints = 0
*
* if (met_constraints and # <<<<<<<<<<<<<<
@@ -53973,17 +54025,17 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
if (__pyx_v_met_constraints) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1679
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1678
*
* 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 = 1679; __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 = 1678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1683
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1682
* 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, # <<<<<<<<<<<<<<
@@ -53993,7 +54045,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;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1685
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1684
* 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 # <<<<<<<<<<<<<<
@@ -54009,17 +54061,17 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_7) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1686
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1685
* 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 = 1686; __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 = 1685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1691
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1690
* 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, # <<<<<<<<<<<<<<
@@ -54042,7 +54094,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_9) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1693
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1692
* self.train_max_initial_size, self.train_max_initial_size,
* 0, 0, 0, 0, 0, 0, 0)):
* fphr_arr._clear() # <<<<<<<<<<<<<<
@@ -54051,7 +54103,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);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1694
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1693
* 0, 0, 0, 0, 0, 0, 0)):
* fphr_arr._clear()
* i = 1 # <<<<<<<<<<<<<<
@@ -54060,21 +54112,21 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_i = 1;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1695
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1694
* 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 = 1695; __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 = 1694; __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 = 1695; __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 = 1694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1696
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1695
* i = 1
* self.findexes.reset()
* if f_back_low < f_low: # <<<<<<<<<<<<<<
@@ -54084,7 +54136,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1697
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1696
* self.findexes.reset()
* if f_back_low < f_low:
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -54093,7 +54145,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));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1698
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1697
* if f_back_low < f_low:
* fphr_arr._append(sym_setindex(self.category, i))
* i = i+1 # <<<<<<<<<<<<<<
@@ -54102,16 +54154,16 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_i = (__pyx_v_i + 1);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1699
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1698
* fphr_arr._append(sym_setindex(self.category, i))
* 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 = 1699; __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 = 1698; __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 = 1699; __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 = 1698; __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;
@@ -54119,27 +54171,27 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L85:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1700
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1699
* 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 = 1700; __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 = 1699; __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 = 1700; __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 = 1699; __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 = 1700; __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 = 1699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1701
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1700
* self.findexes.append(sym_setindex(self.category, i))
* self.findexes.extend(self.findexes1)
* for j from 0 <= j < phrase.n: # <<<<<<<<<<<<<<
@@ -54149,7 +54201,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++) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1702
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1701
* self.findexes.extend(self.findexes1)
* for j from 0 <= j < phrase.n:
* if sym_isvar(phrase.syms[j]): # <<<<<<<<<<<<<<
@@ -54159,7 +54211,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1703
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1702
* for j from 0 <= j < phrase.n:
* if sym_isvar(phrase.syms[j]):
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -54168,7 +54220,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));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1704
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1703
* if sym_isvar(phrase.syms[j]):
* fphr_arr._append(sym_setindex(self.category, i))
* i = i + 1 # <<<<<<<<<<<<<<
@@ -54180,7 +54232,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
/*else*/ {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1706
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1705
* i = i + 1
* else:
* fphr_arr._append(phrase.syms[j]) # <<<<<<<<<<<<<<
@@ -54192,7 +54244,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_L88:;
}
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1707
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1706
* else:
* fphr_arr._append(phrase.syms[j])
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -54201,81 +54253,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));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1708
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1707
* 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 = 1708; __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 = 1707; __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 = 1708; __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 = 1707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1709
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1708
* 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 = 1709; __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 = 1708; __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 = 1709; __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 = 1708; __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;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1712
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1711
* 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 = 1710; __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 = 1709; __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;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1713
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1712
* 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 = 1713; __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 = 1712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_9 = (__pyx_t_13 > 0);
if (__pyx_t_9) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1714
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1713
* 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 = 1714; __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 = 1713; __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 = 1714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_v_pair_count = (1.0 / __pyx_t_13);
goto __pyx_L89;
}
/*else*/ {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1716
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1715
* pair_count = 1.0 / len(phrase_list)
* else:
* pair_count = 0 # <<<<<<<<<<<<<<
@@ -54286,7 +54338,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L89:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1717
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1716
* else:
* pair_count = 0
* for phrase2, eindexes in phrase_list: # <<<<<<<<<<<<<<
@@ -54297,7 +54349,7 @@ 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 = 1717; __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 = 1716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_16 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -54305,23 +54357,23 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
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 = 1717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_13); __Pyx_INCREF(__pyx_t_14); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1716; __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 = 1717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PySequence_ITEM(__pyx_t_1, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_14 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_13); __Pyx_INCREF(__pyx_t_14); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_13); __Pyx_INCREF(__pyx_t_14); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1716; __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 = 1717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PySequence_ITEM(__pyx_t_1, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1716; __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 = 1717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -54337,7 +54389,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
@@ -54350,14 +54402,14 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__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 = 1717; __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 = 1717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1716; __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 = 1716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
} else
{
Py_ssize_t index = -1;
- __pyx_t_10 = PyObject_GetIter(__pyx_t_14); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1717; __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 = 1716; __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;
@@ -54365,7 +54417,7 @@ 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 = 1717; __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 = 1716; __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;
@@ -54373,7 +54425,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_17 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L93_unpacking_done:;
}
__Pyx_XDECREF(__pyx_v_phrase2);
@@ -54383,7 +54435,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_v_eindexes = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1718
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1717
* pair_count = 0
* for phrase2, eindexes in phrase_list:
* als3 = self.create_alignments(sent_links,num_links,self.findexes,eindexes) # <<<<<<<<<<<<<<
@@ -54392,31 +54444,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 = 1718; __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 = 1717; __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;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1719
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1718
* 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 = 1719; __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 = 1718; __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 = 1719; __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 = 1718; __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 = 1719; __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 = 1718; __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 = 1719; __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 = 1718; __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));
@@ -54430,7 +54482,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 = 1719; __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 = 1718; __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;
@@ -54443,7 +54495,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L79:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1720
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1719
* 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 # <<<<<<<<<<<<<<
@@ -54453,7 +54505,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_9 = (__pyx_v_num_gaps < (__pyx_v_self->max_nonterminals - 1));
if (__pyx_t_9) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1721
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1720
* extracts.append((fphr, phrase2, pair_count, tuple(als3)))
* if (num_gaps < self.max_nonterminals - 1 and
* phrase_len+1 < self.max_length and # <<<<<<<<<<<<<<
@@ -54463,7 +54515,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_7 = ((__pyx_v_phrase_len + 1) < __pyx_v_self->max_length);
if (__pyx_t_7) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1722
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1721
* if (num_gaps < self.max_nonterminals - 1 and
* phrase_len+1 < self.max_length and
* f_back_high == f_high and # <<<<<<<<<<<<<<
@@ -54473,7 +54525,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1723
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1722
* phrase_len+1 < self.max_length and
* f_back_high == f_high and
* f_back_low == f_low and # <<<<<<<<<<<<<<
@@ -54483,7 +54535,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1724
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1723
* 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 # <<<<<<<<<<<<<<
@@ -54493,7 +54545,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1725
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1724
* 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 # <<<<<<<<<<<<<<
@@ -54503,7 +54555,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1726
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1725
* 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 # <<<<<<<<<<<<<<
@@ -54513,7 +54565,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1727
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1726
* 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))): # <<<<<<<<<<<<<<
@@ -54563,7 +54615,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_7) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1729
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1728
* ((not self.tight_phrases) or (f_links_low[f_low-1] != -1 and f_links_low[f_high] != -1))):
*
* met_constraints = 1 # <<<<<<<<<<<<<<
@@ -54572,7 +54624,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_met_constraints = 1;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1730
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1729
*
* met_constraints = 1
* f_x_low = f_low-self.train_min_gap_size # <<<<<<<<<<<<<<
@@ -54581,7 +54633,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);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1731
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1730
* met_constraints = 1
* f_x_low = f_low-self.train_min_gap_size
* if self.tight_phrases: # <<<<<<<<<<<<<<
@@ -54590,7 +54642,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
if (__pyx_v_self->tight_phrases) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1732
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1731
* 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: # <<<<<<<<<<<<<<
@@ -54607,7 +54659,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (!__pyx_t_18) break;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1733
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1732
* if self.tight_phrases:
* while f_x_low >= 0 and f_links_low[f_x_low] == -1:
* f_x_low = f_x_low - 1 # <<<<<<<<<<<<<<
@@ -54620,7 +54672,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L95:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1734
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1733
* 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: # <<<<<<<<<<<<<<
@@ -54630,7 +54682,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1735
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1734
* f_x_low = f_x_low - 1
* if f_x_low < 0:
* met_constraints = 0 # <<<<<<<<<<<<<<
@@ -54642,7 +54694,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L98:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1737
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1736
* met_constraints = 0
*
* f_x_high = f_high+self.train_min_gap_size # <<<<<<<<<<<<<<
@@ -54651,7 +54703,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);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1738
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1737
*
* f_x_high = f_high+self.train_min_gap_size
* if self.tight_phrases: # <<<<<<<<<<<<<<
@@ -54660,7 +54712,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
if (__pyx_v_self->tight_phrases) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1739
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1738
* 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: # <<<<<<<<<<<<<<
@@ -54677,7 +54729,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (!__pyx_t_9) break;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1740
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1739
* 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 # <<<<<<<<<<<<<<
@@ -54690,7 +54742,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L99:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1741
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1740
* 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: # <<<<<<<<<<<<<<
@@ -54706,7 +54758,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_7) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1742
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1741
* 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 # <<<<<<<<<<<<<<
@@ -54718,7 +54770,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L102:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1744
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1743
* met_constraints = 0
*
* if (met_constraints and # <<<<<<<<<<<<<<
@@ -54727,17 +54779,17 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
if (__pyx_v_met_constraints) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1745
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1744
*
* 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 = 1745; __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 = 1744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1749
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1748
* 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, # <<<<<<<<<<<<<<
@@ -54747,7 +54799,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_1, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_e_low, __pyx_v_e_high, (&__pyx_v_e_x_low), (&__pyx_v_e_x_high), (&__pyx_v_f_x_low), (&__pyx_v_f_x_high), __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, 1, 1, 2, 1, 1, 1, 1)) {
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1751
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1750
* self.train_max_initial_size, self.train_max_initial_size,
* 1, 1, 2, 1, 1, 1, 1) and
* ((not self.tight_phrases) or (f_links_low[f_x_low] != -1 and f_links_low[f_x_high-1] != -1)) and # <<<<<<<<<<<<<<
@@ -54769,17 +54821,17 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_9) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1752
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1751
* 1, 1, 2, 1, 1, 1, 1) and
* ((not self.tight_phrases) or (f_links_low[f_x_low] != -1 and f_links_low[f_x_high-1] != -1)) and
* self.find_fixpoint(f_x_low, f_low, # <<<<<<<<<<<<<<
* f_links_low, f_links_high, e_links_low, e_links_high,
* -1, -1, e_gap_low, e_gap_high, f_gap_low, f_gap_high,
*/
- __pyx_t_15 = PyInt_FromLong(__pyx_v_f_low); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyInt_FromLong(__pyx_v_f_low); 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);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1756
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1755
* -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, # <<<<<<<<<<<<<<
@@ -54790,17 +54842,17 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
if (__pyx_t_3) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1758
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1757
* 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_15 = PyInt_FromLong(__pyx_v_f_x_high); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyInt_FromLong(__pyx_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);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1763
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1762
* 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, # <<<<<<<<<<<<<<
@@ -54828,7 +54880,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_8) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1765
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1764
* self.train_max_initial_size, self.train_max_initial_size,
* 0, 0, 0, 0, 0, 0, 0)):
* fphr_arr._clear() # <<<<<<<<<<<<<<
@@ -54837,7 +54889,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);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1766
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1765
* 0, 0, 0, 0, 0, 0, 0)):
* fphr_arr._clear()
* i = 1 # <<<<<<<<<<<<<<
@@ -54846,35 +54898,35 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_i = 1;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1767
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1766
* 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 = 1767; __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 = 1766; __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 = 1767; __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 = 1766; __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;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1768
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1767
* 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 = 1768; __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 = 1767; __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 = 1768; __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 = 1767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1769
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1768
* self.findexes.reset()
* self.findexes.append(sym_setindex(self.category, i))
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -54883,7 +54935,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));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1770
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1769
* self.findexes.append(sym_setindex(self.category, i))
* fphr_arr._append(sym_setindex(self.category, i))
* i = i+1 # <<<<<<<<<<<<<<
@@ -54892,27 +54944,27 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_i = (__pyx_v_i + 1);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1771
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1770
* 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 = 1771; __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 = 1770; __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 = 1771; __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 = 1770; __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 = 1771; __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 = 1770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1772
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1771
* i = i+1
* self.findexes.extend(self.findexes1)
* for j from 0 <= j < phrase.n: # <<<<<<<<<<<<<<
@@ -54922,7 +54974,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++) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1773
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1772
* self.findexes.extend(self.findexes1)
* for j from 0 <= j < phrase.n:
* if sym_isvar(phrase.syms[j]): # <<<<<<<<<<<<<<
@@ -54932,7 +54984,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) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1774
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1773
* for j from 0 <= j < phrase.n:
* if sym_isvar(phrase.syms[j]):
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -54941,7 +54993,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));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1775
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1774
* if sym_isvar(phrase.syms[j]):
* fphr_arr._append(sym_setindex(self.category, i))
* i = i + 1 # <<<<<<<<<<<<<<
@@ -54953,7 +55005,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
/*else*/ {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1777
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1776
* i = i + 1
* else:
* fphr_arr._append(phrase.syms[j]) # <<<<<<<<<<<<<<
@@ -54965,7 +55017,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_L106:;
}
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1778
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1777
* else:
* fphr_arr._append(phrase.syms[j])
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -54974,81 +55026,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));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1779
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1778
* 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 = 1779; __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 = 1778; __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 = 1779; __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 = 1778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1780
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1779
* 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 = 1780; __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 = 1779; __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 = 1780; __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 = 1779; __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;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1783
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1782
* 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 = 1781; __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 = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__Pyx_XDECREF(__pyx_v_phrase_list);
__pyx_v_phrase_list = __pyx_t_14;
__pyx_t_14 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1784
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1783
* 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 = 1784; __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 = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_8 = (__pyx_t_13 > 0);
if (__pyx_t_8) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1785
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1784
* 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 = 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 = 1784; __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 = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_v_pair_count = (1.0 / __pyx_t_13);
goto __pyx_L107;
}
/*else*/ {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1787
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1786
* pair_count = 1.0 / len(phrase_list)
* else:
* pair_count = 0 # <<<<<<<<<<<<<<
@@ -55059,7 +55111,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L107:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1788
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1787
* else:
* pair_count = 0
* for phrase2, eindexes in phrase_list: # <<<<<<<<<<<<<<
@@ -55070,7 +55122,7 @@ 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 = 1788; __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 = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__pyx_t_16 = Py_TYPE(__pyx_t_14)->tp_iternext;
}
@@ -55078,23 +55130,23 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
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 = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_15); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1787; __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 = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PySequence_ITEM(__pyx_t_14, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_14)) {
if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_14)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_15 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_15); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_15); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1787; __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 = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PySequence_ITEM(__pyx_t_14, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1787; __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 = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -55110,7 +55162,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
@@ -55123,14 +55175,14 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__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 = 1788; __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 = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1787; __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 = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
} else
{
Py_ssize_t index = -1;
- __pyx_t_10 = PyObject_GetIter(__pyx_t_15); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1788; __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 = 1787; __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;
@@ -55138,7 +55190,7 @@ 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 = 1788; __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 = 1787; __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;
@@ -55146,7 +55198,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_17 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L111_unpacking_done:;
}
__Pyx_XDECREF(__pyx_v_phrase2);
@@ -55156,7 +55208,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_v_eindexes = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1789
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1788
* pair_count = 0
* for phrase2, eindexes in phrase_list:
* als4 = self.create_alignments(sent_links,num_links,self.findexes,eindexes) # <<<<<<<<<<<<<<
@@ -55165,31 +55217,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 = 1789; __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 = 1788; __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;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1790
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1789
* 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 = 1790; __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 = 1789; __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 = 1790; __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 = 1789; __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 = 1790; __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 = 1789; __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 = 1790; __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 = 1789; __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));
@@ -55203,7 +55255,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 = 1790; __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 = 1789; __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;
@@ -55225,7 +55277,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
/*else*/ {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1792
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1791
* extracts.append((fphr, phrase2, pair_count, tuple(als4)))
* else:
* reason_for_failure = "Unable to extract basic phrase" # <<<<<<<<<<<<<<
@@ -55241,7 +55293,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L33:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1794
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1793
* reason_for_failure = "Unable to extract basic phrase"
*
* free(sent_links) # <<<<<<<<<<<<<<
@@ -55250,7 +55302,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
free(__pyx_v_sent_links);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1795
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1794
*
* free(sent_links)
* free(f_links_low) # <<<<<<<<<<<<<<
@@ -55259,7 +55311,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
free(__pyx_v_f_links_low);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1796
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1795
* free(sent_links)
* free(f_links_low)
* free(f_links_high) # <<<<<<<<<<<<<<
@@ -55268,7 +55320,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
free(__pyx_v_f_links_high);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1797
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1796
* free(f_links_low)
* free(f_links_high)
* free(e_links_low) # <<<<<<<<<<<<<<
@@ -55277,7 +55329,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
free(__pyx_v_e_links_low);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1798
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1797
* free(f_links_high)
* free(e_links_low)
* free(e_links_high) # <<<<<<<<<<<<<<
@@ -55286,7 +55338,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
free(__pyx_v_e_links_high);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1799
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1798
* free(e_links_low)
* free(e_links_high)
* free(f_gap_low) # <<<<<<<<<<<<<<
@@ -55295,7 +55347,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
free(__pyx_v_f_gap_low);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1800
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1799
* free(e_links_high)
* free(f_gap_low)
* free(f_gap_high) # <<<<<<<<<<<<<<
@@ -55304,7 +55356,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
free(__pyx_v_f_gap_high);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1801
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1800
* free(f_gap_low)
* free(f_gap_high)
* free(e_gap_low) # <<<<<<<<<<<<<<
@@ -55313,7 +55365,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
free(__pyx_v_e_gap_low);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1802
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1801
* free(f_gap_high)
* free(e_gap_low)
* free(e_gap_high) # <<<<<<<<<<<<<<
@@ -55322,7 +55374,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
free(__pyx_v_e_gap_high);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1804
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1803
* free(e_gap_high)
*
* return extracts # <<<<<<<<<<<<<<
@@ -57566,24 +57618,41 @@ static int __pyx_tp_clear_3_sa_DataArray(PyObject *o) {
return 0;
}
+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, CYTHON_UNUSED void *x) {
+ if (v) {
+ return __pyx_pw_3_sa_9DataArray_4data_3__set__(o, v);
+ }
+ else {
+ return __pyx_pw_3_sa_9DataArray_4data_5__del__(o);
+ }
+}
+
static PyMethodDef __pyx_methods_3_sa_DataArray[] = {
- {__Pyx_NAMESTR("get_data"), (PyCFunction)__pyx_pw_3_sa_9DataArray_5get_data, METH_NOARGS, __Pyx_DOCSTR(0)},
- {__Pyx_NAMESTR("get_sentence_id"), (PyCFunction)__pyx_pw_3_sa_9DataArray_7get_sentence_id, METH_O, __Pyx_DOCSTR(0)},
- {__Pyx_NAMESTR("get_sentence"), (PyCFunction)__pyx_pw_3_sa_9DataArray_9get_sentence, METH_O, __Pyx_DOCSTR(0)},
- {__Pyx_NAMESTR("get_sentence_position"), (PyCFunction)__pyx_pw_3_sa_9DataArray_11get_sentence_position, METH_O, __Pyx_DOCSTR(0)},
- {__Pyx_NAMESTR("get_id"), (PyCFunction)__pyx_pw_3_sa_9DataArray_13get_id, METH_O, __Pyx_DOCSTR(0)},
- {__Pyx_NAMESTR("get_word"), (PyCFunction)__pyx_pw_3_sa_9DataArray_15get_word, METH_O, __Pyx_DOCSTR(0)},
- {__Pyx_NAMESTR("write_text"), (PyCFunction)__pyx_pw_3_sa_9DataArray_17write_text, METH_O, __Pyx_DOCSTR(0)},
- {__Pyx_NAMESTR("read_text"), (PyCFunction)__pyx_pw_3_sa_9DataArray_19read_text, METH_O, __Pyx_DOCSTR(0)},
- {__Pyx_NAMESTR("read_bitext"), (PyCFunction)__pyx_pw_3_sa_9DataArray_21read_bitext, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
- {__Pyx_NAMESTR("read_text_data"), (PyCFunction)__pyx_pw_3_sa_9DataArray_23read_text_data, METH_O, __Pyx_DOCSTR(0)},
- {__Pyx_NAMESTR("read_binary"), (PyCFunction)__pyx_pw_3_sa_9DataArray_25read_binary, METH_O, __Pyx_DOCSTR(0)},
- {__Pyx_NAMESTR("write_binary"), (PyCFunction)__pyx_pw_3_sa_9DataArray_27write_binary, METH_O, __Pyx_DOCSTR(0)},
- {__Pyx_NAMESTR("write_enhanced_handle"), (PyCFunction)__pyx_pw_3_sa_9DataArray_29write_enhanced_handle, METH_O, __Pyx_DOCSTR(0)},
- {__Pyx_NAMESTR("write_enhanced"), (PyCFunction)__pyx_pw_3_sa_9DataArray_31write_enhanced, METH_O, __Pyx_DOCSTR(0)},
+ {__Pyx_NAMESTR("get_sentence_id"), (PyCFunction)__pyx_pw_3_sa_9DataArray_5get_sentence_id, METH_O, __Pyx_DOCSTR(0)},
+ {__Pyx_NAMESTR("get_sentence"), (PyCFunction)__pyx_pw_3_sa_9DataArray_7get_sentence, METH_O, __Pyx_DOCSTR(0)},
+ {__Pyx_NAMESTR("get_sentence_position"), (PyCFunction)__pyx_pw_3_sa_9DataArray_9get_sentence_position, METH_O, __Pyx_DOCSTR(0)},
+ {__Pyx_NAMESTR("get_id"), (PyCFunction)__pyx_pw_3_sa_9DataArray_11get_id, METH_O, __Pyx_DOCSTR(0)},
+ {__Pyx_NAMESTR("get_word"), (PyCFunction)__pyx_pw_3_sa_9DataArray_13get_word, METH_O, __Pyx_DOCSTR(0)},
+ {__Pyx_NAMESTR("write_text"), (PyCFunction)__pyx_pw_3_sa_9DataArray_15write_text, METH_O, __Pyx_DOCSTR(0)},
+ {__Pyx_NAMESTR("read_text"), (PyCFunction)__pyx_pw_3_sa_9DataArray_17read_text, METH_O, __Pyx_DOCSTR(0)},
+ {__Pyx_NAMESTR("read_bitext"), (PyCFunction)__pyx_pw_3_sa_9DataArray_19read_bitext, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
+ {__Pyx_NAMESTR("read_text_data"), (PyCFunction)__pyx_pw_3_sa_9DataArray_21read_text_data, METH_O, __Pyx_DOCSTR(0)},
+ {__Pyx_NAMESTR("read_binary"), (PyCFunction)__pyx_pw_3_sa_9DataArray_23read_binary, METH_O, __Pyx_DOCSTR(0)},
+ {__Pyx_NAMESTR("write_binary"), (PyCFunction)__pyx_pw_3_sa_9DataArray_25write_binary, METH_O, __Pyx_DOCSTR(0)},
+ {__Pyx_NAMESTR("write_enhanced_handle"), (PyCFunction)__pyx_pw_3_sa_9DataArray_27write_enhanced_handle, METH_O, __Pyx_DOCSTR(0)},
+ {__Pyx_NAMESTR("write_enhanced"), (PyCFunction)__pyx_pw_3_sa_9DataArray_29write_enhanced, METH_O, __Pyx_DOCSTR(0)},
{0, 0, 0, 0}
};
+static struct PyGetSetDef __pyx_getsets_3_sa_DataArray[] = {
+ {(char *)"data", __pyx_getprop_3_sa_9DataArray_data, __pyx_setprop_3_sa_9DataArray_data, 0, 0},
+ {0, 0, 0, 0, 0}
+};
+
static PyNumberMethods __pyx_tp_as_number_DataArray = {
0, /*nb_add*/
0, /*nb_subtract*/
@@ -57716,7 +57785,7 @@ static PyTypeObject __pyx_type_3_sa_DataArray = {
0, /*tp_iternext*/
__pyx_methods_3_sa_DataArray, /*tp_methods*/
0, /*tp_members*/
- 0, /*tp_getset*/
+ __pyx_getsets_3_sa_DataArray, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
@@ -66007,6 +66076,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s__fphrase, __pyx_k__fphrase, sizeof(__pyx_k__fphrase), 0, 0, 1, 1},
{&__pyx_n_s__from_binary, __pyx_k__from_binary, sizeof(__pyx_k__from_binary), 0, 0, 1, 1},
{&__pyx_n_s__from_data, __pyx_k__from_data, sizeof(__pyx_k__from_data), 0, 0, 1, 1},
+ {&__pyx_n_s__from_iterable, __pyx_k__from_iterable, sizeof(__pyx_k__from_iterable), 0, 0, 1, 1},
{&__pyx_n_s__from_stats, __pyx_k__from_stats, sizeof(__pyx_k__from_stats), 0, 0, 1, 1},
{&__pyx_n_s__from_text, __pyx_k__from_text, sizeof(__pyx_k__from_text), 0, 0, 1, 1},
{&__pyx_n_s__frontier, __pyx_k__frontier, sizeof(__pyx_k__frontier), 0, 0, 1, 1},
@@ -66145,7 +66215,7 @@ static int __Pyx_InitCachedBuiltins(void) {
__pyx_builtin_IndexError = __Pyx_GetName(__pyx_b, __pyx_n_s__IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_builtin_TypeError = __Pyx_GetName(__pyx_b, __pyx_n_s__TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_enumerate = __Pyx_GetName(__pyx_b, __pyx_n_s__enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_enumerate = __Pyx_GetName(__pyx_b, __pyx_n_s__enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_builtin_map = __Pyx_GetName(__pyx_b, __pyx_n_s__map); if (!__pyx_builtin_map) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_builtin_Exception = __Pyx_GetName(__pyx_b, __pyx_n_s__Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_builtin_zip = __Pyx_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;}
@@ -66213,28 +66283,28 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(__pyx_int_1000);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_12));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":68
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":65
* f.write("%s " % self.get_word(w_id))
* if w_id == 1:
* f.write("\n") # <<<<<<<<<<<<<<
*
* def read_text(self, char* filename):
*/
- __pyx_k_tuple_15 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_15)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_k_tuple_15 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_15)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_15);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_14));
PyTuple_SET_ITEM(__pyx_k_tuple_15, 0, ((PyObject *)__pyx_kp_s_14));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_15));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":63
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":60
*
* def write_text(self, char* filename):
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
* for w_id in self.data:
* if w_id > 1:
*/
- __pyx_k_tuple_16 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_16)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_k_tuple_16 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_16)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_16);
__Pyx_INCREF(Py_None);
PyTuple_SET_ITEM(__pyx_k_tuple_16, 0, Py_None);
@@ -66247,14 +66317,14 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(Py_None);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_16));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":71
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":68
*
* def read_text(self, char* filename):
* with gzip_or_text(filename) as fp: # <<<<<<<<<<<<<<
* self.read_text_data(fp)
*
*/
- __pyx_k_tuple_17 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_17)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_k_tuple_17 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_17)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_17);
__Pyx_INCREF(Py_None);
PyTuple_SET_ITEM(__pyx_k_tuple_17, 0, Py_None);
@@ -66267,28 +66337,28 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(Py_None);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_17));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":76
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":73
* def read_bitext(self, char* filename, int side):
* with gzip_or_text(filename) as fp:
* data = (line.split(' ||| ')[side] for line in fp) # <<<<<<<<<<<<<<
* self.read_text_data(data)
*
*/
- __pyx_k_tuple_19 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_19)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_k_tuple_19 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_19)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_19);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_18));
PyTuple_SET_ITEM(__pyx_k_tuple_19, 0, ((PyObject *)__pyx_kp_s_18));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_18));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_19));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":75
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":72
*
* def read_bitext(self, char* filename, int side):
* with gzip_or_text(filename) as fp: # <<<<<<<<<<<<<<
* data = (line.split(' ||| ')[side] for line in fp)
* self.read_text_data(data)
*/
- __pyx_k_tuple_20 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_k_tuple_20 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_20);
__Pyx_INCREF(Py_None);
PyTuple_SET_ITEM(__pyx_k_tuple_20, 0, Py_None);
@@ -66301,69 +66371,69 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(Py_None);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_20));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":146
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":143
* for i in self.data:
* f.write("%d " %i)
* f.write("\n") # <<<<<<<<<<<<<<
* for i in self.sent_index:
* f.write("%d " %i)
*/
- __pyx_k_tuple_22 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_22)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_k_tuple_22 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_22)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_22);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_14));
PyTuple_SET_ITEM(__pyx_k_tuple_22, 0, ((PyObject *)__pyx_kp_s_14));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_22));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":149
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":146
* for i in self.sent_index:
* f.write("%d " %i)
* f.write("\n") # <<<<<<<<<<<<<<
* for i in self.sent_id:
* f.write("%d " %i)
*/
- __pyx_k_tuple_23 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_23)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_k_tuple_23 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_23)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_23);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_14));
PyTuple_SET_ITEM(__pyx_k_tuple_23, 0, ((PyObject *)__pyx_kp_s_14));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_23));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":152
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":149
* for i in self.sent_id:
* f.write("%d " %i)
* f.write("\n") # <<<<<<<<<<<<<<
* for word in self.id2word:
* f.write("%s %d " % (word, self.word2id[word]))
*/
- __pyx_k_tuple_24 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_24)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_k_tuple_24 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_24)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_24);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_14));
PyTuple_SET_ITEM(__pyx_k_tuple_24, 0, ((PyObject *)__pyx_kp_s_14));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_24));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":155
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":152
* for word in self.id2word:
* f.write("%s %d " % (word, self.word2id[word]))
* f.write("\n") # <<<<<<<<<<<<<<
*
* def write_enhanced(self, char* filename):
*/
- __pyx_k_tuple_26 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_26)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_k_tuple_26 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_26)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_26);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_14));
PyTuple_SET_ITEM(__pyx_k_tuple_26, 0, ((PyObject *)__pyx_kp_s_14));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_26));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":158
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":155
*
* def write_enhanced(self, char* filename):
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
* self.write_enhanced_handle(self, f)
*/
- __pyx_k_tuple_28 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_28)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_k_tuple_28 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_28)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_28);
__Pyx_INCREF(Py_None);
PyTuple_SET_ITEM(__pyx_k_tuple_28, 0, Py_None);
@@ -67280,9 +67350,9 @@ PyMODINIT_FUNC PyInit__sa(void)
__pyx_ptype_3_sa_Scorer = &__pyx_type_3_sa_Scorer;
if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct____iter__) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_3_sa___pyx_scope_struct____iter__ = &__pyx_type_3_sa___pyx_scope_struct____iter__;
- if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_1_read_bitext) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_1_read_bitext) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_3_sa___pyx_scope_struct_1_read_bitext = &__pyx_type_3_sa___pyx_scope_struct_1_read_bitext;
- if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_2_genexpr) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_2_genexpr) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_3_sa___pyx_scope_struct_2_genexpr = &__pyx_type_3_sa___pyx_scope_struct_2_genexpr;
if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_3_compute_stats) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_3_sa___pyx_scope_struct_3_compute_stats = &__pyx_type_3_sa___pyx_scope_struct_3_compute_stats;
diff --git a/python/src/sa/data_array.pxi b/python/src/sa/data_array.pxi
index ce2d3a79..371708c5 100644
--- a/python/src/sa/data_array.pxi
+++ b/python/src/sa/data_array.pxi
@@ -9,8 +9,8 @@ from libc.string cimport memset, strcpy
cdef class DataArray:
cdef word2id
cdef id2word
- cdef IntList data
- cdef IntList sent_id
+ cdef public IntList data
+ cdef public IntList sent_id
cdef IntList sent_index
cdef bint use_sent_id
@@ -32,9 +32,6 @@ cdef class DataArray:
def __len__(self):
return len(self.data)
- def get_data(self):
- return self.data
-
def get_sentence_id(self, i):
return self.sent_id.arr[i]
diff --git a/python/src/sa/rulefactory.pxi b/python/src/sa/rulefactory.pxi
index 233654e9..3973554c 100644
--- a/python/src/sa/rulefactory.pxi
+++ b/python/src/sa/rulefactory.pxi
@@ -1101,9 +1101,8 @@ cdef class HieroCachingRuleFactory:
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(alslist.itervalues()))
- # count = len(locs) # Should be?
- count = len(max_locs) # Was
+ 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, fwords, self.fda, self.eda