summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/src/sa/_sa.c2719
-rw-r--r--python/src/sa/data_array.pxi17
-rw-r--r--python/src/sa/suffix_array.pxi9
3 files changed, 1495 insertions, 1250 deletions
diff --git a/python/src/sa/_sa.c b/python/src/sa/_sa.c
index d1cc55c0..5507cd15 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 14:37:00 2012 */
+/* Generated by Cython 0.17 on Thu Sep 6 16:40:54 2012 */
#define PY_SSIZE_T_CLEAN
#include "Python.h"
@@ -701,8 +701,8 @@ struct __pyx_obj_3_sa_LCP {
* from libc.string cimport memset, strcpy
*
* cdef class DataArray: # <<<<<<<<<<<<<<
- * cdef word2id
- * cdef id2word
+ * cdef public word2id
+ * cdef public id2word
*/
struct __pyx_obj_3_sa_DataArray {
PyObject_HEAD
@@ -837,7 +837,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_6_genexpr {
};
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":73
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":74
* def read_bitext(self, char* filename, int side):
* with gzip_or_text(filename) as fp:
* data = (line.split(' ||| ')[side] for line in fp) # <<<<<<<<<<<<<<
@@ -889,7 +889,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_16___iter__ {
};
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":71
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":72
* self.read_text_data(fp)
*
* def read_bitext(self, char* filename, int side): # <<<<<<<<<<<<<<
@@ -1344,8 +1344,8 @@ static struct __pyx_vtabstruct_3_sa_StringMap *__pyx_vtabptr_3_sa_StringMap;
* from libc.string cimport memset, strcpy
*
* cdef class DataArray: # <<<<<<<<<<<<<<
- * cdef word2id
- * cdef id2word
+ * cdef public word2id
+ * cdef public id2word
*/
struct __pyx_vtabstruct_3_sa_DataArray {
@@ -2306,9 +2306,9 @@ static int __pyx_pf_3_sa_9DataArray___cinit__(struct __pyx_obj_3_sa_DataArray *_
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_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_8get_id(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_word); /* proto */
+static PyObject *__pyx_pf_3_sa_9DataArray_10__getitem__(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_loc); /* proto */
+static PyObject *__pyx_pf_3_sa_9DataArray_12get_sentence_bounds(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_loc); /* 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 */
@@ -2318,9 +2318,21 @@ static PyObject *__pyx_pf_3_sa_9DataArray_22read_binary(struct __pyx_obj_3_sa_Da
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_7word2id___get__(struct __pyx_obj_3_sa_DataArray *__pyx_v_self); /* proto */
+static int __pyx_pf_3_sa_9DataArray_7word2id_2__set__(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
+static int __pyx_pf_3_sa_9DataArray_7word2id_4__del__(struct __pyx_obj_3_sa_DataArray *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_3_sa_9DataArray_7id2word___get__(struct __pyx_obj_3_sa_DataArray *__pyx_v_self); /* proto */
+static int __pyx_pf_3_sa_9DataArray_7id2word_2__set__(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
+static int __pyx_pf_3_sa_9DataArray_7id2word_4__del__(struct __pyx_obj_3_sa_DataArray *__pyx_v_self); /* 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_9DataArray_7sent_id___get__(struct __pyx_obj_3_sa_DataArray *__pyx_v_self); /* proto */
+static int __pyx_pf_3_sa_9DataArray_7sent_id_2__set__(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
+static int __pyx_pf_3_sa_9DataArray_7sent_id_4__del__(struct __pyx_obj_3_sa_DataArray *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_3_sa_9DataArray_10sent_index___get__(struct __pyx_obj_3_sa_DataArray *__pyx_v_self); /* proto */
+static int __pyx_pf_3_sa_9DataArray_10sent_index_2__set__(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
+static int __pyx_pf_3_sa_9DataArray_10sent_index_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 */
@@ -2413,16 +2425,13 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_4write_binary(struct __pyx_obj_3
static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_sa_Precomputation *__pyx_v_self, PyObject *__pyx_v_stats, struct __pyx_obj_3_sa_SuffixArray *__pyx_v_sarray); /* proto */
static int __pyx_pf_3_sa_11SuffixArray___cinit__(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, PyObject *__pyx_v_from_binary, PyObject *__pyx_v_from_text, PyObject *__pyx_v_side); /* proto */
static PyObject *__pyx_pf_3_sa_11SuffixArray_2__getitem__(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, PyObject *__pyx_v_i); /* proto */
-static PyObject *__pyx_pf_3_sa_11SuffixArray_4get_sentence_id(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, PyObject *__pyx_v_i); /* proto */
-static PyObject *__pyx_pf_3_sa_11SuffixArray_6get_sentence(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, PyObject *__pyx_v_i); /* proto */
-static PyObject *__pyx_pf_3_sa_11SuffixArray_8get_sentence_position(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, PyObject *__pyx_v_loc); /* proto */
-static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_side); /* proto */
-static PyObject *__pyx_pf_3_sa_11SuffixArray_12q3sort(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, int __pyx_v_i, int __pyx_v_j, int __pyx_v_h, struct __pyx_obj_3_sa_IntList *__pyx_v_isa, PyObject *__pyx_v_pad); /* proto */
-static PyObject *__pyx_pf_3_sa_11SuffixArray_14write_text(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, char *__pyx_v_filename); /* proto */
-static PyObject *__pyx_pf_3_sa_11SuffixArray_16read_binary(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, char *__pyx_v_filename); /* proto */
-static PyObject *__pyx_pf_3_sa_11SuffixArray_18write_binary(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, char *__pyx_v_filename); /* proto */
-static PyObject *__pyx_pf_3_sa_11SuffixArray_20write_enhanced(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, char *__pyx_v_filename); /* proto */
-static PyObject *__pyx_pf_3_sa_11SuffixArray_22lookup(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, PyObject *__pyx_v_word, int __pyx_v_offset, int __pyx_v_low, int __pyx_v_high); /* proto */
+static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_side); /* proto */
+static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, int __pyx_v_i, int __pyx_v_j, int __pyx_v_h, struct __pyx_obj_3_sa_IntList *__pyx_v_isa, PyObject *__pyx_v_pad); /* proto */
+static PyObject *__pyx_pf_3_sa_11SuffixArray_8write_text(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, char *__pyx_v_filename); /* proto */
+static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_binary(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, char *__pyx_v_filename); /* proto */
+static PyObject *__pyx_pf_3_sa_11SuffixArray_12write_binary(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, char *__pyx_v_filename); /* proto */
+static PyObject *__pyx_pf_3_sa_11SuffixArray_14write_enhanced(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, char *__pyx_v_filename); /* proto */
+static PyObject *__pyx_pf_3_sa_11SuffixArray_16lookup(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, PyObject *__pyx_v_word, int __pyx_v_offset, int __pyx_v_low, int __pyx_v_high); /* proto */
static int __pyx_pf_3_sa_8TrieNode___cinit__(struct __pyx_obj_3_sa_TrieNode *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3_sa_8TrieNode_8children___get__(struct __pyx_obj_3_sa_TrieNode *__pyx_v_self); /* proto */
static int __pyx_pf_3_sa_8TrieNode_8children_2__set__(struct __pyx_obj_3_sa_TrieNode *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
@@ -2515,13 +2524,12 @@ static char __pyx_k_85[] = "RANK %d\tCOUNT, COST: %d %d\tCUMUL: %d, %d";
static char __pyx_k_86[] = "Precomputed collocations for %d patterns out of %d possible (upper bound %d)";
static char __pyx_k_87[] = "Precomputed inverted index for %d patterns ";
static char __pyx_k_88[] = "Precomputation took %f seconds";
-static char __pyx_k_89[] = "get_sentence_position";
-static char __pyx_k_90[] = " Bucket sort took %f seconds";
-static char __pyx_k_91[] = " Refining, sort depth = %d";
-static char __pyx_k_92[] = " Refinement took %f seconds";
-static char __pyx_k_93[] = " Finalizing sort...";
-static char __pyx_k_95[] = "Suffix array construction took %f seconds";
-static char __pyx_k_96[] = "Unexpected condition found in q3sort: sort from %d to %d";
+static char __pyx_k_89[] = " Bucket sort took %f seconds";
+static char __pyx_k_90[] = " Refining, sort depth = %d";
+static char __pyx_k_91[] = " Refinement took %f seconds";
+static char __pyx_k_92[] = " Finalizing sort...";
+static char __pyx_k_94[] = "Suffix array construction took %f seconds";
+static char __pyx_k_95[] = "Unexpected condition found in q3sort: sort from %d to %d";
static char __pyx_k__0[] = "0";
static char __pyx_k__1[] = "1";
static char __pyx_k__e[] = "e";
@@ -2531,42 +2539,42 @@ static char __pyx_k__i[] = "i";
static char __pyx_k__j[] = "j";
static char __pyx_k__r[] = "r";
static char __pyx_k__w[] = "w";
-static char __pyx_k_101[] = "Sampling strategy: uniform, max sample size = %d";
-static char __pyx_k_102[] = "Sampling strategy: no sampling";
-static char __pyx_k_104[] = "require_aligned_terminal";
-static char __pyx_k_105[] = "require_aligned_chunks";
-static char __pyx_k_106[] = "[X]";
-static char __pyx_k_107[] = "Must specify an alignment object";
-static char __pyx_k_109[] = "Reading precomputed data from file %s... ";
-static char __pyx_k_110[] = "Precomputation done with max nonterminals %d, decoder uses %d";
-static char __pyx_k_111[] = "Precomputation done with max terminals %d, decoder uses %d";
-static char __pyx_k_112[] = "Precomputation done with max initial size %d, decoder uses %d";
-static char __pyx_k_113[] = "Precomputation done with min gap size %d, decoder uses %d";
-static char __pyx_k_114[] = "Converting %d hash keys on precomputed inverted index... ";
-static char __pyx_k_115[] = "Converting %d hash keys on precomputed collocations... ";
-static char __pyx_k_116[] = "Processing precomputations took %f seconds";
-static char __pyx_k_117[] = "{";
- static char __pyx_k_118[] = "(";
-static char __pyx_k_119[] = "}";
-static char __pyx_k_120[] = "get_precomputed_collocation";
-static char __pyx_k_121[] = "double binary";
-static char __pyx_k_122[] = "Keyword trie error";
-static char __pyx_k_124[] = "get_all_nodes_isteps_away";
-static char __pyx_k_125[] = "Total time for rule lookup, extraction, and scoring = %f seconds";
-static char __pyx_k_126[] = " Extract time = %f seconds";
-static char __pyx_k_127[] = "No aligned terminals";
-static char __pyx_k_128[] = "Unaligned chunk";
-static char __pyx_k_129[] = "Gaps are not tight phrases";
-static char __pyx_k_130[] = "Inside edges of preceding subphrase are not tight";
-static char __pyx_k_131[] = "Inside edges of following subphrase are not tight";
-static char __pyx_k_132[] = "Subphrase [%d, %d] failed integrity check";
-static char __pyx_k_133[] = "Didn't extract anything from [%d, %d] -> [%d, %d]";
-static char __pyx_k_134[] = "Unable to extract basic phrase";
-static char __pyx_k_135[] = "%s=%s";
-static char __pyx_k_138[] = "/Users/vchahun/Sandbox/cdec/python/src/sa/_sa.pyx";
-static char __pyx_k_139[] = "cdec.sa";
-static char __pyx_k_143[] = "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi";
-static char __pyx_k_148[] = "*EPS*";
+static char __pyx_k_100[] = "Sampling strategy: uniform, max sample size = %d";
+static char __pyx_k_101[] = "Sampling strategy: no sampling";
+static char __pyx_k_103[] = "require_aligned_terminal";
+static char __pyx_k_104[] = "require_aligned_chunks";
+static char __pyx_k_105[] = "[X]";
+static char __pyx_k_106[] = "Must specify an alignment object";
+static char __pyx_k_108[] = "Reading precomputed data from file %s... ";
+static char __pyx_k_109[] = "Precomputation done with max nonterminals %d, decoder uses %d";
+static char __pyx_k_110[] = "Precomputation done with max terminals %d, decoder uses %d";
+static char __pyx_k_111[] = "Precomputation done with max initial size %d, decoder uses %d";
+static char __pyx_k_112[] = "Precomputation done with min gap size %d, decoder uses %d";
+static char __pyx_k_113[] = "Converting %d hash keys on precomputed inverted index... ";
+static char __pyx_k_114[] = "Converting %d hash keys on precomputed collocations... ";
+static char __pyx_k_115[] = "Processing precomputations took %f seconds";
+static char __pyx_k_116[] = "{";
+ static char __pyx_k_117[] = "(";
+static char __pyx_k_118[] = "}";
+static char __pyx_k_119[] = "get_precomputed_collocation";
+static char __pyx_k_120[] = "double binary";
+static char __pyx_k_121[] = "Keyword trie error";
+static char __pyx_k_123[] = "get_all_nodes_isteps_away";
+static char __pyx_k_124[] = "Total time for rule lookup, extraction, and scoring = %f seconds";
+static char __pyx_k_125[] = " Extract time = %f seconds";
+static char __pyx_k_126[] = "No aligned terminals";
+static char __pyx_k_127[] = "Unaligned chunk";
+static char __pyx_k_128[] = "Gaps are not tight phrases";
+static char __pyx_k_129[] = "Inside edges of preceding subphrase are not tight";
+static char __pyx_k_130[] = "Inside edges of following subphrase are not tight";
+static char __pyx_k_131[] = "Subphrase [%d, %d] failed integrity check";
+static char __pyx_k_132[] = "Didn't extract anything from [%d, %d] -> [%d, %d]";
+static char __pyx_k_133[] = "Unable to extract basic phrase";
+static char __pyx_k_134[] = "%s=%s";
+static char __pyx_k_137[] = "/Users/vchahun/Sandbox/cdec/python/src/sa/_sa.pyx";
+static char __pyx_k_138[] = "cdec.sa";
+static char __pyx_k_142[] = "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi";
+static char __pyx_k_147[] = "*EPS*";
static char __pyx_k__gc[] = "gc";
static char __pyx_k__sa[] = "sa";
static char __pyx_k___sa[] = "_sa";
@@ -2721,7 +2729,6 @@ static char __pyx_k__sample_size[] = "sample_size";
static char __pyx_k__suffix_link[] = "suffix_link";
static char __pyx_k__use_sent_id[] = "use_sent_id";
static char __pyx_k___doquicksort[] = "_doquicksort";
-static char __pyx_k__get_sentence[] = "get_sentence";
static char __pyx_k__gzip_or_text[] = "gzip_or_text";
static char __pyx_k__make_lattice[] = "make_lattice";
static char __pyx_k__min_gap_size[] = "min_gap_size";
@@ -2738,7 +2745,6 @@ static char __pyx_k__read_text_data[] = "read_text_data";
static char __pyx_k__by_slack_factor[] = "by_slack_factor";
static char __pyx_k__decode_sentence[] = "decode_sentence";
static char __pyx_k__get_next_states[] = "get_next_states";
-static char __pyx_k__get_sentence_id[] = "get_sentence_id";
static char __pyx_k__num_subpatterns[] = "num_subpatterns";
static char __pyx_k__phrase_location[] = "phrase_location";
static char __pyx_k__precompute_file[] = "precompute_file";
@@ -2755,11 +2761,12 @@ static char __pyx_k__max_target_length[] = "max_target_length";
static char __pyx_k__train_min_gap_size[] = "train_min_gap_size";
static char __pyx_k__pattern2phrase_plus[] = "pattern2phrase_plus";
static PyObject *__pyx_kp_s_1;
+static PyObject *__pyx_kp_s_100;
static PyObject *__pyx_kp_s_101;
-static PyObject *__pyx_kp_s_102;
+static PyObject *__pyx_n_s_103;
static PyObject *__pyx_n_s_104;
-static PyObject *__pyx_n_s_105;
-static PyObject *__pyx_kp_s_107;
+static PyObject *__pyx_kp_s_106;
+static PyObject *__pyx_kp_s_108;
static PyObject *__pyx_kp_s_109;
static PyObject *__pyx_kp_s_110;
static PyObject *__pyx_kp_s_111;
@@ -2770,11 +2777,11 @@ static PyObject *__pyx_kp_s_115;
static PyObject *__pyx_kp_s_116;
static PyObject *__pyx_kp_s_117;
static PyObject *__pyx_kp_s_118;
-static PyObject *__pyx_kp_s_119;
-static PyObject *__pyx_n_s_120;
+static PyObject *__pyx_n_s_119;
+static PyObject *__pyx_kp_s_120;
static PyObject *__pyx_kp_s_121;
-static PyObject *__pyx_kp_s_122;
-static PyObject *__pyx_n_s_124;
+static PyObject *__pyx_n_s_123;
+static PyObject *__pyx_kp_s_124;
static PyObject *__pyx_kp_s_125;
static PyObject *__pyx_kp_s_126;
static PyObject *__pyx_kp_s_127;
@@ -2786,11 +2793,10 @@ static PyObject *__pyx_kp_s_131;
static PyObject *__pyx_kp_s_132;
static PyObject *__pyx_kp_s_133;
static PyObject *__pyx_kp_s_134;
-static PyObject *__pyx_kp_s_135;
+static PyObject *__pyx_kp_s_137;
static PyObject *__pyx_kp_s_138;
-static PyObject *__pyx_kp_s_139;
static PyObject *__pyx_kp_s_14;
-static PyObject *__pyx_kp_s_143;
+static PyObject *__pyx_kp_s_142;
static PyObject *__pyx_kp_s_18;
static PyObject *__pyx_kp_s_2;
static PyObject *__pyx_kp_s_21;
@@ -2833,14 +2839,13 @@ static PyObject *__pyx_kp_s_85;
static PyObject *__pyx_kp_s_86;
static PyObject *__pyx_kp_s_87;
static PyObject *__pyx_kp_s_88;
-static PyObject *__pyx_n_s_89;
+static PyObject *__pyx_kp_s_89;
static PyObject *__pyx_kp_s_9;
static PyObject *__pyx_kp_s_90;
static PyObject *__pyx_kp_s_91;
static PyObject *__pyx_kp_s_92;
-static PyObject *__pyx_kp_s_93;
+static PyObject *__pyx_kp_s_94;
static PyObject *__pyx_kp_s_95;
-static PyObject *__pyx_kp_s_96;
static PyObject *__pyx_kp_s__0;
static PyObject *__pyx_kp_s__1;
static PyObject *__pyx_n_s__Counter;
@@ -2918,8 +2923,6 @@ static PyObject *__pyx_n_s__get_e_id;
static PyObject *__pyx_n_s__get_f_id;
static PyObject *__pyx_n_s__get_id;
static PyObject *__pyx_n_s__get_next_states;
-static PyObject *__pyx_n_s__get_sentence;
-static PyObject *__pyx_n_s__get_sentence_id;
static PyObject *__pyx_n_s__get_word;
static PyObject *__pyx_n_s__getchunk;
static PyObject *__pyx_n_s__getrusage;
@@ -3046,7 +3049,7 @@ static PyObject *__pyx_int_20;
static PyObject *__pyx_int_1000;
static PyObject *__pyx_int_65536;
static PyObject *__pyx_k_41;
-static PyObject *__pyx_k_100;
+static PyObject *__pyx_k_99;
static PyObject *__pyx_k_tuple_10;
static PyObject *__pyx_k_tuple_11;
static PyObject *__pyx_k_tuple_12;
@@ -3088,22 +3091,22 @@ static PyObject *__pyx_k_tuple_79;
static PyObject *__pyx_k_tuple_80;
static PyObject *__pyx_k_tuple_81;
static PyObject *__pyx_k_tuple_82;
-static PyObject *__pyx_k_tuple_94;
+static PyObject *__pyx_k_tuple_93;
+static PyObject *__pyx_k_tuple_96;
static PyObject *__pyx_k_tuple_97;
static PyObject *__pyx_k_tuple_98;
-static PyObject *__pyx_k_tuple_99;
-static PyObject *__pyx_k_tuple_103;
-static PyObject *__pyx_k_tuple_108;
-static PyObject *__pyx_k_tuple_123;
-static PyObject *__pyx_k_tuple_136;
+static PyObject *__pyx_k_tuple_102;
+static PyObject *__pyx_k_tuple_107;
+static PyObject *__pyx_k_tuple_122;
+static PyObject *__pyx_k_tuple_135;
+static PyObject *__pyx_k_tuple_139;
static PyObject *__pyx_k_tuple_140;
-static PyObject *__pyx_k_tuple_141;
-static PyObject *__pyx_k_tuple_144;
-static PyObject *__pyx_k_tuple_146;
-static PyObject *__pyx_k_codeobj_137;
-static PyObject *__pyx_k_codeobj_142;
-static PyObject *__pyx_k_codeobj_145;
-static PyObject *__pyx_k_codeobj_147;
+static PyObject *__pyx_k_tuple_143;
+static PyObject *__pyx_k_tuple_145;
+static PyObject *__pyx_k_codeobj_136;
+static PyObject *__pyx_k_codeobj_141;
+static PyObject *__pyx_k_codeobj_144;
+static PyObject *__pyx_k_codeobj_146;
/* "_sa.pyx":5
* import gzip
@@ -7384,7 +7387,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_6get_sentence(struct __pyx_obj_3_sa_Da
* sent.append(self.id2word[self.data.arr[i]])
* return sent # <<<<<<<<<<<<<<
*
- * def get_sentence_position(self, loc):
+ * def get_id(self, word):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_sent));
@@ -7406,12 +7409,12 @@ static PyObject *__pyx_pf_3_sa_9DataArray_6get_sentence(struct __pyx_obj_3_sa_Da
}
/* Python wrapper */
-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) {
+static PyObject *__pyx_pw_3_sa_9DataArray_9get_id(PyObject *__pyx_v_self, PyObject *__pyx_v_word); /*proto*/
+static PyObject *__pyx_pw_3_sa_9DataArray_9get_id(PyObject *__pyx_v_self, PyObject *__pyx_v_word) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("get_sentence_position (wrapper)", 0);
- __pyx_r = __pyx_pf_3_sa_9DataArray_8get_sentence_position(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self), ((PyObject *)__pyx_v_loc));
+ __Pyx_RefNannySetupContext("get_id (wrapper)", 0);
+ __pyx_r = __pyx_pf_3_sa_9DataArray_8get_id(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self), ((PyObject *)__pyx_v_word));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
@@ -7419,73 +7422,12 @@ static PyObject *__pyx_pw_3_sa_9DataArray_9get_sentence_position(PyObject *__pyx
/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":47
* return sent
*
- * def get_sentence_position(self, loc): # <<<<<<<<<<<<<<
- * return loc - self.sent_index.arr[self.sent_id.arr[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;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("get_sentence_position", 0);
-
- /* "/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]] # <<<<<<<<<<<<<<
- *
- * 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 = 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 = 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;
- __pyx_t_3 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("_sa.DataArray.get_sentence_position", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_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_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":50
- * return loc - self.sent_index.arr[self.sent_id.arr[loc]]
- *
* def get_id(self, word): # <<<<<<<<<<<<<<
* if not word in self.word2id:
* self.word2id[word] = len(self.id2word)
*/
-static PyObject *__pyx_pf_3_sa_9DataArray_10get_id(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_word) {
+static PyObject *__pyx_pf_3_sa_9DataArray_8get_id(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_word) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
@@ -7497,18 +7439,18 @@ static PyObject *__pyx_pf_3_sa_9DataArray_10get_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":51
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":48
*
* def get_id(self, word):
* if not word in self.word2id: # <<<<<<<<<<<<<<
* self.word2id[word] = len(self.id2word)
* self.id2word.append(word)
*/
- __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_word, __pyx_v_self->word2id, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_word, __pyx_v_self->word2id, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_2 = (!__pyx_t_1);
if (__pyx_t_2) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":52
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":49
* def get_id(self, word):
* if not word in self.word2id:
* self.word2id[word] = len(self.id2word) # <<<<<<<<<<<<<<
@@ -7517,36 +7459,36 @@ static PyObject *__pyx_pf_3_sa_9DataArray_10get_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 = 52; __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 = 49; __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 = 52; __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 = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- if (PyObject_SetItem(__pyx_v_self->word2id, __pyx_v_word, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 52; __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 = 49; __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":53
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":50
* if not word in self.word2id:
* self.word2id[word] = len(self.id2word)
* self.id2word.append(word) # <<<<<<<<<<<<<<
* return self.word2id[word]
*
*/
- __pyx_t_3 = __Pyx_PyObject_Append(__pyx_v_self->id2word, __pyx_v_word); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 53; __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 = 50; __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":54
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":51
* self.word2id[word] = len(self.id2word)
* self.id2word.append(word)
* return self.word2id[word] # <<<<<<<<<<<<<<
*
- * def get_word(self, id):
+ * def __getitem__(self, loc):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = PyObject_GetItem(__pyx_v_self->word2id, __pyx_v_word); if (!__pyx_t_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 54; __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 = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
@@ -7565,52 +7507,134 @@ static PyObject *__pyx_pf_3_sa_9DataArray_10get_id(struct __pyx_obj_3_sa_DataArr
}
/* Python wrapper */
-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) {
+static PyObject *__pyx_pw_3_sa_9DataArray_11__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_loc); /*proto*/
+static PyObject *__pyx_pw_3_sa_9DataArray_11__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_loc) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("get_word (wrapper)", 0);
- __pyx_r = __pyx_pf_3_sa_9DataArray_12get_word(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self), ((PyObject *)__pyx_v_id));
+ __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_3_sa_9DataArray_10__getitem__(((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":56
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":53
* return self.word2id[word]
*
- * def get_word(self, id): # <<<<<<<<<<<<<<
- * return self.id2word[id]
+ * def __getitem__(self, loc): # <<<<<<<<<<<<<<
+ * return self.id2word[self.data.arr[loc]]
*
*/
-static PyObject *__pyx_pf_3_sa_9DataArray_12get_word(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_id) {
+static PyObject *__pyx_pf_3_sa_9DataArray_10__getitem__(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_loc) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
+ Py_ssize_t __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("get_word", 0);
+ __Pyx_RefNannySetupContext("__getitem__", 0);
+
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":54
+ *
+ * def __getitem__(self, loc):
+ * return self.id2word[self.data.arr[loc]] # <<<<<<<<<<<<<<
+ *
+ * def get_sentence_bounds(self, loc):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_loc); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_self->id2word, (__pyx_v_self->data->arr[__pyx_t_1]), sizeof(int), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("_sa.DataArray.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3_sa_9DataArray_13get_sentence_bounds(PyObject *__pyx_v_self, PyObject *__pyx_v_loc); /*proto*/
+static PyObject *__pyx_pw_3_sa_9DataArray_13get_sentence_bounds(PyObject *__pyx_v_self, PyObject *__pyx_v_loc) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("get_sentence_bounds (wrapper)", 0);
+ __pyx_r = __pyx_pf_3_sa_9DataArray_12get_sentence_bounds(((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":56
+ * return self.id2word[self.data.arr[loc]]
+ *
+ * def get_sentence_bounds(self, loc): # <<<<<<<<<<<<<<
+ * cdef int sid = self.sent_id.arr[loc]
+ * return (self.sent_index.arr[sid], self.sent_index.arr[sid+1])
+ */
+
+static PyObject *__pyx_pf_3_sa_9DataArray_12get_sentence_bounds(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_loc) {
+ int __pyx_v_sid;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ Py_ssize_t __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("get_sentence_bounds", 0);
/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":57
*
- * def get_word(self, id):
- * return self.id2word[id] # <<<<<<<<<<<<<<
+ * def get_sentence_bounds(self, loc):
+ * cdef int sid = self.sent_id.arr[loc] # <<<<<<<<<<<<<<
+ * return (self.sent_index.arr[sid], self.sent_index.arr[sid+1])
+ *
+ */
+ __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_loc); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_sid = (__pyx_v_self->sent_id->arr[__pyx_t_1]);
+
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":58
+ * def get_sentence_bounds(self, loc):
+ * cdef int sid = self.sent_id.arr[loc]
+ * return (self.sent_index.arr[sid], self.sent_index.arr[sid+1]) # <<<<<<<<<<<<<<
*
* 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 = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
+ __pyx_t_2 = PyInt_FromLong((__pyx_v_self->sent_index->arr[__pyx_v_sid])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyInt_FromLong((__pyx_v_self->sent_index->arr[(__pyx_v_sid + 1)])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
+ __pyx_t_2 = 0;
+ __pyx_t_3 = 0;
+ __pyx_r = ((PyObject *)__pyx_t_4);
+ __pyx_t_4 = 0;
goto __pyx_L0;
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("_sa.DataArray.get_word", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_AddTraceback("_sa.DataArray.get_sentence_bounds", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -7626,7 +7650,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_15write_text(PyObject *__pyx_v_self, P
__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 = 59; __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 = 60; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
@@ -7639,8 +7663,8 @@ static PyObject *__pyx_pw_3_sa_9DataArray_15write_text(PyObject *__pyx_v_self, P
return __pyx_r;
}
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":59
- * return self.id2word[id]
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":60
+ * return (self.sent_index.arr[sid], self.sent_index.arr[sid+1])
*
* def write_text(self, char* filename): # <<<<<<<<<<<<<<
* with open(filename, "w") as f:
@@ -7671,7 +7695,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_14write_text(struct __pyx_obj_3_sa_Dat
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("write_text", 0);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":60
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":61
*
* def write_text(self, char* filename):
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -7679,9 +7703,9 @@ static PyObject *__pyx_pf_3_sa_9DataArray_14write_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 = 60; __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 = 61; __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 = 60; __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 = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1));
__Pyx_GIVEREF(((PyObject *)__pyx_t_1));
@@ -7689,14 +7713,14 @@ static PyObject *__pyx_pf_3_sa_9DataArray_14write_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 = 60; __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 = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_3 = 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_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____exit__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = 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_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____enter__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 60; __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 = 61; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -7711,7 +7735,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_14write_text(struct __pyx_obj_3_sa_Dat
__pyx_v_f = __pyx_t_4;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":61
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":62
* def write_text(self, char* filename):
* with open(filename, "w") as f:
* for w_id in self.data: # <<<<<<<<<<<<<<
@@ -7722,7 +7746,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_14write_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 = 61; __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 = 62; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_9 = Py_TYPE(__pyx_t_4)->tp_iternext;
}
@@ -7730,23 +7754,23 @@ static PyObject *__pyx_pf_3_sa_9DataArray_14write_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 = 61; __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 = 62; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
#else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 61; __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 = 62; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
#endif
} else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_4)) {
if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
#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 = 61; __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 = 62; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
#else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 61; __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 = 62; __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 = 61; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ else {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
}
break;
}
@@ -7756,47 +7780,47 @@ static PyObject *__pyx_pf_3_sa_9DataArray_14write_text(struct __pyx_obj_3_sa_Dat
__pyx_v_w_id = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":62
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":63
* with open(filename, "w") as f:
* for w_id in self.data:
* if w_id > 1: # <<<<<<<<<<<<<<
* f.write("%s " % self.get_word(w_id))
* if w_id == 1:
*/
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_w_id, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 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_t_1 = PyObject_RichCompare(__pyx_v_w_id, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_10) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":63
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":64
* for w_id in self.data:
* if w_id > 1:
* f.write("%s " % self.get_word(w_id)) # <<<<<<<<<<<<<<
* 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 = 63; __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 = 64; __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 = 63; __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 = 64; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __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 = 64; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_INCREF(__pyx_v_w_id);
PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_w_id);
__Pyx_GIVEREF(__pyx_v_w_id);
- __pyx_t_12 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __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 = 64; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
- __pyx_t_11 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_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_t_11 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_13), __pyx_t_12); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_11));
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __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_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(__pyx_t_12);
PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)__pyx_t_11));
__Pyx_GIVEREF(((PyObject *)__pyx_t_11));
__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 = 63; __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 = 64; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
@@ -7805,28 +7829,28 @@ static PyObject *__pyx_pf_3_sa_9DataArray_14write_text(struct __pyx_obj_3_sa_Dat
}
__pyx_L18:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":64
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":65
* if w_id > 1:
* f.write("%s " % self.get_word(w_id))
* if w_id == 1: # <<<<<<<<<<<<<<
* f.write("\n")
*
*/
- __pyx_t_11 = PyObject_RichCompare(__pyx_v_w_id, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 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_t_11 = PyObject_RichCompare(__pyx_v_w_id, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
if (__pyx_t_10) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":65
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":66
* f.write("%s " % self.get_word(w_id))
* if w_id == 1:
* f.write("\n") # <<<<<<<<<<<<<<
*
* def read_text(self, char* filename):
*/
- __pyx_t_11 = 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_t_11 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(__pyx_t_11);
- __pyx_t_12 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_k_tuple_15), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 65; __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 = 66; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
@@ -7847,7 +7871,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_14write_text(struct __pyx_obj_3_sa_Dat
__Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":60
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":61
*
* def write_text(self, char* filename):
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -7856,11 +7880,11 @@ static PyObject *__pyx_pf_3_sa_9DataArray_14write_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 = 60; __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 = 61; __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 = 60; __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 = 61; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
@@ -7873,11 +7897,11 @@ static PyObject *__pyx_pf_3_sa_9DataArray_14write_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 = 60; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
+ if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
__Pyx_GOTREF(__pyx_t_13);
__pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_13);
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
+ if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
__pyx_t_14 = (!__pyx_t_10);
if (__pyx_t_14) {
__Pyx_GIVEREF(__pyx_t_4);
@@ -7885,7 +7909,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_14write_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 = 60; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
+ {__pyx_filename = __pyx_f[3]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
goto __pyx_L22;
}
__pyx_L22:;
@@ -7913,11 +7937,11 @@ static PyObject *__pyx_pf_3_sa_9DataArray_14write_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 = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_7);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
}
goto __pyx_L23;
@@ -7953,7 +7977,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_17read_text(PyObject *__pyx_v_self, Py
__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 = 67; __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 = 68; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
@@ -7966,7 +7990,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_17read_text(PyObject *__pyx_v_self, Py
return __pyx_r;
}
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":67
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":68
* f.write("\n")
*
* def read_text(self, char* filename): # <<<<<<<<<<<<<<
@@ -7994,7 +8018,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_16read_text(struct __pyx_obj_3_sa_Data
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("read_text", 0);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":68
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":69
*
* def read_text(self, char* filename):
* with gzip_or_text(filename) as fp: # <<<<<<<<<<<<<<
@@ -8002,24 +8026,24 @@ static PyObject *__pyx_pf_3_sa_9DataArray_16read_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 = 68; __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 = 69; __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 = 68; __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 = 69; __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 = 68; __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 = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2));
__Pyx_GIVEREF(((PyObject *)__pyx_t_2));
__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 = 68; __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 = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __pyx_t_4 = 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_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s____exit__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = 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_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s____enter__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 68; __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 = 69; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -8034,21 +8058,21 @@ static PyObject *__pyx_pf_3_sa_9DataArray_16read_text(struct __pyx_obj_3_sa_Data
__pyx_v_fp = __pyx_t_1;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":69
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":70
* def read_text(self, char* filename):
* with gzip_or_text(filename) as fp:
* self.read_text_data(fp) # <<<<<<<<<<<<<<
*
* 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 = 69; __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 = 70; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 69; __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 = 70; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_v_fp);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_fp);
__Pyx_GIVEREF(__pyx_v_fp);
- __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 69; __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 = 70; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
@@ -8063,7 +8087,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_16read_text(struct __pyx_obj_3_sa_Data
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":68
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":69
*
* def read_text(self, char* filename):
* with gzip_or_text(filename) as fp: # <<<<<<<<<<<<<<
@@ -8072,11 +8096,11 @@ static PyObject *__pyx_pf_3_sa_9DataArray_16read_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 = 68; __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 = 69; __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 = 68; __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 = 69; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_INCREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
@@ -8089,11 +8113,11 @@ static PyObject *__pyx_pf_3_sa_9DataArray_16read_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 = 68; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
+ if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
__Pyx_GOTREF(__pyx_t_10);
__pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_10);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
+ if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
__pyx_t_11 = (!__pyx_t_9);
if (__pyx_t_11) {
__Pyx_GIVEREF(__pyx_t_3);
@@ -8101,7 +8125,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_16read_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 = 68; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
+ {__pyx_filename = __pyx_f[3]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
goto __pyx_L18;
}
__pyx_L18:;
@@ -8129,11 +8153,11 @@ static PyObject *__pyx_pf_3_sa_9DataArray_16read_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 = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_7);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
}
goto __pyx_L19;
@@ -8187,11 +8211,11 @@ static PyObject *__pyx_pw_3_sa_9DataArray_19read_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 = 71; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("read_bitext", 1, 2, 2, 1); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 72; __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 = 71; __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 = 72; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
@@ -8199,12 +8223,12 @@ static PyObject *__pyx_pw_3_sa_9DataArray_19read_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 = 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;}
+ __pyx_v_filename = PyBytes_AsString(values[0]); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_side = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_side == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
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 = 71; __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 = 72; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("_sa.DataArray.read_bitext", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -8216,7 +8240,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_19read_bitext(PyObject *__pyx_v_self,
}
static PyObject *__pyx_gb_3_sa_9DataArray_11read_bitext_2generator6(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":73
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":74
* def read_bitext(self, char* filename, int side):
* with gzip_or_text(filename) as fp:
* data = (line.split(' ||| ')[side] for line in fp) # <<<<<<<<<<<<<<
@@ -8242,7 +8266,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 = 73; __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 = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_cur_scope);
__Pyx_RefNannyFinishContext();
return (PyObject *) gen;
@@ -8279,13 +8303,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 = 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 (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 74; __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 = 74; __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 = 73; __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 = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -8293,23 +8317,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 = 73; __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 = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __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 = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#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 = 73; __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 = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __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 = 74; __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 = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[3]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -8320,12 +8344,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 = 73; __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 = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_19), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __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 = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_5, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_side, sizeof(int), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __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 = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_r = __pyx_t_4;
@@ -8345,7 +8369,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 = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyErr_SetNone(PyExc_StopIteration);
@@ -8363,7 +8387,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":71
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":72
* self.read_text_data(fp)
*
* def read_bitext(self, char* filename, int side): # <<<<<<<<<<<<<<
@@ -8399,7 +8423,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_18read_bitext(struct __pyx_obj_3_sa_Da
__Pyx_GOTREF(__pyx_cur_scope);
__pyx_cur_scope->__pyx_v_side = __pyx_v_side;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":72
+ /* "/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: # <<<<<<<<<<<<<<
@@ -8407,24 +8431,24 @@ static PyObject *__pyx_pf_3_sa_9DataArray_18read_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 = 72; __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 = 73; __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 = 72; __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 = 73; __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 = 72; __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 = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2));
__Pyx_GIVEREF(((PyObject *)__pyx_t_2));
__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 = 72; __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 = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __pyx_t_4 = 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_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s____exit__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = 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_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s____enter__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 72; __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 = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -8440,33 +8464,33 @@ static PyObject *__pyx_pf_3_sa_9DataArray_18read_bitext(struct __pyx_obj_3_sa_Da
__pyx_cur_scope->__pyx_v_fp = __pyx_t_1;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":73
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":74
* def read_bitext(self, char* filename, int side):
* with gzip_or_text(filename) as fp:
* data = (line.split(' ||| ')[side] for line in fp) # <<<<<<<<<<<<<<
* 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 = 73; __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 = 74; __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":74
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":75
* with gzip_or_text(filename) as fp:
* data = (line.split(' ||| ')[side] for line in fp)
* self.read_text_data(data) # <<<<<<<<<<<<<<
*
* 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 = 74; __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 = 75; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 74; __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 = 75; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_v_data);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_data);
__Pyx_GIVEREF(__pyx_v_data);
- __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 74; __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 = 75; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
@@ -8481,7 +8505,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_18read_bitext(struct __pyx_obj_3_sa_Da
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":72
+ /* "/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: # <<<<<<<<<<<<<<
@@ -8490,11 +8514,11 @@ static PyObject *__pyx_pf_3_sa_9DataArray_18read_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 = 72; __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 = 73; __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 = 72; __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 = 73; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_INCREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
@@ -8507,11 +8531,11 @@ static PyObject *__pyx_pf_3_sa_9DataArray_18read_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 = 72; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
+ if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
__Pyx_GOTREF(__pyx_t_10);
__pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_10);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
+ if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
__pyx_t_11 = (!__pyx_t_9);
if (__pyx_t_11) {
__Pyx_GIVEREF(__pyx_t_3);
@@ -8519,7 +8543,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_18read_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 = 72; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
+ {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
goto __pyx_L18;
}
__pyx_L18:;
@@ -8547,11 +8571,11 @@ static PyObject *__pyx_pf_3_sa_9DataArray_18read_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 = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_7);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
}
goto __pyx_L19;
@@ -8589,7 +8613,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_21read_text_data(PyObject *__pyx_v_sel
return __pyx_r;
}
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":76
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":77
* self.read_text_data(data)
*
* def read_text_data(self, data): # <<<<<<<<<<<<<<
@@ -8619,7 +8643,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("read_text_data", 0);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":77
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":78
*
* def read_text_data(self, data):
* cdef int word_count = 0 # <<<<<<<<<<<<<<
@@ -8628,7 +8652,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa
*/
__pyx_v_word_count = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":78
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":79
* def read_text_data(self, data):
* cdef int word_count = 0
* for line_num, line in enumerate(data): # <<<<<<<<<<<<<<
@@ -8641,7 +8665,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_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 = 78; __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 = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
}
@@ -8649,23 +8673,23 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_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 = 78; __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 = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 78; __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 = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
#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 = 78; __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 = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 78; __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 = 79; __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 = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[3]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -8677,43 +8701,43 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_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 = 78; __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 = 79; __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":79
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":80
* cdef int word_count = 0
* for line_num, line in enumerate(data):
* self.sent_index.append(word_count) # <<<<<<<<<<<<<<
* 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 = 79; __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 = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->sent_index), __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 79; __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 = 80; __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":80
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":81
* for line_num, line in enumerate(data):
* self.sent_index.append(word_count)
* for word in line.split(): # <<<<<<<<<<<<<<
* 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 = 80; __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 = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 80; __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 = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (PyList_CheckExact(__pyx_t_5) || PyTuple_CheckExact(__pyx_t_5)) {
__pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
} 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 = 80; __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 = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_8 = Py_TYPE(__pyx_t_6)->tp_iternext;
}
@@ -8722,23 +8746,23 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_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 = 80; __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 = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 80; __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 = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_6)) {
if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
#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 = 80; __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 = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 80; __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 = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_5 = __pyx_t_8(__pyx_t_6);
if (unlikely(!__pyx_t_5)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[3]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -8748,30 +8772,30 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa
__pyx_v_word = __pyx_t_5;
__pyx_t_5 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":81
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":82
* self.sent_index.append(word_count)
* for word in line.split():
* self.data.append(self.get_id(word)) # <<<<<<<<<<<<<<
* 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 = 81; __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 = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __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 = 82; __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 = 81; __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 = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
- __pyx_t_9 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->data), __pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __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 = 82; __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":82
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":83
* for word in line.split():
* self.data.append(self.get_id(word))
* if self.use_sent_id: # <<<<<<<<<<<<<<
@@ -8780,21 +8804,21 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa
*/
if (__pyx_v_self->use_sent_id) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":83
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":84
* self.data.append(self.get_id(word))
* if self.use_sent_id:
* self.sent_id.append(line_num) # <<<<<<<<<<<<<<
* 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 = 83; __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 = 84; __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":84
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":85
* if self.use_sent_id:
* self.sent_id.append(line_num)
* word_count = word_count + 1 # <<<<<<<<<<<<<<
@@ -8805,18 +8829,18 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_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":85
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":86
* self.sent_id.append(line_num)
* word_count = word_count + 1
* self.data.append(1) # <<<<<<<<<<<<<<
* if self.use_sent_id:
* self.sent_id.append(line_num)
*/
- __pyx_t_6 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->data), __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 85; __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 = 86; __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":86
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":87
* word_count = word_count + 1
* self.data.append(1)
* if self.use_sent_id: # <<<<<<<<<<<<<<
@@ -8825,21 +8849,21 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa
*/
if (__pyx_v_self->use_sent_id) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":87
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":88
* self.data.append(1)
* if self.use_sent_id:
* self.sent_id.append(line_num) # <<<<<<<<<<<<<<
* word_count = word_count + 1
* self.data.append(0)
*/
- __pyx_t_6 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->sent_id), __pyx_v_line_num); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 87; __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 = 88; __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":88
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":89
* if self.use_sent_id:
* self.sent_id.append(line_num)
* word_count = word_count + 1 # <<<<<<<<<<<<<<
@@ -8851,27 +8875,27 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":89
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":90
* self.sent_id.append(line_num)
* word_count = word_count + 1
* self.data.append(0) # <<<<<<<<<<<<<<
* self.sent_index.append(word_count)
*
*/
- __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->data), __pyx_int_0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 89; __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 = 90; __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":90
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":91
* word_count = word_count + 1
* self.data.append(0)
* self.sent_index.append(word_count) # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_1 = PyInt_FromLong(__pyx_v_word_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 90; __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 = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->sent_index), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 90; __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 = 91; __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;
@@ -8904,7 +8928,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_23read_binary(PyObject *__pyx_v_self,
__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 = 93; __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 = 94; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
@@ -8917,7 +8941,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_23read_binary(PyObject *__pyx_v_self,
return __pyx_r;
}
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":93
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":94
*
*
* def read_binary(self, char* filename): # <<<<<<<<<<<<<<
@@ -8931,7 +8955,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_22read_binary(struct __pyx_obj_3_sa_Da
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("read_binary", 0);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":95
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":96
* def read_binary(self, char* filename):
* cdef FILE* f
* f = fopen(filename, "r") # <<<<<<<<<<<<<<
@@ -8940,7 +8964,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_22read_binary(struct __pyx_obj_3_sa_Da
*/
__pyx_v_f = fopen(__pyx_v_filename, __pyx_k__r);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":96
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":97
* cdef FILE* f
* f = fopen(filename, "r")
* self.read_handle(f) # <<<<<<<<<<<<<<
@@ -8949,7 +8973,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_22read_binary(struct __pyx_obj_3_sa_Da
*/
((struct __pyx_vtabstruct_3_sa_DataArray *)__pyx_v_self->__pyx_vtab)->read_handle(__pyx_v_self, __pyx_v_f);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":97
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":98
* f = fopen(filename, "r")
* self.read_handle(f)
* fclose(f) # <<<<<<<<<<<<<<
@@ -8964,7 +8988,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_22read_binary(struct __pyx_obj_3_sa_Da
return __pyx_r;
}
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":99
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":100
* fclose(f)
*
* cdef void read_handle(self, FILE* f): # <<<<<<<<<<<<<<
@@ -8989,7 +9013,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":104
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":105
* cdef char* word
*
* self.data.read_handle(f) # <<<<<<<<<<<<<<
@@ -8998,7 +9022,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":105
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":106
*
* self.data.read_handle(f)
* self.sent_index.read_handle(f) # <<<<<<<<<<<<<<
@@ -9007,7 +9031,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":106
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":107
* self.data.read_handle(f)
* self.sent_index.read_handle(f)
* self.sent_id.read_handle(f) # <<<<<<<<<<<<<<
@@ -9016,7 +9040,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":107
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":108
* self.sent_index.read_handle(f)
* self.sent_id.read_handle(f)
* fread(&(num_words), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -9025,7 +9049,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":108
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":109
* self.sent_id.read_handle(f)
* fread(&(num_words), sizeof(int), 1, f)
* for i in range(num_words): # <<<<<<<<<<<<<<
@@ -9036,7 +9060,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":109
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":110
* fread(&(num_words), sizeof(int), 1, f)
* for i in range(num_words):
* fread(&(word_len), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -9045,7 +9069,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":110
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":111
* for i in range(num_words):
* fread(&(word_len), sizeof(int), 1, f)
* word = <char*> malloc (word_len * sizeof(char)) # <<<<<<<<<<<<<<
@@ -9054,7 +9078,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":111
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":112
* fread(&(word_len), sizeof(int), 1, f)
* word = <char*> malloc (word_len * sizeof(char))
* fread(word, sizeof(char), word_len, f) # <<<<<<<<<<<<<<
@@ -9063,7 +9087,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":112
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":113
* word = <char*> malloc (word_len * sizeof(char))
* fread(word, sizeof(char), word_len, f)
* self.word2id[word] = len(self.id2word) # <<<<<<<<<<<<<<
@@ -9072,31 +9096,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 = 112; __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 = 113; __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 = 112; __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 = 113; __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 = 112; __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 = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_5));
- if (PyObject_SetItem(__pyx_v_self->word2id, ((PyObject *)__pyx_t_5), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 112; __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 = 113; __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":113
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":114
* fread(word, sizeof(char), word_len, f)
* self.word2id[word] = len(self.id2word)
* self.id2word.append(word) # <<<<<<<<<<<<<<
* 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 = 113; __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 = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_3));
- __pyx_t_5 = __Pyx_PyObject_Append(__pyx_v_self->id2word, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 113; __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 = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":114
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":115
* self.word2id[word] = len(self.id2word)
* self.id2word.append(word)
* free(word) # <<<<<<<<<<<<<<
@@ -9106,7 +9130,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":115
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":116
* self.id2word.append(word)
* free(word)
* if len(self.sent_id) == 0: # <<<<<<<<<<<<<<
@@ -9115,12 +9139,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 = 115; __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 = 116; __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":116
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":117
* free(word)
* if len(self.sent_id) == 0:
* self.use_sent_id = False # <<<<<<<<<<<<<<
@@ -9132,7 +9156,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":118
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":119
* self.use_sent_id = False
* else:
* self.use_sent_id = True # <<<<<<<<<<<<<<
@@ -9152,7 +9176,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":120
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":121
* self.use_sent_id = True
*
* cdef void write_handle(self, FILE* f): # <<<<<<<<<<<<<<
@@ -9176,7 +9200,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":124
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":125
* cdef int num_words
*
* self.data.write_handle(f) # <<<<<<<<<<<<<<
@@ -9185,7 +9209,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":125
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":126
*
* self.data.write_handle(f)
* self.sent_index.write_handle(f) # <<<<<<<<<<<<<<
@@ -9194,7 +9218,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":126
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":127
* self.data.write_handle(f)
* self.sent_index.write_handle(f)
* self.sent_id.write_handle(f) # <<<<<<<<<<<<<<
@@ -9203,7 +9227,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":127
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":128
* self.sent_index.write_handle(f)
* self.sent_id.write_handle(f)
* num_words = len(self.id2word) - 2 # <<<<<<<<<<<<<<
@@ -9212,11 +9236,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 = 127; __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 = 128; __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":128
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":129
* self.sent_id.write_handle(f)
* num_words = len(self.id2word) - 2
* fwrite(&(num_words), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -9225,20 +9249,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":129
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":130
* num_words = len(self.id2word) - 2
* fwrite(&(num_words), sizeof(int), 1, f)
* for word in self.id2word[2:]: # <<<<<<<<<<<<<<
* 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 = 129; __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 = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
__pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = 0;
__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 = 129; __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 = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext;
}
@@ -9247,23 +9271,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 = 129; __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 = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 129; __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 = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_3)) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
#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 = 129; __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 = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 129; __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 = 130; __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 = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -9273,17 +9297,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":130
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":131
* fwrite(&(num_words), sizeof(int), 1, f)
* for word in self.id2word[2:]:
* word_len = len(word) + 1 # <<<<<<<<<<<<<<
* 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 = 130; __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 = 131; __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":131
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":132
* for word in self.id2word[2:]:
* word_len = len(word) + 1
* fwrite(&(word_len), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -9292,14 +9316,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":132
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":133
* 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 = 132; __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 = 133; __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;
@@ -9322,7 +9346,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_25write_binary(PyObject *__pyx_v_self,
__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 = 134; __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 = 135; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
@@ -9335,7 +9359,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_25write_binary(PyObject *__pyx_v_self,
return __pyx_r;
}
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":134
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":135
* fwrite(<char *>word, sizeof(char), word_len, f)
*
* def write_binary(self, char* filename): # <<<<<<<<<<<<<<
@@ -9349,7 +9373,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_24write_binary(struct __pyx_obj_3_sa_D
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("write_binary", 0);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":136
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":137
* def write_binary(self, char* filename):
* cdef FILE* f
* f = fopen(filename, "w") # <<<<<<<<<<<<<<
@@ -9358,7 +9382,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_24write_binary(struct __pyx_obj_3_sa_D
*/
__pyx_v_f = fopen(__pyx_v_filename, __pyx_k__w);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":137
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":138
* cdef FILE* f
* f = fopen(filename, "w")
* self.write_handle(f) # <<<<<<<<<<<<<<
@@ -9367,7 +9391,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_24write_binary(struct __pyx_obj_3_sa_D
*/
((struct __pyx_vtabstruct_3_sa_DataArray *)__pyx_v_self->__pyx_vtab)->write_handle(__pyx_v_self, __pyx_v_f);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":138
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":139
* f = fopen(filename, "w")
* self.write_handle(f)
* fclose(f) # <<<<<<<<<<<<<<
@@ -9393,7 +9417,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_27write_enhanced_handle(PyObject *__py
return __pyx_r;
}
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":140
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":141
* fclose(f)
*
* def write_enhanced_handle(self, f): # <<<<<<<<<<<<<<
@@ -9417,7 +9441,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_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":141
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":142
*
* def write_enhanced_handle(self, f):
* for i in self.data: # <<<<<<<<<<<<<<
@@ -9428,7 +9452,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_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 = 141; __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 = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -9436,23 +9460,23 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_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 = 141; __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 = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 141; __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 = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#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 = 141; __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 = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 141; __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 = 142; __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 = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[3]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -9462,23 +9486,23 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_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":142
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":143
* def write_enhanced_handle(self, f):
* for i in self.data:
* f.write("%d " %i) # <<<<<<<<<<<<<<
* f.write("\n")
* for i in self.sent_index:
*/
- __pyx_t_4 = 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_t_4 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_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_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_21), __pyx_v_i); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_5));
- __pyx_t_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_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_5));
__Pyx_GIVEREF(((PyObject *)__pyx_t_5));
__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 = 142; __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 = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
@@ -9486,21 +9510,21 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_o
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":143
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":144
* for i in self.data:
* f.write("%d " %i)
* f.write("\n") # <<<<<<<<<<<<<<
* for i in self.sent_index:
* f.write("%d " %i)
*/
- __pyx_t_1 = 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_t_1 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_22), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 143; __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 = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":144
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":145
* f.write("%d " %i)
* f.write("\n")
* for i in self.sent_index: # <<<<<<<<<<<<<<
@@ -9511,7 +9535,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_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 = 144; __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 = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_3 = Py_TYPE(__pyx_t_5)->tp_iternext;
}
@@ -9519,23 +9543,23 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_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 = 144; __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 = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 144; __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 = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_5)) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
#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 = 144; __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 = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 144; __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 = 145; __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 = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[3]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -9545,23 +9569,23 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_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":145
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":146
* f.write("\n")
* for i in self.sent_index:
* f.write("%d " %i) # <<<<<<<<<<<<<<
* f.write("\n")
* for i in self.sent_id:
*/
- __pyx_t_1 = 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_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_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 = 145; __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 = 146; __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 = 145; __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 = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_6));
__Pyx_GIVEREF(((PyObject *)__pyx_t_6));
__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 = 145; __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 = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
@@ -9569,21 +9593,21 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_o
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":146
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":147
* for i in self.sent_index:
* f.write("%d " %i)
* f.write("\n") # <<<<<<<<<<<<<<
* for i in self.sent_id:
* f.write("%d " %i)
*/
- __pyx_t_5 = 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_t_5 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_23), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 146; __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 = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":147
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":148
* f.write("%d " %i)
* f.write("\n")
* for i in self.sent_id: # <<<<<<<<<<<<<<
@@ -9594,7 +9618,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_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 = 147; __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 = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_3 = Py_TYPE(__pyx_t_6)->tp_iternext;
}
@@ -9602,23 +9626,23 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_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 = 147; __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 = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 147; __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 = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_6)) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
#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 = 147; __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 = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 147; __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 = 148; __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 = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[3]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -9628,23 +9652,23 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_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":148
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":149
* f.write("\n")
* for i in self.sent_id:
* f.write("%d " %i) # <<<<<<<<<<<<<<
* f.write("\n")
* for word in self.id2word:
*/
- __pyx_t_5 = 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_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_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 = 148; __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 = 149; __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 = 148; __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 = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_4));
__Pyx_GIVEREF(((PyObject *)__pyx_t_4));
__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 = 148; __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 = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
@@ -9652,21 +9676,21 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_o
}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":149
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":150
* for i in self.sent_id:
* f.write("%d " %i)
* f.write("\n") # <<<<<<<<<<<<<<
* for word in self.id2word:
* f.write("%s %d " % (word, self.word2id[word]))
*/
- __pyx_t_6 = 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_t_6 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_k_tuple_24), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 149; __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 = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":150
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":151
* f.write("%d " %i)
* f.write("\n")
* for word in self.id2word: # <<<<<<<<<<<<<<
@@ -9677,7 +9701,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_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 = 150; __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 = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = Py_TYPE(__pyx_t_4)->tp_iternext;
}
@@ -9685,23 +9709,23 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_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 = 150; __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 = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 150; __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 = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_4)) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
#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 = 150; __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 = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 150; __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 = 151; __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 = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[3]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -9711,18 +9735,18 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_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":151
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":152
* f.write("\n")
* for word in self.id2word:
* f.write("%s %d " % (word, self.word2id[word])) # <<<<<<<<<<<<<<
* f.write("\n")
*
*/
- __pyx_t_6 = 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_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_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 = 151; __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 = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 151; __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 = 152; __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);
@@ -9730,15 +9754,15 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_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 = 151; __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 = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_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_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_1));
__Pyx_GIVEREF(((PyObject *)__pyx_t_1));
__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 = 151; __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 = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
@@ -9746,16 +9770,16 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_o
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":152
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":153
* for word in self.id2word:
* f.write("%s %d " % (word, self.word2id[word]))
* f.write("\n") # <<<<<<<<<<<<<<
*
* def write_enhanced(self, char* filename):
*/
- __pyx_t_4 = 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_t_4 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_26), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __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 = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -9785,7 +9809,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_29write_enhanced(PyObject *__pyx_v_sel
__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 = 154; __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 = 155; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
@@ -9798,7 +9822,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_29write_enhanced(PyObject *__pyx_v_sel
return __pyx_r;
}
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":154
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":155
* f.write("\n")
*
* def write_enhanced(self, char* filename): # <<<<<<<<<<<<<<
@@ -9826,16 +9850,16 @@ static PyObject *__pyx_pf_3_sa_9DataArray_28write_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":155
+ /* "/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)
*/
/*with:*/ {
- __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_t_1 = PyBytes_FromString(__pyx_v_filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __pyx_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_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1));
__Pyx_GIVEREF(((PyObject *)__pyx_t_1));
@@ -9843,14 +9867,14 @@ static PyObject *__pyx_pf_3_sa_9DataArray_28write_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 = 155; __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 = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_3 = 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_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____exit__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = 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_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____enter__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 155; __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 = 156; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -9865,14 +9889,14 @@ static PyObject *__pyx_pf_3_sa_9DataArray_28write_enhanced(struct __pyx_obj_3_sa
__pyx_v_f = __pyx_t_4;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":156
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":157
* def write_enhanced(self, char* filename):
* with open(filename, "w") as f:
* self.write_enhanced_handle(self, f) # <<<<<<<<<<<<<<
*/
- __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_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_27); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; __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 = 157; __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));
@@ -9880,7 +9904,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_28write_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 = 156; __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 = 157; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
@@ -9895,7 +9919,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_28write_enhanced(struct __pyx_obj_3_sa
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":155
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":156
*
* def write_enhanced(self, char* filename):
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -9903,11 +9927,11 @@ static PyObject *__pyx_pf_3_sa_9DataArray_28write_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 = 155; __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 = 156; __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 = 155; __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 = 156; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_INCREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2);
@@ -9920,11 +9944,11 @@ static PyObject *__pyx_pf_3_sa_9DataArray_28write_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 = 155; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
+ if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
__Pyx_GOTREF(__pyx_t_10);
__pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_10);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
+ if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
__pyx_t_11 = (!__pyx_t_9);
if (__pyx_t_11) {
__Pyx_GIVEREF(__pyx_t_2);
@@ -9932,7 +9956,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_28write_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 = 155; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
+ {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
goto __pyx_L18;
}
__pyx_L18:;
@@ -9960,11 +9984,11 @@ static PyObject *__pyx_pf_3_sa_9DataArray_28write_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 = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_7);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
}
goto __pyx_L19;
@@ -9991,6 +10015,180 @@ static PyObject *__pyx_pf_3_sa_9DataArray_28write_enhanced(struct __pyx_obj_3_sa
}
/* Python wrapper */
+static PyObject *__pyx_pw_3_sa_9DataArray_7word2id_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_3_sa_9DataArray_7word2id_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_3_sa_9DataArray_7word2id___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":10
+ *
+ * cdef class DataArray:
+ * cdef public word2id # <<<<<<<<<<<<<<
+ * cdef public id2word
+ * cdef public IntList data
+ */
+
+static PyObject *__pyx_pf_3_sa_9DataArray_7word2id___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(__pyx_v_self->word2id);
+ __pyx_r = __pyx_v_self->word2id;
+ 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_7word2id_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_pw_3_sa_9DataArray_7word2id_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_7word2id_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_7word2id_2__set__(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_value) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__set__", 0);
+ __Pyx_INCREF(__pyx_v_value);
+ __Pyx_GIVEREF(__pyx_v_value);
+ __Pyx_GOTREF(__pyx_v_self->word2id);
+ __Pyx_DECREF(__pyx_v_self->word2id);
+ __pyx_v_self->word2id = __pyx_v_value;
+
+ __pyx_r = 0;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_3_sa_9DataArray_7word2id_5__del__(PyObject *__pyx_v_self); /*proto*/
+static int __pyx_pw_3_sa_9DataArray_7word2id_5__del__(PyObject *__pyx_v_self) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_3_sa_9DataArray_7word2id_4__del__(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self));
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_pf_3_sa_9DataArray_7word2id_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->word2id);
+ __Pyx_DECREF(__pyx_v_self->word2id);
+ __pyx_v_self->word2id = Py_None;
+
+ __pyx_r = 0;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3_sa_9DataArray_7id2word_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_3_sa_9DataArray_7id2word_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_3_sa_9DataArray_7id2word___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":11
+ * cdef class DataArray:
+ * cdef public word2id
+ * cdef public id2word # <<<<<<<<<<<<<<
+ * cdef public IntList data
+ * cdef public IntList sent_id
+ */
+
+static PyObject *__pyx_pf_3_sa_9DataArray_7id2word___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(__pyx_v_self->id2word);
+ __pyx_r = __pyx_v_self->id2word;
+ 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_7id2word_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_pw_3_sa_9DataArray_7id2word_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_7id2word_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_7id2word_2__set__(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_value) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__set__", 0);
+ __Pyx_INCREF(__pyx_v_value);
+ __Pyx_GIVEREF(__pyx_v_value);
+ __Pyx_GOTREF(__pyx_v_self->id2word);
+ __Pyx_DECREF(__pyx_v_self->id2word);
+ __pyx_v_self->id2word = __pyx_v_value;
+
+ __pyx_r = 0;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_3_sa_9DataArray_7id2word_5__del__(PyObject *__pyx_v_self); /*proto*/
+static int __pyx_pw_3_sa_9DataArray_7id2word_5__del__(PyObject *__pyx_v_self) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_3_sa_9DataArray_7id2word_4__del__(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self));
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_pf_3_sa_9DataArray_7id2word_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->id2word);
+ __Pyx_DECREF(__pyx_v_self->id2word);
+ __pyx_v_self->id2word = Py_None;
+
+ __pyx_r = 0;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* 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;
@@ -10002,11 +10200,11 @@ static PyObject *__pyx_pw_3_sa_9DataArray_4data_1__get__(PyObject *__pyx_v_self)
}
/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":12
- * cdef word2id
- * cdef id2word
+ * cdef public word2id
+ * cdef public id2word
* cdef public IntList data # <<<<<<<<<<<<<<
- * cdef IntList sent_id
- * cdef IntList sent_index
+ * cdef public IntList sent_id
+ * cdef public IntList sent_index
*/
static PyObject *__pyx_pf_3_sa_9DataArray_4data___get__(struct __pyx_obj_3_sa_DataArray *__pyx_v_self) {
@@ -10086,6 +10284,206 @@ static int __pyx_pf_3_sa_9DataArray_4data_4__del__(struct __pyx_obj_3_sa_DataArr
return __pyx_r;
}
+/* Python wrapper */
+static PyObject *__pyx_pw_3_sa_9DataArray_7sent_id_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_3_sa_9DataArray_7sent_id_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_3_sa_9DataArray_7sent_id___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":13
+ * cdef public id2word
+ * cdef public IntList data
+ * cdef public IntList sent_id # <<<<<<<<<<<<<<
+ * cdef public IntList sent_index
+ * cdef bint use_sent_id
+ */
+
+static PyObject *__pyx_pf_3_sa_9DataArray_7sent_id___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->sent_id));
+ __pyx_r = ((PyObject *)__pyx_v_self->sent_id);
+ 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_7sent_id_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_pw_3_sa_9DataArray_7sent_id_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_7sent_id_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_7sent_id_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 = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_INCREF(__pyx_v_value);
+ __Pyx_GIVEREF(__pyx_v_value);
+ __Pyx_GOTREF(__pyx_v_self->sent_id);
+ __Pyx_DECREF(((PyObject *)__pyx_v_self->sent_id));
+ __pyx_v_self->sent_id = ((struct __pyx_obj_3_sa_IntList *)__pyx_v_value);
+
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_AddTraceback("_sa.DataArray.sent_id.__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_7sent_id_5__del__(PyObject *__pyx_v_self); /*proto*/
+static int __pyx_pw_3_sa_9DataArray_7sent_id_5__del__(PyObject *__pyx_v_self) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_3_sa_9DataArray_7sent_id_4__del__(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self));
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_pf_3_sa_9DataArray_7sent_id_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->sent_id);
+ __Pyx_DECREF(((PyObject *)__pyx_v_self->sent_id));
+ __pyx_v_self->sent_id = ((struct __pyx_obj_3_sa_IntList *)Py_None);
+
+ __pyx_r = 0;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3_sa_9DataArray_10sent_index_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_3_sa_9DataArray_10sent_index_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_3_sa_9DataArray_10sent_index___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":14
+ * cdef public IntList data
+ * cdef public IntList sent_id
+ * cdef public IntList sent_index # <<<<<<<<<<<<<<
+ * cdef bint use_sent_id
+ *
+ */
+
+static PyObject *__pyx_pf_3_sa_9DataArray_10sent_index___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->sent_index));
+ __pyx_r = ((PyObject *)__pyx_v_self->sent_index);
+ 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_10sent_index_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_pw_3_sa_9DataArray_10sent_index_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_10sent_index_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_10sent_index_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 = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_INCREF(__pyx_v_value);
+ __Pyx_GIVEREF(__pyx_v_value);
+ __Pyx_GOTREF(__pyx_v_self->sent_index);
+ __Pyx_DECREF(((PyObject *)__pyx_v_self->sent_index));
+ __pyx_v_self->sent_index = ((struct __pyx_obj_3_sa_IntList *)__pyx_v_value);
+
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_AddTraceback("_sa.DataArray.sent_index.__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_10sent_index_5__del__(PyObject *__pyx_v_self); /*proto*/
+static int __pyx_pw_3_sa_9DataArray_10sent_index_5__del__(PyObject *__pyx_v_self) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_3_sa_9DataArray_10sent_index_4__del__(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self));
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_pf_3_sa_9DataArray_10sent_index_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->sent_index);
+ __Pyx_DECREF(((PyObject *)__pyx_v_self->sent_index));
+ __pyx_v_self->sent_index = ((struct __pyx_obj_3_sa_IntList *)Py_None);
+
+ __pyx_r = 0;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/alignment.pxi":12
+ * cdef IntList sent_index
+ *
+ * cdef int link(self, int i, int j): # <<<<<<<<<<<<<<
+ * """Integerizes an alignment link pair"""
+ * return i*65536 + j
+ */
+
static int __pyx_f_3_sa_9Alignment_link(CYTHON_UNUSED struct __pyx_obj_3_sa_Alignment *__pyx_v_self, int __pyx_v_i, int __pyx_v_j) {
int __pyx_r;
__Pyx_RefNannyDeclarations
@@ -32650,7 +33048,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_2__getitem__(struct __pyx_obj_3_sa_
* def __getitem__(self, i):
* return self.sa.arr[i] # <<<<<<<<<<<<<<
*
- * def get_sentence_id(self, i):
+ * def read_text(self, filename, side):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
@@ -32673,210 +33071,9 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_2__getitem__(struct __pyx_obj_3_sa_
}
/* Python wrapper */
-static PyObject *__pyx_pw_3_sa_11SuffixArray_5get_sentence_id(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
-static PyObject *__pyx_pw_3_sa_11SuffixArray_5get_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_11SuffixArray_4get_sentence_id(((struct __pyx_obj_3_sa_SuffixArray *)__pyx_v_self), ((PyObject *)__pyx_v_i));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":23
- * return self.sa.arr[i]
- *
- * def get_sentence_id(self, i): # <<<<<<<<<<<<<<
- * return self.darray.get_sentence_id(i)
- *
- */
-
-static PyObject *__pyx_pf_3_sa_11SuffixArray_4get_sentence_id(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, PyObject *__pyx_v_i) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("get_sentence_id", 0);
-
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":24
- *
- * def get_sentence_id(self, i):
- * return self.darray.get_sentence_id(i) # <<<<<<<<<<<<<<
- *
- * def get_sentence(self, i):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->darray), __pyx_n_s__get_sentence_id); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_v_i);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_i);
- __Pyx_GIVEREF(__pyx_v_i);
- __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_r = __pyx_t_3;
- __pyx_t_3 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("_sa.SuffixArray.get_sentence_id", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_3_sa_11SuffixArray_7get_sentence(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
-static PyObject *__pyx_pw_3_sa_11SuffixArray_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_11SuffixArray_6get_sentence(((struct __pyx_obj_3_sa_SuffixArray *)__pyx_v_self), ((PyObject *)__pyx_v_i));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":26
- * return self.darray.get_sentence_id(i)
- *
- * def get_sentence(self, i): # <<<<<<<<<<<<<<
- * return self.darray.get_sentence(i)
- *
- */
-
-static PyObject *__pyx_pf_3_sa_11SuffixArray_6get_sentence(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, PyObject *__pyx_v_i) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("get_sentence", 0);
-
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":27
- *
- * def get_sentence(self, i):
- * return self.darray.get_sentence(i) # <<<<<<<<<<<<<<
- *
- * def get_sentence_position(self, loc):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->darray), __pyx_n_s__get_sentence); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_v_i);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_i);
- __Pyx_GIVEREF(__pyx_v_i);
- __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_r = __pyx_t_3;
- __pyx_t_3 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("_sa.SuffixArray.get_sentence", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_3_sa_11SuffixArray_9get_sentence_position(PyObject *__pyx_v_self, PyObject *__pyx_v_loc); /*proto*/
-static PyObject *__pyx_pw_3_sa_11SuffixArray_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_11SuffixArray_8get_sentence_position(((struct __pyx_obj_3_sa_SuffixArray *)__pyx_v_self), ((PyObject *)__pyx_v_loc));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":29
- * return self.darray.get_sentence(i)
- *
- * def get_sentence_position(self, loc): # <<<<<<<<<<<<<<
- * return self.darray.get_sentence_position(loc)
- *
- */
-
-static PyObject *__pyx_pf_3_sa_11SuffixArray_8get_sentence_position(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, PyObject *__pyx_v_loc) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("get_sentence_position", 0);
-
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":30
- *
- * def get_sentence_position(self, loc):
- * return self.darray.get_sentence_position(loc) # <<<<<<<<<<<<<<
- *
- * def read_text(self, filename, side):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->darray), __pyx_n_s_89); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_v_loc);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_loc);
- __Pyx_GIVEREF(__pyx_v_loc);
- __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_r = __pyx_t_3;
- __pyx_t_3 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("_sa.SuffixArray.get_sentence_position", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_3_sa_11SuffixArray_11read_text(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_3_sa_11SuffixArray_10read_text[] = "Constructs suffix array using the algorithm\n of Larsson & Sadahkane (1999)";
-static PyObject *__pyx_pw_3_sa_11SuffixArray_11read_text(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_3_sa_11SuffixArray_5read_text(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_3_sa_11SuffixArray_4read_text[] = "Constructs suffix array using the algorithm\n of Larsson & Sadahkane (1999)";
+static PyObject *__pyx_pw_3_sa_11SuffixArray_5read_text(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_filename = 0;
PyObject *__pyx_v_side = 0;
PyObject *__pyx_r = 0;
@@ -32902,11 +33099,11 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_11read_text(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_text", 1, 2, 2, 1); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("read_text", 1, 2, 2, 1); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 23; __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_text") < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_text") < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
@@ -32919,26 +33116,26 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_11read_text(PyObject *__pyx_v_self,
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("read_text", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("read_text", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("_sa.SuffixArray.read_text", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_3_sa_11SuffixArray_10read_text(((struct __pyx_obj_3_sa_SuffixArray *)__pyx_v_self), __pyx_v_filename, __pyx_v_side);
+ __pyx_r = __pyx_pf_3_sa_11SuffixArray_4read_text(((struct __pyx_obj_3_sa_SuffixArray *)__pyx_v_self), __pyx_v_filename, __pyx_v_side);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":32
- * return self.darray.get_sentence_position(loc)
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":23
+ * return self.sa.arr[i]
*
* def read_text(self, filename, side): # <<<<<<<<<<<<<<
* '''Constructs suffix array using the algorithm
* of Larsson & Sadahkane (1999)'''
*/
-static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_side) {
+static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_side) {
int __pyx_v_V;
int __pyx_v_N;
int __pyx_v_i;
@@ -32970,22 +33167,22 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("read_text", 0);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":38
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":29
* cdef IntList isa, word_count
*
* self.darray = DataArray(from_text=filename, side=side, use_sent_id=True) # <<<<<<<<<<<<<<
* N = len(self.darray)
* V = len(self.darray.id2word)
*/
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__from_text), __pyx_v_filename) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__side), __pyx_v_side) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__from_text), __pyx_v_filename) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__side), __pyx_v_side) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__use_sent_id), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__use_sent_id), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_DataArray)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_DataArray)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__Pyx_GIVEREF(__pyx_t_2);
@@ -32994,7 +33191,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
__pyx_v_self->darray = ((struct __pyx_obj_3_sa_DataArray *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":39
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":30
*
* self.darray = DataArray(from_text=filename, side=side, use_sent_id=True)
* N = len(self.darray) # <<<<<<<<<<<<<<
@@ -33003,11 +33200,11 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
*/
__pyx_t_2 = ((PyObject *)__pyx_v_self->darray);
__Pyx_INCREF(__pyx_t_2);
- __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_N = __pyx_t_3;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":40
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":31
* self.darray = DataArray(from_text=filename, side=side, use_sent_id=True)
* N = len(self.darray)
* V = len(self.darray.id2word) # <<<<<<<<<<<<<<
@@ -33016,24 +33213,24 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
*/
__pyx_t_2 = __pyx_v_self->darray->id2word;
__Pyx_INCREF(__pyx_t_2);
- __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_V = __pyx_t_3;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":42
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":33
* V = len(self.darray.id2word)
*
* self.sa = IntList(initial_len=N) # <<<<<<<<<<<<<<
* self.ha = IntList(initial_len=V+1)
*
*/
- __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
- __pyx_t_1 = PyInt_FromLong(__pyx_v_N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong(__pyx_v_N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__Pyx_GIVEREF(__pyx_t_1);
@@ -33042,20 +33239,20 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
__pyx_v_self->sa = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":43
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":34
*
* self.sa = IntList(initial_len=N)
* self.ha = IntList(initial_len=V+1) # <<<<<<<<<<<<<<
*
* isa = IntList(initial_len=N)
*/
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __pyx_t_2 = PyInt_FromLong((__pyx_v_V + 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromLong((__pyx_v_V + 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__Pyx_GIVEREF(__pyx_t_2);
@@ -33064,45 +33261,45 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
__pyx_v_self->ha = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":45
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":36
* self.ha = IntList(initial_len=V+1)
*
* isa = IntList(initial_len=N) # <<<<<<<<<<<<<<
* word_count = IntList(initial_len=V+1)
*
*/
- __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
- __pyx_t_1 = PyInt_FromLong(__pyx_v_N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong(__pyx_v_N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__pyx_v_isa = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":46
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":37
*
* isa = IntList(initial_len=N)
* word_count = IntList(initial_len=V+1) # <<<<<<<<<<<<<<
*
* '''Step 1: bucket sort data'''
*/
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __pyx_t_2 = PyInt_FromLong((__pyx_v_V + 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromLong((__pyx_v_V + 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__pyx_v_word_count = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":49
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":40
*
* '''Step 1: bucket sort data'''
* cdef float sort_start_time = monitor_cpu() # <<<<<<<<<<<<<<
@@ -33111,7 +33308,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
*/
__pyx_v_sort_start_time = __pyx_f_3_sa_monitor_cpu();
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":50
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":41
* '''Step 1: bucket sort data'''
* cdef float sort_start_time = monitor_cpu()
* cdef float start_time = sort_start_time # <<<<<<<<<<<<<<
@@ -33120,7 +33317,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
*/
__pyx_v_start_time = __pyx_v_sort_start_time;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":51
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":42
* cdef float sort_start_time = monitor_cpu()
* cdef float start_time = sort_start_time
* for i from 0 <= i < N: # <<<<<<<<<<<<<<
@@ -33130,7 +33327,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
__pyx_t_4 = __pyx_v_N;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":52
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":43
* cdef float start_time = sort_start_time
* for i from 0 <= i < N:
* a_i = self.darray.data.arr[i] # <<<<<<<<<<<<<<
@@ -33139,7 +33336,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
*/
__pyx_v_a_i = (__pyx_v_self->darray->data->arr[__pyx_v_i]);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":53
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":44
* for i from 0 <= i < N:
* a_i = self.darray.data.arr[i]
* word_count.arr[a_i] = word_count.arr[a_i] + 1 # <<<<<<<<<<<<<<
@@ -33149,7 +33346,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
(__pyx_v_word_count->arr[__pyx_v_a_i]) = ((__pyx_v_word_count->arr[__pyx_v_a_i]) + 1);
}
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":55
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":46
* word_count.arr[a_i] = word_count.arr[a_i] + 1
*
* n = 0 # <<<<<<<<<<<<<<
@@ -33158,7 +33355,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
*/
__pyx_v_n = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":56
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":47
*
* n = 0
* for i from 0 <= i < V+1: # <<<<<<<<<<<<<<
@@ -33168,7 +33365,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
__pyx_t_5 = (__pyx_v_V + 1);
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":57
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":48
* n = 0
* for i from 0 <= i < V+1:
* self.ha.arr[i] = n # <<<<<<<<<<<<<<
@@ -33177,7 +33374,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
*/
(__pyx_v_self->ha->arr[__pyx_v_i]) = __pyx_v_n;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":58
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":49
* for i from 0 <= i < V+1:
* self.ha.arr[i] = n
* n = n + word_count.arr[i] # <<<<<<<<<<<<<<
@@ -33186,7 +33383,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
*/
__pyx_v_n = (__pyx_v_n + (__pyx_v_word_count->arr[__pyx_v_i]));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":59
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":50
* self.ha.arr[i] = n
* n = n + word_count.arr[i]
* word_count.arr[i] = 0 # <<<<<<<<<<<<<<
@@ -33196,7 +33393,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
(__pyx_v_word_count->arr[__pyx_v_i]) = 0;
}
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":61
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":52
* word_count.arr[i] = 0
*
* for i from 0 <= i < N: # <<<<<<<<<<<<<<
@@ -33206,7 +33403,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
__pyx_t_4 = __pyx_v_N;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":62
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":53
*
* for i from 0 <= i < N:
* a_i = self.darray.data.arr[i] # <<<<<<<<<<<<<<
@@ -33215,7 +33412,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
*/
__pyx_v_a_i = (__pyx_v_self->darray->data->arr[__pyx_v_i]);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":63
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":54
* for i from 0 <= i < N:
* a_i = self.darray.data.arr[i]
* self.sa.arr[self.ha.arr[a_i] + word_count.arr[a_i]] = i # <<<<<<<<<<<<<<
@@ -33224,7 +33421,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
*/
(__pyx_v_self->sa->arr[((__pyx_v_self->ha->arr[__pyx_v_a_i]) + (__pyx_v_word_count->arr[__pyx_v_a_i]))]) = __pyx_v_i;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":64
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":55
* a_i = self.darray.data.arr[i]
* self.sa.arr[self.ha.arr[a_i] + word_count.arr[a_i]] = i
* isa.arr[i] = self.ha.arr[a_i + 1] - 1 # bucket pointer is last index in bucket # <<<<<<<<<<<<<<
@@ -33233,7 +33430,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
*/
(__pyx_v_isa->arr[__pyx_v_i]) = ((__pyx_v_self->ha->arr[(__pyx_v_a_i + 1)]) - 1);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":65
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":56
* self.sa.arr[self.ha.arr[a_i] + word_count.arr[a_i]] = i
* isa.arr[i] = self.ha.arr[a_i + 1] - 1 # bucket pointer is last index in bucket
* word_count.arr[a_i] = word_count.arr[a_i] + 1 # <<<<<<<<<<<<<<
@@ -33243,7 +33440,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
(__pyx_v_word_count->arr[__pyx_v_a_i]) = ((__pyx_v_word_count->arr[__pyx_v_a_i]) + 1);
}
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":68
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":59
*
* '''Determine size of initial runs'''
* current_run = 0 # <<<<<<<<<<<<<<
@@ -33252,7 +33449,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
*/
__pyx_v_current_run = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":69
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":60
* '''Determine size of initial runs'''
* current_run = 0
* for i from 0 <= i < V+1: # <<<<<<<<<<<<<<
@@ -33262,7 +33459,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
__pyx_t_5 = (__pyx_v_V + 1);
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":70
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":61
* current_run = 0
* for i from 0 <= i < V+1:
* if i < V and self.ha.arr[i+1] - self.ha.arr[i] == 1: # <<<<<<<<<<<<<<
@@ -33278,7 +33475,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
}
if (__pyx_t_8) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":71
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":62
* for i from 0 <= i < V+1:
* if i < V and self.ha.arr[i+1] - self.ha.arr[i] == 1:
* current_run = current_run + 1 # <<<<<<<<<<<<<<
@@ -33290,7 +33487,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
}
/*else*/ {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":73
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":64
* current_run = current_run + 1
* else:
* if current_run > 0: # <<<<<<<<<<<<<<
@@ -33300,7 +33497,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
__pyx_t_8 = (__pyx_v_current_run > 0);
if (__pyx_t_8) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":74
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":65
* else:
* if current_run > 0:
* self.sa.arr[self.ha.arr[i] - current_run] = -current_run # <<<<<<<<<<<<<<
@@ -33309,7 +33506,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
*/
(__pyx_v_self->sa->arr[((__pyx_v_self->ha->arr[__pyx_v_i]) - __pyx_v_current_run)]) = (-__pyx_v_current_run);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":75
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":66
* if current_run > 0:
* self.sa.arr[self.ha.arr[i] - current_run] = -current_run
* current_run = 0 # <<<<<<<<<<<<<<
@@ -33324,35 +33521,35 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
__pyx_L11:;
}
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":77
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":68
* current_run = 0
*
* logger.info(" Bucket sort took %f seconds", (monitor_cpu() - sort_start_time)) # <<<<<<<<<<<<<<
*
* '''Step 2: prefix-doubling sort'''
*/
- __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyFloat_FromDouble((__pyx_f_3_sa_monitor_cpu() - __pyx_v_sort_start_time)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyFloat_FromDouble((__pyx_f_3_sa_monitor_cpu() - __pyx_v_sort_start_time)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
- __Pyx_INCREF(((PyObject *)__pyx_kp_s_90));
- PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_kp_s_90));
- __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_90));
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_89));
+ PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_kp_s_89));
+ __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_89));
PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
__pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":80
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":71
*
* '''Step 2: prefix-doubling sort'''
* h = 1 # <<<<<<<<<<<<<<
@@ -33361,7 +33558,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
*/
__pyx_v_h = 1;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":81
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":72
* '''Step 2: prefix-doubling sort'''
* h = 1
* while self.sa.arr[0] != -N: # <<<<<<<<<<<<<<
@@ -33372,7 +33569,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
__pyx_t_8 = ((__pyx_v_self->sa->arr[0]) != (-__pyx_v_N));
if (!__pyx_t_8) break;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":82
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":73
* h = 1
* while self.sa.arr[0] != -N:
* sort_start_time = monitor_cpu() # <<<<<<<<<<<<<<
@@ -33381,35 +33578,35 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
*/
__pyx_v_sort_start_time = __pyx_f_3_sa_monitor_cpu();
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":83
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":74
* while self.sa.arr[0] != -N:
* sort_start_time = monitor_cpu()
* logger.debug(" Refining, sort depth = %d", h) # <<<<<<<<<<<<<<
* i = 0
* skip = 0
*/
- __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_9 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__debug); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__debug); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyInt_FromLong(__pyx_v_h); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromLong(__pyx_v_h); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __Pyx_INCREF(((PyObject *)__pyx_kp_s_91));
- PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_91));
- __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_91));
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_90));
+ PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_90));
+ __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_90));
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
__pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":84
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":75
* sort_start_time = monitor_cpu()
* logger.debug(" Refining, sort depth = %d", h)
* i = 0 # <<<<<<<<<<<<<<
@@ -33418,7 +33615,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
*/
__pyx_v_i = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":85
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":76
* logger.debug(" Refining, sort depth = %d", h)
* i = 0
* skip = 0 # <<<<<<<<<<<<<<
@@ -33427,7 +33624,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
*/
__pyx_v_skip = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":86
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":77
* i = 0
* skip = 0
* while i < N: # <<<<<<<<<<<<<<
@@ -33438,7 +33635,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
__pyx_t_8 = (__pyx_v_i < __pyx_v_N);
if (!__pyx_t_8) break;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":87
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":78
* skip = 0
* while i < N:
* if self.sa.arr[i] < 0: # <<<<<<<<<<<<<<
@@ -33448,7 +33645,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
__pyx_t_8 = ((__pyx_v_self->sa->arr[__pyx_v_i]) < 0);
if (__pyx_t_8) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":88
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":79
* while i < N:
* if self.sa.arr[i] < 0:
* skip = skip + self.sa.arr[i] # <<<<<<<<<<<<<<
@@ -33457,7 +33654,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
*/
__pyx_v_skip = (__pyx_v_skip + (__pyx_v_self->sa->arr[__pyx_v_i]));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":89
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":80
* if self.sa.arr[i] < 0:
* skip = skip + self.sa.arr[i]
* i = i - self.sa.arr[i] # <<<<<<<<<<<<<<
@@ -33469,7 +33666,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
}
/*else*/ {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":91
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":82
* i = i - self.sa.arr[i]
* else:
* if skip < 0: # <<<<<<<<<<<<<<
@@ -33479,7 +33676,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
__pyx_t_8 = (__pyx_v_skip < 0);
if (__pyx_t_8) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":92
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":83
* else:
* if skip < 0:
* self.sa.arr[i+skip] = skip # <<<<<<<<<<<<<<
@@ -33488,7 +33685,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
*/
(__pyx_v_self->sa->arr[(__pyx_v_i + __pyx_v_skip)]) = __pyx_v_skip;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":93
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":84
* if skip < 0:
* self.sa.arr[i+skip] = skip
* skip = 0 # <<<<<<<<<<<<<<
@@ -33500,7 +33697,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
}
__pyx_L18:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":94
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":85
* self.sa.arr[i+skip] = skip
* skip = 0
* j = isa.arr[self.sa.arr[i]] # <<<<<<<<<<<<<<
@@ -33509,22 +33706,22 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
*/
__pyx_v_j = (__pyx_v_isa->arr[(__pyx_v_self->sa->arr[__pyx_v_i])]);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":95
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":86
* skip = 0
* j = isa.arr[self.sa.arr[i]]
* self.q3sort(i, j, h, isa) # <<<<<<<<<<<<<<
* i = j+1
* if skip < 0:
*/
- __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__q3sort); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__q3sort); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_9 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
- __pyx_t_10 = PyInt_FromLong(__pyx_v_h); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyInt_FromLong(__pyx_v_h); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_11 = PyTuple_New(4); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyTuple_New(4); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
@@ -33538,13 +33735,13 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
__pyx_t_1 = 0;
__pyx_t_9 = 0;
__pyx_t_10 = 0;
- __pyx_t_10 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":96
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":87
* j = isa.arr[self.sa.arr[i]]
* self.q3sort(i, j, h, isa)
* i = j+1 # <<<<<<<<<<<<<<
@@ -33556,7 +33753,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
__pyx_L17:;
}
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":97
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":88
* self.q3sort(i, j, h, isa)
* i = j+1
* if skip < 0: # <<<<<<<<<<<<<<
@@ -33566,7 +33763,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
__pyx_t_8 = (__pyx_v_skip < 0);
if (__pyx_t_8) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":98
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":89
* i = j+1
* if skip < 0:
* self.sa.arr[i+skip] = skip # <<<<<<<<<<<<<<
@@ -33578,7 +33775,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
}
__pyx_L19:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":99
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":90
* if skip < 0:
* self.sa.arr[i+skip] = skip
* h = h * 2 # <<<<<<<<<<<<<<
@@ -33587,53 +33784,53 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
*/
__pyx_v_h = (__pyx_v_h * 2);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":100
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":91
* self.sa.arr[i+skip] = skip
* h = h * 2
* logger.debug(" Refinement took %f seconds", (monitor_cpu() - sort_start_time)) # <<<<<<<<<<<<<<
*
* '''Step 3: read off suffix array from inverse suffix array'''
*/
- __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_11 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__debug); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__debug); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = PyFloat_FromDouble((__pyx_f_3_sa_monitor_cpu() - __pyx_v_sort_start_time)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyFloat_FromDouble((__pyx_f_3_sa_monitor_cpu() - __pyx_v_sort_start_time)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(((PyObject *)__pyx_kp_s_92));
- PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_92));
- __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_92));
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_91));
+ PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_91));
+ __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_91));
PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_10);
__Pyx_GIVEREF(__pyx_t_10);
__pyx_t_10 = 0;
- __pyx_t_10 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
}
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":103
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":94
*
* '''Step 3: read off suffix array from inverse suffix array'''
* logger.info(" Finalizing sort...") # <<<<<<<<<<<<<<
* for i from 0 <= i < N:
* j = isa.arr[i]
*/
- __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_2 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_94), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_93), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":104
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":95
* '''Step 3: read off suffix array from inverse suffix array'''
* logger.info(" Finalizing sort...")
* for i from 0 <= i < N: # <<<<<<<<<<<<<<
@@ -33643,7 +33840,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
__pyx_t_4 = __pyx_v_N;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":105
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":96
* logger.info(" Finalizing sort...")
* for i from 0 <= i < N:
* j = isa.arr[i] # <<<<<<<<<<<<<<
@@ -33652,7 +33849,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
*/
__pyx_v_j = (__pyx_v_isa->arr[__pyx_v_i]);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":106
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":97
* for i from 0 <= i < N:
* j = isa.arr[i]
* self.sa.arr[j] = i # <<<<<<<<<<<<<<
@@ -33662,29 +33859,29 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
(__pyx_v_self->sa->arr[__pyx_v_j]) = __pyx_v_i;
}
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":107
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":98
* j = isa.arr[i]
* self.sa.arr[j] = i
* logger.info("Suffix array construction took %f seconds", (monitor_cpu() - start_time)) # <<<<<<<<<<<<<<
*
* def q3sort(self, int i, int j, int h, IntList isa, pad=""):
*/
- __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_2 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = PyFloat_FromDouble((__pyx_f_3_sa_monitor_cpu() - __pyx_v_start_time)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyFloat_FromDouble((__pyx_f_3_sa_monitor_cpu() - __pyx_v_start_time)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
- __Pyx_INCREF(((PyObject *)__pyx_kp_s_95));
- PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)__pyx_kp_s_95));
- __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_95));
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_94));
+ PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)__pyx_kp_s_94));
+ __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_94));
PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_10);
__Pyx_GIVEREF(__pyx_t_10);
__pyx_t_10 = 0;
- __pyx_t_10 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
@@ -33709,9 +33906,9 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_S
}
/* Python wrapper */
-static PyObject *__pyx_pw_3_sa_11SuffixArray_13q3sort(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_3_sa_11SuffixArray_12q3sort[] = "This is a ternary quicksort. It divides the array into\n three partitions: items less than the pivot, items equal\n to pivot, and items greater than pivot. The first and last\n of these partitions are then recursively sorted";
-static PyObject *__pyx_pw_3_sa_11SuffixArray_13q3sort(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_3_sa_11SuffixArray_7q3sort(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_3_sa_11SuffixArray_6q3sort[] = "This is a ternary quicksort. It divides the array into\n three partitions: items less than the pivot, items equal\n to pivot, and items greater than pivot. The first and last\n of these partitions are then recursively sorted";
+static PyObject *__pyx_pw_3_sa_11SuffixArray_7q3sort(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
int __pyx_v_i;
int __pyx_v_j;
int __pyx_v_h;
@@ -33744,17 +33941,17 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_13q3sort(PyObject *__pyx_v_self, Py
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__j)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("q3sort", 0, 4, 5, 1); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("q3sort", 0, 4, 5, 1); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__h)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("q3sort", 0, 4, 5, 2); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("q3sort", 0, 4, 5, 2); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__isa)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("q3sort", 0, 4, 5, 3); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("q3sort", 0, 4, 5, 3); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 4:
if (kw_args > 0) {
@@ -33763,7 +33960,7 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_13q3sort(PyObject *__pyx_v_self, Py
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "q3sort") < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "q3sort") < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -33776,22 +33973,22 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_13q3sort(PyObject *__pyx_v_self, Py
default: goto __pyx_L5_argtuple_error;
}
}
- __pyx_v_i = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_i == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_j = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_j == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_h = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_h == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_i == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_j = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_j == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_h = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_h == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_v_isa = ((struct __pyx_obj_3_sa_IntList *)values[3]);
__pyx_v_pad = values[4];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("q3sort", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("q3sort", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("_sa.SuffixArray.q3sort", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isa), __pyx_ptype_3_sa_IntList, 1, "isa", 0))) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_r = __pyx_pf_3_sa_11SuffixArray_12q3sort(((struct __pyx_obj_3_sa_SuffixArray *)__pyx_v_self), __pyx_v_i, __pyx_v_j, __pyx_v_h, __pyx_v_isa, __pyx_v_pad);
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isa), __pyx_ptype_3_sa_IntList, 1, "isa", 0))) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_r = __pyx_pf_3_sa_11SuffixArray_6q3sort(((struct __pyx_obj_3_sa_SuffixArray *)__pyx_v_self), __pyx_v_i, __pyx_v_j, __pyx_v_h, __pyx_v_isa, __pyx_v_pad);
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
@@ -33800,7 +33997,7 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_13q3sort(PyObject *__pyx_v_self, Py
return __pyx_r;
}
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":109
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":100
* logger.info("Suffix array construction took %f seconds", (monitor_cpu() - start_time))
*
* def q3sort(self, int i, int j, int h, IntList isa, pad=""): # <<<<<<<<<<<<<<
@@ -33808,7 +34005,7 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_13q3sort(PyObject *__pyx_v_self, Py
* three partitions: items less than the pivot, items equal
*/
-static PyObject *__pyx_pf_3_sa_11SuffixArray_12q3sort(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, int __pyx_v_i, int __pyx_v_j, int __pyx_v_h, struct __pyx_obj_3_sa_IntList *__pyx_v_isa, PyObject *__pyx_v_pad) {
+static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, int __pyx_v_i, int __pyx_v_j, int __pyx_v_h, struct __pyx_obj_3_sa_IntList *__pyx_v_isa, PyObject *__pyx_v_pad) {
int __pyx_v_k;
int __pyx_v_midpoint;
int __pyx_v_pval;
@@ -33830,7 +34027,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12q3sort(struct __pyx_obj_3_sa_Suff
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("q3sort", 0);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":116
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":107
* cdef int k, midpoint, pval, phead, ptail, tmp
*
* if j-i < -1: # <<<<<<<<<<<<<<
@@ -33840,18 +34037,18 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12q3sort(struct __pyx_obj_3_sa_Suff
__pyx_t_1 = ((__pyx_v_j - __pyx_v_i) < -1);
if (__pyx_t_1) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":117
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":108
*
* if j-i < -1:
* raise Exception("Unexpected condition found in q3sort: sort from %d to %d" % (i,j)) # <<<<<<<<<<<<<<
* if j-i == -1: # recursive base case -- empty interval
* return
*/
- __pyx_t_2 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
@@ -33859,25 +34056,25 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12q3sort(struct __pyx_obj_3_sa_Suff
__Pyx_GIVEREF(__pyx_t_3);
__pyx_t_2 = 0;
__pyx_t_3 = 0;
- __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_96), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_95), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_3));
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3));
__Pyx_GIVEREF(((PyObject *)__pyx_t_3));
__pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[12]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[12]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L3;
}
__pyx_L3:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":118
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":109
* if j-i < -1:
* raise Exception("Unexpected condition found in q3sort: sort from %d to %d" % (i,j))
* if j-i == -1: # recursive base case -- empty interval # <<<<<<<<<<<<<<
@@ -33887,7 +34084,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12q3sort(struct __pyx_obj_3_sa_Suff
__pyx_t_1 = ((__pyx_v_j - __pyx_v_i) == -1);
if (__pyx_t_1) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":119
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":110
* raise Exception("Unexpected condition found in q3sort: sort from %d to %d" % (i,j))
* if j-i == -1: # recursive base case -- empty interval
* return # <<<<<<<<<<<<<<
@@ -33901,7 +34098,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12q3sort(struct __pyx_obj_3_sa_Suff
}
__pyx_L4:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":120
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":111
* if j-i == -1: # recursive base case -- empty interval
* return
* if (j-i == 0): # recursive base case -- singleton interval # <<<<<<<<<<<<<<
@@ -33911,7 +34108,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12q3sort(struct __pyx_obj_3_sa_Suff
__pyx_t_1 = ((__pyx_v_j - __pyx_v_i) == 0);
if (__pyx_t_1) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":121
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":112
* return
* if (j-i == 0): # recursive base case -- singleton interval
* isa.arr[self.sa.arr[i]] = i # <<<<<<<<<<<<<<
@@ -33920,7 +34117,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12q3sort(struct __pyx_obj_3_sa_Suff
*/
(__pyx_v_isa->arr[(__pyx_v_self->sa->arr[__pyx_v_i])]) = __pyx_v_i;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":122
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":113
* if (j-i == 0): # recursive base case -- singleton interval
* isa.arr[self.sa.arr[i]] = i
* self.sa.arr[i] = -1 # <<<<<<<<<<<<<<
@@ -33929,7 +34126,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12q3sort(struct __pyx_obj_3_sa_Suff
*/
(__pyx_v_self->sa->arr[__pyx_v_i]) = -1;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":123
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":114
* isa.arr[self.sa.arr[i]] = i
* self.sa.arr[i] = -1
* return # <<<<<<<<<<<<<<
@@ -33943,7 +34140,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12q3sort(struct __pyx_obj_3_sa_Suff
}
__pyx_L5:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":132
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":123
* # If the method of assigning word_id's is changed, this method
* # may need to be reconsidered as well.
* midpoint = (i+j)/2 # <<<<<<<<<<<<<<
@@ -33952,7 +34149,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12q3sort(struct __pyx_obj_3_sa_Suff
*/
__pyx_v_midpoint = __Pyx_div_long((__pyx_v_i + __pyx_v_j), 2);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":133
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":124
* # may need to be reconsidered as well.
* midpoint = (i+j)/2
* pval = isa.arr[self.sa.arr[midpoint] + h] # <<<<<<<<<<<<<<
@@ -33961,7 +34158,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12q3sort(struct __pyx_obj_3_sa_Suff
*/
__pyx_v_pval = (__pyx_v_isa->arr[((__pyx_v_self->sa->arr[__pyx_v_midpoint]) + __pyx_v_h)]);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":134
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":125
* midpoint = (i+j)/2
* pval = isa.arr[self.sa.arr[midpoint] + h]
* if i != midpoint: # <<<<<<<<<<<<<<
@@ -33971,7 +34168,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12q3sort(struct __pyx_obj_3_sa_Suff
__pyx_t_1 = (__pyx_v_i != __pyx_v_midpoint);
if (__pyx_t_1) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":135
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":126
* pval = isa.arr[self.sa.arr[midpoint] + h]
* if i != midpoint:
* tmp = self.sa.arr[midpoint] # <<<<<<<<<<<<<<
@@ -33980,7 +34177,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12q3sort(struct __pyx_obj_3_sa_Suff
*/
__pyx_v_tmp = (__pyx_v_self->sa->arr[__pyx_v_midpoint]);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":136
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":127
* if i != midpoint:
* tmp = self.sa.arr[midpoint]
* self.sa.arr[midpoint] = self.sa.arr[i] # <<<<<<<<<<<<<<
@@ -33989,7 +34186,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12q3sort(struct __pyx_obj_3_sa_Suff
*/
(__pyx_v_self->sa->arr[__pyx_v_midpoint]) = (__pyx_v_self->sa->arr[__pyx_v_i]);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":137
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":128
* tmp = self.sa.arr[midpoint]
* self.sa.arr[midpoint] = self.sa.arr[i]
* self.sa.arr[i] = tmp # <<<<<<<<<<<<<<
@@ -34001,7 +34198,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12q3sort(struct __pyx_obj_3_sa_Suff
}
__pyx_L6:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":138
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":129
* self.sa.arr[midpoint] = self.sa.arr[i]
* self.sa.arr[i] = tmp
* phead = i # <<<<<<<<<<<<<<
@@ -34010,7 +34207,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12q3sort(struct __pyx_obj_3_sa_Suff
*/
__pyx_v_phead = __pyx_v_i;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":139
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":130
* self.sa.arr[i] = tmp
* phead = i
* ptail = i # <<<<<<<<<<<<<<
@@ -34019,7 +34216,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12q3sort(struct __pyx_obj_3_sa_Suff
*/
__pyx_v_ptail = __pyx_v_i;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":143
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":134
* # find the three partitions. phead marks the first element
* # of the middle partition, and ptail marks the last element
* for k from i+1 <= k < j+1: # <<<<<<<<<<<<<<
@@ -34029,7 +34226,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12q3sort(struct __pyx_obj_3_sa_Suff
__pyx_t_5 = (__pyx_v_j + 1);
for (__pyx_v_k = (__pyx_v_i + 1); __pyx_v_k < __pyx_t_5; __pyx_v_k++) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":144
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":135
* # of the middle partition, and ptail marks the last element
* for k from i+1 <= k < j+1:
* if isa.arr[self.sa.arr[k] + h] < pval: # <<<<<<<<<<<<<<
@@ -34039,7 +34236,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12q3sort(struct __pyx_obj_3_sa_Suff
__pyx_t_1 = ((__pyx_v_isa->arr[((__pyx_v_self->sa->arr[__pyx_v_k]) + __pyx_v_h)]) < __pyx_v_pval);
if (__pyx_t_1) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":145
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":136
* for k from i+1 <= k < j+1:
* if isa.arr[self.sa.arr[k] + h] < pval:
* if k > ptail+1: # <<<<<<<<<<<<<<
@@ -34049,7 +34246,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12q3sort(struct __pyx_obj_3_sa_Suff
__pyx_t_1 = (__pyx_v_k > (__pyx_v_ptail + 1));
if (__pyx_t_1) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":146
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":137
* if isa.arr[self.sa.arr[k] + h] < pval:
* if k > ptail+1:
* tmp = self.sa.arr[phead] # <<<<<<<<<<<<<<
@@ -34058,7 +34255,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12q3sort(struct __pyx_obj_3_sa_Suff
*/
__pyx_v_tmp = (__pyx_v_self->sa->arr[__pyx_v_phead]);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":147
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":138
* if k > ptail+1:
* tmp = self.sa.arr[phead]
* self.sa.arr[phead] = self.sa.arr[k] # <<<<<<<<<<<<<<
@@ -34067,7 +34264,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12q3sort(struct __pyx_obj_3_sa_Suff
*/
(__pyx_v_self->sa->arr[__pyx_v_phead]) = (__pyx_v_self->sa->arr[__pyx_v_k]);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":148
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":139
* tmp = self.sa.arr[phead]
* self.sa.arr[phead] = self.sa.arr[k]
* self.sa.arr[k] = self.sa.arr[ptail+1] # <<<<<<<<<<<<<<
@@ -34076,7 +34273,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12q3sort(struct __pyx_obj_3_sa_Suff
*/
(__pyx_v_self->sa->arr[__pyx_v_k]) = (__pyx_v_self->sa->arr[(__pyx_v_ptail + 1)]);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":149
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":140
* self.sa.arr[phead] = self.sa.arr[k]
* self.sa.arr[k] = self.sa.arr[ptail+1]
* self.sa.arr[ptail+1] = tmp # <<<<<<<<<<<<<<
@@ -34088,7 +34285,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12q3sort(struct __pyx_obj_3_sa_Suff
}
/*else*/ {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":151
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":142
* self.sa.arr[ptail+1] = tmp
* else: # k == ptail+1
* tmp = self.sa.arr[phead] # <<<<<<<<<<<<<<
@@ -34097,7 +34294,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12q3sort(struct __pyx_obj_3_sa_Suff
*/
__pyx_v_tmp = (__pyx_v_self->sa->arr[__pyx_v_phead]);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":152
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":143
* else: # k == ptail+1
* tmp = self.sa.arr[phead]
* self.sa.arr[phead] = self.sa.arr[k] # <<<<<<<<<<<<<<
@@ -34106,7 +34303,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12q3sort(struct __pyx_obj_3_sa_Suff
*/
(__pyx_v_self->sa->arr[__pyx_v_phead]) = (__pyx_v_self->sa->arr[__pyx_v_k]);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":153
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":144
* tmp = self.sa.arr[phead]
* self.sa.arr[phead] = self.sa.arr[k]
* self.sa.arr[k] = tmp # <<<<<<<<<<<<<<
@@ -34117,7 +34314,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12q3sort(struct __pyx_obj_3_sa_Suff
}
__pyx_L10:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":154
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":145
* self.sa.arr[phead] = self.sa.arr[k]
* self.sa.arr[k] = tmp
* phead = phead + 1 # <<<<<<<<<<<<<<
@@ -34126,7 +34323,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12q3sort(struct __pyx_obj_3_sa_Suff
*/
__pyx_v_phead = (__pyx_v_phead + 1);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":155
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":146
* self.sa.arr[k] = tmp
* phead = phead + 1
* ptail = ptail + 1 # <<<<<<<<<<<<<<
@@ -34138,7 +34335,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12q3sort(struct __pyx_obj_3_sa_Suff
}
/*else*/ {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":157
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":148
* ptail = ptail + 1
* else:
* if isa.arr[self.sa.arr[k] + h] == pval: # <<<<<<<<<<<<<<
@@ -34148,7 +34345,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12q3sort(struct __pyx_obj_3_sa_Suff
__pyx_t_1 = ((__pyx_v_isa->arr[((__pyx_v_self->sa->arr[__pyx_v_k]) + __pyx_v_h)]) == __pyx_v_pval);
if (__pyx_t_1) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":158
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":149
* else:
* if isa.arr[self.sa.arr[k] + h] == pval:
* if k > ptail+1: # <<<<<<<<<<<<<<
@@ -34158,7 +34355,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12q3sort(struct __pyx_obj_3_sa_Suff
__pyx_t_1 = (__pyx_v_k > (__pyx_v_ptail + 1));
if (__pyx_t_1) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":159
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":150
* if isa.arr[self.sa.arr[k] + h] == pval:
* if k > ptail+1:
* tmp = self.sa.arr[ptail+1] # <<<<<<<<<<<<<<
@@ -34167,7 +34364,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12q3sort(struct __pyx_obj_3_sa_Suff
*/
__pyx_v_tmp = (__pyx_v_self->sa->arr[(__pyx_v_ptail + 1)]);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":160
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":151
* if k > ptail+1:
* tmp = self.sa.arr[ptail+1]
* self.sa.arr[ptail+1] = self.sa.arr[k] # <<<<<<<<<<<<<<
@@ -34176,7 +34373,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12q3sort(struct __pyx_obj_3_sa_Suff
*/
(__pyx_v_self->sa->arr[(__pyx_v_ptail + 1)]) = (__pyx_v_self->sa->arr[__pyx_v_k]);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":161
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":152
* tmp = self.sa.arr[ptail+1]
* self.sa.arr[ptail+1] = self.sa.arr[k]
* self.sa.arr[k] = tmp # <<<<<<<<<<<<<<
@@ -34188,7 +34385,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12q3sort(struct __pyx_obj_3_sa_Suff
}
__pyx_L12:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":162
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":153
* self.sa.arr[ptail+1] = self.sa.arr[k]
* self.sa.arr[k] = tmp
* ptail = ptail + 1 # <<<<<<<<<<<<<<
@@ -34203,24 +34400,24 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12q3sort(struct __pyx_obj_3_sa_Suff
__pyx_L9:;
}
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":165
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":156
*
* # recursively sort smaller suffixes
* self.q3sort(i, phead-1, h, isa, pad+" ") # <<<<<<<<<<<<<<
*
* # update suffixes with pivot value
*/
- __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__q3sort); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__q3sort); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_2 = PyInt_FromLong((__pyx_v_phead - 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromLong((__pyx_v_phead - 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_6 = PyInt_FromLong(__pyx_v_h); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyInt_FromLong(__pyx_v_h); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = PyNumber_Add(__pyx_v_pad, ((PyObject *)__pyx_kp_s_48)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyNumber_Add(__pyx_v_pad, ((PyObject *)__pyx_kp_s_48)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = PyTuple_New(5); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyTuple_New(5); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
@@ -34237,13 +34434,13 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12q3sort(struct __pyx_obj_3_sa_Suff
__pyx_t_2 = 0;
__pyx_t_6 = 0;
__pyx_t_7 = 0;
- __pyx_t_7 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":169
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":160
* # update suffixes with pivot value
* # corresponds to update_group function in Larsson & Sadakane
* for k from phead <= k < ptail+1: # <<<<<<<<<<<<<<
@@ -34253,7 +34450,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12q3sort(struct __pyx_obj_3_sa_Suff
__pyx_t_5 = (__pyx_v_ptail + 1);
for (__pyx_v_k = __pyx_v_phead; __pyx_v_k < __pyx_t_5; __pyx_v_k++) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":170
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":161
* # corresponds to update_group function in Larsson & Sadakane
* for k from phead <= k < ptail+1:
* isa.arr[self.sa.arr[k]] = ptail # <<<<<<<<<<<<<<
@@ -34263,7 +34460,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12q3sort(struct __pyx_obj_3_sa_Suff
(__pyx_v_isa->arr[(__pyx_v_self->sa->arr[__pyx_v_k])]) = __pyx_v_ptail;
}
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":171
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":162
* for k from phead <= k < ptail+1:
* isa.arr[self.sa.arr[k]] = ptail
* if phead == ptail: # <<<<<<<<<<<<<<
@@ -34273,7 +34470,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12q3sort(struct __pyx_obj_3_sa_Suff
__pyx_t_1 = (__pyx_v_phead == __pyx_v_ptail);
if (__pyx_t_1) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":172
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":163
* isa.arr[self.sa.arr[k]] = ptail
* if phead == ptail:
* self.sa.arr[phead] = -1 # <<<<<<<<<<<<<<
@@ -34285,24 +34482,24 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12q3sort(struct __pyx_obj_3_sa_Suff
}
__pyx_L15:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":175
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":166
*
* # recursively sort larger suffixes
* self.q3sort(ptail+1, j, h, isa, pad+" ") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_7 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__q3sort); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__q3sort); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = PyInt_FromLong((__pyx_v_ptail + 1)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyInt_FromLong((__pyx_v_ptail + 1)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_3 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_6 = PyInt_FromLong(__pyx_v_h); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyInt_FromLong(__pyx_v_h); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_2 = PyNumber_Add(__pyx_v_pad, ((PyObject *)__pyx_kp_s_48)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Add(__pyx_v_pad, ((PyObject *)__pyx_kp_s_48)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8);
__Pyx_GIVEREF(__pyx_t_8);
@@ -34319,7 +34516,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12q3sort(struct __pyx_obj_3_sa_Suff
__pyx_t_3 = 0;
__pyx_t_6 = 0;
__pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
@@ -34343,14 +34540,14 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12q3sort(struct __pyx_obj_3_sa_Suff
}
/* Python wrapper */
-static PyObject *__pyx_pw_3_sa_11SuffixArray_15write_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/
-static PyObject *__pyx_pw_3_sa_11SuffixArray_15write_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) {
+static PyObject *__pyx_pw_3_sa_11SuffixArray_9write_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/
+static PyObject *__pyx_pw_3_sa_11SuffixArray_9write_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) {
char *__pyx_v_filename;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("write_text (wrapper)", 0);
assert(__pyx_arg_filename); {
- __pyx_v_filename = PyBytes_AsString(__pyx_arg_filename); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_filename = PyBytes_AsString(__pyx_arg_filename); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
@@ -34358,12 +34555,12 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_15write_text(PyObject *__pyx_v_self
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_3_sa_11SuffixArray_14write_text(((struct __pyx_obj_3_sa_SuffixArray *)__pyx_v_self), ((char *)__pyx_v_filename));
+ __pyx_r = __pyx_pf_3_sa_11SuffixArray_8write_text(((struct __pyx_obj_3_sa_SuffixArray *)__pyx_v_self), ((char *)__pyx_v_filename));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":178
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":169
*
*
* def write_text(self, char* filename): # <<<<<<<<<<<<<<
@@ -34371,7 +34568,7 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_15write_text(PyObject *__pyx_v_self
*
*/
-static PyObject *__pyx_pf_3_sa_11SuffixArray_14write_text(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, char *__pyx_v_filename) {
+static PyObject *__pyx_pf_3_sa_11SuffixArray_8write_text(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, char *__pyx_v_filename) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
@@ -34382,23 +34579,23 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_14write_text(struct __pyx_obj_3_sa_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("write_text", 0);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":179
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":170
*
* def write_text(self, char* filename):
* self.darray.write_text(filename) # <<<<<<<<<<<<<<
*
* def read_binary(self, char* filename):
*/
- __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->darray), __pyx_n_s__write_text); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->darray), __pyx_n_s__write_text); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyBytes_FromString(__pyx_v_filename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyBytes_FromString(__pyx_v_filename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2));
__Pyx_GIVEREF(((PyObject *)__pyx_t_2));
__pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
@@ -34419,14 +34616,14 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_14write_text(struct __pyx_obj_3_sa_
}
/* Python wrapper */
-static PyObject *__pyx_pw_3_sa_11SuffixArray_17read_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/
-static PyObject *__pyx_pw_3_sa_11SuffixArray_17read_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) {
+static PyObject *__pyx_pw_3_sa_11SuffixArray_11read_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/
+static PyObject *__pyx_pw_3_sa_11SuffixArray_11read_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) {
char *__pyx_v_filename;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("read_binary (wrapper)", 0);
assert(__pyx_arg_filename); {
- __pyx_v_filename = PyBytes_AsString(__pyx_arg_filename); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_filename = PyBytes_AsString(__pyx_arg_filename); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
@@ -34434,12 +34631,12 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_17read_binary(PyObject *__pyx_v_sel
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_3_sa_11SuffixArray_16read_binary(((struct __pyx_obj_3_sa_SuffixArray *)__pyx_v_self), ((char *)__pyx_v_filename));
+ __pyx_r = __pyx_pf_3_sa_11SuffixArray_10read_binary(((struct __pyx_obj_3_sa_SuffixArray *)__pyx_v_self), ((char *)__pyx_v_filename));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":181
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":172
* self.darray.write_text(filename)
*
* def read_binary(self, char* filename): # <<<<<<<<<<<<<<
@@ -34447,13 +34644,13 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_17read_binary(PyObject *__pyx_v_sel
* f = fopen(filename, "r")
*/
-static PyObject *__pyx_pf_3_sa_11SuffixArray_16read_binary(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, char *__pyx_v_filename) {
+static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_binary(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, char *__pyx_v_filename) {
FILE *__pyx_v_f;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("read_binary", 0);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":183
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":174
* def read_binary(self, char* filename):
* cdef FILE *f
* f = fopen(filename, "r") # <<<<<<<<<<<<<<
@@ -34462,7 +34659,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_16read_binary(struct __pyx_obj_3_sa
*/
__pyx_v_f = fopen(__pyx_v_filename, __pyx_k__r);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":184
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":175
* cdef FILE *f
* f = fopen(filename, "r")
* self.darray.read_handle(f) # <<<<<<<<<<<<<<
@@ -34471,7 +34668,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_16read_binary(struct __pyx_obj_3_sa
*/
((struct __pyx_vtabstruct_3_sa_DataArray *)__pyx_v_self->darray->__pyx_vtab)->read_handle(__pyx_v_self->darray, __pyx_v_f);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":185
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":176
* f = fopen(filename, "r")
* self.darray.read_handle(f)
* self.sa.read_handle(f) # <<<<<<<<<<<<<<
@@ -34480,7 +34677,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_16read_binary(struct __pyx_obj_3_sa
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->sa->__pyx_vtab)->read_handle(__pyx_v_self->sa, __pyx_v_f);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":186
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":177
* self.darray.read_handle(f)
* self.sa.read_handle(f)
* self.ha.read_handle(f) # <<<<<<<<<<<<<<
@@ -34489,7 +34686,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_16read_binary(struct __pyx_obj_3_sa
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->ha->__pyx_vtab)->read_handle(__pyx_v_self->ha, __pyx_v_f);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":187
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":178
* self.sa.read_handle(f)
* self.ha.read_handle(f)
* fclose(f) # <<<<<<<<<<<<<<
@@ -34505,14 +34702,14 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_16read_binary(struct __pyx_obj_3_sa
}
/* Python wrapper */
-static PyObject *__pyx_pw_3_sa_11SuffixArray_19write_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/
-static PyObject *__pyx_pw_3_sa_11SuffixArray_19write_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) {
+static PyObject *__pyx_pw_3_sa_11SuffixArray_13write_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/
+static PyObject *__pyx_pw_3_sa_11SuffixArray_13write_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) {
char *__pyx_v_filename;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("write_binary (wrapper)", 0);
assert(__pyx_arg_filename); {
- __pyx_v_filename = PyBytes_AsString(__pyx_arg_filename); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_filename = PyBytes_AsString(__pyx_arg_filename); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
@@ -34520,12 +34717,12 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_19write_binary(PyObject *__pyx_v_se
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_3_sa_11SuffixArray_18write_binary(((struct __pyx_obj_3_sa_SuffixArray *)__pyx_v_self), ((char *)__pyx_v_filename));
+ __pyx_r = __pyx_pf_3_sa_11SuffixArray_12write_binary(((struct __pyx_obj_3_sa_SuffixArray *)__pyx_v_self), ((char *)__pyx_v_filename));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":189
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":180
* fclose(f)
*
* def write_binary(self, char* filename): # <<<<<<<<<<<<<<
@@ -34533,13 +34730,13 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_19write_binary(PyObject *__pyx_v_se
* f = fopen(filename, "w")
*/
-static PyObject *__pyx_pf_3_sa_11SuffixArray_18write_binary(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, char *__pyx_v_filename) {
+static PyObject *__pyx_pf_3_sa_11SuffixArray_12write_binary(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, char *__pyx_v_filename) {
FILE *__pyx_v_f;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("write_binary", 0);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":191
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":182
* def write_binary(self, char* filename):
* cdef FILE* f
* f = fopen(filename, "w") # <<<<<<<<<<<<<<
@@ -34548,7 +34745,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_18write_binary(struct __pyx_obj_3_s
*/
__pyx_v_f = fopen(__pyx_v_filename, __pyx_k__w);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":192
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":183
* cdef FILE* f
* f = fopen(filename, "w")
* self.darray.write_handle(f) # <<<<<<<<<<<<<<
@@ -34557,7 +34754,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_18write_binary(struct __pyx_obj_3_s
*/
((struct __pyx_vtabstruct_3_sa_DataArray *)__pyx_v_self->darray->__pyx_vtab)->write_handle(__pyx_v_self->darray, __pyx_v_f);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":193
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":184
* f = fopen(filename, "w")
* self.darray.write_handle(f)
* self.sa.write_handle(f) # <<<<<<<<<<<<<<
@@ -34566,7 +34763,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_18write_binary(struct __pyx_obj_3_s
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->sa->__pyx_vtab)->write_handle(__pyx_v_self->sa, __pyx_v_f);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":194
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":185
* self.darray.write_handle(f)
* self.sa.write_handle(f)
* self.ha.write_handle(f) # <<<<<<<<<<<<<<
@@ -34575,7 +34772,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_18write_binary(struct __pyx_obj_3_s
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->ha->__pyx_vtab)->write_handle(__pyx_v_self->ha, __pyx_v_f);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":195
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":186
* self.sa.write_handle(f)
* self.ha.write_handle(f)
* fclose(f) # <<<<<<<<<<<<<<
@@ -34591,14 +34788,14 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_18write_binary(struct __pyx_obj_3_s
}
/* Python wrapper */
-static PyObject *__pyx_pw_3_sa_11SuffixArray_21write_enhanced(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/
-static PyObject *__pyx_pw_3_sa_11SuffixArray_21write_enhanced(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) {
+static PyObject *__pyx_pw_3_sa_11SuffixArray_15write_enhanced(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/
+static PyObject *__pyx_pw_3_sa_11SuffixArray_15write_enhanced(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) {
char *__pyx_v_filename;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("write_enhanced (wrapper)", 0);
assert(__pyx_arg_filename); {
- __pyx_v_filename = PyBytes_AsString(__pyx_arg_filename); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_filename = PyBytes_AsString(__pyx_arg_filename); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
@@ -34606,12 +34803,12 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_21write_enhanced(PyObject *__pyx_v_
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_3_sa_11SuffixArray_20write_enhanced(((struct __pyx_obj_3_sa_SuffixArray *)__pyx_v_self), ((char *)__pyx_v_filename));
+ __pyx_r = __pyx_pf_3_sa_11SuffixArray_14write_enhanced(((struct __pyx_obj_3_sa_SuffixArray *)__pyx_v_self), ((char *)__pyx_v_filename));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":197
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":188
* fclose(f)
*
* def write_enhanced(self, char* filename): # <<<<<<<<<<<<<<
@@ -34619,7 +34816,7 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_21write_enhanced(PyObject *__pyx_v_
* self.darray.write_enhanced_handle(f)
*/
-static PyObject *__pyx_pf_3_sa_11SuffixArray_20write_enhanced(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, char *__pyx_v_filename) {
+static PyObject *__pyx_pf_3_sa_11SuffixArray_14write_enhanced(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, char *__pyx_v_filename) {
PyObject *__pyx_v_f = NULL;
PyObject *__pyx_v_a_i = NULL;
PyObject *__pyx_v_w_i = NULL;
@@ -34643,7 +34840,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_20write_enhanced(struct __pyx_obj_3
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("write_enhanced", 0);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":198
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":189
*
* def write_enhanced(self, char* filename):
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -34651,9 +34848,9 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_20write_enhanced(struct __pyx_obj_3
* for a_i in self.sa:
*/
/*with:*/ {
- __pyx_t_1 = PyBytes_FromString(__pyx_v_filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyBytes_FromString(__pyx_v_filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1));
__Pyx_GIVEREF(((PyObject *)__pyx_t_1));
@@ -34661,14 +34858,14 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_20write_enhanced(struct __pyx_obj_3
PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_n_s__w));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__w));
__pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_builtin_open, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_builtin_open, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____exit__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____exit__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____enter__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____enter__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -34683,27 +34880,27 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_20write_enhanced(struct __pyx_obj_3
__pyx_v_f = __pyx_t_4;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":199
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":190
* def write_enhanced(self, char* filename):
* with open(filename, "w") as f:
* self.darray.write_enhanced_handle(f) # <<<<<<<<<<<<<<
* for a_i in self.sa:
* f.write("%d " % a_i)
*/
- __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self->darray), __pyx_n_s_27); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self->darray), __pyx_n_s_27); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v_f);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_f);
__Pyx_GIVEREF(__pyx_v_f);
- __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":200
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":191
* with open(filename, "w") as f:
* self.darray.write_enhanced_handle(f)
* for a_i in self.sa: # <<<<<<<<<<<<<<
@@ -34714,7 +34911,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_20write_enhanced(struct __pyx_obj_3
__pyx_t_2 = ((PyObject *)__pyx_v_self->sa); __Pyx_INCREF(__pyx_t_2); __pyx_t_8 = 0;
__pyx_t_9 = NULL;
} else {
- __pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(((PyObject *)__pyx_v_self->sa)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(((PyObject *)__pyx_v_self->sa)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_9 = Py_TYPE(__pyx_t_2)->tp_iternext;
}
@@ -34722,23 +34919,23 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_20write_enhanced(struct __pyx_obj_3
if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_2)) {
if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
#else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
#endif
} else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_2)) {
if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
#else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
#endif
} else {
__pyx_t_1 = __pyx_t_9(__pyx_t_2);
if (unlikely(!__pyx_t_1)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[12]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ else {__pyx_filename = __pyx_f[12]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
}
break;
}
@@ -34748,23 +34945,23 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_20write_enhanced(struct __pyx_obj_3
__pyx_v_a_i = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":201
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":192
* self.darray.write_enhanced_handle(f)
* for a_i in self.sa:
* f.write("%d " % a_i) # <<<<<<<<<<<<<<
* f.write("\n")
* for w_i in self.ha:
*/
- __pyx_t_1 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __pyx_t_1 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_21), __pyx_v_a_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_21), __pyx_v_a_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_4));
- __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(__pyx_t_10);
PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_t_4));
__Pyx_GIVEREF(((PyObject *)__pyx_t_4));
__pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
@@ -34772,21 +34969,21 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_20write_enhanced(struct __pyx_obj_3
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":202
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":193
* for a_i in self.sa:
* f.write("%d " % a_i)
* f.write("\n") # <<<<<<<<<<<<<<
* for w_i in self.ha:
* f.write("%d " % w_i)
*/
- __pyx_t_2 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __pyx_t_2 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_97), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_96), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":203
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":194
* f.write("%d " % a_i)
* f.write("\n")
* for w_i in self.ha: # <<<<<<<<<<<<<<
@@ -34797,7 +34994,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_20write_enhanced(struct __pyx_obj_3
__pyx_t_4 = ((PyObject *)__pyx_v_self->ha); __Pyx_INCREF(__pyx_t_4); __pyx_t_8 = 0;
__pyx_t_9 = NULL;
} else {
- __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(((PyObject *)__pyx_v_self->ha)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(((PyObject *)__pyx_v_self->ha)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_9 = Py_TYPE(__pyx_t_4)->tp_iternext;
}
@@ -34805,23 +35002,23 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_20write_enhanced(struct __pyx_obj_3
if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_4)) {
if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_4)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
#else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
#endif
} else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_4)) {
if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
#else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
#endif
} else {
__pyx_t_2 = __pyx_t_9(__pyx_t_4);
if (unlikely(!__pyx_t_2)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[12]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ else {__pyx_filename = __pyx_f[12]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
}
break;
}
@@ -34831,23 +35028,23 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_20write_enhanced(struct __pyx_obj_3
__pyx_v_w_i = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":204
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":195
* f.write("\n")
* for w_i in self.ha:
* f.write("%d " % w_i) # <<<<<<<<<<<<<<
* f.write("\n")
*
*/
- __pyx_t_2 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __pyx_t_2 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_10 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_21), __pyx_v_w_i); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __pyx_t_10 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_21), __pyx_v_w_i); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_10));
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_10));
__Pyx_GIVEREF(((PyObject *)__pyx_t_10));
__pyx_t_10 = 0;
- __pyx_t_10 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __pyx_t_10 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
@@ -34855,16 +35052,16 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_20write_enhanced(struct __pyx_obj_3
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":205
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":196
* for w_i in self.ha:
* f.write("%d " % w_i)
* f.write("\n") # <<<<<<<<<<<<<<
*
* cdef int __search_high(self, int word_id, int offset, int low, int high):
*/
- __pyx_t_4 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __pyx_t_4 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_10 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_98), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
+ __pyx_t_10 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_97), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
@@ -34879,7 +35076,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_20write_enhanced(struct __pyx_obj_3
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":198
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":189
*
* def write_enhanced(self, char* filename):
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -34888,11 +35085,11 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_20write_enhanced(struct __pyx_obj_3
*/
/*except:*/ {
__Pyx_AddTraceback("_sa.SuffixArray.write_enhanced", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_4, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
+ if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_4, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
+ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_10);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_10);
@@ -34905,11 +35102,11 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_20write_enhanced(struct __pyx_obj_3
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_12 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
+ if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
__Pyx_GOTREF(__pyx_t_12);
__pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_12);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
+ if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
__pyx_t_13 = (!__pyx_t_11);
if (__pyx_t_13) {
__Pyx_GIVEREF(__pyx_t_10);
@@ -34917,7 +35114,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_20write_enhanced(struct __pyx_obj_3
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_ErrRestore(__pyx_t_10, __pyx_t_4, __pyx_t_1);
__pyx_t_10 = 0; __pyx_t_4 = 0; __pyx_t_1 = 0;
- {__pyx_filename = __pyx_f[12]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
+ {__pyx_filename = __pyx_f[12]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
goto __pyx_L22;
}
__pyx_L22:;
@@ -34943,13 +35140,13 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_20write_enhanced(struct __pyx_obj_3
}
/*finally:*/ {
if (__pyx_t_3) {
- __pyx_t_7 = PyObject_Call(__pyx_t_3, __pyx_k_tuple_99, NULL);
+ __pyx_t_7 = PyObject_Call(__pyx_t_3, __pyx_k_tuple_98, NULL);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_7);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
}
goto __pyx_L23;
@@ -34977,7 +35174,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_20write_enhanced(struct __pyx_obj_3
return __pyx_r;
}
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":207
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":198
* f.write("\n")
*
* cdef int __search_high(self, int word_id, int offset, int low, int high): # <<<<<<<<<<<<<<
@@ -34992,7 +35189,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_high(struct __pyx_obj_3_sa_Suffix
int __pyx_t_1;
__Pyx_RefNannySetupContext("__search_high", 0);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":210
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":201
* cdef int midpoint
*
* if low >= high: # <<<<<<<<<<<<<<
@@ -35002,7 +35199,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_high(struct __pyx_obj_3_sa_Suffix
__pyx_t_1 = (__pyx_v_low >= __pyx_v_high);
if (__pyx_t_1) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":211
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":202
*
* if low >= high:
* return high # <<<<<<<<<<<<<<
@@ -35015,7 +35212,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_high(struct __pyx_obj_3_sa_Suffix
}
__pyx_L3:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":212
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":203
* if low >= high:
* return high
* midpoint = (high + low) / 2 # <<<<<<<<<<<<<<
@@ -35024,7 +35221,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_high(struct __pyx_obj_3_sa_Suffix
*/
__pyx_v_midpoint = __Pyx_div_long((__pyx_v_high + __pyx_v_low), 2);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":213
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":204
* return high
* midpoint = (high + low) / 2
* if self.darray.data.arr[self.sa.arr[midpoint] + offset] == word_id: # <<<<<<<<<<<<<<
@@ -35034,7 +35231,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_high(struct __pyx_obj_3_sa_Suffix
__pyx_t_1 = ((__pyx_v_self->darray->data->arr[((__pyx_v_self->sa->arr[__pyx_v_midpoint]) + __pyx_v_offset)]) == __pyx_v_word_id);
if (__pyx_t_1) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":214
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":205
* midpoint = (high + low) / 2
* if self.darray.data.arr[self.sa.arr[midpoint] + offset] == word_id:
* return self.__search_high(word_id, offset, midpoint+1, high) # <<<<<<<<<<<<<<
@@ -35047,7 +35244,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_high(struct __pyx_obj_3_sa_Suffix
}
/*else*/ {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":216
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":207
* return self.__search_high(word_id, offset, midpoint+1, high)
* else:
* return self.__search_high(word_id, offset, low, midpoint) # <<<<<<<<<<<<<<
@@ -35065,7 +35262,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_high(struct __pyx_obj_3_sa_Suffix
return __pyx_r;
}
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":218
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":209
* return self.__search_high(word_id, offset, low, midpoint)
*
* cdef int __search_low(self, int word_id, int offset, int low, int high): # <<<<<<<<<<<<<<
@@ -35080,7 +35277,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_low(struct __pyx_obj_3_sa_SuffixA
int __pyx_t_1;
__Pyx_RefNannySetupContext("__search_low", 0);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":221
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":212
* cdef int midpoint
*
* if low >= high: # <<<<<<<<<<<<<<
@@ -35090,7 +35287,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_low(struct __pyx_obj_3_sa_SuffixA
__pyx_t_1 = (__pyx_v_low >= __pyx_v_high);
if (__pyx_t_1) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":222
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":213
*
* if low >= high:
* return high # <<<<<<<<<<<<<<
@@ -35103,7 +35300,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_low(struct __pyx_obj_3_sa_SuffixA
}
__pyx_L3:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":223
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":214
* if low >= high:
* return high
* midpoint = (high + low) / 2 # <<<<<<<<<<<<<<
@@ -35112,7 +35309,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_low(struct __pyx_obj_3_sa_SuffixA
*/
__pyx_v_midpoint = __Pyx_div_long((__pyx_v_high + __pyx_v_low), 2);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":224
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":215
* return high
* midpoint = (high + low) / 2
* if self.darray.data.arr[self.sa.arr[midpoint] + offset] == word_id: # <<<<<<<<<<<<<<
@@ -35122,7 +35319,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_low(struct __pyx_obj_3_sa_SuffixA
__pyx_t_1 = ((__pyx_v_self->darray->data->arr[((__pyx_v_self->sa->arr[__pyx_v_midpoint]) + __pyx_v_offset)]) == __pyx_v_word_id);
if (__pyx_t_1) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":225
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":216
* midpoint = (high + low) / 2
* if self.darray.data.arr[self.sa.arr[midpoint] + offset] == word_id:
* return self.__search_low(word_id, offset, low, midpoint) # <<<<<<<<<<<<<<
@@ -35135,7 +35332,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_low(struct __pyx_obj_3_sa_SuffixA
}
/*else*/ {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":227
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":218
* return self.__search_low(word_id, offset, low, midpoint)
* else:
* return self.__search_low(word_id, offset, midpoint+1, high) # <<<<<<<<<<<<<<
@@ -35153,7 +35350,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_low(struct __pyx_obj_3_sa_SuffixA
return __pyx_r;
}
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":229
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":220
* return self.__search_low(word_id, offset, midpoint+1, high)
*
* cdef __get_range(self, int word_id, int offset, int low, int high, int midpoint): # <<<<<<<<<<<<<<
@@ -35172,7 +35369,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___get_range(struct __pyx_obj_3_sa_Su
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get_range", 0);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":230
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":221
*
* cdef __get_range(self, int word_id, int offset, int low, int high, int midpoint):
* return (self.__search_low(word_id, offset, low, midpoint), # <<<<<<<<<<<<<<
@@ -35180,19 +35377,19 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___get_range(struct __pyx_obj_3_sa_Su
*
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyInt_FromLong(((struct __pyx_vtabstruct_3_sa_SuffixArray *)__pyx_v_self->__pyx_vtab)->__pyx___search_low(__pyx_v_self, __pyx_v_word_id, __pyx_v_offset, __pyx_v_low, __pyx_v_midpoint)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong(((struct __pyx_vtabstruct_3_sa_SuffixArray *)__pyx_v_self->__pyx_vtab)->__pyx___search_low(__pyx_v_self, __pyx_v_word_id, __pyx_v_offset, __pyx_v_low, __pyx_v_midpoint)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":231
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":222
* cdef __get_range(self, int word_id, int offset, int low, int high, int midpoint):
* return (self.__search_low(word_id, offset, low, midpoint),
* self.__search_high(word_id, offset, midpoint, high)) # <<<<<<<<<<<<<<
*
* cdef __lookup_helper(self, int word_id, int offset, int low, int high):
*/
- __pyx_t_2 = PyInt_FromLong(((struct __pyx_vtabstruct_3_sa_SuffixArray *)__pyx_v_self->__pyx_vtab)->__pyx___search_high(__pyx_v_self, __pyx_v_word_id, __pyx_v_offset, __pyx_v_midpoint, __pyx_v_high)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromLong(((struct __pyx_vtabstruct_3_sa_SuffixArray *)__pyx_v_self->__pyx_vtab)->__pyx___search_high(__pyx_v_self, __pyx_v_word_id, __pyx_v_offset, __pyx_v_midpoint, __pyx_v_high)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
@@ -35218,7 +35415,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___get_range(struct __pyx_obj_3_sa_Su
return __pyx_r;
}
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":233
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":224
* self.__search_high(word_id, offset, midpoint, high))
*
* cdef __lookup_helper(self, int word_id, int offset, int low, int high): # <<<<<<<<<<<<<<
@@ -35239,7 +35436,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___lookup_helper(struct __pyx_obj_3_s
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__lookup_helper", 0);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":236
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":227
* cdef int midpoint
*
* if offset == 0: # <<<<<<<<<<<<<<
@@ -35249,7 +35446,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___lookup_helper(struct __pyx_obj_3_s
__pyx_t_1 = (__pyx_v_offset == 0);
if (__pyx_t_1) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":237
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":228
*
* if offset == 0:
* return (self.ha.arr[word_id], self.ha.arr[word_id+1]) # <<<<<<<<<<<<<<
@@ -35257,11 +35454,11 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___lookup_helper(struct __pyx_obj_3_s
* return None
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = PyInt_FromLong((__pyx_v_self->ha->arr[__pyx_v_word_id])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromLong((__pyx_v_self->ha->arr[__pyx_v_word_id])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyInt_FromLong((__pyx_v_self->ha->arr[(__pyx_v_word_id + 1)])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromLong((__pyx_v_self->ha->arr[(__pyx_v_word_id + 1)])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
@@ -35276,7 +35473,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___lookup_helper(struct __pyx_obj_3_s
}
__pyx_L3:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":238
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":229
* if offset == 0:
* return (self.ha.arr[word_id], self.ha.arr[word_id+1])
* if low >= high: # <<<<<<<<<<<<<<
@@ -35286,7 +35483,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___lookup_helper(struct __pyx_obj_3_s
__pyx_t_1 = (__pyx_v_low >= __pyx_v_high);
if (__pyx_t_1) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":239
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":230
* return (self.ha.arr[word_id], self.ha.arr[word_id+1])
* if low >= high:
* return None # <<<<<<<<<<<<<<
@@ -35301,7 +35498,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___lookup_helper(struct __pyx_obj_3_s
}
__pyx_L4:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":241
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":232
* return None
*
* midpoint = (high + low) / 2 # <<<<<<<<<<<<<<
@@ -35310,7 +35507,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___lookup_helper(struct __pyx_obj_3_s
*/
__pyx_v_midpoint = __Pyx_div_long((__pyx_v_high + __pyx_v_low), 2);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":242
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":233
*
* midpoint = (high + low) / 2
* if self.darray.data.arr[self.sa.arr[midpoint] + offset] == word_id: # <<<<<<<<<<<<<<
@@ -35320,7 +35517,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___lookup_helper(struct __pyx_obj_3_s
__pyx_t_1 = ((__pyx_v_self->darray->data->arr[((__pyx_v_self->sa->arr[__pyx_v_midpoint]) + __pyx_v_offset)]) == __pyx_v_word_id);
if (__pyx_t_1) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":243
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":234
* midpoint = (high + low) / 2
* if self.darray.data.arr[self.sa.arr[midpoint] + offset] == word_id:
* return self.__get_range(word_id, offset, low, high, midpoint) # <<<<<<<<<<<<<<
@@ -35328,7 +35525,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___lookup_helper(struct __pyx_obj_3_s
* return self.__lookup_helper(word_id, offset, low, midpoint)
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_4 = ((struct __pyx_vtabstruct_3_sa_SuffixArray *)__pyx_v_self->__pyx_vtab)->__pyx___get_range(__pyx_v_self, __pyx_v_word_id, __pyx_v_offset, __pyx_v_low, __pyx_v_high, __pyx_v_midpoint); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = ((struct __pyx_vtabstruct_3_sa_SuffixArray *)__pyx_v_self->__pyx_vtab)->__pyx___get_range(__pyx_v_self, __pyx_v_word_id, __pyx_v_offset, __pyx_v_low, __pyx_v_high, __pyx_v_midpoint); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
@@ -35337,7 +35534,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___lookup_helper(struct __pyx_obj_3_s
}
__pyx_L5:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":244
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":235
* if self.darray.data.arr[self.sa.arr[midpoint] + offset] == word_id:
* return self.__get_range(word_id, offset, low, high, midpoint)
* if self.darray.data.arr[self.sa.arr[midpoint] + offset] > word_id: # <<<<<<<<<<<<<<
@@ -35347,7 +35544,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___lookup_helper(struct __pyx_obj_3_s
__pyx_t_1 = ((__pyx_v_self->darray->data->arr[((__pyx_v_self->sa->arr[__pyx_v_midpoint]) + __pyx_v_offset)]) > __pyx_v_word_id);
if (__pyx_t_1) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":245
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":236
* return self.__get_range(word_id, offset, low, high, midpoint)
* if self.darray.data.arr[self.sa.arr[midpoint] + offset] > word_id:
* return self.__lookup_helper(word_id, offset, low, midpoint) # <<<<<<<<<<<<<<
@@ -35355,7 +35552,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___lookup_helper(struct __pyx_obj_3_s
* return self.__lookup_helper(word_id, offset, midpoint+1, high)
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_4 = ((struct __pyx_vtabstruct_3_sa_SuffixArray *)__pyx_v_self->__pyx_vtab)->__pyx___lookup_helper(__pyx_v_self, __pyx_v_word_id, __pyx_v_offset, __pyx_v_low, __pyx_v_midpoint); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = ((struct __pyx_vtabstruct_3_sa_SuffixArray *)__pyx_v_self->__pyx_vtab)->__pyx___lookup_helper(__pyx_v_self, __pyx_v_word_id, __pyx_v_offset, __pyx_v_low, __pyx_v_midpoint); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
@@ -35364,7 +35561,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___lookup_helper(struct __pyx_obj_3_s
}
/*else*/ {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":247
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":238
* return self.__lookup_helper(word_id, offset, low, midpoint)
* else:
* return self.__lookup_helper(word_id, offset, midpoint+1, high) # <<<<<<<<<<<<<<
@@ -35372,7 +35569,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___lookup_helper(struct __pyx_obj_3_s
* def lookup(self, word, int offset, int low, int high):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_4 = ((struct __pyx_vtabstruct_3_sa_SuffixArray *)__pyx_v_self->__pyx_vtab)->__pyx___lookup_helper(__pyx_v_self, __pyx_v_word_id, __pyx_v_offset, (__pyx_v_midpoint + 1), __pyx_v_high); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = ((struct __pyx_vtabstruct_3_sa_SuffixArray *)__pyx_v_self->__pyx_vtab)->__pyx___lookup_helper(__pyx_v_self, __pyx_v_word_id, __pyx_v_offset, (__pyx_v_midpoint + 1), __pyx_v_high); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
@@ -35395,8 +35592,8 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___lookup_helper(struct __pyx_obj_3_s
}
/* Python wrapper */
-static PyObject *__pyx_pw_3_sa_11SuffixArray_23lookup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyObject *__pyx_pw_3_sa_11SuffixArray_23lookup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_3_sa_11SuffixArray_17lookup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_3_sa_11SuffixArray_17lookup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_word = 0;
int __pyx_v_offset;
int __pyx_v_low;
@@ -35426,21 +35623,21 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_23lookup(PyObject *__pyx_v_self, Py
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__offset)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("lookup", 1, 4, 4, 1); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("lookup", 1, 4, 4, 1); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__low)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("lookup", 1, 4, 4, 2); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("lookup", 1, 4, 4, 2); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__high)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("lookup", 1, 4, 4, 3); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("lookup", 1, 4, 4, 3); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lookup") < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lookup") < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
goto __pyx_L5_argtuple_error;
@@ -35451,24 +35648,24 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_23lookup(PyObject *__pyx_v_self, Py
values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
}
__pyx_v_word = values[0];
- __pyx_v_offset = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_offset == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_low = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_low == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_high = __Pyx_PyInt_AsInt(values[3]); if (unlikely((__pyx_v_high == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_offset = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_offset == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_low = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_low == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_high = __Pyx_PyInt_AsInt(values[3]); if (unlikely((__pyx_v_high == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("lookup", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("lookup", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("_sa.SuffixArray.lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_3_sa_11SuffixArray_22lookup(((struct __pyx_obj_3_sa_SuffixArray *)__pyx_v_self), __pyx_v_word, __pyx_v_offset, __pyx_v_low, __pyx_v_high);
+ __pyx_r = __pyx_pf_3_sa_11SuffixArray_16lookup(((struct __pyx_obj_3_sa_SuffixArray *)__pyx_v_self), __pyx_v_word, __pyx_v_offset, __pyx_v_low, __pyx_v_high);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":249
+/* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":240
* return self.__lookup_helper(word_id, offset, midpoint+1, high)
*
* def lookup(self, word, int offset, int low, int high): # <<<<<<<<<<<<<<
@@ -35476,7 +35673,7 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_23lookup(PyObject *__pyx_v_self, Py
* if low == -1:
*/
-static PyObject *__pyx_pf_3_sa_11SuffixArray_22lookup(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, PyObject *__pyx_v_word, int __pyx_v_offset, int __pyx_v_low, int __pyx_v_high) {
+static PyObject *__pyx_pf_3_sa_11SuffixArray_16lookup(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, PyObject *__pyx_v_word, int __pyx_v_offset, int __pyx_v_low, int __pyx_v_high) {
PyObject *__pyx_v_word_id = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
@@ -35489,7 +35686,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_22lookup(struct __pyx_obj_3_sa_Suff
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("lookup", 0);
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":251
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":242
* def lookup(self, word, int offset, int low, int high):
* cdef int wordid
* if low == -1: # <<<<<<<<<<<<<<
@@ -35499,7 +35696,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_22lookup(struct __pyx_obj_3_sa_Suff
__pyx_t_1 = (__pyx_v_low == -1);
if (__pyx_t_1) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":252
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":243
* cdef int wordid
* if low == -1:
* low = 0 # <<<<<<<<<<<<<<
@@ -35511,7 +35708,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_22lookup(struct __pyx_obj_3_sa_Suff
}
__pyx_L3:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":253
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":244
* if low == -1:
* low = 0
* if high == -1: # <<<<<<<<<<<<<<
@@ -35521,7 +35718,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_22lookup(struct __pyx_obj_3_sa_Suff
__pyx_t_1 = (__pyx_v_high == -1);
if (__pyx_t_1) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":254
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":245
* low = 0
* if high == -1:
* high = len(self.sa) # <<<<<<<<<<<<<<
@@ -35530,36 +35727,36 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_22lookup(struct __pyx_obj_3_sa_Suff
*/
__pyx_t_2 = ((PyObject *)__pyx_v_self->sa);
__Pyx_INCREF(__pyx_t_2);
- __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_high = __pyx_t_3;
goto __pyx_L4;
}
__pyx_L4:;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":255
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":246
* if high == -1:
* high = len(self.sa)
* if word in self.darray.word2id: # <<<<<<<<<<<<<<
* word_id = self.darray.word2id[word]
* return self.__lookup_helper(word_id, offset, low, high)
*/
- __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_word, __pyx_v_self->darray->word2id, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_word, __pyx_v_self->darray->word2id, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_1) {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":256
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":247
* high = len(self.sa)
* if word in self.darray.word2id:
* word_id = self.darray.word2id[word] # <<<<<<<<<<<<<<
* return self.__lookup_helper(word_id, offset, low, high)
* else:
*/
- __pyx_t_2 = PyObject_GetItem(__pyx_v_self->darray->word2id, __pyx_v_word); if (!__pyx_t_2) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_GetItem(__pyx_v_self->darray->word2id, __pyx_v_word); if (!__pyx_t_2) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_word_id = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":257
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":248
* if word in self.darray.word2id:
* word_id = self.darray.word2id[word]
* return self.__lookup_helper(word_id, offset, low, high) # <<<<<<<<<<<<<<
@@ -35567,8 +35764,8 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_22lookup(struct __pyx_obj_3_sa_Suff
* return None
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_v_word_id); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = ((struct __pyx_vtabstruct_3_sa_SuffixArray *)__pyx_v_self->__pyx_vtab)->__pyx___lookup_helper(__pyx_v_self, __pyx_t_4, __pyx_v_offset, __pyx_v_low, __pyx_v_high); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_v_word_id); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = ((struct __pyx_vtabstruct_3_sa_SuffixArray *)__pyx_v_self->__pyx_vtab)->__pyx___lookup_helper(__pyx_v_self, __pyx_t_4, __pyx_v_offset, __pyx_v_low, __pyx_v_high); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
@@ -35577,7 +35774,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_22lookup(struct __pyx_obj_3_sa_Suff
}
/*else*/ {
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":259
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":250
* return self.__lookup_helper(word_id, offset, low, high)
* else:
* return None # <<<<<<<<<<<<<<
@@ -36146,7 +36343,7 @@ static int __pyx_pw_3_sa_9TrieTable_1__cinit__(PyObject *__pyx_v_self, PyObject
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__extended,0};
PyObject* values[1] = {0};
- values[0] = __pyx_k_100;
+ values[0] = __pyx_k_99;
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
@@ -36893,9 +37090,9 @@ static int __pyx_pf_3_sa_7Sampler___cinit__(struct __pyx_obj_3_sa_Sampler *__pyx
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __Pyx_INCREF(((PyObject *)__pyx_kp_s_101));
- PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_101));
- __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_101));
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_100));
+ PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_100));
+ __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_100));
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
__pyx_t_2 = 0;
@@ -36920,7 +37117,7 @@ static int __pyx_pf_3_sa_7Sampler___cinit__(struct __pyx_obj_3_sa_Sampler *__pyx
__pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__info); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_103), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_102), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -37708,7 +37905,7 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
{
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__alignment,&__pyx_n_s__by_slack_factor,&__pyx_n_s__category,&__pyx_n_s__max_chunks,&__pyx_n_s__max_initial_size,&__pyx_n_s__max_length,&__pyx_n_s__max_nonterminals,&__pyx_n_s__max_target_chunks,&__pyx_n_s__max_target_length,&__pyx_n_s__min_gap_size,&__pyx_n_s__precompute_file,&__pyx_n_s_70,&__pyx_n_s__precompute_rank,&__pyx_n_s_104,&__pyx_n_s_105,&__pyx_n_s_71,&__pyx_n_s__train_min_gap_size,&__pyx_n_s__tight_phrases,&__pyx_n_s__use_baeza_yates,&__pyx_n_s__use_collocations,&__pyx_n_s__use_index,0};
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__alignment,&__pyx_n_s__by_slack_factor,&__pyx_n_s__category,&__pyx_n_s__max_chunks,&__pyx_n_s__max_initial_size,&__pyx_n_s__max_length,&__pyx_n_s__max_nonterminals,&__pyx_n_s__max_target_chunks,&__pyx_n_s__max_target_length,&__pyx_n_s__min_gap_size,&__pyx_n_s__precompute_file,&__pyx_n_s_70,&__pyx_n_s__precompute_rank,&__pyx_n_s_103,&__pyx_n_s_104,&__pyx_n_s_71,&__pyx_n_s__train_min_gap_size,&__pyx_n_s__tight_phrases,&__pyx_n_s__use_baeza_yates,&__pyx_n_s__use_collocations,&__pyx_n_s__use_index,0};
PyObject* values[21] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":273
@@ -37841,12 +38038,12 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_
}
case 13:
if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_104);
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_103);
if (value) { values[13] = value; kw_args--; }
}
case 14:
if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_105);
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_104);
if (value) { values[14] = value; kw_args--; }
}
case 15:
@@ -37927,7 +38124,7 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_
if (values[2]) {
__pyx_v_category = PyBytes_AsString(values[2]); if (unlikely((!__pyx_v_category) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
- __pyx_v_category = ((char *)__pyx_k_106);
+ __pyx_v_category = ((char *)__pyx_k_105);
}
__pyx_v_max_chunks = values[3];
if (values[4]) {
@@ -38152,7 +38349,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
* self.alignment = alignment
*
*/
- __pyx_t_2 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_k_tuple_108), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_k_tuple_107), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -39568,9 +39765,9 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py
__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 = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(((PyObject *)__pyx_kp_s_109));
- PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_109));
- __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_109));
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_108));
+ PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_108));
+ __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_108));
__Pyx_INCREF(__pyx_v_self->precompute_file);
PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self->precompute_file);
__Pyx_GIVEREF(__pyx_v_self->precompute_file);
@@ -39624,9 +39821,9 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_INCREF(((PyObject *)__pyx_kp_s_110));
- PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_110));
- __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_110));
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_109));
+ PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_109));
+ __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_109));
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
@@ -39670,9 +39867,9 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(((PyObject *)__pyx_kp_s_111));
- PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_111));
- __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_111));
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_110));
+ PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_110));
+ __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_110));
PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_4);
@@ -39717,7 +39914,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py
__Pyx_GIVEREF(__pyx_t_2);
__pyx_t_4 = 0;
__pyx_t_2 = 0;
- __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_112), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_111), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
__pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
@@ -39764,7 +39961,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py
__Pyx_GIVEREF(__pyx_t_5);
__pyx_t_2 = 0;
__pyx_t_5 = 0;
- __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_113), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_112), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_5));
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
__pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
@@ -39811,9 +40008,9 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(((PyObject *)__pyx_kp_s_114));
- PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_114));
- __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_114));
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_113));
+ PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_113));
+ __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_113));
PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_5);
__pyx_t_5 = 0;
@@ -39965,9 +40162,9 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(((PyObject *)__pyx_kp_s_115));
- PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_115));
- __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_115));
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_114));
+ PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_114));
+ __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_114));
PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_5);
__pyx_t_5 = 0;
@@ -40071,9 +40268,9 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(((PyObject *)__pyx_kp_s_116));
- PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_116));
- __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_116));
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_115));
+ PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_115));
+ __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_115));
PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_5);
__pyx_t_5 = 0;
@@ -42793,8 +42990,8 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON_UNUSED st
* i = 0
* while i < loc.arr_high:
*/
- __Pyx_INCREF(((PyObject *)__pyx_kp_s_117));
- __pyx_v_result = ((PyObject *)__pyx_kp_s_117);
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_116));
+ __pyx_v_result = ((PyObject *)__pyx_kp_s_116);
/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":811
* cdef int i, j
@@ -42823,7 +43020,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON_UNUSED st
* for j from i <= j < i + loc.num_subpatterns:
* result = result + ("%d " %loc.arr[j])
*/
- __pyx_t_2 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_kp_s_118)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_kp_s_117)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_v_result);
__pyx_v_result = __pyx_t_2;
@@ -42889,7 +43086,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON_UNUSED st
* return result
*
*/
- __pyx_t_2 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_kp_s_119)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_kp_s_118)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_v_result);
__pyx_v_result = __pyx_t_2;
@@ -43006,7 +43203,7 @@ static struct __pyx_obj_3_sa_PhraseLocation *__pyx_f_3_sa_23HieroCachingRuleFact
* if result is not None:
* intersect_method = "precomputed"
*/
- __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_120); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_119); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 830; __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 = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
@@ -43084,9 +43281,9 @@ static struct __pyx_obj_3_sa_PhraseLocation *__pyx_f_3_sa_23HieroCachingRuleFact
* else:
* result = self.intersect_helper(prefix, suffix, prefix_loc, suffix_loc, MERGE)
*/
- __Pyx_INCREF(((PyObject *)__pyx_kp_s_121));
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_120));
__Pyx_XDECREF(__pyx_v_intersect_method);
- __pyx_v_intersect_method = ((PyObject *)__pyx_kp_s_121);
+ __pyx_v_intersect_method = ((PyObject *)__pyx_kp_s_120);
goto __pyx_L5;
}
/*else*/ {
@@ -46783,7 +46980,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
* # checking whether lookup_required
* if lookup_required:
*/
- __pyx_t_3 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_k_tuple_123), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_k_tuple_122), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -48599,7 +48796,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
* 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 = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_123); 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 = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
@@ -48863,9 +49060,9 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__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 = 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));
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_124));
+ PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)__pyx_kp_s_124));
+ __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_124));
PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_13);
__Pyx_GIVEREF(__pyx_t_13);
__pyx_t_13 = 0;
@@ -48908,9 +49105,9 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__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));
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_125));
+ PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_125));
+ __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_125));
PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_13);
__Pyx_GIVEREF(__pyx_t_13);
__pyx_t_13 = 0;
@@ -52078,9 +52275,9 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
* met_constraints = 0
* if self.require_aligned_chunks and num_aligned_chunks < num_chunks:
*/
- __Pyx_INCREF(((PyObject *)__pyx_kp_s_127));
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_126));
__Pyx_DECREF(__pyx_v_reason_for_failure);
- __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_127);
+ __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_126);
/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1496
* if num_aligned_chunks == 0:
@@ -52116,9 +52313,9 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
* met_constraints = 0
*
*/
- __Pyx_INCREF(((PyObject *)__pyx_kp_s_128));
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_127));
__Pyx_DECREF(__pyx_v_reason_for_failure);
- __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_128);
+ __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_127);
/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1499
* if self.require_aligned_chunks and num_aligned_chunks < num_chunks:
@@ -52176,9 +52373,9 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
* met_constraints = 0
* break
*/
- __Pyx_INCREF(((PyObject *)__pyx_kp_s_129));
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_128));
__Pyx_DECREF(__pyx_v_reason_for_failure);
- __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_129);
+ __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_128);
/* "/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:
@@ -52218,9 +52415,9 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
* met_constraints = 0
* break
*/
- __Pyx_INCREF(((PyObject *)__pyx_kp_s_129));
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_128));
__Pyx_DECREF(__pyx_v_reason_for_failure);
- __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_129);
+ __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_128);
/* "/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:
@@ -52432,9 +52629,9 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
* else:
* gap_start = 1
*/
- __Pyx_INCREF(((PyObject *)__pyx_kp_s_130));
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_129));
__Pyx_DECREF(__pyx_v_reason_for_failure);
- __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_130);
+ __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_129);
goto __pyx_L38;
}
__pyx_L38:;
@@ -52630,9 +52827,9 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
* else:
* if self.tight_phrases and f_links_low[f_high-1] == -1:
*/
- __Pyx_INCREF(((PyObject *)__pyx_kp_s_131));
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_130));
__Pyx_DECREF(__pyx_v_reason_for_failure);
- __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_131);
+ __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_130);
goto __pyx_L45;
}
__pyx_L45:;
@@ -52750,7 +52947,7 @@ 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 = 1575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_131), ((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);
@@ -53066,7 +53263,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 = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_132), ((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);
@@ -55284,9 +55481,9 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*
* free(sent_links)
*/
- __Pyx_INCREF(((PyObject *)__pyx_kp_s_134));
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_133));
__Pyx_DECREF(__pyx_v_reason_for_failure);
- __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_134);
+ __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_133);
}
__pyx_L34:;
goto __pyx_L33;
@@ -55887,7 +56084,7 @@ static PyObject *__pyx_gb_3_sa_13FeatureVector_7__str___2generator12(__pyx_Gener
__Pyx_GIVEREF(__pyx_t_4);
__pyx_cur_scope->__pyx_v_feat = __pyx_t_4;
__pyx_t_4 = 0;
- __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_135), __pyx_cur_scope->__pyx_v_feat); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_134), __pyx_cur_scope->__pyx_v_feat); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_4));
__pyx_r = ((PyObject *)__pyx_t_4);
__pyx_t_4 = 0;
@@ -57617,6 +57814,39 @@ static int __pyx_tp_clear_3_sa_DataArray(PyObject *o) {
Py_XDECREF(tmp);
return 0;
}
+static PyObject *__pyx_sq_item_3_sa_DataArray(PyObject *o, Py_ssize_t i) {
+ PyObject *r;
+ PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
+ r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
+ Py_DECREF(x);
+ return r;
+}
+
+static PyObject *__pyx_getprop_3_sa_9DataArray_word2id(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_3_sa_9DataArray_7word2id_1__get__(o);
+}
+
+static int __pyx_setprop_3_sa_9DataArray_word2id(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
+ if (v) {
+ return __pyx_pw_3_sa_9DataArray_7word2id_3__set__(o, v);
+ }
+ else {
+ return __pyx_pw_3_sa_9DataArray_7word2id_5__del__(o);
+ }
+}
+
+static PyObject *__pyx_getprop_3_sa_9DataArray_id2word(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_3_sa_9DataArray_7id2word_1__get__(o);
+}
+
+static int __pyx_setprop_3_sa_9DataArray_id2word(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
+ if (v) {
+ return __pyx_pw_3_sa_9DataArray_7id2word_3__set__(o, v);
+ }
+ else {
+ return __pyx_pw_3_sa_9DataArray_7id2word_5__del__(o);
+ }
+}
static PyObject *__pyx_getprop_3_sa_9DataArray_data(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_3_sa_9DataArray_4data_1__get__(o);
@@ -57631,12 +57861,37 @@ static int __pyx_setprop_3_sa_9DataArray_data(PyObject *o, PyObject *v, CYTHON_U
}
}
+static PyObject *__pyx_getprop_3_sa_9DataArray_sent_id(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_3_sa_9DataArray_7sent_id_1__get__(o);
+}
+
+static int __pyx_setprop_3_sa_9DataArray_sent_id(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
+ if (v) {
+ return __pyx_pw_3_sa_9DataArray_7sent_id_3__set__(o, v);
+ }
+ else {
+ return __pyx_pw_3_sa_9DataArray_7sent_id_5__del__(o);
+ }
+}
+
+static PyObject *__pyx_getprop_3_sa_9DataArray_sent_index(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_3_sa_9DataArray_10sent_index_1__get__(o);
+}
+
+static int __pyx_setprop_3_sa_9DataArray_sent_index(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
+ if (v) {
+ return __pyx_pw_3_sa_9DataArray_10sent_index_3__set__(o, v);
+ }
+ else {
+ return __pyx_pw_3_sa_9DataArray_10sent_index_5__del__(o);
+ }
+}
+
static PyMethodDef __pyx_methods_3_sa_DataArray[] = {
{__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("get_id"), (PyCFunction)__pyx_pw_3_sa_9DataArray_9get_id, METH_O, __Pyx_DOCSTR(0)},
+ {__Pyx_NAMESTR("get_sentence_bounds"), (PyCFunction)__pyx_pw_3_sa_9DataArray_13get_sentence_bounds, 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)},
@@ -57649,7 +57904,11 @@ static PyMethodDef __pyx_methods_3_sa_DataArray[] = {
};
static struct PyGetSetDef __pyx_getsets_3_sa_DataArray[] = {
+ {(char *)"word2id", __pyx_getprop_3_sa_9DataArray_word2id, __pyx_setprop_3_sa_9DataArray_word2id, 0, 0},
+ {(char *)"id2word", __pyx_getprop_3_sa_9DataArray_id2word, __pyx_setprop_3_sa_9DataArray_id2word, 0, 0},
{(char *)"data", __pyx_getprop_3_sa_9DataArray_data, __pyx_setprop_3_sa_9DataArray_data, 0, 0},
+ {(char *)"sent_id", __pyx_getprop_3_sa_9DataArray_sent_id, __pyx_setprop_3_sa_9DataArray_sent_id, 0, 0},
+ {(char *)"sent_index", __pyx_getprop_3_sa_9DataArray_sent_index, __pyx_setprop_3_sa_9DataArray_sent_index, 0, 0},
{0, 0, 0, 0, 0}
};
@@ -57715,7 +57974,7 @@ static PySequenceMethods __pyx_tp_as_sequence_DataArray = {
__pyx_pw_3_sa_9DataArray_3__len__, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
- 0, /*sq_item*/
+ __pyx_sq_item_3_sa_DataArray, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
@@ -57726,7 +57985,7 @@ static PySequenceMethods __pyx_tp_as_sequence_DataArray = {
static PyMappingMethods __pyx_tp_as_mapping_DataArray = {
__pyx_pw_3_sa_9DataArray_3__len__, /*mp_length*/
- 0, /*mp_subscript*/
+ __pyx_pw_3_sa_9DataArray_11__getitem__, /*mp_subscript*/
0, /*mp_ass_subscript*/
};
@@ -59881,16 +60140,13 @@ static PyObject *__pyx_sq_item_3_sa_SuffixArray(PyObject *o, Py_ssize_t i) {
}
static PyMethodDef __pyx_methods_3_sa_SuffixArray[] = {
- {__Pyx_NAMESTR("get_sentence_id"), (PyCFunction)__pyx_pw_3_sa_11SuffixArray_5get_sentence_id, METH_O, __Pyx_DOCSTR(0)},
- {__Pyx_NAMESTR("get_sentence"), (PyCFunction)__pyx_pw_3_sa_11SuffixArray_7get_sentence, METH_O, __Pyx_DOCSTR(0)},
- {__Pyx_NAMESTR("get_sentence_position"), (PyCFunction)__pyx_pw_3_sa_11SuffixArray_9get_sentence_position, METH_O, __Pyx_DOCSTR(0)},
- {__Pyx_NAMESTR("read_text"), (PyCFunction)__pyx_pw_3_sa_11SuffixArray_11read_text, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3_sa_11SuffixArray_10read_text)},
- {__Pyx_NAMESTR("q3sort"), (PyCFunction)__pyx_pw_3_sa_11SuffixArray_13q3sort, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3_sa_11SuffixArray_12q3sort)},
- {__Pyx_NAMESTR("write_text"), (PyCFunction)__pyx_pw_3_sa_11SuffixArray_15write_text, METH_O, __Pyx_DOCSTR(0)},
- {__Pyx_NAMESTR("read_binary"), (PyCFunction)__pyx_pw_3_sa_11SuffixArray_17read_binary, METH_O, __Pyx_DOCSTR(0)},
- {__Pyx_NAMESTR("write_binary"), (PyCFunction)__pyx_pw_3_sa_11SuffixArray_19write_binary, METH_O, __Pyx_DOCSTR(0)},
- {__Pyx_NAMESTR("write_enhanced"), (PyCFunction)__pyx_pw_3_sa_11SuffixArray_21write_enhanced, METH_O, __Pyx_DOCSTR(0)},
- {__Pyx_NAMESTR("lookup"), (PyCFunction)__pyx_pw_3_sa_11SuffixArray_23lookup, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
+ {__Pyx_NAMESTR("read_text"), (PyCFunction)__pyx_pw_3_sa_11SuffixArray_5read_text, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3_sa_11SuffixArray_4read_text)},
+ {__Pyx_NAMESTR("q3sort"), (PyCFunction)__pyx_pw_3_sa_11SuffixArray_7q3sort, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3_sa_11SuffixArray_6q3sort)},
+ {__Pyx_NAMESTR("write_text"), (PyCFunction)__pyx_pw_3_sa_11SuffixArray_9write_text, METH_O, __Pyx_DOCSTR(0)},
+ {__Pyx_NAMESTR("read_binary"), (PyCFunction)__pyx_pw_3_sa_11SuffixArray_11read_binary, METH_O, __Pyx_DOCSTR(0)},
+ {__Pyx_NAMESTR("write_binary"), (PyCFunction)__pyx_pw_3_sa_11SuffixArray_13write_binary, METH_O, __Pyx_DOCSTR(0)},
+ {__Pyx_NAMESTR("write_enhanced"), (PyCFunction)__pyx_pw_3_sa_11SuffixArray_15write_enhanced, METH_O, __Pyx_DOCSTR(0)},
+ {__Pyx_NAMESTR("lookup"), (PyCFunction)__pyx_pw_3_sa_11SuffixArray_17lookup, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
{0, 0, 0, 0}
};
@@ -65928,11 +66184,12 @@ static struct PyModuleDef __pyx_moduledef = {
static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0},
+ {&__pyx_kp_s_100, __pyx_k_100, sizeof(__pyx_k_100), 0, 0, 1, 0},
{&__pyx_kp_s_101, __pyx_k_101, sizeof(__pyx_k_101), 0, 0, 1, 0},
- {&__pyx_kp_s_102, __pyx_k_102, sizeof(__pyx_k_102), 0, 0, 1, 0},
+ {&__pyx_n_s_103, __pyx_k_103, sizeof(__pyx_k_103), 0, 0, 1, 1},
{&__pyx_n_s_104, __pyx_k_104, sizeof(__pyx_k_104), 0, 0, 1, 1},
- {&__pyx_n_s_105, __pyx_k_105, sizeof(__pyx_k_105), 0, 0, 1, 1},
- {&__pyx_kp_s_107, __pyx_k_107, sizeof(__pyx_k_107), 0, 0, 1, 0},
+ {&__pyx_kp_s_106, __pyx_k_106, sizeof(__pyx_k_106), 0, 0, 1, 0},
+ {&__pyx_kp_s_108, __pyx_k_108, sizeof(__pyx_k_108), 0, 0, 1, 0},
{&__pyx_kp_s_109, __pyx_k_109, sizeof(__pyx_k_109), 0, 0, 1, 0},
{&__pyx_kp_s_110, __pyx_k_110, sizeof(__pyx_k_110), 0, 0, 1, 0},
{&__pyx_kp_s_111, __pyx_k_111, sizeof(__pyx_k_111), 0, 0, 1, 0},
@@ -65943,11 +66200,11 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_kp_s_116, __pyx_k_116, sizeof(__pyx_k_116), 0, 0, 1, 0},
{&__pyx_kp_s_117, __pyx_k_117, sizeof(__pyx_k_117), 0, 0, 1, 0},
{&__pyx_kp_s_118, __pyx_k_118, sizeof(__pyx_k_118), 0, 0, 1, 0},
- {&__pyx_kp_s_119, __pyx_k_119, sizeof(__pyx_k_119), 0, 0, 1, 0},
- {&__pyx_n_s_120, __pyx_k_120, sizeof(__pyx_k_120), 0, 0, 1, 1},
+ {&__pyx_n_s_119, __pyx_k_119, sizeof(__pyx_k_119), 0, 0, 1, 1},
+ {&__pyx_kp_s_120, __pyx_k_120, sizeof(__pyx_k_120), 0, 0, 1, 0},
{&__pyx_kp_s_121, __pyx_k_121, sizeof(__pyx_k_121), 0, 0, 1, 0},
- {&__pyx_kp_s_122, __pyx_k_122, sizeof(__pyx_k_122), 0, 0, 1, 0},
- {&__pyx_n_s_124, __pyx_k_124, sizeof(__pyx_k_124), 0, 0, 1, 1},
+ {&__pyx_n_s_123, __pyx_k_123, sizeof(__pyx_k_123), 0, 0, 1, 1},
+ {&__pyx_kp_s_124, __pyx_k_124, sizeof(__pyx_k_124), 0, 0, 1, 0},
{&__pyx_kp_s_125, __pyx_k_125, sizeof(__pyx_k_125), 0, 0, 1, 0},
{&__pyx_kp_s_126, __pyx_k_126, sizeof(__pyx_k_126), 0, 0, 1, 0},
{&__pyx_kp_s_127, __pyx_k_127, sizeof(__pyx_k_127), 0, 0, 1, 0},
@@ -65959,11 +66216,10 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_kp_s_132, __pyx_k_132, sizeof(__pyx_k_132), 0, 0, 1, 0},
{&__pyx_kp_s_133, __pyx_k_133, sizeof(__pyx_k_133), 0, 0, 1, 0},
{&__pyx_kp_s_134, __pyx_k_134, sizeof(__pyx_k_134), 0, 0, 1, 0},
- {&__pyx_kp_s_135, __pyx_k_135, sizeof(__pyx_k_135), 0, 0, 1, 0},
+ {&__pyx_kp_s_137, __pyx_k_137, sizeof(__pyx_k_137), 0, 0, 1, 0},
{&__pyx_kp_s_138, __pyx_k_138, sizeof(__pyx_k_138), 0, 0, 1, 0},
- {&__pyx_kp_s_139, __pyx_k_139, sizeof(__pyx_k_139), 0, 0, 1, 0},
{&__pyx_kp_s_14, __pyx_k_14, sizeof(__pyx_k_14), 0, 0, 1, 0},
- {&__pyx_kp_s_143, __pyx_k_143, sizeof(__pyx_k_143), 0, 0, 1, 0},
+ {&__pyx_kp_s_142, __pyx_k_142, sizeof(__pyx_k_142), 0, 0, 1, 0},
{&__pyx_kp_s_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 0, 1, 0},
{&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0},
{&__pyx_kp_s_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 0, 1, 0},
@@ -66006,14 +66262,13 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_kp_s_86, __pyx_k_86, sizeof(__pyx_k_86), 0, 0, 1, 0},
{&__pyx_kp_s_87, __pyx_k_87, sizeof(__pyx_k_87), 0, 0, 1, 0},
{&__pyx_kp_s_88, __pyx_k_88, sizeof(__pyx_k_88), 0, 0, 1, 0},
- {&__pyx_n_s_89, __pyx_k_89, sizeof(__pyx_k_89), 0, 0, 1, 1},
+ {&__pyx_kp_s_89, __pyx_k_89, sizeof(__pyx_k_89), 0, 0, 1, 0},
{&__pyx_kp_s_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 0, 1, 0},
{&__pyx_kp_s_90, __pyx_k_90, sizeof(__pyx_k_90), 0, 0, 1, 0},
{&__pyx_kp_s_91, __pyx_k_91, sizeof(__pyx_k_91), 0, 0, 1, 0},
{&__pyx_kp_s_92, __pyx_k_92, sizeof(__pyx_k_92), 0, 0, 1, 0},
- {&__pyx_kp_s_93, __pyx_k_93, sizeof(__pyx_k_93), 0, 0, 1, 0},
+ {&__pyx_kp_s_94, __pyx_k_94, sizeof(__pyx_k_94), 0, 0, 1, 0},
{&__pyx_kp_s_95, __pyx_k_95, sizeof(__pyx_k_95), 0, 0, 1, 0},
- {&__pyx_kp_s_96, __pyx_k_96, sizeof(__pyx_k_96), 0, 0, 1, 0},
{&__pyx_kp_s__0, __pyx_k__0, sizeof(__pyx_k__0), 0, 0, 1, 0},
{&__pyx_kp_s__1, __pyx_k__1, sizeof(__pyx_k__1), 0, 0, 1, 0},
{&__pyx_n_s__Counter, __pyx_k__Counter, sizeof(__pyx_k__Counter), 0, 0, 1, 1},
@@ -66091,8 +66346,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s__get_f_id, __pyx_k__get_f_id, sizeof(__pyx_k__get_f_id), 0, 0, 1, 1},
{&__pyx_n_s__get_id, __pyx_k__get_id, sizeof(__pyx_k__get_id), 0, 0, 1, 1},
{&__pyx_n_s__get_next_states, __pyx_k__get_next_states, sizeof(__pyx_k__get_next_states), 0, 0, 1, 1},
- {&__pyx_n_s__get_sentence, __pyx_k__get_sentence, sizeof(__pyx_k__get_sentence), 0, 0, 1, 1},
- {&__pyx_n_s__get_sentence_id, __pyx_k__get_sentence_id, sizeof(__pyx_k__get_sentence_id), 0, 0, 1, 1},
{&__pyx_n_s__get_word, __pyx_k__get_word, sizeof(__pyx_k__get_word), 0, 0, 1, 1},
{&__pyx_n_s__getchunk, __pyx_k__getchunk, sizeof(__pyx_k__getchunk), 0, 0, 1, 1},
{&__pyx_n_s__getrusage, __pyx_k__getrusage, sizeof(__pyx_k__getrusage), 0, 0, 1, 1},
@@ -66215,7 +66468,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 = 78; __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 = 79; __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;}
@@ -66283,28 +66536,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":65
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":66
* f.write("%s " % self.get_word(w_id))
* if w_id == 1:
* f.write("\n") # <<<<<<<<<<<<<<
*
* def read_text(self, char* filename):
*/
- __pyx_k_tuple_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_k_tuple_15 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_15)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 66; __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":60
+ /* "/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:
* if w_id > 1:
*/
- __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_k_tuple_16 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_16)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 61; __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);
@@ -66317,14 +66570,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":68
+ /* "/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)
*
*/
- __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_k_tuple_17 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_17)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 69; __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);
@@ -66337,28 +66590,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":73
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":74
* def read_bitext(self, char* filename, int side):
* with gzip_or_text(filename) as fp:
* data = (line.split(' ||| ')[side] for line in fp) # <<<<<<<<<<<<<<
* 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 = 73; __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 = 74; __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":72
+ /* "/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_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_k_tuple_20 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; __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);
@@ -66371,69 +66624,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":143
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":144
* for i in self.data:
* f.write("%d " %i)
* f.write("\n") # <<<<<<<<<<<<<<
* for i in self.sent_index:
* f.write("%d " %i)
*/
- __pyx_k_tuple_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_k_tuple_22 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_22)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 144; __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":146
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":147
* for i in self.sent_index:
* f.write("%d " %i)
* f.write("\n") # <<<<<<<<<<<<<<
* for i in self.sent_id:
* f.write("%d " %i)
*/
- __pyx_k_tuple_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_k_tuple_23 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_23)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 147; __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":149
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":150
* for i in self.sent_id:
* f.write("%d " %i)
* f.write("\n") # <<<<<<<<<<<<<<
* for word in self.id2word:
* f.write("%s %d " % (word, self.word2id[word]))
*/
- __pyx_k_tuple_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_k_tuple_24 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_24)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 150; __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":152
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":153
* for word in self.id2word:
* f.write("%s %d " % (word, self.word2id[word]))
* f.write("\n") # <<<<<<<<<<<<<<
*
* def write_enhanced(self, char* filename):
*/
- __pyx_k_tuple_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_k_tuple_26 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_26)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 153; __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":155
+ /* "/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_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_k_tuple_28 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_28)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; __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);
@@ -66880,67 +67133,67 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(__pyx_int_neg_1);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_82));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":103
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":94
*
* '''Step 3: read off suffix array from inverse suffix array'''
* logger.info(" Finalizing sort...") # <<<<<<<<<<<<<<
* for i from 0 <= i < N:
* j = isa.arr[i]
*/
- __pyx_k_tuple_94 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_94)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_94);
- __Pyx_INCREF(((PyObject *)__pyx_kp_s_93));
- PyTuple_SET_ITEM(__pyx_k_tuple_94, 0, ((PyObject *)__pyx_kp_s_93));
- __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_93));
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_94));
+ __pyx_k_tuple_93 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_93)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_k_tuple_93);
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_92));
+ PyTuple_SET_ITEM(__pyx_k_tuple_93, 0, ((PyObject *)__pyx_kp_s_92));
+ __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_92));
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_93));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":202
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":193
* for a_i in self.sa:
* f.write("%d " % a_i)
* f.write("\n") # <<<<<<<<<<<<<<
* for w_i in self.ha:
* f.write("%d " % w_i)
*/
- __pyx_k_tuple_97 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_97)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_97);
+ __pyx_k_tuple_96 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_96)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_k_tuple_96);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_14));
- PyTuple_SET_ITEM(__pyx_k_tuple_97, 0, ((PyObject *)__pyx_kp_s_14));
+ PyTuple_SET_ITEM(__pyx_k_tuple_96, 0, ((PyObject *)__pyx_kp_s_14));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14));
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_97));
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_96));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":205
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":196
* for w_i in self.ha:
* f.write("%d " % w_i)
* f.write("\n") # <<<<<<<<<<<<<<
*
* cdef int __search_high(self, int word_id, int offset, int low, int high):
*/
- __pyx_k_tuple_98 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_98)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_98);
+ __pyx_k_tuple_97 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_97)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_k_tuple_97);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_14));
- PyTuple_SET_ITEM(__pyx_k_tuple_98, 0, ((PyObject *)__pyx_kp_s_14));
+ PyTuple_SET_ITEM(__pyx_k_tuple_97, 0, ((PyObject *)__pyx_kp_s_14));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14));
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_98));
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_97));
- /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":198
+ /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":189
*
* def write_enhanced(self, char* filename):
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
* self.darray.write_enhanced_handle(f)
* for a_i in self.sa:
*/
- __pyx_k_tuple_99 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_99)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_99);
+ __pyx_k_tuple_98 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_98)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_k_tuple_98);
__Pyx_INCREF(Py_None);
- PyTuple_SET_ITEM(__pyx_k_tuple_99, 0, Py_None);
+ PyTuple_SET_ITEM(__pyx_k_tuple_98, 0, Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_INCREF(Py_None);
- PyTuple_SET_ITEM(__pyx_k_tuple_99, 1, Py_None);
+ PyTuple_SET_ITEM(__pyx_k_tuple_98, 1, Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_INCREF(Py_None);
- PyTuple_SET_ITEM(__pyx_k_tuple_99, 2, Py_None);
+ PyTuple_SET_ITEM(__pyx_k_tuple_98, 2, Py_None);
__Pyx_GIVEREF(Py_None);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_99));
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_98));
/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":107
* logger.info("Sampling strategy: uniform, max sample size = %d", sample_size)
@@ -66949,12 +67202,12 @@ static int __Pyx_InitCachedConstants(void) {
*
* def sample(self, PhraseLocation phrase_location):
*/
- __pyx_k_tuple_103 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_103)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_103);
- __Pyx_INCREF(((PyObject *)__pyx_kp_s_102));
- PyTuple_SET_ITEM(__pyx_k_tuple_103, 0, ((PyObject *)__pyx_kp_s_102));
- __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_102));
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_103));
+ __pyx_k_tuple_102 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_102)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_k_tuple_102);
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_101));
+ PyTuple_SET_ITEM(__pyx_k_tuple_102, 0, ((PyObject *)__pyx_kp_s_101));
+ __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_101));
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_102));
/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":316
* self.rules.root = ExtendedTrieNode(phrase_location=PhraseLocation())
@@ -66963,12 +67216,12 @@ static int __Pyx_InitCachedConstants(void) {
* self.alignment = alignment
*
*/
- __pyx_k_tuple_108 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_108)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_108);
- __Pyx_INCREF(((PyObject *)__pyx_kp_s_107));
- PyTuple_SET_ITEM(__pyx_k_tuple_108, 0, ((PyObject *)__pyx_kp_s_107));
- __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_107));
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_108));
+ __pyx_k_tuple_107 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_107)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_k_tuple_107);
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_106));
+ PyTuple_SET_ITEM(__pyx_k_tuple_107, 0, ((PyObject *)__pyx_kp_s_106));
+ __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_106));
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_107));
/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1022
* else:
@@ -66977,12 +67230,12 @@ static int __Pyx_InitCachedConstants(void) {
* # checking whether lookup_required
* if lookup_required:
*/
- __pyx_k_tuple_123 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_123)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_123);
- __Pyx_INCREF(((PyObject *)__pyx_kp_s_122));
- PyTuple_SET_ITEM(__pyx_k_tuple_123, 0, ((PyObject *)__pyx_kp_s_122));
- __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_122));
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_123));
+ __pyx_k_tuple_122 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_122)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_k_tuple_122);
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_121));
+ PyTuple_SET_ITEM(__pyx_k_tuple_122, 0, ((PyObject *)__pyx_kp_s_121));
+ __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_121));
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_122));
/* "_sa.pyx":9
* resource.getrusage(resource.RUSAGE_SELF).ru_stime)
@@ -66991,16 +67244,16 @@ static int __Pyx_InitCachedConstants(void) {
* if filename.endswith('.gz'):
* return gzip.GzipFile(filename)
*/
- __pyx_k_tuple_136 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_136)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_136);
+ __pyx_k_tuple_135 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_135)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_k_tuple_135);
__Pyx_INCREF(((PyObject *)__pyx_n_s__filename));
- PyTuple_SET_ITEM(__pyx_k_tuple_136, 0, ((PyObject *)__pyx_n_s__filename));
+ PyTuple_SET_ITEM(__pyx_k_tuple_135, 0, ((PyObject *)__pyx_n_s__filename));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__filename));
__Pyx_INCREF(((PyObject *)__pyx_n_s__filename));
- PyTuple_SET_ITEM(__pyx_k_tuple_136, 1, ((PyObject *)__pyx_n_s__filename));
+ PyTuple_SET_ITEM(__pyx_k_tuple_135, 1, ((PyObject *)__pyx_n_s__filename));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__filename));
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_136));
- __pyx_k_codeobj_137 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_136, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_138, __pyx_n_s__gzip_or_text, 9, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_137)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_135));
+ __pyx_k_codeobj_136 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_135, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_137, __pyx_n_s__gzip_or_text, 9, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_136)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
/* "_sa.pyx":15
* return open(filename)
@@ -67009,12 +67262,12 @@ static int __Pyx_InitCachedConstants(void) {
*
* include "float_list.pxi"
*/
- __pyx_k_tuple_140 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_140)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_140);
- __Pyx_INCREF(((PyObject *)__pyx_kp_s_139));
- PyTuple_SET_ITEM(__pyx_k_tuple_140, 0, ((PyObject *)__pyx_kp_s_139));
- __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_139));
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_140));
+ __pyx_k_tuple_139 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_139)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_k_tuple_139);
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_138));
+ PyTuple_SET_ITEM(__pyx_k_tuple_139, 0, ((PyObject *)__pyx_kp_s_138));
+ __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_138));
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_139));
/* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":107
* return ALPHABET.fromstring(string, terminal)
@@ -67023,25 +67276,25 @@ static int __Pyx_InitCachedConstants(void) {
* word_ids = (sym_fromstring(word, True) for word in words)
* return tuple(((word, None, 1), ) for word in word_ids)
*/
- __pyx_k_tuple_141 = PyTuple_New(5); if (unlikely(!__pyx_k_tuple_141)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_141);
+ __pyx_k_tuple_140 = PyTuple_New(5); if (unlikely(!__pyx_k_tuple_140)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_k_tuple_140);
__Pyx_INCREF(((PyObject *)__pyx_n_s__words));
- PyTuple_SET_ITEM(__pyx_k_tuple_141, 0, ((PyObject *)__pyx_n_s__words));
+ PyTuple_SET_ITEM(__pyx_k_tuple_140, 0, ((PyObject *)__pyx_n_s__words));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__words));
__Pyx_INCREF(((PyObject *)__pyx_n_s__word_ids));
- PyTuple_SET_ITEM(__pyx_k_tuple_141, 1, ((PyObject *)__pyx_n_s__word_ids));
+ PyTuple_SET_ITEM(__pyx_k_tuple_140, 1, ((PyObject *)__pyx_n_s__word_ids));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__word_ids));
__Pyx_INCREF(((PyObject *)__pyx_n_s__genexpr));
- PyTuple_SET_ITEM(__pyx_k_tuple_141, 2, ((PyObject *)__pyx_n_s__genexpr));
+ PyTuple_SET_ITEM(__pyx_k_tuple_140, 2, ((PyObject *)__pyx_n_s__genexpr));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__genexpr));
__Pyx_INCREF(((PyObject *)__pyx_n_s__genexpr));
- PyTuple_SET_ITEM(__pyx_k_tuple_141, 3, ((PyObject *)__pyx_n_s__genexpr));
+ PyTuple_SET_ITEM(__pyx_k_tuple_140, 3, ((PyObject *)__pyx_n_s__genexpr));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__genexpr));
__Pyx_INCREF(((PyObject *)__pyx_n_s__genexpr));
- PyTuple_SET_ITEM(__pyx_k_tuple_141, 4, ((PyObject *)__pyx_n_s__genexpr));
+ PyTuple_SET_ITEM(__pyx_k_tuple_140, 4, ((PyObject *)__pyx_n_s__genexpr));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__genexpr));
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_141));
- __pyx_k_codeobj_142 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_141, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_143, __pyx_n_s__make_lattice, 107, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_142)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_140));
+ __pyx_k_codeobj_141 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_140, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_142, __pyx_n_s__make_lattice, 107, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_141)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
/* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":111
* return tuple(((word, None, 1), ) for word in word_ids)
@@ -67050,19 +67303,19 @@ static int __Pyx_InitCachedConstants(void) {
* return tuple((sym_tostring(sym), weight, dist) for (sym, weight, dist) in arc
* for arc in node for node in lattice)
*/
- __pyx_k_tuple_144 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_144)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_144);
+ __pyx_k_tuple_143 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_143)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_k_tuple_143);
__Pyx_INCREF(((PyObject *)__pyx_n_s__lattice));
- PyTuple_SET_ITEM(__pyx_k_tuple_144, 0, ((PyObject *)__pyx_n_s__lattice));
+ PyTuple_SET_ITEM(__pyx_k_tuple_143, 0, ((PyObject *)__pyx_n_s__lattice));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__lattice));
__Pyx_INCREF(((PyObject *)__pyx_n_s__genexpr));
- PyTuple_SET_ITEM(__pyx_k_tuple_144, 1, ((PyObject *)__pyx_n_s__genexpr));
+ PyTuple_SET_ITEM(__pyx_k_tuple_143, 1, ((PyObject *)__pyx_n_s__genexpr));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__genexpr));
__Pyx_INCREF(((PyObject *)__pyx_n_s__genexpr));
- PyTuple_SET_ITEM(__pyx_k_tuple_144, 2, ((PyObject *)__pyx_n_s__genexpr));
+ PyTuple_SET_ITEM(__pyx_k_tuple_143, 2, ((PyObject *)__pyx_n_s__genexpr));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__genexpr));
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_144));
- __pyx_k_codeobj_145 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_144, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_143, __pyx_n_s__decode_lattice, 111, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_145)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_143));
+ __pyx_k_codeobj_144 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_143, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_142, __pyx_n_s__decode_lattice, 111, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_144)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
/* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":115
* for arc in node for node in lattice)
@@ -67070,19 +67323,19 @@ static int __Pyx_InitCachedConstants(void) {
* def decode_sentence(lattice): # <<<<<<<<<<<<<<
* return tuple(sym_tostring(sym) for ((sym, _, _),) in lattice)
*/
- __pyx_k_tuple_146 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_146)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_146);
+ __pyx_k_tuple_145 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_145)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_k_tuple_145);
__Pyx_INCREF(((PyObject *)__pyx_n_s__lattice));
- PyTuple_SET_ITEM(__pyx_k_tuple_146, 0, ((PyObject *)__pyx_n_s__lattice));
+ PyTuple_SET_ITEM(__pyx_k_tuple_145, 0, ((PyObject *)__pyx_n_s__lattice));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__lattice));
__Pyx_INCREF(((PyObject *)__pyx_n_s__genexpr));
- PyTuple_SET_ITEM(__pyx_k_tuple_146, 1, ((PyObject *)__pyx_n_s__genexpr));
+ PyTuple_SET_ITEM(__pyx_k_tuple_145, 1, ((PyObject *)__pyx_n_s__genexpr));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__genexpr));
__Pyx_INCREF(((PyObject *)__pyx_n_s__genexpr));
- PyTuple_SET_ITEM(__pyx_k_tuple_146, 2, ((PyObject *)__pyx_n_s__genexpr));
+ PyTuple_SET_ITEM(__pyx_k_tuple_145, 2, ((PyObject *)__pyx_n_s__genexpr));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__genexpr));
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_146));
- __pyx_k_codeobj_147 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_146, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_143, __pyx_n_s__decode_sentence, 115, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_147)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_145));
+ __pyx_k_codeobj_146 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_145, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_142, __pyx_n_s__decode_sentence, 115, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_146)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_RefNannyFinishContext();
return 0;
__pyx_L1_error:;
@@ -67350,9 +67603,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 = 71; __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 = 72; __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 = 73; __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 = 74; __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;
@@ -67448,7 +67701,7 @@ PyMODINIT_FUNC PyInit__sa(void)
__pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__getLogger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_140), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_139), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n_s__logger, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
@@ -67731,7 +67984,7 @@ PyMODINIT_FUNC PyInit__sa(void)
*
* cdef class TrieNode:
*/
- __pyx_v_3_sa_EPSILON = __pyx_f_3_sa_sym_fromstring(__pyx_k_148, 1);
+ __pyx_v_3_sa_EPSILON = __pyx_f_3_sa_sym_fromstring(__pyx_k_147, 1);
/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":55
* cdef public int count
@@ -67742,7 +67995,7 @@ PyMODINIT_FUNC PyInit__sa(void)
*/
__pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_k_100 = __pyx_t_1;
+ __pyx_k_99 = __pyx_t_1;
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_1 = 0;
diff --git a/python/src/sa/data_array.pxi b/python/src/sa/data_array.pxi
index 371708c5..2a8ea921 100644
--- a/python/src/sa/data_array.pxi
+++ b/python/src/sa/data_array.pxi
@@ -7,11 +7,11 @@ from libc.stdlib cimport malloc, realloc, free
from libc.string cimport memset, strcpy
cdef class DataArray:
- cdef word2id
- cdef id2word
+ cdef public word2id
+ cdef public id2word
cdef public IntList data
cdef public IntList sent_id
- cdef IntList sent_index
+ cdef public IntList sent_index
cdef bint use_sent_id
def __cinit__(self, from_binary=None, from_text=None, side=None, bint use_sent_id=False):
@@ -44,17 +44,18 @@ cdef class DataArray:
sent.append(self.id2word[self.data.arr[i]])
return sent
- def get_sentence_position(self, loc):
- return loc - self.sent_index.arr[self.sent_id.arr[loc]]
-
def get_id(self, word):
if not word in self.word2id:
self.word2id[word] = len(self.id2word)
self.id2word.append(word)
return self.word2id[word]
- def get_word(self, id):
- return self.id2word[id]
+ def __getitem__(self, loc):
+ return self.id2word[self.data.arr[loc]]
+
+ def get_sentence_bounds(self, loc):
+ cdef int sid = self.sent_id.arr[loc]
+ return (self.sent_index.arr[sid], self.sent_index.arr[sid+1])
def write_text(self, char* filename):
with open(filename, "w") as f:
diff --git a/python/src/sa/suffix_array.pxi b/python/src/sa/suffix_array.pxi
index baa3d546..de4adcd9 100644
--- a/python/src/sa/suffix_array.pxi
+++ b/python/src/sa/suffix_array.pxi
@@ -20,15 +20,6 @@ cdef class SuffixArray:
def __getitem__(self, i):
return self.sa.arr[i]
- def get_sentence_id(self, i):
- return self.darray.get_sentence_id(i)
-
- def get_sentence(self, i):
- return self.darray.get_sentence(i)
-
- def get_sentence_position(self, loc):
- return self.darray.get_sentence_position(loc)
-
def read_text(self, filename, side):
'''Constructs suffix array using the algorithm
of Larsson & Sadahkane (1999)'''