summaryrefslogtreecommitdiff
path: root/python/cdec/sa
diff options
context:
space:
mode:
authorWilker Aziz <will.aziz@gmail.com>2014-09-17 15:54:42 +0100
committerWilker Aziz <will.aziz@gmail.com>2014-09-17 15:54:42 +0100
commita861980460220a31592bdb2e951a55faeebb8c6d (patch)
tree79c844304f2aa3f42b44236ba755200f4f87b7f6 /python/cdec/sa
parent3822a2063e36b6ced948e5c22910a373c6c691b2 (diff)
scaling weights, return dot and fmap from sampling, iterate over the
terminal spans in a rule
Diffstat (limited to 'python/cdec/sa')
-rw-r--r--python/cdec/sa/_sa.cpp9801
-rw-r--r--python/cdec/sa/rule.pxi19
2 files changed, 5252 insertions, 4568 deletions
diff --git a/python/cdec/sa/_sa.cpp b/python/cdec/sa/_sa.cpp
index ca51cbca..d3ffcda3 100644
--- a/python/cdec/sa/_sa.cpp
+++ b/python/cdec/sa/_sa.cpp
@@ -473,20 +473,21 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr;
struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words;
struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr;
struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__;
-struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__;
-struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr;
-struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments;
-struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input;
-struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr;
-struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance;
-struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule;
-struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr;
-struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule;
-struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr;
-struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases;
-struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__;
-struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___str__;
-struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr;
+struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16_iterspans;
+struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17___str__;
+struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_genexpr;
+struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_alignments;
+struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_input;
+struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_genexpr;
+struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_add_instance;
+struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_form_rule;
+struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_genexpr;
+struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_fmt_rule;
+struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_genexpr;
+struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27_get_f_phrases;
+struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___iter__;
+struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29___str__;
+struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_30_genexpr;
struct __pyx_t_4cdec_2sa_3_sa__node;
struct __pyx_t_4cdec_2sa_3_sa__BitSet;
struct __pyx_t_4cdec_2sa_3_sa__VEB;
@@ -495,7 +496,7 @@ struct __pyx_t_4cdec_2sa_3_sa__Trie_Node;
struct __pyx_t_4cdec_2sa_3_sa_match_node;
struct __pyx_t_4cdec_2sa_3_sa_Matching;
-/* "bilex.pxi":9
+/* "cdec/sa/bilex.pxi":9
* from libc.string cimport memset, strcpy
*
* cdef struct _node: # <<<<<<<<<<<<<<
@@ -509,7 +510,7 @@ struct __pyx_t_4cdec_2sa_3_sa__node {
int val;
};
-/* "veb.pxi":30
+/* "cdec/sa/veb.pxi":30
* _init_lower_mask()
*
* cdef struct _BitSet: # <<<<<<<<<<<<<<
@@ -523,7 +524,7 @@ struct __pyx_t_4cdec_2sa_3_sa__BitSet {
int size;
};
-/* "veb.pxi":168
+/* "cdec/sa/veb.pxi":168
* return result
*
* cdef struct _VEB: # <<<<<<<<<<<<<<
@@ -540,7 +541,7 @@ struct __pyx_t_4cdec_2sa_3_sa__VEB {
void **bottom;
};
-/* "precomputation.pxi":10
+/* "cdec/sa/precomputation.pxi":10
* cdef struct _Trie_Node # forward decl
*
* cdef struct _Trie_Edge: # <<<<<<<<<<<<<<
@@ -554,7 +555,7 @@ struct __pyx_t_4cdec_2sa_3_sa__Trie_Edge {
struct __pyx_t_4cdec_2sa_3_sa__Trie_Edge *smaller;
};
-/* "precomputation.pxi":8
+/* "cdec/sa/precomputation.pxi":8
* from libc.string cimport memset, memcpy
*
* cdef struct _Trie_Node # forward decl # <<<<<<<<<<<<<<
@@ -567,7 +568,7 @@ struct __pyx_t_4cdec_2sa_3_sa__Trie_Node {
int arr_len;
};
-/* "rulefactory.pxi":97
+/* "cdec/sa/rulefactory.pxi":97
*
* # linked list structure for storing matches in BaselineRuleFactory
* cdef struct match_node: # <<<<<<<<<<<<<<
@@ -579,7 +580,7 @@ struct __pyx_t_4cdec_2sa_3_sa_match_node {
struct __pyx_t_4cdec_2sa_3_sa_match_node *next;
};
-/* "rulefactory.pxi":193
+/* "cdec/sa/rulefactory.pxi":193
*
* # struct used to encapsulate a single matching
* cdef struct Matching: # <<<<<<<<<<<<<<
@@ -677,7 +678,7 @@ struct __pyx_obj_4cdec_2sa_3_sa_Rule {
};
-/* "str_map.pxi":8
+/* "cdec/sa/str_map.pxi":8
* char* stringmap_word(StrMap *vocab, int i)
*
* cdef class StringMap: # <<<<<<<<<<<<<<
@@ -691,7 +692,7 @@ struct __pyx_obj_4cdec_2sa_3_sa_StringMap {
};
-/* "data_array.pxi":9
+/* "cdec/sa/data_array.pxi":9
* from libc.string cimport memset, strcpy
*
* cdef class DataArray: # <<<<<<<<<<<<<<
@@ -710,7 +711,7 @@ struct __pyx_obj_4cdec_2sa_3_sa_DataArray {
};
-/* "alignment.pxi":10
+/* "cdec/sa/alignment.pxi":10
* cdef int ALIGNMENT_CODE = 1 << 16
*
* cdef class Alignment: # <<<<<<<<<<<<<<
@@ -725,7 +726,7 @@ struct __pyx_obj_4cdec_2sa_3_sa_Alignment {
};
-/* "bilex.pxi":47
+/* "cdec/sa/bilex.pxi":47
*
*
* cdef class BiLex: # <<<<<<<<<<<<<<
@@ -746,7 +747,7 @@ struct __pyx_obj_4cdec_2sa_3_sa_BiLex {
};
-/* "veb.pxi":100
+/* "cdec/sa/veb.pxi":100
*
*
* cdef class BitSetIterator: # <<<<<<<<<<<<<<
@@ -760,7 +761,7 @@ struct __pyx_obj_4cdec_2sa_3_sa_BitSetIterator {
};
-/* "veb.pxi":118
+/* "cdec/sa/veb.pxi":118
* # (entirely C-implemented) _BitSet struct.
* # Very slow; use only for debugging
* cdef class BitSet: # <<<<<<<<<<<<<<
@@ -773,7 +774,7 @@ struct __pyx_obj_4cdec_2sa_3_sa_BitSet {
};
-/* "veb.pxi":340
+/* "cdec/sa/veb.pxi":340
*
*
* cdef class VEBIterator: # <<<<<<<<<<<<<<
@@ -787,7 +788,7 @@ struct __pyx_obj_4cdec_2sa_3_sa_VEBIterator {
};
-/* "veb.pxi":354
+/* "cdec/sa/veb.pxi":354
*
*
* cdef class VEB: # <<<<<<<<<<<<<<
@@ -801,7 +802,7 @@ struct __pyx_obj_4cdec_2sa_3_sa_VEB {
};
-/* "lcp.pxi":5
+/* "cdec/sa/lcp.pxi":5
* as k most frequent n-grams"""
*
* cdef class LCP: # <<<<<<<<<<<<<<
@@ -815,7 +816,7 @@ struct __pyx_obj_4cdec_2sa_3_sa_LCP {
};
-/* "sym.pxi":7
+/* "cdec/sa/sym.pxi":7
* cdef int INDEX_MASK = (1<<INDEX_SHIFT)-1
*
* cdef class Alphabet: # <<<<<<<<<<<<<<
@@ -833,7 +834,7 @@ struct __pyx_obj_4cdec_2sa_3_sa_Alphabet {
};
-/* "precomputation.pxi":109
+/* "cdec/sa/precomputation.pxi":109
* trie_node_to_map(edge.node, result, prefix, include_zeros)
*
* cdef class TrieMap: # <<<<<<<<<<<<<<
@@ -848,7 +849,7 @@ struct __pyx_obj_4cdec_2sa_3_sa_TrieMap {
};
-/* "precomputation.pxi":188
+/* "cdec/sa/precomputation.pxi":188
*
*
* cdef class Precomputation: # <<<<<<<<<<<<<<
@@ -869,7 +870,7 @@ struct __pyx_obj_4cdec_2sa_3_sa_Precomputation {
};
-/* "suffix_array.pxi":6
+/* "cdec/sa/suffix_array.pxi":6
* from libc.stdio cimport FILE, fclose, fopen
*
* cdef class SuffixArray: # <<<<<<<<<<<<<<
@@ -885,7 +886,7 @@ struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray {
};
-/* "rulefactory.pxi":39
+/* "cdec/sa/rulefactory.pxi":39
* ])
*
* cdef class OnlineStats: # <<<<<<<<<<<<<<
@@ -903,7 +904,7 @@ struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats {
};
-/* "rulefactory.pxi":67
+/* "cdec/sa/rulefactory.pxi":67
* cdef int EPSILON = sym_fromstring('*EPS*', True)
*
* cdef class TrieNode: # <<<<<<<<<<<<<<
@@ -916,7 +917,7 @@ struct __pyx_obj_4cdec_2sa_3_sa_TrieNode {
};
-/* "rulefactory.pxi":73
+/* "cdec/sa/rulefactory.pxi":73
* self.children = {}
*
* cdef class ExtendedTrieNode(TrieNode): # <<<<<<<<<<<<<<
@@ -931,7 +932,7 @@ struct __pyx_obj_4cdec_2sa_3_sa_ExtendedTrieNode {
};
-/* "rulefactory.pxi":84
+/* "cdec/sa/rulefactory.pxi":84
*
*
* cdef class TrieTable: # <<<<<<<<<<<<<<
@@ -946,7 +947,7 @@ struct __pyx_obj_4cdec_2sa_3_sa_TrieTable {
};
-/* "rulefactory.pxi":105
+/* "cdec/sa/rulefactory.pxi":105
* # in the suffix array; if discontiguous, it is the set of
* # actual locations (packed into an array)
* cdef class PhraseLocation: # <<<<<<<<<<<<<<
@@ -965,7 +966,7 @@ struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation {
};
-/* "rulefactory.pxi":127
+/* "cdec/sa/rulefactory.pxi":127
*
*
* cdef class Sampler: # <<<<<<<<<<<<<<
@@ -979,7 +980,7 @@ struct __pyx_obj_4cdec_2sa_3_sa_Sampler {
};
-/* "rulefactory.pxi":249
+/* "cdec/sa/rulefactory.pxi":249
*
*
* cdef class HieroCachingRuleFactory: # <<<<<<<<<<<<<<
@@ -1032,7 +1033,7 @@ struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory {
};
-/* "features.pxi":23
+/* "cdec/sa/features.pxi":23
* return ' '.join('%s=%s' % feat for feat in self)
*
* cdef class Scorer: # <<<<<<<<<<<<<<
@@ -1046,7 +1047,7 @@ struct __pyx_obj_4cdec_2sa_3_sa_Scorer {
};
-/* "int_list.pxi":81
+/* "cdec/sa/int_list.pxi":81
* free(self.arr)
*
* def __iter__(self): # <<<<<<<<<<<<<<
@@ -1062,7 +1063,7 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct____iter__ {
};
-/* "data_array.pxi":72
+/* "cdec/sa/data_array.pxi":72
* self.read_text_data(fp)
*
* def read_bitext(self, char* filename, int side): # <<<<<<<<<<<<<<
@@ -1076,7 +1077,7 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext {
};
-/* "data_array.pxi":74
+/* "cdec/sa/data_array.pxi":74
* def read_bitext(self, char* filename, int side):
* with gzip_or_text(filename) as fp:
* data = (line.split(' ||| ')[side] for line in fp) # <<<<<<<<<<<<<<
@@ -1093,7 +1094,7 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr {
};
-/* "lcp.pxi":36
+/* "cdec/sa/lcp.pxi":36
* logger.info("LCP array completed")
*
* def compute_stats(self, int max_n): # <<<<<<<<<<<<<<
@@ -1124,7 +1125,7 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_3_compute_stats {
};
-/* "sym.pxi":110
+/* "cdec/sa/sym.pxi":110
* return sym_isvar(sym)
*
* def make_lattice(words): # <<<<<<<<<<<<<<
@@ -1138,7 +1139,7 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice {
};
-/* "sym.pxi":111
+/* "cdec/sa/sym.pxi":111
*
* def make_lattice(words):
* word_ids = (sym_fromstring(word, True) for word in words) # <<<<<<<<<<<<<<
@@ -1155,7 +1156,7 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr {
};
-/* "sym.pxi":112
+/* "cdec/sa/sym.pxi":112
* def make_lattice(words):
* word_ids = (sym_fromstring(word, True) for word in words)
* return tuple(((word, None, 1), ) for word in word_ids) # <<<<<<<<<<<<<<
@@ -1172,7 +1173,7 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr {
};
-/* "sym.pxi":114
+/* "cdec/sa/sym.pxi":114
* return tuple(((word, None, 1), ) for word in word_ids)
*
* def decode_lattice(lattice): # <<<<<<<<<<<<<<
@@ -1185,7 +1186,7 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice {
};
-/* "sym.pxi":115
+/* "cdec/sa/sym.pxi":115
*
* def decode_lattice(lattice):
* return tuple((sym_tostring(sym), weight, dist) for (sym, weight, dist) in arc # <<<<<<<<<<<<<<
@@ -1212,7 +1213,7 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr {
};
-/* "sym.pxi":118
+/* "cdec/sa/sym.pxi":118
* for arc in node for node in lattice)
*
* def decode_sentence(lattice): # <<<<<<<<<<<<<<
@@ -1225,7 +1226,7 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_9_decode_sentence {
};
-/* "sym.pxi":119
+/* "cdec/sa/sym.pxi":119
*
* def decode_sentence(lattice):
* return tuple(sym_tostring(sym) for ((sym, _, _),) in lattice) # <<<<<<<<<<<<<<
@@ -1243,7 +1244,7 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr {
};
-/* "sym.pxi":121
+/* "cdec/sa/sym.pxi":121
* return tuple(sym_tostring(sym) for ((sym, _, _),) in lattice)
*
* def encode_words(words): # <<<<<<<<<<<<<<
@@ -1256,7 +1257,7 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words {
};
-/* "sym.pxi":122
+/* "cdec/sa/sym.pxi":122
*
* def encode_words(words):
* return tuple(sym_fromstring(word, True) for word in words) # <<<<<<<<<<<<<<
@@ -1273,7 +1274,7 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr {
};
-/* "sym.pxi":124
+/* "cdec/sa/sym.pxi":124
* return tuple(sym_fromstring(word, True) for word in words)
*
* def decode_words(syms): # <<<<<<<<<<<<<<
@@ -1285,7 +1286,7 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words {
};
-/* "sym.pxi":125
+/* "cdec/sa/sym.pxi":125
*
* def decode_words(syms):
* return tuple(sym_tostring(sym) for sym in syms) # <<<<<<<<<<<<<<
@@ -1300,7 +1301,7 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr {
};
-/* "rule.pxi":140
+/* "cdec/sa/rule.pxi":140
* return self.syms[i]
*
* def __iter__(self): # <<<<<<<<<<<<<<
@@ -1315,29 +1316,49 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__ {
};
-/* "rule.pxi":182
+/* "cdec/sa/rule.pxi":158
+ * return [sym_tostring(w) for w in self if not sym_isvar(w)]
+ *
+ * def iterspans(self, nt_flag = False, to_str = True): # <<<<<<<<<<<<<<
+ * """iterate over (terminal and nonterminal) spans, it generates pairs of the kind (terminal span, !nt_flag) or (nonterminal, nt_flag)
+ * Example: iterspans(False, False) --> ([-1], False), ([2,3], True), ([-1], False), ([4], True), ([-1], False)
+ */
+struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16_iterspans {
+ PyObject_HEAD
+ PyObject *__pyx_v_get_sym;
+ int __pyx_v_i;
+ PyObject *__pyx_v_nt_flag;
+ int __pyx_v_s;
+ struct __pyx_obj_4cdec_2sa_3_sa_Phrase *__pyx_v_self;
+ PyObject *__pyx_v_span;
+ PyObject *__pyx_v_to_str;
+ int __pyx_t_0;
+};
+
+
+/* "cdec/sa/rule.pxi":201
* return self.f.arity()
*
* def __str__(self): # <<<<<<<<<<<<<<
* cdef unsigned i
* fields = [sym_tostring(self.lhs), str(self.f), str(self.e), str(self.scores)]
*/
-struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ {
+struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17___str__ {
PyObject_HEAD
struct __pyx_obj_4cdec_2sa_3_sa_Rule *__pyx_v_self;
};
-/* "rule.pxi":186
+/* "cdec/sa/rule.pxi":205
* fields = [sym_tostring(self.lhs), str(self.f), str(self.e), str(self.scores)]
* if self.word_alignments is not None:
* fields.append(' '.join('%d-%d' % a for a in self.alignments())) # <<<<<<<<<<<<<<
* return ' ||| '.join(fields)
*
*/
-struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr {
+struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_genexpr {
PyObject_HEAD
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ *__pyx_outer_scope;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17___str__ *__pyx_outer_scope;
PyObject *__pyx_v_a;
PyObject *__pyx_t_0;
Py_ssize_t __pyx_t_1;
@@ -1345,14 +1366,14 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr {
};
-/* "rule.pxi":189
+/* "cdec/sa/rule.pxi":208
* return ' ||| '.join(fields)
*
* def alignments(self): # <<<<<<<<<<<<<<
* for point in self.word_alignments:
* yield point / ALIGNMENT_CODE, point % ALIGNMENT_CODE
*/
-struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments {
+struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_alignments {
PyObject_HEAD
PyObject *__pyx_v_point;
struct __pyx_obj_4cdec_2sa_3_sa_Rule *__pyx_v_self;
@@ -1362,14 +1383,14 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments {
};
-/* "rulefactory.pxi":981
+/* "cdec/sa/rulefactory.pxi":981
* return sorted(result);
*
* def input(self, fwords, meta, ctx_name=None): # <<<<<<<<<<<<<<
* '''When this function is called on the RuleFactory,
* it looks up all of the rules that can be used to translate
*/
-struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input {
+struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_input {
PyObject_HEAD
PyObject *__pyx_v_alignment;
PyObject *__pyx_v_als;
@@ -1459,16 +1480,16 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input {
};
-/* "rulefactory.pxi":1196
+/* "cdec/sa/rulefactory.pxi":1196
* if self.online:
* stats = self.online_stats[ctx_name]
* f_syms = tuple(word[0][0] for word in fwords) # <<<<<<<<<<<<<<
* for f, lex_i, lex_j in self.get_f_phrases(f_syms):
* spanlen = (lex_j - lex_i) + 1
*/
-struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr {
+struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_genexpr {
PyObject_HEAD
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input *__pyx_outer_scope;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_input *__pyx_outer_scope;
PyObject *__pyx_v_word;
PyObject *__pyx_t_0;
Py_ssize_t __pyx_t_1;
@@ -1476,14 +1497,14 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr {
};
-/* "rulefactory.pxi":1906
+/* "cdec/sa/rulefactory.pxi":1906
* # Aggregate stats from a training instance
* # (Extract rules, update counts)
* def add_instance(self, f_words, e_words, alignment, ctx_name=None): # <<<<<<<<<<<<<<
*
* self.online = True
*/
-struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance {
+struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_add_instance {
PyObject_HEAD
PyObject *__pyx_v_al;
PyObject *__pyx_v_cover;
@@ -1499,30 +1520,30 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance {
};
-/* "rulefactory.pxi":2073
+/* "cdec/sa/rulefactory.pxi":2073
*
* # Create a rule from source, target, non-terminals, and alignments
* def form_rule(self, f_i, e_i, f_span, e_span, nt, al): # <<<<<<<<<<<<<<
*
* # Substitute in non-terminals
*/
-struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule {
+struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_form_rule {
PyObject_HEAD
PyObject *__pyx_v_links;
struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *__pyx_v_self;
};
-/* "rulefactory.pxi":2134
+/* "cdec/sa/rulefactory.pxi":2134
* f = Phrase(f_sym)
* e = Phrase(e_sym)
* a = tuple(self.alignment.link(i, j) for i, j in links) # <<<<<<<<<<<<<<
* return (f, e, a, lex_f_i, lex_f_j)
*
*/
-struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr {
+struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_genexpr {
PyObject_HEAD
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule *__pyx_outer_scope;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_form_rule *__pyx_outer_scope;
PyObject *__pyx_v_i;
PyObject *__pyx_v_j;
PyObject *__pyx_t_0;
@@ -1530,30 +1551,30 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr {
};
-/* "rulefactory.pxi":2138
+/* "cdec/sa/rulefactory.pxi":2138
*
* # Rule string from rule
* def fmt_rule(self, f, e, a): # <<<<<<<<<<<<<<
* a_str = ' '.join('{0}-{1}'.format(*self.alignment.unlink(packed)) for packed in a)
* return '[X] ||| {0} ||| {1} ||| {2}'.format(f, e, a_str)
*/
-struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule {
+struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_fmt_rule {
PyObject_HEAD
PyObject *__pyx_v_a;
struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *__pyx_v_self;
};
-/* "rulefactory.pxi":2139
+/* "cdec/sa/rulefactory.pxi":2139
* # Rule string from rule
* def fmt_rule(self, f, e, a):
* a_str = ' '.join('{0}-{1}'.format(*self.alignment.unlink(packed)) for packed in a) # <<<<<<<<<<<<<<
* return '[X] ||| {0} ||| {1} ||| {2}'.format(f, e, a_str)
*
*/
-struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr {
+struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_genexpr {
PyObject_HEAD
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule *__pyx_outer_scope;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_fmt_rule *__pyx_outer_scope;
PyObject *__pyx_v_packed;
PyObject *__pyx_t_0;
Py_ssize_t __pyx_t_1;
@@ -1561,14 +1582,14 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr {
};
-/* "rulefactory.pxi":2157
+/* "cdec/sa/rulefactory.pxi":2157
* # (Used for EGivenFCoherent)
* # Return set of (fphrase, lex_i, lex_j)
* def get_f_phrases(self, f_words): # <<<<<<<<<<<<<<
*
* f_len = len(f_words)
*/
-struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases {
+struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27_get_f_phrases {
PyObject_HEAD
PyObject *__pyx_v_extract;
Py_ssize_t __pyx_v_f_len;
@@ -1578,14 +1599,14 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases {
};
-/* "features.pxi":15
+/* "cdec/sa/features.pxi":15
* self.values.append(value)
*
* def __iter__(self): # <<<<<<<<<<<<<<
* cdef unsigned i
* for i in range(self.names.len):
*/
-struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ {
+struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___iter__ {
PyObject_HEAD
unsigned int __pyx_v_i;
struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *__pyx_v_self;
@@ -1594,29 +1615,29 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ {
};
-/* "features.pxi":20
+/* "cdec/sa/features.pxi":20
* yield (FD.word(self.names[i]), self.values[i])
*
* def __str__(self): # <<<<<<<<<<<<<<
* return ' '.join('%s=%s' % feat for feat in self)
*
*/
-struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ {
+struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29___str__ {
PyObject_HEAD
struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *__pyx_v_self;
};
-/* "features.pxi":21
+/* "cdec/sa/features.pxi":21
*
* def __str__(self):
* return ' '.join('%s=%s' % feat for feat in self) # <<<<<<<<<<<<<<
*
* cdef class Scorer:
*/
-struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr {
+struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_30_genexpr {
PyObject_HEAD
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ *__pyx_outer_scope;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29___str__ *__pyx_outer_scope;
PyObject *__pyx_v_feat;
PyObject *__pyx_t_0;
Py_ssize_t __pyx_t_1;
@@ -1625,7 +1646,7 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr {
-/* "float_list.pxi":9
+/* "cdec/sa/float_list.pxi":9
* from libc.string cimport memset, strcpy, strlen
*
* cdef class FloatList: # <<<<<<<<<<<<<<
@@ -1653,7 +1674,7 @@ struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList {
static struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *__pyx_vtabptr_4cdec_2sa_3_sa_IntList;
-/* "rule.pxi":4
+/* "cdec/sa/rule.pxi":4
* from libc.string cimport strsep, strcpy, strlen
*
* cdef class Phrase: # <<<<<<<<<<<<<<
@@ -1668,7 +1689,7 @@ struct __pyx_vtabstruct_4cdec_2sa_3_sa_Phrase {
static struct __pyx_vtabstruct_4cdec_2sa_3_sa_Phrase *__pyx_vtabptr_4cdec_2sa_3_sa_Phrase;
-/* "str_map.pxi":8
+/* "cdec/sa/str_map.pxi":8
* char* stringmap_word(StrMap *vocab, int i)
*
* cdef class StringMap: # <<<<<<<<<<<<<<
@@ -1683,7 +1704,7 @@ struct __pyx_vtabstruct_4cdec_2sa_3_sa_StringMap {
static struct __pyx_vtabstruct_4cdec_2sa_3_sa_StringMap *__pyx_vtabptr_4cdec_2sa_3_sa_StringMap;
-/* "data_array.pxi":9
+/* "cdec/sa/data_array.pxi":9
* from libc.string cimport memset, strcpy
*
* cdef class DataArray: # <<<<<<<<<<<<<<
@@ -1698,7 +1719,7 @@ struct __pyx_vtabstruct_4cdec_2sa_3_sa_DataArray {
static struct __pyx_vtabstruct_4cdec_2sa_3_sa_DataArray *__pyx_vtabptr_4cdec_2sa_3_sa_DataArray;
-/* "alignment.pxi":10
+/* "cdec/sa/alignment.pxi":10
* cdef int ALIGNMENT_CODE = 1 << 16
*
* cdef class Alignment: # <<<<<<<<<<<<<<
@@ -1714,7 +1735,7 @@ struct __pyx_vtabstruct_4cdec_2sa_3_sa_Alignment {
static struct __pyx_vtabstruct_4cdec_2sa_3_sa_Alignment *__pyx_vtabptr_4cdec_2sa_3_sa_Alignment;
-/* "bilex.pxi":47
+/* "cdec/sa/bilex.pxi":47
*
*
* cdef class BiLex: # <<<<<<<<<<<<<<
@@ -1733,7 +1754,7 @@ struct __pyx_vtabstruct_4cdec_2sa_3_sa_BiLex {
static struct __pyx_vtabstruct_4cdec_2sa_3_sa_BiLex *__pyx_vtabptr_4cdec_2sa_3_sa_BiLex;
-/* "veb.pxi":354
+/* "cdec/sa/veb.pxi":354
*
*
* cdef class VEB: # <<<<<<<<<<<<<<
@@ -1749,7 +1770,7 @@ struct __pyx_vtabstruct_4cdec_2sa_3_sa_VEB {
static struct __pyx_vtabstruct_4cdec_2sa_3_sa_VEB *__pyx_vtabptr_4cdec_2sa_3_sa_VEB;
-/* "sym.pxi":7
+/* "cdec/sa/sym.pxi":7
* cdef int INDEX_MASK = (1<<INDEX_SHIFT)-1
*
* cdef class Alphabet: # <<<<<<<<<<<<<<
@@ -1772,7 +1793,7 @@ struct __pyx_vtabstruct_4cdec_2sa_3_sa_Alphabet {
static struct __pyx_vtabstruct_4cdec_2sa_3_sa_Alphabet *__pyx_vtabptr_4cdec_2sa_3_sa_Alphabet;
-/* "precomputation.pxi":109
+/* "cdec/sa/precomputation.pxi":109
* trie_node_to_map(edge.node, result, prefix, include_zeros)
*
* cdef class TrieMap: # <<<<<<<<<<<<<<
@@ -1787,7 +1808,7 @@ struct __pyx_vtabstruct_4cdec_2sa_3_sa_TrieMap {
static struct __pyx_vtabstruct_4cdec_2sa_3_sa_TrieMap *__pyx_vtabptr_4cdec_2sa_3_sa_TrieMap;
-/* "precomputation.pxi":188
+/* "cdec/sa/precomputation.pxi":188
*
*
* cdef class Precomputation: # <<<<<<<<<<<<<<
@@ -1802,7 +1823,7 @@ struct __pyx_vtabstruct_4cdec_2sa_3_sa_Precomputation {
static struct __pyx_vtabstruct_4cdec_2sa_3_sa_Precomputation *__pyx_vtabptr_4cdec_2sa_3_sa_Precomputation;
-/* "suffix_array.pxi":6
+/* "cdec/sa/suffix_array.pxi":6
* from libc.stdio cimport FILE, fclose, fopen
*
* cdef class SuffixArray: # <<<<<<<<<<<<<<
@@ -1819,7 +1840,7 @@ struct __pyx_vtabstruct_4cdec_2sa_3_sa_SuffixArray {
static struct __pyx_vtabstruct_4cdec_2sa_3_sa_SuffixArray *__pyx_vtabptr_4cdec_2sa_3_sa_SuffixArray;
-/* "rulefactory.pxi":105
+/* "cdec/sa/rulefactory.pxi":105
* # in the suffix array; if discontiguous, it is the set of
* # actual locations (packed into an array)
* cdef class PhraseLocation: # <<<<<<<<<<<<<<
@@ -1833,7 +1854,7 @@ struct __pyx_vtabstruct_4cdec_2sa_3_sa_PhraseLocation {
static struct __pyx_vtabstruct_4cdec_2sa_3_sa_PhraseLocation *__pyx_vtabptr_4cdec_2sa_3_sa_PhraseLocation;
-/* "rulefactory.pxi":249
+/* "cdec/sa/rulefactory.pxi":249
*
*
* cdef class HieroCachingRuleFactory: # <<<<<<<<<<<<<<
@@ -1861,7 +1882,7 @@ struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory {
static struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *__pyx_vtabptr_4cdec_2sa_3_sa_HieroCachingRuleFactory;
-/* "features.pxi":23
+/* "cdec/sa/features.pxi":23
* return ' '.join('%s=%s' % feat for feat in self)
*
* cdef class Scorer: # <<<<<<<<<<<<<<
@@ -2265,22 +2286,6 @@ static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values);
#endif
-static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);
-
-static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
-
-static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index);
-
-static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** value1, PyObject** value2,
- int is_tuple, int has_known_size, int decref_tuple);
-
-static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name,
- Py_ssize_t* p_orig_length, int* p_is_dict);
-static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos,
- PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict);
-
-static CYTHON_INLINE long __Pyx_mod_long(long, long); /* proto */
-
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
#define __Pyx_CyFunction_USED 1
@@ -2336,6 +2341,22 @@ static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
PyObject *dict);
static int __Pyx_CyFunction_init(void);
+static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);
+
+static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
+
+static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index);
+
+static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** value1, PyObject** value2,
+ int is_tuple, int has_known_size, int decref_tuple);
+
+static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name,
+ Py_ssize_t* p_orig_length, int* p_is_dict);
+static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos,
+ PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict);
+
+static CYTHON_INLINE long __Pyx_mod_long(long, long); /* proto */
+
static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
#if CYTHON_COMPILING_IN_CPYTHON
PyObject* none = _PyList_Extend((PyListObject*)L, v);
@@ -2549,20 +2570,21 @@ static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr =
static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words = 0;
static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr = 0;
static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__ = 0;
-static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ = 0;
-static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr = 0;
-static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments = 0;
-static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_19_input = 0;
-static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr = 0;
-static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance = 0;
-static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule = 0;
-static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr = 0;
-static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule = 0;
-static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr = 0;
-static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases = 0;
-static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ = 0;
-static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ = 0;
-static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr = 0;
+static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_16_iterspans = 0;
+static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_17___str__ = 0;
+static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_18_genexpr = 0;
+static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_19_alignments = 0;
+static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_20_input = 0;
+static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_21_genexpr = 0;
+static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_22_add_instance = 0;
+static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_23_form_rule = 0;
+static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_24_genexpr = 0;
+static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_25_fmt_rule = 0;
+static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_26_genexpr = 0;
+static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_27_get_f_phrases = 0;
+static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_28___iter__ = 0;
+static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_29___str__ = 0;
+static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_30_genexpr = 0;
static int __pyx_v_4cdec_2sa_3_sa_ALIGNMENT_CODE;
static int __pyx_v_4cdec_2sa_3_sa_MIN_BOTTOM_SIZE;
static int __pyx_v_4cdec_2sa_3_sa_MIN_BOTTOM_BITS;
@@ -2761,6 +2783,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_26__getitem__(struct __pyx_obj_
static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_28__iter__(struct __pyx_obj_4cdec_2sa_3_sa_Phrase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_31subst(struct __pyx_obj_4cdec_2sa_3_sa_Phrase *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_children); /* proto */
static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_5words___get__(struct __pyx_obj_4cdec_2sa_3_sa_Phrase *__pyx_v_self); /* proto */
+static PyObject *__pyx_lambda_funcdef_lambda2(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sym); /* proto */
+static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_sym); /* proto */
+static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_33iterspans(struct __pyx_obj_4cdec_2sa_3_sa_Phrase *__pyx_v_self, PyObject *__pyx_v_nt_flag, PyObject *__pyx_v_to_str); /* proto */
static int __pyx_pf_4cdec_2sa_3_sa_4Rule___cinit__(struct __pyx_obj_4cdec_2sa_3_sa_Rule *__pyx_v_self, int __pyx_v_lhs, struct __pyx_obj_4cdec_2sa_3_sa_Phrase *__pyx_v_f, struct __pyx_obj_4cdec_2sa_3_sa_Phrase *__pyx_v_e, PyObject *__pyx_v_scores, PyObject *__pyx_v_word_alignments); /* proto */
static Py_hash_t __pyx_pf_4cdec_2sa_3_sa_4Rule_2__hash__(struct __pyx_obj_4cdec_2sa_3_sa_Rule *__pyx_v_self); /* proto */
#if PY_MAJOR_VERSION < 3
@@ -2791,8 +2816,8 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_10read_binary(struct __py
static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_12write_binary(struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *__pyx_v_self, char *__pyx_v_filename); /* proto */
static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_14write_enhanced(struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *__pyx_v_self, char *__pyx_v_filename); /* proto */
static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_16lookup(struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *__pyx_v_self, PyObject *__pyx_v_word, int __pyx_v_offset, int __pyx_v_low, int __pyx_v_high); /* proto */
-static PyObject *__pyx_lambda_funcdef_lambda1(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
-static PyObject *__pyx_lambda_funcdef_lambda2(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
+static PyObject *__pyx_lambda_funcdef_lambda3(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
+static PyObject *__pyx_lambda_funcdef_lambda4(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats___cinit__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4cdec_2sa_3_sa_11OnlineStats_9samples_f___get__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self); /* proto */
static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_9samples_f_2__set__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
@@ -2848,15 +2873,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod
static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_16reachable(struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_fwords, PyObject *__pyx_v_ifrom, PyObject *__pyx_v_dist); /* proto */
static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_18shortest(struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_fwords, PyObject *__pyx_v_ifrom, PyObject *__pyx_v_ito); /* proto */
static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_states(struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v__columns, PyObject *__pyx_v_curr_idx, PyObject *__pyx_v_min_dist); /* proto */
-static PyObject *__pyx_lambda_funcdef_lambda4(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
-static PyObject *__pyx_lambda_funcdef_lambda3(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
-static PyObject *__pyx_lambda_funcdef_lambda5(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
+static PyObject *__pyx_lambda_funcdef_lambda6(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
+static PyObject *__pyx_lambda_funcdef_lambda5(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
+static PyObject *__pyx_lambda_funcdef_lambda7(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_2genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_22input(struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_fwords, PyObject *__pyx_v_meta, PyObject *__pyx_v_ctx_name); /* proto */
static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_extract(PyObject *__pyx_self, PyObject *__pyx_v_f_i, PyObject *__pyx_v_f_j, PyObject *__pyx_v_e_i, PyObject *__pyx_v_e_j, PyObject *__pyx_v_min_bound, PyObject *__pyx_v_wc, PyObject *__pyx_v_links, PyObject *__pyx_v_nt, PyObject *__pyx_v_nt_open); /* proto */
static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instance(struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_f_words, PyObject *__pyx_v_e_words, PyObject *__pyx_v_alignment, PyObject *__pyx_v_ctx_name); /* proto */
-static PyObject *__pyx_lambda_funcdef_lambda6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */
-static PyObject *__pyx_lambda_funcdef_lambda7(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */
+static PyObject *__pyx_lambda_funcdef_lambda8(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */
+static PyObject *__pyx_lambda_funcdef_lambda9(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_2genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_f_i, PyObject *__pyx_v_e_i, PyObject *__pyx_v_f_span, PyObject *__pyx_v_e_span, PyObject *__pyx_v_nt, PyObject *__pyx_v_al); /* proto */
static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_genexpr(PyObject *__pyx_self); /* proto */
@@ -2916,20 +2941,21 @@ static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr(PyTyp
static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_16___str__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_19_input(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_28___str__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_16_iterspans(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_17___str__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_18_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_19_alignments(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_20_input(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_21_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_22_add_instance(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_23_form_rule(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_24_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_25_fmt_rule(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_26_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_27_get_f_phrases(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_28___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_29___str__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_30_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static char __pyx_k_[] = ",";
static char __pyx_k_0[] = "0";
static char __pyx_k_1[] = "1";
@@ -3083,6 +3109,7 @@ static char __pyx_k_scorer[] = "scorer";
static char __pyx_k_scores[] = "scores";
static char __pyx_k_sorted[] = "sorted";
static char __pyx_k_source[] = "source";
+static char __pyx_k_to_str[] = "to_str";
static char __pyx_k_unlink[] = "unlink";
static char __pyx_k_update[] = "update";
static char __pyx_k_Counter[] = "Counter";
@@ -3106,6 +3133,7 @@ static char __pyx_k_logging[] = "logging";
static char __pyx_k_matches[] = "matches";
static char __pyx_k_new_e_i[] = "new_e_i";
static char __pyx_k_new_e_j[] = "new_e_j";
+static char __pyx_k_nt_flag[] = "nt_flag";
static char __pyx_k_nt_open[] = "nt_open";
static char __pyx_k_pathlen[] = "pathlen";
static char __pyx_k_sa_high[] = "sa_high";
@@ -3144,6 +3172,7 @@ static char __pyx_k_getLogger[] = "getLogger";
static char __pyx_k_getrusage[] = "getrusage";
static char __pyx_k_increment[] = "increment";
static char __pyx_k_iteritems[] = "iteritems";
+static char __pyx_k_iterspans[] = "iterspans";
static char __pyx_k_itertools[] = "itertools";
static char __pyx_k_min_bound[] = "min_bound";
static char __pyx_k_new_lex_i[] = "new_lex_i";
@@ -3228,6 +3257,7 @@ static char __pyx_k_precompute_rank[] = "precompute_rank";
static char __pyx_k_use_baeza_yates[] = "use_baeza_yates";
static char __pyx_k_word_alignments[] = "word_alignments";
static char __pyx_k_INITIAL_CAPACITY[] = "INITIAL_CAPACITY";
+static char __pyx_k_Phrase_iterspans[] = "Phrase.iterspans";
static char __pyx_k_max_initial_size[] = "max_initial_size";
static char __pyx_k_max_nonterminals[] = "max_nonterminals";
static char __pyx_k_reachable_buffer[] = "reachable_buffer";
@@ -3259,6 +3289,7 @@ static char __pyx_k_require_aligned_chunks[] = "require_aligned_chunks";
static char __pyx_k_train_max_initial_size[] = "train_max_initial_size";
static char __pyx_k_fmt_rule_locals_genexpr[] = "fmt_rule.<locals>.genexpr";
static char __pyx_k_form_rule_locals_lambda[] = "form_rule.<locals>.<lambda>";
+static char __pyx_k_iterspans_locals_lambda[] = "iterspans.<locals>.<lambda>";
static char __pyx_k_Intersect_time_f_seconds[] = " Intersect time = %f seconds";
static char __pyx_k_form_rule_locals_genexpr[] = "form_rule.<locals>.genexpr";
static char __pyx_k_require_aligned_terminal[] = "require_aligned_terminal";
@@ -3281,12 +3312,12 @@ static char __pyx_k_Sampling_strategy_no_sampling[] = "Sampling strategy: no sam
static char __pyx_k_decode_lattice_locals_genexpr[] = "decode_lattice.<locals>.genexpr";
static char __pyx_k_Illegal_key_type_s_for_IntList[] = "Illegal key type %s for IntList";
static char __pyx_k_Unable_to_extract_basic_phrase[] = "Unable to extract basic phrase";
+static char __pyx_k_Users_waziz_workspace_mtm14_my[] = "/Users/waziz/workspace/mtm14/my-cdec/python/cdec/sa/rulefactory.pxi";
static char __pyx_k_decode_sentence_locals_genexpr[] = "decode_sentence.<locals>.genexpr";
static char __pyx_k_Processing_precomputations_took[] = "Processing precomputations took %f seconds";
static char __pyx_k_RANK_d_COUNT_COST_d_d_CUMUL_d_d[] = "RANK %d\tCOUNT, COST: %d %d\tCUMUL: %d, %d";
static char __pyx_k_Requested_index_d_d_of_d_length[] = "Requested index %d:%d of %d-length IntList";
static char __pyx_k_d_d_out_of_bounds_I_d_J_d_in_li[] = "%d-%d out of bounds (I=%d,J=%d) in line %d\n";
-static char __pyx_k_usr0_home_cdyer_cdec_python_cde[] = "/usr0/home/cdyer/cdec/python/cdec/sa/rulefactory.pxi";
static char __pyx_k_Converting_d_hash_keys_on_precom[] = "Converting %d hash keys on precomputed inverted index... ";
static char __pyx_k_Didn_t_extract_anything_from_d_d[] = "Didn't extract anything from [%d, %d] -> [%d, %d]";
static char __pyx_k_ERROR_unexpected_pattern_s_in_se[] = "ERROR: unexpected pattern %s in set of precomputed collocations";
@@ -3308,9 +3339,10 @@ static char __pyx_k_Subphrase_d_d_failed_integrity_c[] = "Subphrase [%d, %d] fai
static char __pyx_k_Suffix_array_construction_took_f[] = "Suffix array construction took %f seconds";
static char __pyx_k_Total_time_for_rule_lookup_extra[] = "Total time for rule lookup, extraction, and scoring = %f seconds";
static char __pyx_k_Unexpected_condition_found_in_q3[] = "Unexpected condition found in q3sort: sort from %d to %d";
+static char __pyx_k_Users_waziz_workspace_mtm14_my_2[] = "/Users/waziz/workspace/mtm14/my-cdec/python/cdec/sa/_sa.pyx";
+static char __pyx_k_Users_waziz_workspace_mtm14_my_3[] = "/Users/waziz/workspace/mtm14/my-cdec/python/cdec/sa/sym.pxi";
static char __pyx_k_input_locals_lambda_locals_lambd[] = "input.<locals>.<lambda>.<locals>.<lambda>";
-static char __pyx_k_usr0_home_cdyer_cdec_python_cde_2[] = "/usr0/home/cdyer/cdec/python/cdec/sa/_sa.pyx";
-static char __pyx_k_usr0_home_cdyer_cdec_python_cde_3[] = "/usr0/home/cdyer/cdec/python/cdec/sa/sym.pxi";
+static char __pyx_k_iterspans_locals_lambda_locals_l[] = "iterspans.<locals>.<lambda>.<locals>.<lambda>";
static char __pyx_k_Converting_d_hash_keys_on_precom_2[] = "Converting %d hash keys on precomputed collocations... ";
static PyObject *__pyx_kp_s_;
static PyObject *__pyx_kp_s_0;
@@ -3354,6 +3386,7 @@ static PyObject *__pyx_n_s_NULL;
static PyObject *__pyx_kp_s_No_aligned_terminals;
static PyObject *__pyx_n_s_OnlineFeatureContext;
static PyObject *__pyx_n_s_Phrase___iter;
+static PyObject *__pyx_n_s_Phrase_iterspans;
static PyObject *__pyx_kp_s_Precomputation_done_with_max_ini;
static PyObject *__pyx_kp_s_Precomputation_done_with_max_non;
static PyObject *__pyx_kp_s_Precomputation_done_with_max_ter;
@@ -3383,6 +3416,9 @@ static PyObject *__pyx_n_s_TypeError;
static PyObject *__pyx_kp_s_Unable_to_extract_basic_phrase;
static PyObject *__pyx_kp_s_Unaligned_chunk;
static PyObject *__pyx_kp_s_Unexpected_condition_found_in_q3;
+static PyObject *__pyx_kp_s_Users_waziz_workspace_mtm14_my;
+static PyObject *__pyx_kp_s_Users_waziz_workspace_mtm14_my_2;
+static PyObject *__pyx_kp_s_Users_waziz_workspace_mtm14_my_3;
static PyObject *__pyx_n_s_ValueError;
static PyObject *__pyx_kp_s_X;
static PyObject *__pyx_kp_s_X_0_1_2;
@@ -3528,6 +3564,9 @@ static PyObject *__pyx_n_s_isa;
static PyObject *__pyx_n_s_isvar;
static PyObject *__pyx_n_s_iter;
static PyObject *__pyx_n_s_iteritems;
+static PyObject *__pyx_n_s_iterspans;
+static PyObject *__pyx_n_s_iterspans_locals_lambda;
+static PyObject *__pyx_n_s_iterspans_locals_lambda_locals_l;
static PyObject *__pyx_n_s_itertools;
static PyObject *__pyx_n_s_itervalues;
static PyObject *__pyx_n_s_ito;
@@ -3577,6 +3616,7 @@ static PyObject *__pyx_n_s_new_min_bound;
static PyObject *__pyx_n_s_next_states;
static PyObject *__pyx_n_s_nt;
static PyObject *__pyx_n_s_nt_collision;
+static PyObject *__pyx_n_s_nt_flag;
static PyObject *__pyx_n_s_nt_open;
static PyObject *__pyx_n_s_ntc;
static PyObject *__pyx_n_s_num_subpatterns;
@@ -3664,6 +3704,7 @@ static PyObject *__pyx_n_s_test_sentence;
static PyObject *__pyx_n_s_throw;
static PyObject *__pyx_n_s_tight_phrases;
static PyObject *__pyx_n_s_toMap;
+static PyObject *__pyx_n_s_to_str;
static PyObject *__pyx_n_s_train_max_initial_size;
static PyObject *__pyx_n_s_train_min_gap_size;
static PyObject *__pyx_n_s_unlink;
@@ -3672,9 +3713,6 @@ static PyObject *__pyx_n_s_use_baeza_yates;
static PyObject *__pyx_n_s_use_collocations;
static PyObject *__pyx_n_s_use_index;
static PyObject *__pyx_n_s_use_sent_id;
-static PyObject *__pyx_kp_s_usr0_home_cdyer_cdec_python_cde;
-static PyObject *__pyx_kp_s_usr0_home_cdyer_cdec_python_cde_2;
-static PyObject *__pyx_kp_s_usr0_home_cdyer_cdec_python_cde_3;
static PyObject *__pyx_n_s_value;
static PyObject *__pyx_n_s_vec;
static PyObject *__pyx_n_s_w;
@@ -4108,7 +4146,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_2gzip_or_text(CYTHON_UNUSED PyObject *_
return __pyx_r;
}
-/* "float_list.pxi":11
+/* "cdec/sa/float_list.pxi":11
* cdef class FloatList:
*
* def __cinit__(self, int size=0, int increment=1, int initial_len=0): # <<<<<<<<<<<<<<
@@ -4208,7 +4246,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9FloatList___cinit__(struct __pyx_obj_4cdec_2
int __pyx_t_1;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "float_list.pxi":12
+ /* "cdec/sa/float_list.pxi":12
*
* def __cinit__(self, int size=0, int increment=1, int initial_len=0):
* if initial_len > size: # <<<<<<<<<<<<<<
@@ -4218,7 +4256,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9FloatList___cinit__(struct __pyx_obj_4cdec_2
__pyx_t_1 = ((__pyx_v_initial_len > __pyx_v_size) != 0);
if (__pyx_t_1) {
- /* "float_list.pxi":13
+ /* "cdec/sa/float_list.pxi":13
* def __cinit__(self, int size=0, int increment=1, int initial_len=0):
* if initial_len > size:
* size = initial_len # <<<<<<<<<<<<<<
@@ -4230,7 +4268,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9FloatList___cinit__(struct __pyx_obj_4cdec_2
}
__pyx_L3:;
- /* "float_list.pxi":14
+ /* "cdec/sa/float_list.pxi":14
* if initial_len > size:
* size = initial_len
* self.size = size # <<<<<<<<<<<<<<
@@ -4239,7 +4277,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9FloatList___cinit__(struct __pyx_obj_4cdec_2
*/
__pyx_v_self->size = __pyx_v_size;
- /* "float_list.pxi":15
+ /* "cdec/sa/float_list.pxi":15
* size = initial_len
* self.size = size
* self.increment = increment # <<<<<<<<<<<<<<
@@ -4248,7 +4286,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9FloatList___cinit__(struct __pyx_obj_4cdec_2
*/
__pyx_v_self->increment = __pyx_v_increment;
- /* "float_list.pxi":16
+ /* "cdec/sa/float_list.pxi":16
* self.size = size
* self.increment = increment
* self.len = initial_len # <<<<<<<<<<<<<<
@@ -4257,7 +4295,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9FloatList___cinit__(struct __pyx_obj_4cdec_2
*/
__pyx_v_self->len = __pyx_v_initial_len;
- /* "float_list.pxi":17
+ /* "cdec/sa/float_list.pxi":17
* self.increment = increment
* self.len = initial_len
* self.arr = <float*> malloc(size*sizeof(float)) # <<<<<<<<<<<<<<
@@ -4266,7 +4304,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9FloatList___cinit__(struct __pyx_obj_4cdec_2
*/
__pyx_v_self->arr = ((float *)malloc((__pyx_v_size * (sizeof(float)))));
- /* "float_list.pxi":18
+ /* "cdec/sa/float_list.pxi":18
* self.len = initial_len
* self.arr = <float*> malloc(size*sizeof(float))
* memset(self.arr, 0, initial_len*sizeof(float)) # <<<<<<<<<<<<<<
@@ -4275,7 +4313,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9FloatList___cinit__(struct __pyx_obj_4cdec_2
*/
memset(__pyx_v_self->arr, 0, (__pyx_v_initial_len * (sizeof(float))));
- /* "float_list.pxi":11
+ /* "cdec/sa/float_list.pxi":11
* cdef class FloatList:
*
* def __cinit__(self, int size=0, int increment=1, int initial_len=0): # <<<<<<<<<<<<<<
@@ -4289,7 +4327,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9FloatList___cinit__(struct __pyx_obj_4cdec_2
return __pyx_r;
}
-/* "float_list.pxi":20
+/* "cdec/sa/float_list.pxi":20
* memset(self.arr, 0, initial_len*sizeof(float))
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -4312,7 +4350,7 @@ static void __pyx_pf_4cdec_2sa_3_sa_9FloatList_2__dealloc__(struct __pyx_obj_4cd
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "float_list.pxi":21
+ /* "cdec/sa/float_list.pxi":21
*
* def __dealloc__(self):
* free(self.arr) # <<<<<<<<<<<<<<
@@ -4321,7 +4359,7 @@ static void __pyx_pf_4cdec_2sa_3_sa_9FloatList_2__dealloc__(struct __pyx_obj_4cd
*/
free(__pyx_v_self->arr);
- /* "float_list.pxi":20
+ /* "cdec/sa/float_list.pxi":20
* memset(self.arr, 0, initial_len*sizeof(float))
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -4333,7 +4371,7 @@ static void __pyx_pf_4cdec_2sa_3_sa_9FloatList_2__dealloc__(struct __pyx_obj_4cd
__Pyx_RefNannyFinishContext();
}
-/* "float_list.pxi":23
+/* "cdec/sa/float_list.pxi":23
* free(self.arr)
*
* def __getitem__(self, i): # <<<<<<<<<<<<<<
@@ -4368,7 +4406,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9FloatList_4__getitem__(struct __pyx_ob
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__getitem__", 0);
- /* "float_list.pxi":24
+ /* "cdec/sa/float_list.pxi":24
*
* def __getitem__(self, i):
* j = i # <<<<<<<<<<<<<<
@@ -4378,7 +4416,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9FloatList_4__getitem__(struct __pyx_ob
__Pyx_INCREF(__pyx_v_i);
__pyx_v_j = __pyx_v_i;
- /* "float_list.pxi":25
+ /* "cdec/sa/float_list.pxi":25
* def __getitem__(self, i):
* j = i
* if i<0: # <<<<<<<<<<<<<<
@@ -4390,7 +4428,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9FloatList_4__getitem__(struct __pyx_ob
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
- /* "float_list.pxi":26
+ /* "cdec/sa/float_list.pxi":26
* j = i
* if i<0:
* j = self.len + i # <<<<<<<<<<<<<<
@@ -4408,7 +4446,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9FloatList_4__getitem__(struct __pyx_ob
}
__pyx_L3:;
- /* "float_list.pxi":27
+ /* "cdec/sa/float_list.pxi":27
* if i<0:
* j = self.len + i
* if j<0 or j>=self.len: # <<<<<<<<<<<<<<
@@ -4435,7 +4473,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9FloatList_4__getitem__(struct __pyx_ob
__pyx_L5_bool_binop_done:;
if (__pyx_t_2) {
- /* "float_list.pxi":28
+ /* "cdec/sa/float_list.pxi":28
* j = self.len + i
* if j<0 or j>=self.len:
* raise IndexError("Requested index %d of %d-length FloatList" % (i, self.len)) # <<<<<<<<<<<<<<
@@ -4468,7 +4506,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9FloatList_4__getitem__(struct __pyx_ob
{__pyx_filename = __pyx_f[1]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- /* "float_list.pxi":29
+ /* "cdec/sa/float_list.pxi":29
* if j<0 or j>=self.len:
* raise IndexError("Requested index %d of %d-length FloatList" % (i, self.len))
* return self.arr[j] # <<<<<<<<<<<<<<
@@ -4483,7 +4521,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9FloatList_4__getitem__(struct __pyx_ob
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "float_list.pxi":23
+ /* "cdec/sa/float_list.pxi":23
* free(self.arr)
*
* def __getitem__(self, i): # <<<<<<<<<<<<<<
@@ -4504,7 +4542,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9FloatList_4__getitem__(struct __pyx_ob
return __pyx_r;
}
-/* "float_list.pxi":31
+/* "cdec/sa/float_list.pxi":31
* return self.arr[j]
*
* cdef void set(self, int i, float v): # <<<<<<<<<<<<<<
@@ -4525,7 +4563,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9FloatList_set(struct __pyx_obj_4cdec_2sa_3_s
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("set", 0);
- /* "float_list.pxi":32
+ /* "cdec/sa/float_list.pxi":32
*
* cdef void set(self, int i, float v):
* j = i # <<<<<<<<<<<<<<
@@ -4534,7 +4572,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9FloatList_set(struct __pyx_obj_4cdec_2sa_3_s
*/
__pyx_v_j = __pyx_v_i;
- /* "float_list.pxi":33
+ /* "cdec/sa/float_list.pxi":33
* cdef void set(self, int i, float v):
* j = i
* if i<0: # <<<<<<<<<<<<<<
@@ -4544,7 +4582,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9FloatList_set(struct __pyx_obj_4cdec_2sa_3_s
__pyx_t_1 = ((__pyx_v_i < 0) != 0);
if (__pyx_t_1) {
- /* "float_list.pxi":34
+ /* "cdec/sa/float_list.pxi":34
* j = i
* if i<0:
* j = self.len + i # <<<<<<<<<<<<<<
@@ -4556,7 +4594,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9FloatList_set(struct __pyx_obj_4cdec_2sa_3_s
}
__pyx_L3:;
- /* "float_list.pxi":35
+ /* "cdec/sa/float_list.pxi":35
* if i<0:
* j = self.len + i
* if j<0 or j>=self.len: # <<<<<<<<<<<<<<
@@ -4576,7 +4614,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9FloatList_set(struct __pyx_obj_4cdec_2sa_3_s
__pyx_L5_bool_binop_done:;
if (__pyx_t_1) {
- /* "float_list.pxi":36
+ /* "cdec/sa/float_list.pxi":36
* j = self.len + i
* if j<0 or j>=self.len:
* raise IndexError("Requested index %d of %d-length FloatList" % (i, self.len)) # <<<<<<<<<<<<<<
@@ -4611,7 +4649,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9FloatList_set(struct __pyx_obj_4cdec_2sa_3_s
{__pyx_filename = __pyx_f[1]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- /* "float_list.pxi":37
+ /* "cdec/sa/float_list.pxi":37
* if j<0 or j>=self.len:
* raise IndexError("Requested index %d of %d-length FloatList" % (i, self.len))
* self.arr[j] = v # <<<<<<<<<<<<<<
@@ -4620,7 +4658,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9FloatList_set(struct __pyx_obj_4cdec_2sa_3_s
*/
(__pyx_v_self->arr[__pyx_v_j]) = __pyx_v_v;
- /* "float_list.pxi":31
+ /* "cdec/sa/float_list.pxi":31
* return self.arr[j]
*
* cdef void set(self, int i, float v): # <<<<<<<<<<<<<<
@@ -4639,7 +4677,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9FloatList_set(struct __pyx_obj_4cdec_2sa_3_s
__Pyx_RefNannyFinishContext();
}
-/* "float_list.pxi":39
+/* "cdec/sa/float_list.pxi":39
* self.arr[j] = v
*
* def __setitem__(self, i, val): # <<<<<<<<<<<<<<
@@ -4670,7 +4708,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9FloatList_6__setitem__(struct __pyx_obj_4cde
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__setitem__", 0);
- /* "float_list.pxi":40
+ /* "cdec/sa/float_list.pxi":40
*
* def __setitem__(self, i, val):
* self.set(i, val) # <<<<<<<<<<<<<<
@@ -4681,7 +4719,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9FloatList_6__setitem__(struct __pyx_obj_4cde
__pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_v_val); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_FloatList *)__pyx_v_self->__pyx_vtab)->set(__pyx_v_self, __pyx_t_1, __pyx_t_2);
- /* "float_list.pxi":39
+ /* "cdec/sa/float_list.pxi":39
* self.arr[j] = v
*
* def __setitem__(self, i, val): # <<<<<<<<<<<<<<
@@ -4700,7 +4738,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9FloatList_6__setitem__(struct __pyx_obj_4cde
return __pyx_r;
}
-/* "float_list.pxi":42
+/* "cdec/sa/float_list.pxi":42
* self.set(i, val)
*
* def __len__(self): # <<<<<<<<<<<<<<
@@ -4726,7 +4764,7 @@ static Py_ssize_t __pyx_pf_4cdec_2sa_3_sa_9FloatList_8__len__(struct __pyx_obj_4
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__len__", 0);
- /* "float_list.pxi":43
+ /* "cdec/sa/float_list.pxi":43
*
* def __len__(self):
* return self.len # <<<<<<<<<<<<<<
@@ -4736,7 +4774,7 @@ static Py_ssize_t __pyx_pf_4cdec_2sa_3_sa_9FloatList_8__len__(struct __pyx_obj_4
__pyx_r = __pyx_v_self->len;
goto __pyx_L0;
- /* "float_list.pxi":42
+ /* "cdec/sa/float_list.pxi":42
* self.set(i, val)
*
* def __len__(self): # <<<<<<<<<<<<<<
@@ -4750,7 +4788,7 @@ static Py_ssize_t __pyx_pf_4cdec_2sa_3_sa_9FloatList_8__len__(struct __pyx_obj_4
return __pyx_r;
}
-/* "float_list.pxi":45
+/* "cdec/sa/float_list.pxi":45
* return self.len
*
* def append(self, float val): # <<<<<<<<<<<<<<
@@ -4790,7 +4828,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9FloatList_10append(struct __pyx_obj_4c
int __pyx_t_1;
__Pyx_RefNannySetupContext("append", 0);
- /* "float_list.pxi":46
+ /* "cdec/sa/float_list.pxi":46
*
* def append(self, float val):
* if self.len == self.size: # <<<<<<<<<<<<<<
@@ -4800,7 +4838,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9FloatList_10append(struct __pyx_obj_4c
__pyx_t_1 = ((__pyx_v_self->len == __pyx_v_self->size) != 0);
if (__pyx_t_1) {
- /* "float_list.pxi":47
+ /* "cdec/sa/float_list.pxi":47
* def append(self, float val):
* if self.len == self.size:
* self.size = self.size + self.increment # <<<<<<<<<<<<<<
@@ -4809,7 +4847,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9FloatList_10append(struct __pyx_obj_4c
*/
__pyx_v_self->size = (__pyx_v_self->size + __pyx_v_self->increment);
- /* "float_list.pxi":48
+ /* "cdec/sa/float_list.pxi":48
* if self.len == self.size:
* self.size = self.size + self.increment
* self.arr = <float*> realloc(self.arr, self.size*sizeof(float)) # <<<<<<<<<<<<<<
@@ -4821,7 +4859,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9FloatList_10append(struct __pyx_obj_4c
}
__pyx_L3:;
- /* "float_list.pxi":49
+ /* "cdec/sa/float_list.pxi":49
* self.size = self.size + self.increment
* self.arr = <float*> realloc(self.arr, self.size*sizeof(float))
* self.arr[self.len] = val # <<<<<<<<<<<<<<
@@ -4830,7 +4868,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9FloatList_10append(struct __pyx_obj_4c
*/
(__pyx_v_self->arr[__pyx_v_self->len]) = __pyx_v_val;
- /* "float_list.pxi":50
+ /* "cdec/sa/float_list.pxi":50
* self.arr = <float*> realloc(self.arr, self.size*sizeof(float))
* self.arr[self.len] = val
* self.len = self.len + 1 # <<<<<<<<<<<<<<
@@ -4839,7 +4877,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9FloatList_10append(struct __pyx_obj_4c
*/
__pyx_v_self->len = (__pyx_v_self->len + 1);
- /* "float_list.pxi":45
+ /* "cdec/sa/float_list.pxi":45
* return self.len
*
* def append(self, float val): # <<<<<<<<<<<<<<
@@ -4854,7 +4892,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9FloatList_10append(struct __pyx_obj_4c
return __pyx_r;
}
-/* "float_list.pxi":52
+/* "cdec/sa/float_list.pxi":52
* self.len = self.len + 1
*
* cdef void write_handle(self, FILE* f): # <<<<<<<<<<<<<<
@@ -4866,7 +4904,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9FloatList_write_handle(struct __pyx_obj_4cde
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("write_handle", 0);
- /* "float_list.pxi":53
+ /* "cdec/sa/float_list.pxi":53
*
* cdef void write_handle(self, FILE* f):
* fwrite(&(self.len), sizeof(float), 1, f) # <<<<<<<<<<<<<<
@@ -4875,7 +4913,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9FloatList_write_handle(struct __pyx_obj_4cde
*/
fwrite((&__pyx_v_self->len), (sizeof(float)), 1, __pyx_v_f);
- /* "float_list.pxi":54
+ /* "cdec/sa/float_list.pxi":54
* cdef void write_handle(self, FILE* f):
* fwrite(&(self.len), sizeof(float), 1, f)
* fwrite(self.arr, sizeof(float), self.len, f) # <<<<<<<<<<<<<<
@@ -4884,7 +4922,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9FloatList_write_handle(struct __pyx_obj_4cde
*/
fwrite(__pyx_v_self->arr, (sizeof(float)), __pyx_v_self->len, __pyx_v_f);
- /* "float_list.pxi":52
+ /* "cdec/sa/float_list.pxi":52
* self.len = self.len + 1
*
* cdef void write_handle(self, FILE* f): # <<<<<<<<<<<<<<
@@ -4896,7 +4934,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9FloatList_write_handle(struct __pyx_obj_4cde
__Pyx_RefNannyFinishContext();
}
-/* "float_list.pxi":56
+/* "cdec/sa/float_list.pxi":56
* fwrite(self.arr, sizeof(float), self.len, f)
*
* def write(self, char* filename): # <<<<<<<<<<<<<<
@@ -4936,7 +4974,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9FloatList_12write(struct __pyx_obj_4cd
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("write", 0);
- /* "float_list.pxi":58
+ /* "cdec/sa/float_list.pxi":58
* def write(self, char* filename):
* cdef FILE* f
* f = fopen(filename, "w") # <<<<<<<<<<<<<<
@@ -4945,7 +4983,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9FloatList_12write(struct __pyx_obj_4cd
*/
__pyx_v_f = fopen(__pyx_v_filename, __pyx_k_w);
- /* "float_list.pxi":59
+ /* "cdec/sa/float_list.pxi":59
* cdef FILE* f
* f = fopen(filename, "w")
* self.write_handle(f) # <<<<<<<<<<<<<<
@@ -4954,7 +4992,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9FloatList_12write(struct __pyx_obj_4cd
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_FloatList *)__pyx_v_self->__pyx_vtab)->write_handle(__pyx_v_self, __pyx_v_f);
- /* "float_list.pxi":60
+ /* "cdec/sa/float_list.pxi":60
* f = fopen(filename, "w")
* self.write_handle(f)
* fclose(f) # <<<<<<<<<<<<<<
@@ -4963,7 +5001,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9FloatList_12write(struct __pyx_obj_4cd
*/
fclose(__pyx_v_f);
- /* "float_list.pxi":56
+ /* "cdec/sa/float_list.pxi":56
* fwrite(self.arr, sizeof(float), self.len, f)
*
* def write(self, char* filename): # <<<<<<<<<<<<<<
@@ -4978,7 +5016,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9FloatList_12write(struct __pyx_obj_4cd
return __pyx_r;
}
-/* "float_list.pxi":62
+/* "cdec/sa/float_list.pxi":62
* fclose(f)
*
* cdef void read_handle(self, FILE* f): # <<<<<<<<<<<<<<
@@ -4991,7 +5029,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9FloatList_read_handle(struct __pyx_obj_4cdec
int __pyx_t_1;
__Pyx_RefNannySetupContext("read_handle", 0);
- /* "float_list.pxi":63
+ /* "cdec/sa/float_list.pxi":63
*
* cdef void read_handle(self, FILE* f):
* free(self.arr) # <<<<<<<<<<<<<<
@@ -5000,7 +5038,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9FloatList_read_handle(struct __pyx_obj_4cdec
*/
free(__pyx_v_self->arr);
- /* "float_list.pxi":64
+ /* "cdec/sa/float_list.pxi":64
* cdef void read_handle(self, FILE* f):
* free(self.arr)
* fread(&(self.len), sizeof(float), 1, f) # <<<<<<<<<<<<<<
@@ -5009,7 +5047,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9FloatList_read_handle(struct __pyx_obj_4cdec
*/
fread((&__pyx_v_self->len), (sizeof(float)), 1, __pyx_v_f);
- /* "float_list.pxi":65
+ /* "cdec/sa/float_list.pxi":65
* free(self.arr)
* fread(&(self.len), sizeof(float), 1, f)
* self.arr = <float*> malloc(self.len * sizeof(float)) # <<<<<<<<<<<<<<
@@ -5018,7 +5056,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9FloatList_read_handle(struct __pyx_obj_4cdec
*/
__pyx_v_self->arr = ((float *)malloc((__pyx_v_self->len * (sizeof(float)))));
- /* "float_list.pxi":66
+ /* "cdec/sa/float_list.pxi":66
* fread(&(self.len), sizeof(float), 1, f)
* self.arr = <float*> malloc(self.len * sizeof(float))
* self.size = self.len # <<<<<<<<<<<<<<
@@ -5028,7 +5066,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9FloatList_read_handle(struct __pyx_obj_4cdec
__pyx_t_1 = __pyx_v_self->len;
__pyx_v_self->size = __pyx_t_1;
- /* "float_list.pxi":67
+ /* "cdec/sa/float_list.pxi":67
* self.arr = <float*> malloc(self.len * sizeof(float))
* self.size = self.len
* fread(self.arr, sizeof(float), self.len, f) # <<<<<<<<<<<<<<
@@ -5037,7 +5075,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9FloatList_read_handle(struct __pyx_obj_4cdec
*/
fread(__pyx_v_self->arr, (sizeof(float)), __pyx_v_self->len, __pyx_v_f);
- /* "float_list.pxi":62
+ /* "cdec/sa/float_list.pxi":62
* fclose(f)
*
* cdef void read_handle(self, FILE* f): # <<<<<<<<<<<<<<
@@ -5049,7 +5087,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9FloatList_read_handle(struct __pyx_obj_4cdec
__Pyx_RefNannyFinishContext();
}
-/* "float_list.pxi":69
+/* "cdec/sa/float_list.pxi":69
* fread(self.arr, sizeof(float), self.len, f)
*
* def read(self, char* filename): # <<<<<<<<<<<<<<
@@ -5089,7 +5127,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9FloatList_14read(struct __pyx_obj_4cde
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("read", 0);
- /* "float_list.pxi":71
+ /* "cdec/sa/float_list.pxi":71
* def read(self, char* filename):
* cdef FILE* f
* f = fopen(filename, "r") # <<<<<<<<<<<<<<
@@ -5098,7 +5136,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9FloatList_14read(struct __pyx_obj_4cde
*/
__pyx_v_f = fopen(__pyx_v_filename, __pyx_k_r);
- /* "float_list.pxi":72
+ /* "cdec/sa/float_list.pxi":72
* cdef FILE* f
* f = fopen(filename, "r")
* self.read_handle(f) # <<<<<<<<<<<<<<
@@ -5106,14 +5144,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9FloatList_14read(struct __pyx_obj_4cde
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_FloatList *)__pyx_v_self->__pyx_vtab)->read_handle(__pyx_v_self, __pyx_v_f);
- /* "float_list.pxi":73
+ /* "cdec/sa/float_list.pxi":73
* f = fopen(filename, "r")
* self.read_handle(f)
* fclose(f) # <<<<<<<<<<<<<<
*/
fclose(__pyx_v_f);
- /* "float_list.pxi":69
+ /* "cdec/sa/float_list.pxi":69
* fread(self.arr, sizeof(float), self.len, f)
*
* def read(self, char* filename): # <<<<<<<<<<<<<<
@@ -5128,7 +5166,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9FloatList_14read(struct __pyx_obj_4cde
return __pyx_r;
}
-/* "int_list.pxi":11
+/* "cdec/sa/int_list.pxi":11
* cdef class IntList:
*
* def __cinit__(self, int size=0, int increment=1, int initial_len=0): # <<<<<<<<<<<<<<
@@ -5228,7 +5266,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_7IntList___cinit__(struct __pyx_obj_4cdec_2sa
int __pyx_t_1;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "int_list.pxi":12
+ /* "cdec/sa/int_list.pxi":12
*
* def __cinit__(self, int size=0, int increment=1, int initial_len=0):
* if initial_len > size: # <<<<<<<<<<<<<<
@@ -5238,7 +5276,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_7IntList___cinit__(struct __pyx_obj_4cdec_2sa
__pyx_t_1 = ((__pyx_v_initial_len > __pyx_v_size) != 0);
if (__pyx_t_1) {
- /* "int_list.pxi":13
+ /* "cdec/sa/int_list.pxi":13
* def __cinit__(self, int size=0, int increment=1, int initial_len=0):
* if initial_len > size:
* size = initial_len # <<<<<<<<<<<<<<
@@ -5250,7 +5288,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_7IntList___cinit__(struct __pyx_obj_4cdec_2sa
}
__pyx_L3:;
- /* "int_list.pxi":14
+ /* "cdec/sa/int_list.pxi":14
* if initial_len > size:
* size = initial_len
* self.size = size # <<<<<<<<<<<<<<
@@ -5259,7 +5297,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_7IntList___cinit__(struct __pyx_obj_4cdec_2sa
*/
__pyx_v_self->size = __pyx_v_size;
- /* "int_list.pxi":15
+ /* "cdec/sa/int_list.pxi":15
* size = initial_len
* self.size = size
* self.increment = increment # <<<<<<<<<<<<<<
@@ -5268,7 +5306,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_7IntList___cinit__(struct __pyx_obj_4cdec_2sa
*/
__pyx_v_self->increment = __pyx_v_increment;
- /* "int_list.pxi":16
+ /* "cdec/sa/int_list.pxi":16
* self.size = size
* self.increment = increment
* self.len = initial_len # <<<<<<<<<<<<<<
@@ -5277,7 +5315,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_7IntList___cinit__(struct __pyx_obj_4cdec_2sa
*/
__pyx_v_self->len = __pyx_v_initial_len;
- /* "int_list.pxi":17
+ /* "cdec/sa/int_list.pxi":17
* self.increment = increment
* self.len = initial_len
* self.arr = <int*> malloc(size*sizeof(int)) # <<<<<<<<<<<<<<
@@ -5286,7 +5324,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_7IntList___cinit__(struct __pyx_obj_4cdec_2sa
*/
__pyx_v_self->arr = ((int *)malloc((__pyx_v_size * (sizeof(int)))));
- /* "int_list.pxi":18
+ /* "cdec/sa/int_list.pxi":18
* self.len = initial_len
* self.arr = <int*> malloc(size*sizeof(int))
* memset(self.arr, 0, initial_len*sizeof(int)) # <<<<<<<<<<<<<<
@@ -5295,7 +5333,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_7IntList___cinit__(struct __pyx_obj_4cdec_2sa
*/
memset(__pyx_v_self->arr, 0, (__pyx_v_initial_len * (sizeof(int))));
- /* "int_list.pxi":11
+ /* "cdec/sa/int_list.pxi":11
* cdef class IntList:
*
* def __cinit__(self, int size=0, int increment=1, int initial_len=0): # <<<<<<<<<<<<<<
@@ -5309,7 +5347,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_7IntList___cinit__(struct __pyx_obj_4cdec_2sa
return __pyx_r;
}
-/* "int_list.pxi":20
+/* "cdec/sa/int_list.pxi":20
* memset(self.arr, 0, initial_len*sizeof(int))
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -5345,7 +5383,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_2__str__(struct __pyx_obj_4cde
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__str__", 0);
- /* "int_list.pxi":22
+ /* "cdec/sa/int_list.pxi":22
* def __str__(self):
* cdef unsigned i
* ret = "IntList[" # <<<<<<<<<<<<<<
@@ -5355,7 +5393,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_2__str__(struct __pyx_obj_4cde
__Pyx_INCREF(__pyx_kp_s_IntList);
__pyx_v_ret = __pyx_kp_s_IntList;
- /* "int_list.pxi":23
+ /* "cdec/sa/int_list.pxi":23
* cdef unsigned i
* ret = "IntList["
* for idx in range(self.size): # <<<<<<<<<<<<<<
@@ -5366,7 +5404,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_2__str__(struct __pyx_obj_4cde
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_idx = __pyx_t_2;
- /* "int_list.pxi":24
+ /* "cdec/sa/int_list.pxi":24
* ret = "IntList["
* for idx in range(self.size):
* if idx>0: # <<<<<<<<<<<<<<
@@ -5376,7 +5414,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_2__str__(struct __pyx_obj_4cde
__pyx_t_3 = ((__pyx_v_idx > 0) != 0);
if (__pyx_t_3) {
- /* "int_list.pxi":25
+ /* "cdec/sa/int_list.pxi":25
* for idx in range(self.size):
* if idx>0:
* ret += "," # <<<<<<<<<<<<<<
@@ -5391,7 +5429,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_2__str__(struct __pyx_obj_4cde
}
__pyx_L5:;
- /* "int_list.pxi":26
+ /* "cdec/sa/int_list.pxi":26
* if idx>0:
* ret += ","
* ret += str(self.arr[idx]) # <<<<<<<<<<<<<<
@@ -5415,7 +5453,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_2__str__(struct __pyx_obj_4cde
__pyx_t_5 = 0;
}
- /* "int_list.pxi":27
+ /* "cdec/sa/int_list.pxi":27
* ret += ","
* ret += str(self.arr[idx])
* ret += "]" # <<<<<<<<<<<<<<
@@ -5427,7 +5465,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_2__str__(struct __pyx_obj_4cde
__Pyx_DECREF_SET(__pyx_v_ret, __pyx_t_5);
__pyx_t_5 = 0;
- /* "int_list.pxi":28
+ /* "cdec/sa/int_list.pxi":28
* ret += str(self.arr[idx])
* ret += "]"
* ret += "len=" # <<<<<<<<<<<<<<
@@ -5439,7 +5477,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_2__str__(struct __pyx_obj_4cde
__Pyx_DECREF_SET(__pyx_v_ret, __pyx_t_5);
__pyx_t_5 = 0;
- /* "int_list.pxi":29
+ /* "cdec/sa/int_list.pxi":29
* ret += "]"
* ret += "len="
* ret += str(self.len) # <<<<<<<<<<<<<<
@@ -5462,7 +5500,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_2__str__(struct __pyx_obj_4cde
__Pyx_DECREF_SET(__pyx_v_ret, __pyx_t_4);
__pyx_t_4 = 0;
- /* "int_list.pxi":30
+ /* "cdec/sa/int_list.pxi":30
* ret += "len="
* ret += str(self.len)
* return ret # <<<<<<<<<<<<<<
@@ -5474,7 +5512,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_2__str__(struct __pyx_obj_4cde
__pyx_r = __pyx_v_ret;
goto __pyx_L0;
- /* "int_list.pxi":20
+ /* "cdec/sa/int_list.pxi":20
* memset(self.arr, 0, initial_len*sizeof(int))
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -5495,7 +5533,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_2__str__(struct __pyx_obj_4cde
return __pyx_r;
}
-/* "int_list.pxi":32
+/* "cdec/sa/int_list.pxi":32
* return ret
*
* def index(self, int val): # <<<<<<<<<<<<<<
@@ -5543,7 +5581,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_4index(struct __pyx_obj_4cdec_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("index", 0);
- /* "int_list.pxi":34
+ /* "cdec/sa/int_list.pxi":34
* def index(self, int val):
* cdef unsigned i
* for i in range(self.len): # <<<<<<<<<<<<<<
@@ -5554,7 +5592,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_4index(struct __pyx_obj_4cdec_
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "int_list.pxi":35
+ /* "cdec/sa/int_list.pxi":35
* cdef unsigned i
* for i in range(self.len):
* if self.arr[i] == val: # <<<<<<<<<<<<<<
@@ -5564,7 +5602,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_4index(struct __pyx_obj_4cdec_
__pyx_t_3 = (((__pyx_v_self->arr[__pyx_v_i]) == __pyx_v_val) != 0);
if (__pyx_t_3) {
- /* "int_list.pxi":36
+ /* "cdec/sa/int_list.pxi":36
* for i in range(self.len):
* if self.arr[i] == val:
* return i # <<<<<<<<<<<<<<
@@ -5580,7 +5618,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_4index(struct __pyx_obj_4cdec_
}
}
- /* "int_list.pxi":37
+ /* "cdec/sa/int_list.pxi":37
* if self.arr[i] == val:
* return i
* raise ValueError('%s not in IntList' % val) # <<<<<<<<<<<<<<
@@ -5604,7 +5642,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_4index(struct __pyx_obj_4cdec_
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
{__pyx_filename = __pyx_f[2]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "int_list.pxi":32
+ /* "cdec/sa/int_list.pxi":32
* return ret
*
* def index(self, int val): # <<<<<<<<<<<<<<
@@ -5624,7 +5662,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_4index(struct __pyx_obj_4cdec_
return __pyx_r;
}
-/* "int_list.pxi":39
+/* "cdec/sa/int_list.pxi":39
* raise ValueError('%s not in IntList' % val)
*
* def partition(self,start,end): # <<<<<<<<<<<<<<
@@ -5711,7 +5749,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("partition", 0);
- /* "int_list.pxi":40
+ /* "cdec/sa/int_list.pxi":40
*
* def partition(self,start,end):
* pivot = self.arr[end] # <<<<<<<<<<<<<<
@@ -5724,7 +5762,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c
__pyx_v_pivot = __pyx_t_2;
__pyx_t_2 = 0;
- /* "int_list.pxi":41
+ /* "cdec/sa/int_list.pxi":41
* def partition(self,start,end):
* pivot = self.arr[end]
* bottom = start-1 # <<<<<<<<<<<<<<
@@ -5736,7 +5774,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c
__pyx_v_bottom = __pyx_t_2;
__pyx_t_2 = 0;
- /* "int_list.pxi":42
+ /* "cdec/sa/int_list.pxi":42
* pivot = self.arr[end]
* bottom = start-1
* top = end # <<<<<<<<<<<<<<
@@ -5746,7 +5784,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c
__Pyx_INCREF(__pyx_v_end);
__pyx_v_top = __pyx_v_end;
- /* "int_list.pxi":43
+ /* "cdec/sa/int_list.pxi":43
* bottom = start-1
* top = end
* done = 0 # <<<<<<<<<<<<<<
@@ -5755,7 +5793,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c
*/
__pyx_v_done = 0;
- /* "int_list.pxi":44
+ /* "cdec/sa/int_list.pxi":44
* top = end
* done = 0
* while not done: # <<<<<<<<<<<<<<
@@ -5766,7 +5804,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c
__pyx_t_3 = ((!(__pyx_v_done != 0)) != 0);
if (!__pyx_t_3) break;
- /* "int_list.pxi":45
+ /* "cdec/sa/int_list.pxi":45
* done = 0
* while not done:
* while not done: # <<<<<<<<<<<<<<
@@ -5777,7 +5815,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c
__pyx_t_3 = ((!(__pyx_v_done != 0)) != 0);
if (!__pyx_t_3) break;
- /* "int_list.pxi":46
+ /* "cdec/sa/int_list.pxi":46
* while not done:
* while not done:
* bottom += 1 # <<<<<<<<<<<<<<
@@ -5789,7 +5827,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c
__Pyx_DECREF_SET(__pyx_v_bottom, __pyx_t_2);
__pyx_t_2 = 0;
- /* "int_list.pxi":47
+ /* "cdec/sa/int_list.pxi":47
* while not done:
* bottom += 1
* if bottom == top: # <<<<<<<<<<<<<<
@@ -5801,7 +5839,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (__pyx_t_3) {
- /* "int_list.pxi":48
+ /* "cdec/sa/int_list.pxi":48
* bottom += 1
* if bottom == top:
* done = 1 # <<<<<<<<<<<<<<
@@ -5810,7 +5848,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c
*/
__pyx_v_done = 1;
- /* "int_list.pxi":49
+ /* "cdec/sa/int_list.pxi":49
* if bottom == top:
* done = 1
* break # <<<<<<<<<<<<<<
@@ -5820,7 +5858,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c
goto __pyx_L6_break;
}
- /* "int_list.pxi":50
+ /* "cdec/sa/int_list.pxi":50
* done = 1
* break
* if self.arr[bottom] > pivot: # <<<<<<<<<<<<<<
@@ -5836,7 +5874,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_3) {
- /* "int_list.pxi":51
+ /* "cdec/sa/int_list.pxi":51
* break
* if self.arr[bottom] > pivot:
* self.arr[top] = self.arr[bottom] # <<<<<<<<<<<<<<
@@ -5847,7 +5885,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c
__pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_top); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
(__pyx_v_self->arr[__pyx_t_5]) = (__pyx_v_self->arr[__pyx_t_1]);
- /* "int_list.pxi":52
+ /* "cdec/sa/int_list.pxi":52
* if self.arr[bottom] > pivot:
* self.arr[top] = self.arr[bottom]
* break # <<<<<<<<<<<<<<
@@ -5859,7 +5897,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c
}
__pyx_L6_break:;
- /* "int_list.pxi":53
+ /* "cdec/sa/int_list.pxi":53
* self.arr[top] = self.arr[bottom]
* break
* while not done: # <<<<<<<<<<<<<<
@@ -5870,7 +5908,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c
__pyx_t_3 = ((!(__pyx_v_done != 0)) != 0);
if (!__pyx_t_3) break;
- /* "int_list.pxi":54
+ /* "cdec/sa/int_list.pxi":54
* break
* while not done:
* top -= 1 # <<<<<<<<<<<<<<
@@ -5882,7 +5920,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c
__Pyx_DECREF_SET(__pyx_v_top, __pyx_t_4);
__pyx_t_4 = 0;
- /* "int_list.pxi":55
+ /* "cdec/sa/int_list.pxi":55
* while not done:
* top -= 1
* if top == bottom: # <<<<<<<<<<<<<<
@@ -5894,7 +5932,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_3) {
- /* "int_list.pxi":56
+ /* "cdec/sa/int_list.pxi":56
* top -= 1
* if top == bottom:
* done = 1 # <<<<<<<<<<<<<<
@@ -5903,7 +5941,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c
*/
__pyx_v_done = 1;
- /* "int_list.pxi":57
+ /* "cdec/sa/int_list.pxi":57
* if top == bottom:
* done = 1
* break # <<<<<<<<<<<<<<
@@ -5913,7 +5951,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c
goto __pyx_L10_break;
}
- /* "int_list.pxi":58
+ /* "cdec/sa/int_list.pxi":58
* done = 1
* break
* if self.arr[top] < pivot: # <<<<<<<<<<<<<<
@@ -5929,7 +5967,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (__pyx_t_3) {
- /* "int_list.pxi":59
+ /* "cdec/sa/int_list.pxi":59
* break
* if self.arr[top] < pivot:
* self.arr[bottom] = self.arr[top] # <<<<<<<<<<<<<<
@@ -5940,7 +5978,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c
__pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_bottom); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
(__pyx_v_self->arr[__pyx_t_5]) = (__pyx_v_self->arr[__pyx_t_1]);
- /* "int_list.pxi":60
+ /* "cdec/sa/int_list.pxi":60
* if self.arr[top] < pivot:
* self.arr[bottom] = self.arr[top]
* break # <<<<<<<<<<<<<<
@@ -5953,7 +5991,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c
__pyx_L10_break:;
}
- /* "int_list.pxi":61
+ /* "cdec/sa/int_list.pxi":61
* self.arr[bottom] = self.arr[top]
* break
* self.arr[top] = pivot # <<<<<<<<<<<<<<
@@ -5964,7 +6002,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c
__pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_top); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
(__pyx_v_self->arr[__pyx_t_1]) = __pyx_t_6;
- /* "int_list.pxi":62
+ /* "cdec/sa/int_list.pxi":62
* break
* self.arr[top] = pivot
* return top # <<<<<<<<<<<<<<
@@ -5976,7 +6014,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c
__pyx_r = __pyx_v_top;
goto __pyx_L0;
- /* "int_list.pxi":39
+ /* "cdec/sa/int_list.pxi":39
* raise ValueError('%s not in IntList' % val)
*
* def partition(self,start,end): # <<<<<<<<<<<<<<
@@ -5999,7 +6037,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_6partition(struct __pyx_obj_4c
return __pyx_r;
}
-/* "int_list.pxi":64
+/* "cdec/sa/int_list.pxi":64
* return top
*
* def _doquicksort(self,start,end): # <<<<<<<<<<<<<<
@@ -6084,7 +6122,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_8_doquicksort(struct __pyx_obj
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_doquicksort", 0);
- /* "int_list.pxi":65
+ /* "cdec/sa/int_list.pxi":65
*
* def _doquicksort(self,start,end):
* if start < end: # <<<<<<<<<<<<<<
@@ -6096,7 +6134,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_8_doquicksort(struct __pyx_obj
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
- /* "int_list.pxi":66
+ /* "cdec/sa/int_list.pxi":66
* def _doquicksort(self,start,end):
* if start < end:
* split = self.partition(start,end) # <<<<<<<<<<<<<<
@@ -6135,7 +6173,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_8_doquicksort(struct __pyx_obj
__pyx_v_split = __pyx_t_1;
__pyx_t_1 = 0;
- /* "int_list.pxi":67
+ /* "cdec/sa/int_list.pxi":67
* if start < end:
* split = self.partition(start,end)
* self._doquicksort(start,split-1) # <<<<<<<<<<<<<<
@@ -6175,7 +6213,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_8_doquicksort(struct __pyx_obj
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "int_list.pxi":68
+ /* "cdec/sa/int_list.pxi":68
* split = self.partition(start,end)
* self._doquicksort(start,split-1)
* self._doquicksort(split+1,end) # <<<<<<<<<<<<<<
@@ -6218,7 +6256,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_8_doquicksort(struct __pyx_obj
}
/*else*/ {
- /* "int_list.pxi":70
+ /* "cdec/sa/int_list.pxi":70
* self._doquicksort(split+1,end)
* else:
* return # <<<<<<<<<<<<<<
@@ -6231,7 +6269,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_8_doquicksort(struct __pyx_obj
}
__pyx_L3:;
- /* "int_list.pxi":64
+ /* "cdec/sa/int_list.pxi":64
* return top
*
* def _doquicksort(self,start,end): # <<<<<<<<<<<<<<
@@ -6257,7 +6295,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_8_doquicksort(struct __pyx_obj
return __pyx_r;
}
-/* "int_list.pxi":72
+/* "cdec/sa/int_list.pxi":72
* return
*
* def sort(self): # <<<<<<<<<<<<<<
@@ -6292,7 +6330,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_10sort(struct __pyx_obj_4cdec_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("sort", 0);
- /* "int_list.pxi":73
+ /* "cdec/sa/int_list.pxi":73
*
* def sort(self):
* self._doquicksort(0,self.len-1) # <<<<<<<<<<<<<<
@@ -6332,7 +6370,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_10sort(struct __pyx_obj_4cdec_
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "int_list.pxi":72
+ /* "cdec/sa/int_list.pxi":72
* return
*
* def sort(self): # <<<<<<<<<<<<<<
@@ -6357,7 +6395,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_10sort(struct __pyx_obj_4cdec_
return __pyx_r;
}
-/* "int_list.pxi":75
+/* "cdec/sa/int_list.pxi":75
* self._doquicksort(0,self.len-1)
*
* def reset(self): # <<<<<<<<<<<<<<
@@ -6383,7 +6421,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_12reset(struct __pyx_obj_4cdec
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("reset", 0);
- /* "int_list.pxi":76
+ /* "cdec/sa/int_list.pxi":76
*
* def reset(self):
* self.len = 0 # <<<<<<<<<<<<<<
@@ -6392,7 +6430,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_12reset(struct __pyx_obj_4cdec
*/
__pyx_v_self->len = 0;
- /* "int_list.pxi":75
+ /* "cdec/sa/int_list.pxi":75
* self._doquicksort(0,self.len-1)
*
* def reset(self): # <<<<<<<<<<<<<<
@@ -6407,7 +6445,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_12reset(struct __pyx_obj_4cdec
return __pyx_r;
}
-/* "int_list.pxi":78
+/* "cdec/sa/int_list.pxi":78
* self.len = 0
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -6430,7 +6468,7 @@ static void __pyx_pf_4cdec_2sa_3_sa_7IntList_14__dealloc__(struct __pyx_obj_4cde
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "int_list.pxi":79
+ /* "cdec/sa/int_list.pxi":79
*
* def __dealloc__(self):
* free(self.arr) # <<<<<<<<<<<<<<
@@ -6439,7 +6477,7 @@ static void __pyx_pf_4cdec_2sa_3_sa_7IntList_14__dealloc__(struct __pyx_obj_4cde
*/
free(__pyx_v_self->arr);
- /* "int_list.pxi":78
+ /* "cdec/sa/int_list.pxi":78
* self.len = 0
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -6452,7 +6490,7 @@ static void __pyx_pf_4cdec_2sa_3_sa_7IntList_14__dealloc__(struct __pyx_obj_4cde
}
static PyObject *__pyx_gb_4cdec_2sa_3_sa_7IntList_18generator(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-/* "int_list.pxi":81
+/* "cdec/sa/int_list.pxi":81
* free(self.arr)
*
* def __iter__(self): # <<<<<<<<<<<<<<
@@ -6529,7 +6567,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_7IntList_18generator(__pyx_GeneratorObj
__pyx_L3_first_run:;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "int_list.pxi":83
+ /* "cdec/sa/int_list.pxi":83
* def __iter__(self):
* cdef int i
* for i in range(self.len): # <<<<<<<<<<<<<<
@@ -6540,7 +6578,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_7IntList_18generator(__pyx_GeneratorObj
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_cur_scope->__pyx_v_i = __pyx_t_2;
- /* "int_list.pxi":84
+ /* "cdec/sa/int_list.pxi":84
* cdef int i
* for i in range(self.len):
* yield self.arr[i] # <<<<<<<<<<<<<<
@@ -6564,7 +6602,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_7IntList_18generator(__pyx_GeneratorObj
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- /* "int_list.pxi":81
+ /* "cdec/sa/int_list.pxi":81
* free(self.arr)
*
* def __iter__(self): # <<<<<<<<<<<<<<
@@ -6586,7 +6624,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_7IntList_18generator(__pyx_GeneratorObj
return NULL;
}
-/* "int_list.pxi":86
+/* "cdec/sa/int_list.pxi":86
* yield self.arr[i]
*
* def __getitem__(self, index): # <<<<<<<<<<<<<<
@@ -6626,7 +6664,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_19__getitem__(struct __pyx_obj
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__getitem__", 0);
- /* "int_list.pxi":88
+ /* "cdec/sa/int_list.pxi":88
* def __getitem__(self, index):
* cdef int i, j, k
* if isinstance(index, int): # <<<<<<<<<<<<<<
@@ -6637,7 +6675,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_19__getitem__(struct __pyx_obj
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "int_list.pxi":89
+ /* "cdec/sa/int_list.pxi":89
* cdef int i, j, k
* if isinstance(index, int):
* j = index # <<<<<<<<<<<<<<
@@ -6647,7 +6685,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_19__getitem__(struct __pyx_obj
__pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_index); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_j = __pyx_t_3;
- /* "int_list.pxi":90
+ /* "cdec/sa/int_list.pxi":90
* if isinstance(index, int):
* j = index
* if j < 0: # <<<<<<<<<<<<<<
@@ -6657,7 +6695,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_19__getitem__(struct __pyx_obj
__pyx_t_2 = ((__pyx_v_j < 0) != 0);
if (__pyx_t_2) {
- /* "int_list.pxi":91
+ /* "cdec/sa/int_list.pxi":91
* j = index
* if j < 0:
* j = self.len + j # <<<<<<<<<<<<<<
@@ -6669,7 +6707,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_19__getitem__(struct __pyx_obj
}
__pyx_L4:;
- /* "int_list.pxi":92
+ /* "cdec/sa/int_list.pxi":92
* if j < 0:
* j = self.len + j
* if j<0 or j>=self.len: # <<<<<<<<<<<<<<
@@ -6689,7 +6727,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_19__getitem__(struct __pyx_obj
__pyx_L6_bool_binop_done:;
if (__pyx_t_2) {
- /* "int_list.pxi":93
+ /* "cdec/sa/int_list.pxi":93
* j = self.len + j
* if j<0 or j>=self.len:
* raise IndexError("Requested index %d of %d-length IntList" % (index, self.len)) # <<<<<<<<<<<<<<
@@ -6722,7 +6760,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_19__getitem__(struct __pyx_obj
{__pyx_filename = __pyx_f[2]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- /* "int_list.pxi":94
+ /* "cdec/sa/int_list.pxi":94
* if j<0 or j>=self.len:
* raise IndexError("Requested index %d of %d-length IntList" % (index, self.len))
* return self.arr[j] # <<<<<<<<<<<<<<
@@ -6737,7 +6775,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_19__getitem__(struct __pyx_obj
goto __pyx_L0;
}
- /* "int_list.pxi":95
+ /* "cdec/sa/int_list.pxi":95
* raise IndexError("Requested index %d of %d-length IntList" % (index, self.len))
* return self.arr[j]
* elif isinstance(index, slice): # <<<<<<<<<<<<<<
@@ -6748,7 +6786,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_19__getitem__(struct __pyx_obj
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "int_list.pxi":96
+ /* "cdec/sa/int_list.pxi":96
* return self.arr[j]
* elif isinstance(index, slice):
* i = index.start # <<<<<<<<<<<<<<
@@ -6761,7 +6799,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_19__getitem__(struct __pyx_obj
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_i = __pyx_t_3;
- /* "int_list.pxi":97
+ /* "cdec/sa/int_list.pxi":97
* elif isinstance(index, slice):
* i = index.start
* j = index.stop # <<<<<<<<<<<<<<
@@ -6774,7 +6812,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_19__getitem__(struct __pyx_obj
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_j = __pyx_t_3;
- /* "int_list.pxi":98
+ /* "cdec/sa/int_list.pxi":98
* i = index.start
* j = index.stop
* if i < 0: # <<<<<<<<<<<<<<
@@ -6784,7 +6822,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_19__getitem__(struct __pyx_obj
__pyx_t_1 = ((__pyx_v_i < 0) != 0);
if (__pyx_t_1) {
- /* "int_list.pxi":99
+ /* "cdec/sa/int_list.pxi":99
* j = index.stop
* if i < 0:
* i = self.len + i # <<<<<<<<<<<<<<
@@ -6796,7 +6834,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_19__getitem__(struct __pyx_obj
}
__pyx_L8:;
- /* "int_list.pxi":100
+ /* "cdec/sa/int_list.pxi":100
* if i < 0:
* i = self.len + i
* if j < 0: # <<<<<<<<<<<<<<
@@ -6806,7 +6844,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_19__getitem__(struct __pyx_obj
__pyx_t_1 = ((__pyx_v_j < 0) != 0);
if (__pyx_t_1) {
- /* "int_list.pxi":101
+ /* "cdec/sa/int_list.pxi":101
* i = self.len + i
* if j < 0:
* j = self.len + j # <<<<<<<<<<<<<<
@@ -6818,7 +6856,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_19__getitem__(struct __pyx_obj
}
__pyx_L9:;
- /* "int_list.pxi":102
+ /* "cdec/sa/int_list.pxi":102
* if j < 0:
* j = self.len + j
* if i < 0 or i >= self.len or j < 0 or j > self.len: # <<<<<<<<<<<<<<
@@ -6854,7 +6892,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_19__getitem__(struct __pyx_obj
__pyx_L11_bool_binop_done:;
if (__pyx_t_1) {
- /* "int_list.pxi":103
+ /* "cdec/sa/int_list.pxi":103
* j = self.len + j
* if i < 0 or i >= self.len or j < 0 or j > self.len:
* raise IndexError("Requested index %d:%d of %d-length IntList" % (index.start, index.stop, self.len)) # <<<<<<<<<<<<<<
@@ -6894,7 +6932,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_19__getitem__(struct __pyx_obj
{__pyx_filename = __pyx_f[2]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- /* "int_list.pxi":104
+ /* "cdec/sa/int_list.pxi":104
* if i < 0 or i >= self.len or j < 0 or j > self.len:
* raise IndexError("Requested index %d:%d of %d-length IntList" % (index.start, index.stop, self.len))
* result = () # <<<<<<<<<<<<<<
@@ -6904,7 +6942,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_19__getitem__(struct __pyx_obj
__Pyx_INCREF(__pyx_empty_tuple);
__pyx_v_result = __pyx_empty_tuple;
- /* "int_list.pxi":105
+ /* "cdec/sa/int_list.pxi":105
* raise IndexError("Requested index %d:%d of %d-length IntList" % (index.start, index.stop, self.len))
* result = ()
* for k from i <= k < j: # <<<<<<<<<<<<<<
@@ -6914,7 +6952,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_19__getitem__(struct __pyx_obj
__pyx_t_3 = __pyx_v_j;
for (__pyx_v_k = __pyx_v_i; __pyx_v_k < __pyx_t_3; __pyx_v_k++) {
- /* "int_list.pxi":106
+ /* "cdec/sa/int_list.pxi":106
* result = ()
* for k from i <= k < j:
* result = result + (self.arr[k],) # <<<<<<<<<<<<<<
@@ -6935,7 +6973,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_19__getitem__(struct __pyx_obj
__pyx_t_6 = 0;
}
- /* "int_list.pxi":107
+ /* "cdec/sa/int_list.pxi":107
* for k from i <= k < j:
* result = result + (self.arr[k],)
* return result # <<<<<<<<<<<<<<
@@ -6949,7 +6987,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_19__getitem__(struct __pyx_obj
}
/*else*/ {
- /* "int_list.pxi":109
+ /* "cdec/sa/int_list.pxi":109
* return result
* else:
* raise TypeError("Illegal key type %s for IntList" % type(index)) # <<<<<<<<<<<<<<
@@ -6971,7 +7009,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_19__getitem__(struct __pyx_obj
{__pyx_filename = __pyx_f[2]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- /* "int_list.pxi":86
+ /* "cdec/sa/int_list.pxi":86
* yield self.arr[i]
*
* def __getitem__(self, index): # <<<<<<<<<<<<<<
@@ -6994,7 +7032,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_19__getitem__(struct __pyx_obj
return __pyx_r;
}
-/* "int_list.pxi":111
+/* "cdec/sa/int_list.pxi":111
* raise TypeError("Illegal key type %s for IntList" % type(index))
*
* cdef void set(self, int i, int val): # <<<<<<<<<<<<<<
@@ -7015,7 +7053,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList_set(struct __pyx_obj_4cdec_2sa_3_sa_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("set", 0);
- /* "int_list.pxi":112
+ /* "cdec/sa/int_list.pxi":112
*
* cdef void set(self, int i, int val):
* j = i # <<<<<<<<<<<<<<
@@ -7024,7 +7062,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList_set(struct __pyx_obj_4cdec_2sa_3_sa_
*/
__pyx_v_j = __pyx_v_i;
- /* "int_list.pxi":113
+ /* "cdec/sa/int_list.pxi":113
* cdef void set(self, int i, int val):
* j = i
* if i<0: # <<<<<<<<<<<<<<
@@ -7034,7 +7072,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList_set(struct __pyx_obj_4cdec_2sa_3_sa_
__pyx_t_1 = ((__pyx_v_i < 0) != 0);
if (__pyx_t_1) {
- /* "int_list.pxi":114
+ /* "cdec/sa/int_list.pxi":114
* j = i
* if i<0:
* j = self.len + i # <<<<<<<<<<<<<<
@@ -7046,7 +7084,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList_set(struct __pyx_obj_4cdec_2sa_3_sa_
}
__pyx_L3:;
- /* "int_list.pxi":115
+ /* "cdec/sa/int_list.pxi":115
* if i<0:
* j = self.len + i
* if j<0 or j>=self.len: # <<<<<<<<<<<<<<
@@ -7066,7 +7104,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList_set(struct __pyx_obj_4cdec_2sa_3_sa_
__pyx_L5_bool_binop_done:;
if (__pyx_t_1) {
- /* "int_list.pxi":116
+ /* "cdec/sa/int_list.pxi":116
* j = self.len + i
* if j<0 or j>=self.len:
* raise IndexError("Requested index %d of %d-length IntList" % (i, self.len)) # <<<<<<<<<<<<<<
@@ -7101,7 +7139,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList_set(struct __pyx_obj_4cdec_2sa_3_sa_
{__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- /* "int_list.pxi":117
+ /* "cdec/sa/int_list.pxi":117
* if j<0 or j>=self.len:
* raise IndexError("Requested index %d of %d-length IntList" % (i, self.len))
* self.arr[j] = val # <<<<<<<<<<<<<<
@@ -7110,7 +7148,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList_set(struct __pyx_obj_4cdec_2sa_3_sa_
*/
(__pyx_v_self->arr[__pyx_v_j]) = __pyx_v_val;
- /* "int_list.pxi":111
+ /* "cdec/sa/int_list.pxi":111
* raise TypeError("Illegal key type %s for IntList" % type(index))
*
* cdef void set(self, int i, int val): # <<<<<<<<<<<<<<
@@ -7129,7 +7167,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList_set(struct __pyx_obj_4cdec_2sa_3_sa_
__Pyx_RefNannyFinishContext();
}
-/* "int_list.pxi":119
+/* "cdec/sa/int_list.pxi":119
* self.arr[j] = val
*
* def __setitem__(self, i, val): # <<<<<<<<<<<<<<
@@ -7160,7 +7198,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_7IntList_21__setitem__(struct __pyx_obj_4cdec
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__setitem__", 0);
- /* "int_list.pxi":120
+ /* "cdec/sa/int_list.pxi":120
*
* def __setitem__(self, i, val):
* self.set(i, val) # <<<<<<<<<<<<<<
@@ -7171,7 +7209,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_7IntList_21__setitem__(struct __pyx_obj_4cdec
__pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_val); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->__pyx_vtab)->set(__pyx_v_self, __pyx_t_1, __pyx_t_2);
- /* "int_list.pxi":119
+ /* "cdec/sa/int_list.pxi":119
* self.arr[j] = val
*
* def __setitem__(self, i, val): # <<<<<<<<<<<<<<
@@ -7190,7 +7228,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_7IntList_21__setitem__(struct __pyx_obj_4cdec
return __pyx_r;
}
-/* "int_list.pxi":122
+/* "cdec/sa/int_list.pxi":122
* self.set(i, val)
*
* def __len__(self): # <<<<<<<<<<<<<<
@@ -7216,7 +7254,7 @@ static Py_ssize_t __pyx_pf_4cdec_2sa_3_sa_7IntList_23__len__(struct __pyx_obj_4c
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__len__", 0);
- /* "int_list.pxi":123
+ /* "cdec/sa/int_list.pxi":123
*
* def __len__(self):
* return self.len # <<<<<<<<<<<<<<
@@ -7226,7 +7264,7 @@ static Py_ssize_t __pyx_pf_4cdec_2sa_3_sa_7IntList_23__len__(struct __pyx_obj_4c
__pyx_r = __pyx_v_self->len;
goto __pyx_L0;
- /* "int_list.pxi":122
+ /* "cdec/sa/int_list.pxi":122
* self.set(i, val)
*
* def __len__(self): # <<<<<<<<<<<<<<
@@ -7240,7 +7278,7 @@ static Py_ssize_t __pyx_pf_4cdec_2sa_3_sa_7IntList_23__len__(struct __pyx_obj_4c
return __pyx_r;
}
-/* "int_list.pxi":125
+/* "cdec/sa/int_list.pxi":125
* return self.len
*
* def get_size(self): # <<<<<<<<<<<<<<
@@ -7270,7 +7308,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_25get_size(struct __pyx_obj_4c
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("get_size", 0);
- /* "int_list.pxi":126
+ /* "cdec/sa/int_list.pxi":126
*
* def get_size(self):
* return self.size # <<<<<<<<<<<<<<
@@ -7284,7 +7322,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_25get_size(struct __pyx_obj_4c
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "int_list.pxi":125
+ /* "cdec/sa/int_list.pxi":125
* return self.len
*
* def get_size(self): # <<<<<<<<<<<<<<
@@ -7303,7 +7341,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_25get_size(struct __pyx_obj_4c
return __pyx_r;
}
-/* "int_list.pxi":128
+/* "cdec/sa/int_list.pxi":128
* return self.size
*
* def append(self, int val): # <<<<<<<<<<<<<<
@@ -7342,7 +7380,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_27append(struct __pyx_obj_4cde
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("append", 0);
- /* "int_list.pxi":129
+ /* "cdec/sa/int_list.pxi":129
*
* def append(self, int val):
* self._append(val) # <<<<<<<<<<<<<<
@@ -7351,7 +7389,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_27append(struct __pyx_obj_4cde
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->__pyx_vtab)->_append(__pyx_v_self, __pyx_v_val);
- /* "int_list.pxi":128
+ /* "cdec/sa/int_list.pxi":128
* return self.size
*
* def append(self, int val): # <<<<<<<<<<<<<<
@@ -7366,7 +7404,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_27append(struct __pyx_obj_4cde
return __pyx_r;
}
-/* "int_list.pxi":131
+/* "cdec/sa/int_list.pxi":131
* self._append(val)
*
* cdef void _append(self, int val): # <<<<<<<<<<<<<<
@@ -7379,7 +7417,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList__append(struct __pyx_obj_4cdec_2sa_3
int __pyx_t_1;
__Pyx_RefNannySetupContext("_append", 0);
- /* "int_list.pxi":132
+ /* "cdec/sa/int_list.pxi":132
*
* cdef void _append(self, int val):
* if self.len == self.size: # <<<<<<<<<<<<<<
@@ -7389,7 +7427,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList__append(struct __pyx_obj_4cdec_2sa_3
__pyx_t_1 = ((__pyx_v_self->len == __pyx_v_self->size) != 0);
if (__pyx_t_1) {
- /* "int_list.pxi":133
+ /* "cdec/sa/int_list.pxi":133
* cdef void _append(self, int val):
* if self.len == self.size:
* self.size = self.size + self.increment # <<<<<<<<<<<<<<
@@ -7398,7 +7436,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList__append(struct __pyx_obj_4cdec_2sa_3
*/
__pyx_v_self->size = (__pyx_v_self->size + __pyx_v_self->increment);
- /* "int_list.pxi":134
+ /* "cdec/sa/int_list.pxi":134
* if self.len == self.size:
* self.size = self.size + self.increment
* self.arr = <int*> realloc(self.arr, self.size*sizeof(int)) # <<<<<<<<<<<<<<
@@ -7410,7 +7448,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList__append(struct __pyx_obj_4cdec_2sa_3
}
__pyx_L3:;
- /* "int_list.pxi":135
+ /* "cdec/sa/int_list.pxi":135
* self.size = self.size + self.increment
* self.arr = <int*> realloc(self.arr, self.size*sizeof(int))
* self.arr[self.len] = val # <<<<<<<<<<<<<<
@@ -7419,7 +7457,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList__append(struct __pyx_obj_4cdec_2sa_3
*/
(__pyx_v_self->arr[__pyx_v_self->len]) = __pyx_v_val;
- /* "int_list.pxi":136
+ /* "cdec/sa/int_list.pxi":136
* self.arr = <int*> realloc(self.arr, self.size*sizeof(int))
* self.arr[self.len] = val
* self.len = self.len + 1 # <<<<<<<<<<<<<<
@@ -7428,7 +7466,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList__append(struct __pyx_obj_4cdec_2sa_3
*/
__pyx_v_self->len = (__pyx_v_self->len + 1);
- /* "int_list.pxi":131
+ /* "cdec/sa/int_list.pxi":131
* self._append(val)
*
* cdef void _append(self, int val): # <<<<<<<<<<<<<<
@@ -7440,7 +7478,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList__append(struct __pyx_obj_4cdec_2sa_3
__Pyx_RefNannyFinishContext();
}
-/* "int_list.pxi":138
+/* "cdec/sa/int_list.pxi":138
* self.len = self.len + 1
*
* def extend(self, other): # <<<<<<<<<<<<<<
@@ -7469,7 +7507,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_29extend(struct __pyx_obj_4cde
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("extend", 0);
- /* "int_list.pxi":139
+ /* "cdec/sa/int_list.pxi":139
*
* def extend(self, other):
* self._extend(other) # <<<<<<<<<<<<<<
@@ -7479,7 +7517,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_29extend(struct __pyx_obj_4cde
if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->__pyx_vtab)->_extend(__pyx_v_self, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_v_other));
- /* "int_list.pxi":138
+ /* "cdec/sa/int_list.pxi":138
* self.len = self.len + 1
*
* def extend(self, other): # <<<<<<<<<<<<<<
@@ -7499,7 +7537,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_29extend(struct __pyx_obj_4cde
return __pyx_r;
}
-/* "int_list.pxi":141
+/* "cdec/sa/int_list.pxi":141
* self._extend(other)
*
* cdef void _extend(self, IntList other): # <<<<<<<<<<<<<<
@@ -7511,7 +7549,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList__extend(struct __pyx_obj_4cdec_2sa_3
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_extend", 0);
- /* "int_list.pxi":142
+ /* "cdec/sa/int_list.pxi":142
*
* cdef void _extend(self, IntList other):
* self._extend_arr(other.arr, other.len) # <<<<<<<<<<<<<<
@@ -7520,7 +7558,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList__extend(struct __pyx_obj_4cdec_2sa_3
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->__pyx_vtab)->_extend_arr(__pyx_v_self, __pyx_v_other->arr, __pyx_v_other->len);
- /* "int_list.pxi":141
+ /* "cdec/sa/int_list.pxi":141
* self._extend(other)
*
* cdef void _extend(self, IntList other): # <<<<<<<<<<<<<<
@@ -7532,7 +7570,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList__extend(struct __pyx_obj_4cdec_2sa_3
__Pyx_RefNannyFinishContext();
}
-/* "int_list.pxi":144
+/* "cdec/sa/int_list.pxi":144
* self._extend_arr(other.arr, other.len)
*
* cdef void _extend_arr(self, int* other, int other_len): # <<<<<<<<<<<<<<
@@ -7545,7 +7583,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList__extend_arr(struct __pyx_obj_4cdec_2
int __pyx_t_1;
__Pyx_RefNannySetupContext("_extend_arr", 0);
- /* "int_list.pxi":145
+ /* "cdec/sa/int_list.pxi":145
*
* cdef void _extend_arr(self, int* other, int other_len):
* if self.size < self.len + other_len: # <<<<<<<<<<<<<<
@@ -7555,7 +7593,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList__extend_arr(struct __pyx_obj_4cdec_2
__pyx_t_1 = ((__pyx_v_self->size < (__pyx_v_self->len + __pyx_v_other_len)) != 0);
if (__pyx_t_1) {
- /* "int_list.pxi":146
+ /* "cdec/sa/int_list.pxi":146
* cdef void _extend_arr(self, int* other, int other_len):
* if self.size < self.len + other_len:
* self.size = self.len + other_len # <<<<<<<<<<<<<<
@@ -7564,7 +7602,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList__extend_arr(struct __pyx_obj_4cdec_2
*/
__pyx_v_self->size = (__pyx_v_self->len + __pyx_v_other_len);
- /* "int_list.pxi":147
+ /* "cdec/sa/int_list.pxi":147
* if self.size < self.len + other_len:
* self.size = self.len + other_len
* self.arr = <int*> realloc(self.arr, self.size*sizeof(int)) # <<<<<<<<<<<<<<
@@ -7576,7 +7614,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList__extend_arr(struct __pyx_obj_4cdec_2
}
__pyx_L3:;
- /* "int_list.pxi":148
+ /* "cdec/sa/int_list.pxi":148
* self.size = self.len + other_len
* self.arr = <int*> realloc(self.arr, self.size*sizeof(int))
* memcpy(self.arr+self.len, other, other_len*sizeof(int)) # <<<<<<<<<<<<<<
@@ -7585,7 +7623,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList__extend_arr(struct __pyx_obj_4cdec_2
*/
memcpy((__pyx_v_self->arr + __pyx_v_self->len), __pyx_v_other, (__pyx_v_other_len * (sizeof(int))));
- /* "int_list.pxi":149
+ /* "cdec/sa/int_list.pxi":149
* self.arr = <int*> realloc(self.arr, self.size*sizeof(int))
* memcpy(self.arr+self.len, other, other_len*sizeof(int))
* self.len = self.len + other_len # <<<<<<<<<<<<<<
@@ -7594,7 +7632,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList__extend_arr(struct __pyx_obj_4cdec_2
*/
__pyx_v_self->len = (__pyx_v_self->len + __pyx_v_other_len);
- /* "int_list.pxi":144
+ /* "cdec/sa/int_list.pxi":144
* self._extend_arr(other.arr, other.len)
*
* cdef void _extend_arr(self, int* other, int other_len): # <<<<<<<<<<<<<<
@@ -7606,7 +7644,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList__extend_arr(struct __pyx_obj_4cdec_2
__Pyx_RefNannyFinishContext();
}
-/* "int_list.pxi":151
+/* "cdec/sa/int_list.pxi":151
* self.len = self.len + other_len
*
* cdef void _clear(self): # <<<<<<<<<<<<<<
@@ -7618,7 +7656,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList__clear(struct __pyx_obj_4cdec_2sa_3_
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_clear", 0);
- /* "int_list.pxi":152
+ /* "cdec/sa/int_list.pxi":152
*
* cdef void _clear(self):
* free(self.arr) # <<<<<<<<<<<<<<
@@ -7627,7 +7665,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList__clear(struct __pyx_obj_4cdec_2sa_3_
*/
free(__pyx_v_self->arr);
- /* "int_list.pxi":153
+ /* "cdec/sa/int_list.pxi":153
* cdef void _clear(self):
* free(self.arr)
* self.len = 0 # <<<<<<<<<<<<<<
@@ -7636,7 +7674,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList__clear(struct __pyx_obj_4cdec_2sa_3_
*/
__pyx_v_self->len = 0;
- /* "int_list.pxi":154
+ /* "cdec/sa/int_list.pxi":154
* free(self.arr)
* self.len = 0
* self.size = 0 # <<<<<<<<<<<<<<
@@ -7645,7 +7683,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList__clear(struct __pyx_obj_4cdec_2sa_3_
*/
__pyx_v_self->size = 0;
- /* "int_list.pxi":155
+ /* "cdec/sa/int_list.pxi":155
* self.len = 0
* self.size = 0
* self.arr = <int*> malloc(0) # <<<<<<<<<<<<<<
@@ -7654,7 +7692,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList__clear(struct __pyx_obj_4cdec_2sa_3_
*/
__pyx_v_self->arr = ((int *)malloc(0));
- /* "int_list.pxi":151
+ /* "cdec/sa/int_list.pxi":151
* self.len = self.len + other_len
*
* cdef void _clear(self): # <<<<<<<<<<<<<<
@@ -7666,7 +7704,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList__clear(struct __pyx_obj_4cdec_2sa_3_
__Pyx_RefNannyFinishContext();
}
-/* "int_list.pxi":157
+/* "cdec/sa/int_list.pxi":157
* self.arr = <int*> malloc(0)
*
* cdef void write_handle(self, FILE* f): # <<<<<<<<<<<<<<
@@ -7678,7 +7716,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList_write_handle(struct __pyx_obj_4cdec_
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("write_handle", 0);
- /* "int_list.pxi":158
+ /* "cdec/sa/int_list.pxi":158
*
* cdef void write_handle(self, FILE* f):
* fwrite(&(self.len), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -7687,7 +7725,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList_write_handle(struct __pyx_obj_4cdec_
*/
fwrite((&__pyx_v_self->len), (sizeof(int)), 1, __pyx_v_f);
- /* "int_list.pxi":159
+ /* "cdec/sa/int_list.pxi":159
* cdef void write_handle(self, FILE* f):
* fwrite(&(self.len), sizeof(int), 1, f)
* fwrite(self.arr, sizeof(int), self.len, f) # <<<<<<<<<<<<<<
@@ -7696,7 +7734,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList_write_handle(struct __pyx_obj_4cdec_
*/
fwrite(__pyx_v_self->arr, (sizeof(int)), __pyx_v_self->len, __pyx_v_f);
- /* "int_list.pxi":157
+ /* "cdec/sa/int_list.pxi":157
* self.arr = <int*> malloc(0)
*
* cdef void write_handle(self, FILE* f): # <<<<<<<<<<<<<<
@@ -7708,7 +7746,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList_write_handle(struct __pyx_obj_4cdec_
__Pyx_RefNannyFinishContext();
}
-/* "int_list.pxi":161
+/* "cdec/sa/int_list.pxi":161
* fwrite(self.arr, sizeof(int), self.len, f)
*
* def write(self, char* filename): # <<<<<<<<<<<<<<
@@ -7748,7 +7786,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_31write(struct __pyx_obj_4cdec
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("write", 0);
- /* "int_list.pxi":163
+ /* "cdec/sa/int_list.pxi":163
* def write(self, char* filename):
* cdef FILE* f
* f = fopen(filename, "w") # <<<<<<<<<<<<<<
@@ -7757,7 +7795,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_31write(struct __pyx_obj_4cdec
*/
__pyx_v_f = fopen(__pyx_v_filename, __pyx_k_w);
- /* "int_list.pxi":164
+ /* "cdec/sa/int_list.pxi":164
* cdef FILE* f
* f = fopen(filename, "w")
* self.write_handle(f) # <<<<<<<<<<<<<<
@@ -7766,7 +7804,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_31write(struct __pyx_obj_4cdec
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->__pyx_vtab)->write_handle(__pyx_v_self, __pyx_v_f);
- /* "int_list.pxi":165
+ /* "cdec/sa/int_list.pxi":165
* f = fopen(filename, "w")
* self.write_handle(f)
* fclose(f) # <<<<<<<<<<<<<<
@@ -7775,7 +7813,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_31write(struct __pyx_obj_4cdec
*/
fclose(__pyx_v_f);
- /* "int_list.pxi":161
+ /* "cdec/sa/int_list.pxi":161
* fwrite(self.arr, sizeof(int), self.len, f)
*
* def write(self, char* filename): # <<<<<<<<<<<<<<
@@ -7790,7 +7828,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_31write(struct __pyx_obj_4cdec
return __pyx_r;
}
-/* "int_list.pxi":167
+/* "cdec/sa/int_list.pxi":167
* fclose(f)
*
* cdef void read_handle(self, FILE* f): # <<<<<<<<<<<<<<
@@ -7803,7 +7841,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList_read_handle(struct __pyx_obj_4cdec_2
int __pyx_t_1;
__Pyx_RefNannySetupContext("read_handle", 0);
- /* "int_list.pxi":168
+ /* "cdec/sa/int_list.pxi":168
*
* cdef void read_handle(self, FILE* f):
* (self.arr) # <<<<<<<<<<<<<<
@@ -7812,7 +7850,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList_read_handle(struct __pyx_obj_4cdec_2
*/
__pyx_v_self->arr;
- /* "int_list.pxi":169
+ /* "cdec/sa/int_list.pxi":169
* cdef void read_handle(self, FILE* f):
* (self.arr)
* fread(&(self.len), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -7821,7 +7859,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList_read_handle(struct __pyx_obj_4cdec_2
*/
fread((&__pyx_v_self->len), (sizeof(int)), 1, __pyx_v_f);
- /* "int_list.pxi":170
+ /* "cdec/sa/int_list.pxi":170
* (self.arr)
* fread(&(self.len), sizeof(int), 1, f)
* self.arr = <int*> malloc(self.len * sizeof(int)) # <<<<<<<<<<<<<<
@@ -7830,7 +7868,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList_read_handle(struct __pyx_obj_4cdec_2
*/
__pyx_v_self->arr = ((int *)malloc((__pyx_v_self->len * (sizeof(int)))));
- /* "int_list.pxi":171
+ /* "cdec/sa/int_list.pxi":171
* fread(&(self.len), sizeof(int), 1, f)
* self.arr = <int*> malloc(self.len * sizeof(int))
* self.size = self.len # <<<<<<<<<<<<<<
@@ -7840,7 +7878,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList_read_handle(struct __pyx_obj_4cdec_2
__pyx_t_1 = __pyx_v_self->len;
__pyx_v_self->size = __pyx_t_1;
- /* "int_list.pxi":172
+ /* "cdec/sa/int_list.pxi":172
* self.arr = <int*> malloc(self.len * sizeof(int))
* self.size = self.len
* fread(self.arr, sizeof(int), self.len, f) # <<<<<<<<<<<<<<
@@ -7849,7 +7887,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList_read_handle(struct __pyx_obj_4cdec_2
*/
fread(__pyx_v_self->arr, (sizeof(int)), __pyx_v_self->len, __pyx_v_f);
- /* "int_list.pxi":167
+ /* "cdec/sa/int_list.pxi":167
* fclose(f)
*
* cdef void read_handle(self, FILE* f): # <<<<<<<<<<<<<<
@@ -7861,7 +7899,7 @@ static void __pyx_f_4cdec_2sa_3_sa_7IntList_read_handle(struct __pyx_obj_4cdec_2
__Pyx_RefNannyFinishContext();
}
-/* "int_list.pxi":174
+/* "cdec/sa/int_list.pxi":174
* fread(self.arr, sizeof(int), self.len, f)
*
* def read(self, char* filename): # <<<<<<<<<<<<<<
@@ -7901,7 +7939,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_33read(struct __pyx_obj_4cdec_
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("read", 0);
- /* "int_list.pxi":176
+ /* "cdec/sa/int_list.pxi":176
* def read(self, char* filename):
* cdef FILE* f
* f = fopen(filename, "r") # <<<<<<<<<<<<<<
@@ -7910,7 +7948,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_33read(struct __pyx_obj_4cdec_
*/
__pyx_v_f = fopen(__pyx_v_filename, __pyx_k_r);
- /* "int_list.pxi":177
+ /* "cdec/sa/int_list.pxi":177
* cdef FILE* f
* f = fopen(filename, "r")
* self.read_handle(f) # <<<<<<<<<<<<<<
@@ -7918,14 +7956,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_33read(struct __pyx_obj_4cdec_
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->__pyx_vtab)->read_handle(__pyx_v_self, __pyx_v_f);
- /* "int_list.pxi":178
+ /* "cdec/sa/int_list.pxi":178
* f = fopen(filename, "r")
* self.read_handle(f)
* fclose(f) # <<<<<<<<<<<<<<
*/
fclose(__pyx_v_f);
- /* "int_list.pxi":174
+ /* "cdec/sa/int_list.pxi":174
* fread(self.arr, sizeof(int), self.len, f)
*
* def read(self, char* filename): # <<<<<<<<<<<<<<
@@ -7940,7 +7978,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7IntList_33read(struct __pyx_obj_4cdec_
return __pyx_r;
}
-/* "str_map.pxi":13
+/* "cdec/sa/str_map.pxi":13
* cdef int index(self, char *s)
*
* def __cinit__(self): # <<<<<<<<<<<<<<
@@ -7969,7 +8007,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9StringMap___cinit__(struct __pyx_obj_4cdec_2
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "str_map.pxi":14
+ /* "cdec/sa/str_map.pxi":14
*
* def __cinit__(self):
* self.vocab = stringmap_new() # <<<<<<<<<<<<<<
@@ -7978,7 +8016,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9StringMap___cinit__(struct __pyx_obj_4cdec_2
*/
__pyx_v_self->vocab = stringmap_new();
- /* "str_map.pxi":13
+ /* "cdec/sa/str_map.pxi":13
* cdef int index(self, char *s)
*
* def __cinit__(self): # <<<<<<<<<<<<<<
@@ -7992,7 +8030,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9StringMap___cinit__(struct __pyx_obj_4cdec_2
return __pyx_r;
}
-/* "str_map.pxi":16
+/* "cdec/sa/str_map.pxi":16
* self.vocab = stringmap_new()
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -8015,7 +8053,7 @@ static void __pyx_pf_4cdec_2sa_3_sa_9StringMap_2__dealloc__(struct __pyx_obj_4cd
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "str_map.pxi":17
+ /* "cdec/sa/str_map.pxi":17
*
* def __dealloc__(self):
* stringmap_delete(self.vocab) # <<<<<<<<<<<<<<
@@ -8024,7 +8062,7 @@ static void __pyx_pf_4cdec_2sa_3_sa_9StringMap_2__dealloc__(struct __pyx_obj_4cd
*/
stringmap_delete(__pyx_v_self->vocab);
- /* "str_map.pxi":16
+ /* "cdec/sa/str_map.pxi":16
* self.vocab = stringmap_new()
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -8036,7 +8074,7 @@ static void __pyx_pf_4cdec_2sa_3_sa_9StringMap_2__dealloc__(struct __pyx_obj_4cd
__Pyx_RefNannyFinishContext();
}
-/* "str_map.pxi":19
+/* "cdec/sa/str_map.pxi":19
* stringmap_delete(self.vocab)
*
* cdef char *word(self, int i): # <<<<<<<<<<<<<<
@@ -8049,7 +8087,7 @@ static char *__pyx_f_4cdec_2sa_3_sa_9StringMap_word(struct __pyx_obj_4cdec_2sa_3
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("word", 0);
- /* "str_map.pxi":20
+ /* "cdec/sa/str_map.pxi":20
*
* cdef char *word(self, int i):
* return stringmap_word(self.vocab, i) # <<<<<<<<<<<<<<
@@ -8059,7 +8097,7 @@ static char *__pyx_f_4cdec_2sa_3_sa_9StringMap_word(struct __pyx_obj_4cdec_2sa_3
__pyx_r = stringmap_word(__pyx_v_self->vocab, __pyx_v_i);
goto __pyx_L0;
- /* "str_map.pxi":19
+ /* "cdec/sa/str_map.pxi":19
* stringmap_delete(self.vocab)
*
* cdef char *word(self, int i): # <<<<<<<<<<<<<<
@@ -8073,7 +8111,7 @@ static char *__pyx_f_4cdec_2sa_3_sa_9StringMap_word(struct __pyx_obj_4cdec_2sa_3
return __pyx_r;
}
-/* "str_map.pxi":22
+/* "cdec/sa/str_map.pxi":22
* return stringmap_word(self.vocab, i)
*
* cdef int index(self, char *s): # <<<<<<<<<<<<<<
@@ -8085,7 +8123,7 @@ static int __pyx_f_4cdec_2sa_3_sa_9StringMap_index(struct __pyx_obj_4cdec_2sa_3_
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("index", 0);
- /* "str_map.pxi":23
+ /* "cdec/sa/str_map.pxi":23
*
* cdef int index(self, char *s):
* return stringmap_index(self.vocab, s) # <<<<<<<<<<<<<<
@@ -8093,7 +8131,7 @@ static int __pyx_f_4cdec_2sa_3_sa_9StringMap_index(struct __pyx_obj_4cdec_2sa_3_
__pyx_r = stringmap_index(__pyx_v_self->vocab, __pyx_v_s);
goto __pyx_L0;
- /* "str_map.pxi":22
+ /* "cdec/sa/str_map.pxi":22
* return stringmap_word(self.vocab, i)
*
* cdef int index(self, char *s): # <<<<<<<<<<<<<<
@@ -8106,7 +8144,7 @@ static int __pyx_f_4cdec_2sa_3_sa_9StringMap_index(struct __pyx_obj_4cdec_2sa_3_
return __pyx_r;
}
-/* "data_array.pxi":17
+/* "cdec/sa/data_array.pxi":17
* cdef bint use_sent_id
*
* def __cinit__(self, from_binary=None, from_text=None, side=None, bint use_sent_id=False): # <<<<<<<<<<<<<<
@@ -8219,7 +8257,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9DataArray___cinit__(struct __pyx_obj_4cdec_2
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "data_array.pxi":18
+ /* "cdec/sa/data_array.pxi":18
*
* def __cinit__(self, from_binary=None, from_text=None, side=None, bint use_sent_id=False):
* self.word2id = {"END_OF_FILE":0, "END_OF_LINE":1} # <<<<<<<<<<<<<<
@@ -8236,7 +8274,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9DataArray___cinit__(struct __pyx_obj_4cdec_2
__pyx_v_self->word2id = __pyx_t_1;
__pyx_t_1 = 0;
- /* "data_array.pxi":19
+ /* "cdec/sa/data_array.pxi":19
* def __cinit__(self, from_binary=None, from_text=None, side=None, bint use_sent_id=False):
* self.word2id = {"END_OF_FILE":0, "END_OF_LINE":1}
* self.id2word = ["END_OF_FILE", "END_OF_LINE"] # <<<<<<<<<<<<<<
@@ -8257,7 +8295,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9DataArray___cinit__(struct __pyx_obj_4cdec_2
__pyx_v_self->id2word = __pyx_t_1;
__pyx_t_1 = 0;
- /* "data_array.pxi":20
+ /* "cdec/sa/data_array.pxi":20
* self.word2id = {"END_OF_FILE":0, "END_OF_LINE":1}
* self.id2word = ["END_OF_FILE", "END_OF_LINE"]
* self.data = IntList(1000,1000) # <<<<<<<<<<<<<<
@@ -8272,7 +8310,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9DataArray___cinit__(struct __pyx_obj_4cdec_2
__pyx_v_self->data = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "data_array.pxi":21
+ /* "cdec/sa/data_array.pxi":21
* self.id2word = ["END_OF_FILE", "END_OF_LINE"]
* self.data = IntList(1000,1000)
* self.sent_id = IntList(1000,1000) # <<<<<<<<<<<<<<
@@ -8287,7 +8325,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9DataArray___cinit__(struct __pyx_obj_4cdec_2
__pyx_v_self->sent_id = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "data_array.pxi":22
+ /* "cdec/sa/data_array.pxi":22
* self.data = IntList(1000,1000)
* self.sent_id = IntList(1000,1000)
* self.sent_index = IntList(1000,1000) # <<<<<<<<<<<<<<
@@ -8302,7 +8340,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9DataArray___cinit__(struct __pyx_obj_4cdec_2
__pyx_v_self->sent_index = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "data_array.pxi":23
+ /* "cdec/sa/data_array.pxi":23
* self.sent_id = IntList(1000,1000)
* self.sent_index = IntList(1000,1000)
* self.use_sent_id = use_sent_id # <<<<<<<<<<<<<<
@@ -8311,7 +8349,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9DataArray___cinit__(struct __pyx_obj_4cdec_2
*/
__pyx_v_self->use_sent_id = __pyx_v_use_sent_id;
- /* "data_array.pxi":24
+ /* "cdec/sa/data_array.pxi":24
* self.sent_index = IntList(1000,1000)
* self.use_sent_id = use_sent_id
* if from_binary: # <<<<<<<<<<<<<<
@@ -8321,7 +8359,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9DataArray___cinit__(struct __pyx_obj_4cdec_2
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_from_binary); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_2) {
- /* "data_array.pxi":25
+ /* "cdec/sa/data_array.pxi":25
* self.use_sent_id = use_sent_id
* if from_binary:
* self.read_binary(from_binary) # <<<<<<<<<<<<<<
@@ -8359,7 +8397,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9DataArray___cinit__(struct __pyx_obj_4cdec_2
goto __pyx_L3;
}
- /* "data_array.pxi":26
+ /* "cdec/sa/data_array.pxi":26
* if from_binary:
* self.read_binary(from_binary)
* elif from_text: # <<<<<<<<<<<<<<
@@ -8369,7 +8407,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9DataArray___cinit__(struct __pyx_obj_4cdec_2
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_from_text); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_2) {
- /* "data_array.pxi":27
+ /* "cdec/sa/data_array.pxi":27
* self.read_binary(from_binary)
* elif from_text:
* if side: # <<<<<<<<<<<<<<
@@ -8379,7 +8417,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9DataArray___cinit__(struct __pyx_obj_4cdec_2
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_side); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_2) {
- /* "data_array.pxi":28
+ /* "cdec/sa/data_array.pxi":28
* elif from_text:
* if side:
* self.read_bitext(from_text, (0 if side == 'source' else 1)) # <<<<<<<<<<<<<<
@@ -8428,7 +8466,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9DataArray___cinit__(struct __pyx_obj_4cdec_2
}
/*else*/ {
- /* "data_array.pxi":30
+ /* "cdec/sa/data_array.pxi":30
* self.read_bitext(from_text, (0 if side == 'source' else 1))
* else:
* self.read_text(from_text) # <<<<<<<<<<<<<<
@@ -8469,7 +8507,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9DataArray___cinit__(struct __pyx_obj_4cdec_2
}
__pyx_L3:;
- /* "data_array.pxi":17
+ /* "cdec/sa/data_array.pxi":17
* cdef bint use_sent_id
*
* def __cinit__(self, from_binary=None, from_text=None, side=None, bint use_sent_id=False): # <<<<<<<<<<<<<<
@@ -8493,7 +8531,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9DataArray___cinit__(struct __pyx_obj_4cdec_2
return __pyx_r;
}
-/* "data_array.pxi":32
+/* "cdec/sa/data_array.pxi":32
* self.read_text(from_text)
*
* def __len__(self): # <<<<<<<<<<<<<<
@@ -8524,7 +8562,7 @@ static Py_ssize_t __pyx_pf_4cdec_2sa_3_sa_9DataArray_2__len__(struct __pyx_obj_4
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__len__", 0);
- /* "data_array.pxi":33
+ /* "cdec/sa/data_array.pxi":33
*
* def __len__(self):
* return len(self.data) # <<<<<<<<<<<<<<
@@ -8538,7 +8576,7 @@ static Py_ssize_t __pyx_pf_4cdec_2sa_3_sa_9DataArray_2__len__(struct __pyx_obj_4
__pyx_r = __pyx_t_2;
goto __pyx_L0;
- /* "data_array.pxi":32
+ /* "cdec/sa/data_array.pxi":32
* self.read_text(from_text)
*
* def __len__(self): # <<<<<<<<<<<<<<
@@ -8556,7 +8594,7 @@ static Py_ssize_t __pyx_pf_4cdec_2sa_3_sa_9DataArray_2__len__(struct __pyx_obj_4
return __pyx_r;
}
-/* "data_array.pxi":35
+/* "cdec/sa/data_array.pxi":35
* return len(self.data)
*
* def get_sentence_id(self, i): # <<<<<<<<<<<<<<
@@ -8587,7 +8625,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_4get_sentence_id(struct __py
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("get_sentence_id", 0);
- /* "data_array.pxi":36
+ /* "cdec/sa/data_array.pxi":36
*
* def get_sentence_id(self, i):
* return self.sent_id.arr[i] # <<<<<<<<<<<<<<
@@ -8602,7 +8640,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_4get_sentence_id(struct __py
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "data_array.pxi":35
+ /* "cdec/sa/data_array.pxi":35
* return len(self.data)
*
* def get_sentence_id(self, i): # <<<<<<<<<<<<<<
@@ -8621,7 +8659,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_4get_sentence_id(struct __py
return __pyx_r;
}
-/* "data_array.pxi":38
+/* "cdec/sa/data_array.pxi":38
* return self.sent_id.arr[i]
*
* def get_sentence(self, i): # <<<<<<<<<<<<<<
@@ -8659,7 +8697,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_6get_sentence(struct __pyx_o
__Pyx_RefNannySetupContext("get_sentence", 0);
__Pyx_INCREF(__pyx_v_i);
- /* "data_array.pxi":40
+ /* "cdec/sa/data_array.pxi":40
* def get_sentence(self, i):
* cdef int j, start, stop
* sent = [] # <<<<<<<<<<<<<<
@@ -8671,7 +8709,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_6get_sentence(struct __pyx_o
__pyx_v_sent = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "data_array.pxi":41
+ /* "cdec/sa/data_array.pxi":41
* cdef int j, start, stop
* sent = []
* start = self.sent_index.arr[i] # <<<<<<<<<<<<<<
@@ -8681,7 +8719,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_6get_sentence(struct __pyx_o
__pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_start = (__pyx_v_self->sent_index->arr[__pyx_t_2]);
- /* "data_array.pxi":42
+ /* "cdec/sa/data_array.pxi":42
* sent = []
* start = self.sent_index.arr[i]
* stop = self.sent_index.arr[i+1] # <<<<<<<<<<<<<<
@@ -8694,7 +8732,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_6get_sentence(struct __pyx_o
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_stop = (__pyx_v_self->sent_index->arr[__pyx_t_2]);
- /* "data_array.pxi":43
+ /* "cdec/sa/data_array.pxi":43
* start = self.sent_index.arr[i]
* stop = self.sent_index.arr[i+1]
* for i from start <= i < stop: # <<<<<<<<<<<<<<
@@ -8708,7 +8746,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_6get_sentence(struct __pyx_o
__Pyx_DECREF_SET(__pyx_v_i, __pyx_t_1);
__pyx_t_1 = 0;
- /* "data_array.pxi":44
+ /* "cdec/sa/data_array.pxi":44
* stop = self.sent_index.arr[i+1]
* for i from start <= i < stop:
* sent.append(self.id2word[self.data.arr[i]]) # <<<<<<<<<<<<<<
@@ -8723,7 +8761,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_6get_sentence(struct __pyx_o
__pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_i); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- /* "data_array.pxi":43
+ /* "cdec/sa/data_array.pxi":43
* start = self.sent_index.arr[i]
* stop = self.sent_index.arr[i+1]
* for i from start <= i < stop: # <<<<<<<<<<<<<<
@@ -8735,7 +8773,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_6get_sentence(struct __pyx_o
__Pyx_DECREF_SET(__pyx_v_i, __pyx_t_1);
__pyx_t_1 = 0;
- /* "data_array.pxi":45
+ /* "cdec/sa/data_array.pxi":45
* for i from start <= i < stop:
* sent.append(self.id2word[self.data.arr[i]])
* return sent # <<<<<<<<<<<<<<
@@ -8747,7 +8785,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_6get_sentence(struct __pyx_o
__pyx_r = __pyx_v_sent;
goto __pyx_L0;
- /* "data_array.pxi":38
+ /* "cdec/sa/data_array.pxi":38
* return self.sent_id.arr[i]
*
* def get_sentence(self, i): # <<<<<<<<<<<<<<
@@ -8768,7 +8806,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_6get_sentence(struct __pyx_o
return __pyx_r;
}
-/* "data_array.pxi":47
+/* "cdec/sa/data_array.pxi":47
* return sent
*
* def get_id(self, word): # <<<<<<<<<<<<<<
@@ -8802,7 +8840,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_8get_id(struct __pyx_obj_4cd
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("get_id", 0);
- /* "data_array.pxi":48
+ /* "cdec/sa/data_array.pxi":48
*
* def get_id(self, word):
* if not word in self.word2id: # <<<<<<<<<<<<<<
@@ -8813,7 +8851,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_8get_id(struct __pyx_obj_4cd
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "data_array.pxi":49
+ /* "cdec/sa/data_array.pxi":49
* def get_id(self, word):
* if not word in self.word2id:
* self.word2id[word] = len(self.id2word) # <<<<<<<<<<<<<<
@@ -8829,7 +8867,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_8get_id(struct __pyx_obj_4cd
if (unlikely(PyObject_SetItem(__pyx_v_self->word2id, __pyx_v_word, __pyx_t_3) < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "data_array.pxi":50
+ /* "cdec/sa/data_array.pxi":50
* if not word in self.word2id:
* self.word2id[word] = len(self.id2word)
* self.id2word.append(word) # <<<<<<<<<<<<<<
@@ -8841,7 +8879,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_8get_id(struct __pyx_obj_4cd
}
__pyx_L3:;
- /* "data_array.pxi":51
+ /* "cdec/sa/data_array.pxi":51
* self.word2id[word] = len(self.id2word)
* self.id2word.append(word)
* return self.word2id[word] # <<<<<<<<<<<<<<
@@ -8855,7 +8893,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_8get_id(struct __pyx_obj_4cd
__pyx_t_3 = 0;
goto __pyx_L0;
- /* "data_array.pxi":47
+ /* "cdec/sa/data_array.pxi":47
* return sent
*
* def get_id(self, word): # <<<<<<<<<<<<<<
@@ -8874,7 +8912,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_8get_id(struct __pyx_obj_4cd
return __pyx_r;
}
-/* "data_array.pxi":53
+/* "cdec/sa/data_array.pxi":53
* return self.word2id[word]
*
* def __getitem__(self, loc): # <<<<<<<<<<<<<<
@@ -8905,7 +8943,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_10__getitem__(struct __pyx_o
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__getitem__", 0);
- /* "data_array.pxi":54
+ /* "cdec/sa/data_array.pxi":54
*
* def __getitem__(self, loc):
* return self.id2word[self.data.arr[loc]] # <<<<<<<<<<<<<<
@@ -8920,7 +8958,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_10__getitem__(struct __pyx_o
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "data_array.pxi":53
+ /* "cdec/sa/data_array.pxi":53
* return self.word2id[word]
*
* def __getitem__(self, loc): # <<<<<<<<<<<<<<
@@ -8939,7 +8977,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_10__getitem__(struct __pyx_o
return __pyx_r;
}
-/* "data_array.pxi":56
+/* "cdec/sa/data_array.pxi":56
* return self.id2word[self.data.arr[loc]]
*
* def get_sentence_bounds(self, loc): # <<<<<<<<<<<<<<
@@ -8973,7 +9011,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_12get_sentence_bounds(struct
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("get_sentence_bounds", 0);
- /* "data_array.pxi":57
+ /* "cdec/sa/data_array.pxi":57
*
* def get_sentence_bounds(self, loc):
* cdef int sid = self.sent_id.arr[loc] # <<<<<<<<<<<<<<
@@ -8983,7 +9021,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_12get_sentence_bounds(struct
__pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_loc); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_sid = (__pyx_v_self->sent_id->arr[__pyx_t_1]);
- /* "data_array.pxi":58
+ /* "cdec/sa/data_array.pxi":58
* def get_sentence_bounds(self, loc):
* cdef int sid = self.sent_id.arr[loc]
* return (self.sent_index.arr[sid], self.sent_index.arr[sid+1]) # <<<<<<<<<<<<<<
@@ -9007,7 +9045,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_12get_sentence_bounds(struct
__pyx_t_4 = 0;
goto __pyx_L0;
- /* "data_array.pxi":56
+ /* "cdec/sa/data_array.pxi":56
* return self.id2word[self.data.arr[loc]]
*
* def get_sentence_bounds(self, loc): # <<<<<<<<<<<<<<
@@ -9028,7 +9066,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_12get_sentence_bounds(struct
return __pyx_r;
}
-/* "data_array.pxi":60
+/* "cdec/sa/data_array.pxi":60
* return (self.sent_index.arr[sid], self.sent_index.arr[sid+1])
*
* def write_text(self, char* filename): # <<<<<<<<<<<<<<
@@ -9088,7 +9126,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_14write_text(struct __pyx_ob
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("write_text", 0);
- /* "data_array.pxi":61
+ /* "cdec/sa/data_array.pxi":61
*
* def write_text(self, char* filename):
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -9144,7 +9182,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_14write_text(struct __pyx_ob
__pyx_v_f = __pyx_t_4;
__pyx_t_4 = 0;
- /* "data_array.pxi":62
+ /* "cdec/sa/data_array.pxi":62
* def write_text(self, char* filename):
* with open(filename, "w") as f:
* for w_id in self.data: # <<<<<<<<<<<<<<
@@ -9191,7 +9229,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_14write_text(struct __pyx_ob
__Pyx_XDECREF_SET(__pyx_v_w_id, __pyx_t_1);
__pyx_t_1 = 0;
- /* "data_array.pxi":63
+ /* "cdec/sa/data_array.pxi":63
* with open(filename, "w") as f:
* for w_id in self.data:
* if w_id > 1: # <<<<<<<<<<<<<<
@@ -9203,7 +9241,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_14write_text(struct __pyx_ob
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_11) {
- /* "data_array.pxi":64
+ /* "cdec/sa/data_array.pxi":64
* for w_id in self.data:
* if w_id > 1:
* f.write("%s " % self.get_word(w_id)) # <<<<<<<<<<<<<<
@@ -9273,7 +9311,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_14write_text(struct __pyx_ob
}
__pyx_L17:;
- /* "data_array.pxi":65
+ /* "cdec/sa/data_array.pxi":65
* if w_id > 1:
* f.write("%s " % self.get_word(w_id))
* if w_id == 1: # <<<<<<<<<<<<<<
@@ -9285,7 +9323,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_14write_text(struct __pyx_ob
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_11) {
- /* "data_array.pxi":66
+ /* "cdec/sa/data_array.pxi":66
* f.write("%s " % self.get_word(w_id))
* if w_id == 1:
* f.write("\n") # <<<<<<<<<<<<<<
@@ -9302,7 +9340,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_14write_text(struct __pyx_ob
}
__pyx_L18:;
- /* "data_array.pxi":62
+ /* "cdec/sa/data_array.pxi":62
* def write_text(self, char* filename):
* with open(filename, "w") as f:
* for w_id in self.data: # <<<<<<<<<<<<<<
@@ -9325,7 +9363,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_14write_text(struct __pyx_ob
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "data_array.pxi":61
+ /* "cdec/sa/data_array.pxi":61
*
* def write_text(self, char* filename):
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -9396,7 +9434,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_14write_text(struct __pyx_ob
__pyx_L22:;
}
- /* "data_array.pxi":60
+ /* "cdec/sa/data_array.pxi":60
* return (self.sent_index.arr[sid], self.sent_index.arr[sid+1])
*
* def write_text(self, char* filename): # <<<<<<<<<<<<<<
@@ -9425,7 +9463,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_14write_text(struct __pyx_ob
return __pyx_r;
}
-/* "data_array.pxi":68
+/* "cdec/sa/data_array.pxi":68
* f.write("\n")
*
* def read_text(self, char* filename): # <<<<<<<<<<<<<<
@@ -9480,7 +9518,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_16read_text(struct __pyx_obj
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("read_text", 0);
- /* "data_array.pxi":69
+ /* "cdec/sa/data_array.pxi":69
*
* def read_text(self, char* filename):
* with gzip_or_text(filename) as fp: # <<<<<<<<<<<<<<
@@ -9553,7 +9591,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_16read_text(struct __pyx_obj
__pyx_v_fp = __pyx_t_5;
__pyx_t_5 = 0;
- /* "data_array.pxi":70
+ /* "cdec/sa/data_array.pxi":70
* def read_text(self, char* filename):
* with gzip_or_text(filename) as fp:
* self.read_text_data(fp) # <<<<<<<<<<<<<<
@@ -9600,7 +9638,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_16read_text(struct __pyx_obj
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "data_array.pxi":69
+ /* "cdec/sa/data_array.pxi":69
*
* def read_text(self, char* filename):
* with gzip_or_text(filename) as fp: # <<<<<<<<<<<<<<
@@ -9671,7 +9709,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_16read_text(struct __pyx_obj
__pyx_L18:;
}
- /* "data_array.pxi":68
+ /* "cdec/sa/data_array.pxi":68
* f.write("\n")
*
* def read_text(self, char* filename): # <<<<<<<<<<<<<<
@@ -9697,7 +9735,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_16read_text(struct __pyx_obj
return __pyx_r;
}
-/* "data_array.pxi":72
+/* "cdec/sa/data_array.pxi":72
* self.read_text_data(fp)
*
* def read_bitext(self, char* filename, int side): # <<<<<<<<<<<<<<
@@ -9765,9 +9803,9 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9DataArray_19read_bitext(PyObject *__py
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_2sa_3_sa_9DataArray_11read_bitext_2generator6(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4cdec_2sa_3_sa_9DataArray_11read_bitext_2generator7(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-/* "data_array.pxi":74
+/* "cdec/sa/data_array.pxi":74
* def read_bitext(self, char* filename, int side):
* with gzip_or_text(filename) as fp:
* data = (line.split(' ||| ')[side] for line in fp) # <<<<<<<<<<<<<<
@@ -9793,7 +9831,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_11read_bitext_genexpr(PyObje
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
{
- __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_9DataArray_11read_bitext_2generator6, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_read_bitext_locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_9DataArray_11read_bitext_2generator7, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_read_bitext_locals_genexpr); 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;
@@ -9809,7 +9847,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_11read_bitext_genexpr(PyObje
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_2sa_3_sa_9DataArray_11read_bitext_2generator6(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4cdec_2sa_3_sa_9DataArray_11read_bitext_2generator7(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr *)__pyx_generator->closure);
PyObject *__pyx_r = NULL;
@@ -9919,7 +9957,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_9DataArray_11read_bitext_2generator6(__
return NULL;
}
-/* "data_array.pxi":72
+/* "cdec/sa/data_array.pxi":72
* self.read_text_data(fp)
*
* def read_bitext(self, char* filename, int side): # <<<<<<<<<<<<<<
@@ -9956,7 +9994,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_18read_bitext(struct __pyx_o
__Pyx_GOTREF(__pyx_cur_scope);
__pyx_cur_scope->__pyx_v_side = __pyx_v_side;
- /* "data_array.pxi":73
+ /* "cdec/sa/data_array.pxi":73
*
* def read_bitext(self, char* filename, int side):
* with gzip_or_text(filename) as fp: # <<<<<<<<<<<<<<
@@ -10030,7 +10068,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_18read_bitext(struct __pyx_o
__pyx_cur_scope->__pyx_v_fp = __pyx_t_5;
__pyx_t_5 = 0;
- /* "data_array.pxi":74
+ /* "cdec/sa/data_array.pxi":74
* def read_bitext(self, char* filename, int side):
* with gzip_or_text(filename) as fp:
* data = (line.split(' ||| ')[side] for line in fp) # <<<<<<<<<<<<<<
@@ -10042,7 +10080,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_18read_bitext(struct __pyx_o
__pyx_v_data = __pyx_t_5;
__pyx_t_5 = 0;
- /* "data_array.pxi":75
+ /* "cdec/sa/data_array.pxi":75
* with gzip_or_text(filename) as fp:
* data = (line.split(' ||| ')[side] for line in fp)
* self.read_text_data(data) # <<<<<<<<<<<<<<
@@ -10089,7 +10127,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_18read_bitext(struct __pyx_o
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "data_array.pxi":73
+ /* "cdec/sa/data_array.pxi":73
*
* def read_bitext(self, char* filename, int side):
* with gzip_or_text(filename) as fp: # <<<<<<<<<<<<<<
@@ -10160,7 +10198,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_18read_bitext(struct __pyx_o
__pyx_L18:;
}
- /* "data_array.pxi":72
+ /* "cdec/sa/data_array.pxi":72
* self.read_text_data(fp)
*
* def read_bitext(self, char* filename, int side): # <<<<<<<<<<<<<<
@@ -10187,7 +10225,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_18read_bitext(struct __pyx_o
return __pyx_r;
}
-/* "data_array.pxi":77
+/* "cdec/sa/data_array.pxi":77
* self.read_text_data(data)
*
* def read_text_data(self, data): # <<<<<<<<<<<<<<
@@ -10233,7 +10271,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_20read_text_data(struct __py
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("read_text_data", 0);
- /* "data_array.pxi":78
+ /* "cdec/sa/data_array.pxi":78
*
* def read_text_data(self, data):
* cdef int word_count = 0 # <<<<<<<<<<<<<<
@@ -10242,7 +10280,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_20read_text_data(struct __py
*/
__pyx_v_word_count = 0;
- /* "data_array.pxi":79
+ /* "cdec/sa/data_array.pxi":79
* def read_text_data(self, data):
* cdef int word_count = 0
* for line_num, line in enumerate(data): # <<<<<<<<<<<<<<
@@ -10298,7 +10336,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_20read_text_data(struct __py
__pyx_t_1 = __pyx_t_5;
__pyx_t_5 = 0;
- /* "data_array.pxi":80
+ /* "cdec/sa/data_array.pxi":80
* cdef int word_count = 0
* for line_num, line in enumerate(data):
* self.sent_index.append(word_count) # <<<<<<<<<<<<<<
@@ -10310,7 +10348,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_20read_text_data(struct __py
__pyx_t_6 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->sent_index), __pyx_t_5); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "data_array.pxi":81
+ /* "cdec/sa/data_array.pxi":81
* for line_num, line in enumerate(data):
* self.sent_index.append(word_count)
* for word in line.split(): # <<<<<<<<<<<<<<
@@ -10378,7 +10416,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_20read_text_data(struct __py
__Pyx_XDECREF_SET(__pyx_v_word, __pyx_t_5);
__pyx_t_5 = 0;
- /* "data_array.pxi":82
+ /* "cdec/sa/data_array.pxi":82
* self.sent_index.append(word_count)
* for word in line.split():
* self.data.append(self.get_id(word)) # <<<<<<<<<<<<<<
@@ -10415,7 +10453,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_20read_text_data(struct __py
__pyx_t_6 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->data), __pyx_t_5); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "data_array.pxi":83
+ /* "cdec/sa/data_array.pxi":83
* for word in line.split():
* self.data.append(self.get_id(word))
* if self.use_sent_id: # <<<<<<<<<<<<<<
@@ -10425,7 +10463,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_20read_text_data(struct __py
__pyx_t_13 = (__pyx_v_self->use_sent_id != 0);
if (__pyx_t_13) {
- /* "data_array.pxi":84
+ /* "cdec/sa/data_array.pxi":84
* self.data.append(self.get_id(word))
* if self.use_sent_id:
* self.sent_id.append(line_num) # <<<<<<<<<<<<<<
@@ -10437,7 +10475,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_20read_text_data(struct __py
}
__pyx_L7:;
- /* "data_array.pxi":85
+ /* "cdec/sa/data_array.pxi":85
* if self.use_sent_id:
* self.sent_id.append(line_num)
* word_count = word_count + 1 # <<<<<<<<<<<<<<
@@ -10446,7 +10484,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_20read_text_data(struct __py
*/
__pyx_v_word_count = (__pyx_v_word_count + 1);
- /* "data_array.pxi":81
+ /* "cdec/sa/data_array.pxi":81
* for line_num, line in enumerate(data):
* self.sent_index.append(word_count)
* for word in line.split(): # <<<<<<<<<<<<<<
@@ -10456,7 +10494,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_20read_text_data(struct __py
}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "data_array.pxi":86
+ /* "cdec/sa/data_array.pxi":86
* self.sent_id.append(line_num)
* word_count = word_count + 1
* self.data.append(1) # <<<<<<<<<<<<<<
@@ -10465,7 +10503,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_20read_text_data(struct __py
*/
__pyx_t_6 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->data), __pyx_int_1); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "data_array.pxi":87
+ /* "cdec/sa/data_array.pxi":87
* word_count = word_count + 1
* self.data.append(1)
* if self.use_sent_id: # <<<<<<<<<<<<<<
@@ -10475,7 +10513,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_20read_text_data(struct __py
__pyx_t_13 = (__pyx_v_self->use_sent_id != 0);
if (__pyx_t_13) {
- /* "data_array.pxi":88
+ /* "cdec/sa/data_array.pxi":88
* self.data.append(1)
* if self.use_sent_id:
* self.sent_id.append(line_num) # <<<<<<<<<<<<<<
@@ -10487,7 +10525,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_20read_text_data(struct __py
}
__pyx_L8:;
- /* "data_array.pxi":89
+ /* "cdec/sa/data_array.pxi":89
* if self.use_sent_id:
* self.sent_id.append(line_num)
* word_count = word_count + 1 # <<<<<<<<<<<<<<
@@ -10496,7 +10534,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_20read_text_data(struct __py
*/
__pyx_v_word_count = (__pyx_v_word_count + 1);
- /* "data_array.pxi":79
+ /* "cdec/sa/data_array.pxi":79
* def read_text_data(self, data):
* cdef int word_count = 0
* for line_num, line in enumerate(data): # <<<<<<<<<<<<<<
@@ -10507,7 +10545,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_20read_text_data(struct __py
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "data_array.pxi":90
+ /* "cdec/sa/data_array.pxi":90
* self.sent_id.append(line_num)
* word_count = word_count + 1
* self.data.append(0) # <<<<<<<<<<<<<<
@@ -10516,7 +10554,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_20read_text_data(struct __py
*/
__pyx_t_6 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->data), __pyx_int_0); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "data_array.pxi":91
+ /* "cdec/sa/data_array.pxi":91
* word_count = word_count + 1
* self.data.append(0)
* self.sent_index.append(word_count) # <<<<<<<<<<<<<<
@@ -10528,7 +10566,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_20read_text_data(struct __py
__pyx_t_6 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->sent_index), __pyx_t_1); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "data_array.pxi":77
+ /* "cdec/sa/data_array.pxi":77
* self.read_text_data(data)
*
* def read_text_data(self, data): # <<<<<<<<<<<<<<
@@ -10558,7 +10596,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_20read_text_data(struct __py
return __pyx_r;
}
-/* "data_array.pxi":94
+/* "cdec/sa/data_array.pxi":94
*
*
* def read_binary(self, char* filename): # <<<<<<<<<<<<<<
@@ -10598,7 +10636,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_22read_binary(struct __pyx_o
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("read_binary", 0);
- /* "data_array.pxi":96
+ /* "cdec/sa/data_array.pxi":96
* def read_binary(self, char* filename):
* cdef FILE* f
* f = fopen(filename, "r") # <<<<<<<<<<<<<<
@@ -10607,7 +10645,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_22read_binary(struct __pyx_o
*/
__pyx_v_f = fopen(__pyx_v_filename, __pyx_k_r);
- /* "data_array.pxi":97
+ /* "cdec/sa/data_array.pxi":97
* cdef FILE* f
* f = fopen(filename, "r")
* self.read_handle(f) # <<<<<<<<<<<<<<
@@ -10616,7 +10654,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_22read_binary(struct __pyx_o
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_DataArray *)__pyx_v_self->__pyx_vtab)->read_handle(__pyx_v_self, __pyx_v_f);
- /* "data_array.pxi":98
+ /* "cdec/sa/data_array.pxi":98
* f = fopen(filename, "r")
* self.read_handle(f)
* fclose(f) # <<<<<<<<<<<<<<
@@ -10625,7 +10663,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_22read_binary(struct __pyx_o
*/
fclose(__pyx_v_f);
- /* "data_array.pxi":94
+ /* "cdec/sa/data_array.pxi":94
*
*
* def read_binary(self, char* filename): # <<<<<<<<<<<<<<
@@ -10640,7 +10678,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_22read_binary(struct __pyx_o
return __pyx_r;
}
-/* "data_array.pxi":100
+/* "cdec/sa/data_array.pxi":100
* fclose(f)
*
* cdef void read_handle(self, FILE* f): # <<<<<<<<<<<<<<
@@ -10666,7 +10704,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_read_handle(struct __pyx_obj_4cdec
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("read_handle", 0);
- /* "data_array.pxi":105
+ /* "cdec/sa/data_array.pxi":105
* cdef char* word
*
* self.data.read_handle(f) # <<<<<<<<<<<<<<
@@ -10675,7 +10713,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_read_handle(struct __pyx_obj_4cdec
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->data->__pyx_vtab)->read_handle(__pyx_v_self->data, __pyx_v_f);
- /* "data_array.pxi":106
+ /* "cdec/sa/data_array.pxi":106
*
* self.data.read_handle(f)
* self.sent_index.read_handle(f) # <<<<<<<<<<<<<<
@@ -10684,7 +10722,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_read_handle(struct __pyx_obj_4cdec
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->sent_index->__pyx_vtab)->read_handle(__pyx_v_self->sent_index, __pyx_v_f);
- /* "data_array.pxi":107
+ /* "cdec/sa/data_array.pxi":107
* self.data.read_handle(f)
* self.sent_index.read_handle(f)
* self.sent_id.read_handle(f) # <<<<<<<<<<<<<<
@@ -10693,7 +10731,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_read_handle(struct __pyx_obj_4cdec
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->sent_id->__pyx_vtab)->read_handle(__pyx_v_self->sent_id, __pyx_v_f);
- /* "data_array.pxi":108
+ /* "cdec/sa/data_array.pxi":108
* self.sent_index.read_handle(f)
* self.sent_id.read_handle(f)
* fread(&(num_words), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -10702,7 +10740,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_read_handle(struct __pyx_obj_4cdec
*/
fread((&__pyx_v_num_words), (sizeof(int)), 1, __pyx_v_f);
- /* "data_array.pxi":109
+ /* "cdec/sa/data_array.pxi":109
* self.sent_id.read_handle(f)
* fread(&(num_words), sizeof(int), 1, f)
* for i in range(num_words): # <<<<<<<<<<<<<<
@@ -10713,7 +10751,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_read_handle(struct __pyx_obj_4cdec
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "data_array.pxi":110
+ /* "cdec/sa/data_array.pxi":110
* fread(&(num_words), sizeof(int), 1, f)
* for i in range(num_words):
* fread(&(word_len), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -10722,7 +10760,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_read_handle(struct __pyx_obj_4cdec
*/
fread((&__pyx_v_word_len), (sizeof(int)), 1, __pyx_v_f);
- /* "data_array.pxi":111
+ /* "cdec/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)) # <<<<<<<<<<<<<<
@@ -10731,7 +10769,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_read_handle(struct __pyx_obj_4cdec
*/
__pyx_v_word = ((char *)malloc((__pyx_v_word_len * (sizeof(char)))));
- /* "data_array.pxi":112
+ /* "cdec/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) # <<<<<<<<<<<<<<
@@ -10740,7 +10778,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_read_handle(struct __pyx_obj_4cdec
*/
fread(__pyx_v_word, (sizeof(char)), __pyx_v_word_len, __pyx_v_f);
- /* "data_array.pxi":113
+ /* "cdec/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) # <<<<<<<<<<<<<<
@@ -10759,7 +10797,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_read_handle(struct __pyx_obj_4cdec
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "data_array.pxi":114
+ /* "cdec/sa/data_array.pxi":114
* fread(word, sizeof(char), word_len, f)
* self.word2id[word] = len(self.id2word)
* self.id2word.append(word) # <<<<<<<<<<<<<<
@@ -10771,7 +10809,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_read_handle(struct __pyx_obj_4cdec
__pyx_t_6 = __Pyx_PyObject_Append(__pyx_v_self->id2word, __pyx_t_3); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "data_array.pxi":115
+ /* "cdec/sa/data_array.pxi":115
* self.word2id[word] = len(self.id2word)
* self.id2word.append(word)
* free(word) # <<<<<<<<<<<<<<
@@ -10781,7 +10819,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_read_handle(struct __pyx_obj_4cdec
free(__pyx_v_word);
}
- /* "data_array.pxi":116
+ /* "cdec/sa/data_array.pxi":116
* self.id2word.append(word)
* free(word)
* if len(self.sent_id) == 0: # <<<<<<<<<<<<<<
@@ -10795,7 +10833,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_read_handle(struct __pyx_obj_4cdec
__pyx_t_7 = ((__pyx_t_4 == 0) != 0);
if (__pyx_t_7) {
- /* "data_array.pxi":117
+ /* "cdec/sa/data_array.pxi":117
* free(word)
* if len(self.sent_id) == 0:
* self.use_sent_id = False # <<<<<<<<<<<<<<
@@ -10807,7 +10845,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_read_handle(struct __pyx_obj_4cdec
}
/*else*/ {
- /* "data_array.pxi":119
+ /* "cdec/sa/data_array.pxi":119
* self.use_sent_id = False
* else:
* self.use_sent_id = True # <<<<<<<<<<<<<<
@@ -10818,7 +10856,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_read_handle(struct __pyx_obj_4cdec
}
__pyx_L5:;
- /* "data_array.pxi":100
+ /* "cdec/sa/data_array.pxi":100
* fclose(f)
*
* cdef void read_handle(self, FILE* f): # <<<<<<<<<<<<<<
@@ -10836,7 +10874,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_read_handle(struct __pyx_obj_4cdec
__Pyx_RefNannyFinishContext();
}
-/* "data_array.pxi":121
+/* "cdec/sa/data_array.pxi":121
* self.use_sent_id = True
*
* cdef void write_handle(self, FILE* f): # <<<<<<<<<<<<<<
@@ -10860,7 +10898,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_write_handle(struct __pyx_obj_4cde
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("write_handle", 0);
- /* "data_array.pxi":125
+ /* "cdec/sa/data_array.pxi":125
* cdef int num_words
*
* self.data.write_handle(f) # <<<<<<<<<<<<<<
@@ -10869,7 +10907,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_write_handle(struct __pyx_obj_4cde
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->data->__pyx_vtab)->write_handle(__pyx_v_self->data, __pyx_v_f);
- /* "data_array.pxi":126
+ /* "cdec/sa/data_array.pxi":126
*
* self.data.write_handle(f)
* self.sent_index.write_handle(f) # <<<<<<<<<<<<<<
@@ -10878,7 +10916,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_write_handle(struct __pyx_obj_4cde
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->sent_index->__pyx_vtab)->write_handle(__pyx_v_self->sent_index, __pyx_v_f);
- /* "data_array.pxi":127
+ /* "cdec/sa/data_array.pxi":127
* self.data.write_handle(f)
* self.sent_index.write_handle(f)
* self.sent_id.write_handle(f) # <<<<<<<<<<<<<<
@@ -10887,7 +10925,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_write_handle(struct __pyx_obj_4cde
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->sent_id->__pyx_vtab)->write_handle(__pyx_v_self->sent_id, __pyx_v_f);
- /* "data_array.pxi":128
+ /* "cdec/sa/data_array.pxi":128
* self.sent_index.write_handle(f)
* self.sent_id.write_handle(f)
* num_words = len(self.id2word) - 2 # <<<<<<<<<<<<<<
@@ -10900,7 +10938,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_write_handle(struct __pyx_obj_4cde
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_num_words = (__pyx_t_2 - 2);
- /* "data_array.pxi":129
+ /* "cdec/sa/data_array.pxi":129
* self.sent_id.write_handle(f)
* num_words = len(self.id2word) - 2
* fwrite(&(num_words), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -10909,7 +10947,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_write_handle(struct __pyx_obj_4cde
*/
fwrite((&__pyx_v_num_words), (sizeof(int)), 1, __pyx_v_f);
- /* "data_array.pxi":130
+ /* "cdec/sa/data_array.pxi":130
* num_words = len(self.id2word) - 2
* fwrite(&(num_words), sizeof(int), 1, f)
* for word in self.id2word[2:]: # <<<<<<<<<<<<<<
@@ -10959,7 +10997,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_write_handle(struct __pyx_obj_4cde
__Pyx_XDECREF_SET(__pyx_v_word, __pyx_t_1);
__pyx_t_1 = 0;
- /* "data_array.pxi":131
+ /* "cdec/sa/data_array.pxi":131
* fwrite(&(num_words), sizeof(int), 1, f)
* for word in self.id2word[2:]:
* word_len = len(word) + 1 # <<<<<<<<<<<<<<
@@ -10969,7 +11007,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_write_handle(struct __pyx_obj_4cde
__pyx_t_5 = PyObject_Length(__pyx_v_word); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_word_len = (__pyx_t_5 + 1);
- /* "data_array.pxi":132
+ /* "cdec/sa/data_array.pxi":132
* for word in self.id2word[2:]:
* word_len = len(word) + 1
* fwrite(&(word_len), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -10978,7 +11016,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_write_handle(struct __pyx_obj_4cde
*/
fwrite((&__pyx_v_word_len), (sizeof(int)), 1, __pyx_v_f);
- /* "data_array.pxi":133
+ /* "cdec/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) # <<<<<<<<<<<<<<
@@ -10988,7 +11026,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_write_handle(struct __pyx_obj_4cde
__pyx_t_6 = __Pyx_PyObject_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);
- /* "data_array.pxi":130
+ /* "cdec/sa/data_array.pxi":130
* num_words = len(self.id2word) - 2
* fwrite(&(num_words), sizeof(int), 1, f)
* for word in self.id2word[2:]: # <<<<<<<<<<<<<<
@@ -10998,7 +11036,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_write_handle(struct __pyx_obj_4cde
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "data_array.pxi":121
+ /* "cdec/sa/data_array.pxi":121
* self.use_sent_id = True
*
* cdef void write_handle(self, FILE* f): # <<<<<<<<<<<<<<
@@ -11017,7 +11055,7 @@ static void __pyx_f_4cdec_2sa_3_sa_9DataArray_write_handle(struct __pyx_obj_4cde
__Pyx_RefNannyFinishContext();
}
-/* "data_array.pxi":135
+/* "cdec/sa/data_array.pxi":135
* fwrite(<char *>word, sizeof(char), word_len, f)
*
* def write_binary(self, char* filename): # <<<<<<<<<<<<<<
@@ -11057,7 +11095,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_24write_binary(struct __pyx_
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("write_binary", 0);
- /* "data_array.pxi":137
+ /* "cdec/sa/data_array.pxi":137
* def write_binary(self, char* filename):
* cdef FILE* f
* f = fopen(filename, "w") # <<<<<<<<<<<<<<
@@ -11066,7 +11104,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_24write_binary(struct __pyx_
*/
__pyx_v_f = fopen(__pyx_v_filename, __pyx_k_w);
- /* "data_array.pxi":138
+ /* "cdec/sa/data_array.pxi":138
* cdef FILE* f
* f = fopen(filename, "w")
* self.write_handle(f) # <<<<<<<<<<<<<<
@@ -11075,7 +11113,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_24write_binary(struct __pyx_
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_DataArray *)__pyx_v_self->__pyx_vtab)->write_handle(__pyx_v_self, __pyx_v_f);
- /* "data_array.pxi":139
+ /* "cdec/sa/data_array.pxi":139
* f = fopen(filename, "w")
* self.write_handle(f)
* fclose(f) # <<<<<<<<<<<<<<
@@ -11084,7 +11122,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_24write_binary(struct __pyx_
*/
fclose(__pyx_v_f);
- /* "data_array.pxi":135
+ /* "cdec/sa/data_array.pxi":135
* fwrite(<char *>word, sizeof(char), word_len, f)
*
* def write_binary(self, char* filename): # <<<<<<<<<<<<<<
@@ -11099,7 +11137,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_24write_binary(struct __pyx_
return __pyx_r;
}
-/* "data_array.pxi":141
+/* "cdec/sa/data_array.pxi":141
* fclose(f)
*
* def write_enhanced_handle(self, f): # <<<<<<<<<<<<<<
@@ -11138,7 +11176,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_26write_enhanced_handle(stru
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("write_enhanced_handle", 0);
- /* "data_array.pxi":142
+ /* "cdec/sa/data_array.pxi":142
*
* def write_enhanced_handle(self, f):
* for i in self.data: # <<<<<<<<<<<<<<
@@ -11185,7 +11223,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_26write_enhanced_handle(stru
__Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4);
__pyx_t_4 = 0;
- /* "data_array.pxi":143
+ /* "cdec/sa/data_array.pxi":143
* def write_enhanced_handle(self, f):
* for i in self.data:
* f.write("%d " %i) # <<<<<<<<<<<<<<
@@ -11224,7 +11262,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_26write_enhanced_handle(stru
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "data_array.pxi":142
+ /* "cdec/sa/data_array.pxi":142
*
* def write_enhanced_handle(self, f):
* for i in self.data: # <<<<<<<<<<<<<<
@@ -11234,7 +11272,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_26write_enhanced_handle(stru
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "data_array.pxi":144
+ /* "cdec/sa/data_array.pxi":144
* for i in self.data:
* f.write("%d " %i)
* f.write("\n") # <<<<<<<<<<<<<<
@@ -11248,7 +11286,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_26write_enhanced_handle(stru
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "data_array.pxi":145
+ /* "cdec/sa/data_array.pxi":145
* f.write("%d " %i)
* f.write("\n")
* for i in self.sent_index: # <<<<<<<<<<<<<<
@@ -11295,7 +11333,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_26write_enhanced_handle(stru
__Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
__pyx_t_1 = 0;
- /* "data_array.pxi":146
+ /* "cdec/sa/data_array.pxi":146
* f.write("\n")
* for i in self.sent_index:
* f.write("%d " %i) # <<<<<<<<<<<<<<
@@ -11334,7 +11372,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_26write_enhanced_handle(stru
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "data_array.pxi":145
+ /* "cdec/sa/data_array.pxi":145
* f.write("%d " %i)
* f.write("\n")
* for i in self.sent_index: # <<<<<<<<<<<<<<
@@ -11344,7 +11382,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_26write_enhanced_handle(stru
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "data_array.pxi":147
+ /* "cdec/sa/data_array.pxi":147
* for i in self.sent_index:
* f.write("%d " %i)
* f.write("\n") # <<<<<<<<<<<<<<
@@ -11358,7 +11396,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_26write_enhanced_handle(stru
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "data_array.pxi":148
+ /* "cdec/sa/data_array.pxi":148
* f.write("%d " %i)
* f.write("\n")
* for i in self.sent_id: # <<<<<<<<<<<<<<
@@ -11405,7 +11443,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_26write_enhanced_handle(stru
__Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4);
__pyx_t_4 = 0;
- /* "data_array.pxi":149
+ /* "cdec/sa/data_array.pxi":149
* f.write("\n")
* for i in self.sent_id:
* f.write("%d " %i) # <<<<<<<<<<<<<<
@@ -11444,7 +11482,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_26write_enhanced_handle(stru
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "data_array.pxi":148
+ /* "cdec/sa/data_array.pxi":148
* f.write("%d " %i)
* f.write("\n")
* for i in self.sent_id: # <<<<<<<<<<<<<<
@@ -11454,7 +11492,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_26write_enhanced_handle(stru
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "data_array.pxi":150
+ /* "cdec/sa/data_array.pxi":150
* for i in self.sent_id:
* f.write("%d " %i)
* f.write("\n") # <<<<<<<<<<<<<<
@@ -11468,7 +11506,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_26write_enhanced_handle(stru
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "data_array.pxi":151
+ /* "cdec/sa/data_array.pxi":151
* f.write("%d " %i)
* f.write("\n")
* for word in self.id2word: # <<<<<<<<<<<<<<
@@ -11515,7 +11553,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_26write_enhanced_handle(stru
__Pyx_XDECREF_SET(__pyx_v_word, __pyx_t_1);
__pyx_t_1 = 0;
- /* "data_array.pxi":152
+ /* "cdec/sa/data_array.pxi":152
* f.write("\n")
* for word in self.id2word:
* f.write("%s %d " % (word, self.word2id[word])) # <<<<<<<<<<<<<<
@@ -11565,7 +11603,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_26write_enhanced_handle(stru
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "data_array.pxi":151
+ /* "cdec/sa/data_array.pxi":151
* f.write("%d " %i)
* f.write("\n")
* for word in self.id2word: # <<<<<<<<<<<<<<
@@ -11575,7 +11613,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_26write_enhanced_handle(stru
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "data_array.pxi":153
+ /* "cdec/sa/data_array.pxi":153
* for word in self.id2word:
* f.write("%s %d " % (word, self.word2id[word]))
* f.write("\n") # <<<<<<<<<<<<<<
@@ -11589,7 +11627,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_26write_enhanced_handle(stru
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "data_array.pxi":141
+ /* "cdec/sa/data_array.pxi":141
* fclose(f)
*
* def write_enhanced_handle(self, f): # <<<<<<<<<<<<<<
@@ -11617,7 +11655,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_26write_enhanced_handle(stru
return __pyx_r;
}
-/* "data_array.pxi":155
+/* "cdec/sa/data_array.pxi":155
* f.write("\n")
*
* def write_enhanced(self, char* filename): # <<<<<<<<<<<<<<
@@ -11672,7 +11710,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_28write_enhanced(struct __py
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("write_enhanced", 0);
- /* "data_array.pxi":156
+ /* "cdec/sa/data_array.pxi":156
*
* def write_enhanced(self, char* filename):
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -11727,7 +11765,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_28write_enhanced(struct __py
__pyx_v_f = __pyx_t_4;
__pyx_t_4 = 0;
- /* "data_array.pxi":157
+ /* "cdec/sa/data_array.pxi":157
* def write_enhanced(self, char* filename):
* with open(filename, "w") as f:
* self.write_enhanced_handle(self, f) # <<<<<<<<<<<<<<
@@ -11773,7 +11811,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_28write_enhanced(struct __py
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "data_array.pxi":156
+ /* "cdec/sa/data_array.pxi":156
*
* def write_enhanced(self, char* filename):
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -11843,7 +11881,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_28write_enhanced(struct __py
__pyx_L18:;
}
- /* "data_array.pxi":155
+ /* "cdec/sa/data_array.pxi":155
* f.write("\n")
*
* def write_enhanced(self, char* filename): # <<<<<<<<<<<<<<
@@ -11868,7 +11906,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9DataArray_28write_enhanced(struct __py
return __pyx_r;
}
-/* "data_array.pxi":10
+/* "cdec/sa/data_array.pxi":10
*
* cdef class DataArray:
* cdef public word2id # <<<<<<<<<<<<<<
@@ -11963,7 +12001,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9DataArray_7word2id_4__del__(struct __pyx_obj
return __pyx_r;
}
-/* "data_array.pxi":11
+/* "cdec/sa/data_array.pxi":11
* cdef class DataArray:
* cdef public word2id
* cdef public id2word # <<<<<<<<<<<<<<
@@ -12058,7 +12096,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9DataArray_7id2word_4__del__(struct __pyx_obj
return __pyx_r;
}
-/* "data_array.pxi":12
+/* "cdec/sa/data_array.pxi":12
* cdef public word2id
* cdef public id2word
* cdef public IntList data # <<<<<<<<<<<<<<
@@ -12166,7 +12204,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9DataArray_4data_4__del__(struct __pyx_obj_4c
return __pyx_r;
}
-/* "data_array.pxi":13
+/* "cdec/sa/data_array.pxi":13
* cdef public id2word
* cdef public IntList data
* cdef public IntList sent_id # <<<<<<<<<<<<<<
@@ -12274,7 +12312,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9DataArray_7sent_id_4__del__(struct __pyx_obj
return __pyx_r;
}
-/* "data_array.pxi":14
+/* "cdec/sa/data_array.pxi":14
* cdef public IntList data
* cdef public IntList sent_id
* cdef public IntList sent_index # <<<<<<<<<<<<<<
@@ -12387,7 +12425,7 @@ static int __pyx_f_4cdec_2sa_3_sa_9Alignment_link(CYTHON_UNUSED struct __pyx_obj
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("link", 0);
- /* "alignment.pxi":16
+ /* "cdec/sa/alignment.pxi":16
* cdef int link(self, int i, int j):
* """Integerizes an alignment link pair"""
* return i * ALIGNMENT_CODE + j # <<<<<<<<<<<<<<
@@ -12397,7 +12435,7 @@ static int __pyx_f_4cdec_2sa_3_sa_9Alignment_link(CYTHON_UNUSED struct __pyx_obj
__pyx_r = ((__pyx_v_i * __pyx_v_4cdec_2sa_3_sa_ALIGNMENT_CODE) + __pyx_v_j);
goto __pyx_L0;
- /* "alignment.pxi":14
+ /* "cdec/sa/alignment.pxi":14
* cdef IntList sent_index
*
* cdef int link(self, int i, int j): # <<<<<<<<<<<<<<
@@ -12411,7 +12449,7 @@ static int __pyx_f_4cdec_2sa_3_sa_9Alignment_link(CYTHON_UNUSED struct __pyx_obj
return __pyx_r;
}
-/* "alignment.pxi":18
+/* "cdec/sa/alignment.pxi":18
* return i * ALIGNMENT_CODE + j
*
* def unlink(self, link): # <<<<<<<<<<<<<<
@@ -12444,7 +12482,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_unlink(CYTHON_UNUSED struct
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("unlink", 0);
- /* "alignment.pxi":20
+ /* "cdec/sa/alignment.pxi":20
* def unlink(self, link):
* """De-integerizes an alignment link pair"""
* return (link / ALIGNMENT_CODE, link % ALIGNMENT_CODE) # <<<<<<<<<<<<<<
@@ -12474,7 +12512,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_unlink(CYTHON_UNUSED struct
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "alignment.pxi":18
+ /* "cdec/sa/alignment.pxi":18
* return i * ALIGNMENT_CODE + j
*
* def unlink(self, link): # <<<<<<<<<<<<<<
@@ -12495,7 +12533,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_unlink(CYTHON_UNUSED struct
return __pyx_r;
}
-/* "alignment.pxi":22
+/* "cdec/sa/alignment.pxi":22
* return (link / ALIGNMENT_CODE, link % ALIGNMENT_CODE)
*
* cdef _unlink(self, int link, int* f, int* e): # <<<<<<<<<<<<<<
@@ -12511,7 +12549,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_9Alignment__unlink(CYTHON_UNUSED struct
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_unlink", 0);
- /* "alignment.pxi":23
+ /* "cdec/sa/alignment.pxi":23
*
* cdef _unlink(self, int link, int* f, int* e):
* f[0] = link / ALIGNMENT_CODE # <<<<<<<<<<<<<<
@@ -12540,7 +12578,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_9Alignment__unlink(CYTHON_UNUSED struct
}
(__pyx_v_f[0]) = __Pyx_div_int(__pyx_v_link, __pyx_v_4cdec_2sa_3_sa_ALIGNMENT_CODE);
- /* "alignment.pxi":24
+ /* "cdec/sa/alignment.pxi":24
* cdef _unlink(self, int link, int* f, int* e):
* f[0] = link / ALIGNMENT_CODE
* e[0] = link % ALIGNMENT_CODE # <<<<<<<<<<<<<<
@@ -12559,7 +12597,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_9Alignment__unlink(CYTHON_UNUSED struct
}
(__pyx_v_e[0]) = __Pyx_mod_int(__pyx_v_link, __pyx_v_4cdec_2sa_3_sa_ALIGNMENT_CODE);
- /* "alignment.pxi":22
+ /* "cdec/sa/alignment.pxi":22
* return (link / ALIGNMENT_CODE, link % ALIGNMENT_CODE)
*
* cdef _unlink(self, int link, int* f, int* e): # <<<<<<<<<<<<<<
@@ -12579,7 +12617,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_9Alignment__unlink(CYTHON_UNUSED struct
return __pyx_r;
}
-/* "alignment.pxi":26
+/* "cdec/sa/alignment.pxi":26
* e[0] = link % ALIGNMENT_CODE
*
* def get_sent_links(self, int sent_id): # <<<<<<<<<<<<<<
@@ -12625,7 +12663,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_2get_sent_links(struct __pyx
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("get_sent_links", 0);
- /* "alignment.pxi":30
+ /* "cdec/sa/alignment.pxi":30
* cdef int* arr
* cdef int arr_len
* sent_links = IntList() # <<<<<<<<<<<<<<
@@ -12637,7 +12675,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_2get_sent_links(struct __pyx
__pyx_v_sent_links = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "alignment.pxi":31
+ /* "cdec/sa/alignment.pxi":31
* cdef int arr_len
* sent_links = IntList()
* arr = self._get_sent_links(sent_id, &arr_len) # <<<<<<<<<<<<<<
@@ -12646,7 +12684,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_2get_sent_links(struct __pyx
*/
__pyx_v_arr = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Alignment *)__pyx_v_self->__pyx_vtab)->_get_sent_links(__pyx_v_self, __pyx_v_sent_id, (&__pyx_v_arr_len));
- /* "alignment.pxi":32
+ /* "cdec/sa/alignment.pxi":32
* sent_links = IntList()
* arr = self._get_sent_links(sent_id, &arr_len)
* sent_links._extend_arr(arr, arr_len*2) # <<<<<<<<<<<<<<
@@ -12655,7 +12693,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_2get_sent_links(struct __pyx
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_sent_links->__pyx_vtab)->_extend_arr(__pyx_v_sent_links, __pyx_v_arr, (__pyx_v_arr_len * 2));
- /* "alignment.pxi":33
+ /* "cdec/sa/alignment.pxi":33
* arr = self._get_sent_links(sent_id, &arr_len)
* sent_links._extend_arr(arr, arr_len*2)
* free(arr) # <<<<<<<<<<<<<<
@@ -12664,7 +12702,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_2get_sent_links(struct __pyx
*/
free(__pyx_v_arr);
- /* "alignment.pxi":34
+ /* "cdec/sa/alignment.pxi":34
* sent_links._extend_arr(arr, arr_len*2)
* free(arr)
* return sent_links # <<<<<<<<<<<<<<
@@ -12676,7 +12714,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_2get_sent_links(struct __pyx
__pyx_r = ((PyObject *)__pyx_v_sent_links);
goto __pyx_L0;
- /* "alignment.pxi":26
+ /* "cdec/sa/alignment.pxi":26
* e[0] = link % ALIGNMENT_CODE
*
* def get_sent_links(self, int sent_id): # <<<<<<<<<<<<<<
@@ -12696,7 +12734,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_2get_sent_links(struct __pyx
return __pyx_r;
}
-/* "alignment.pxi":36
+/* "cdec/sa/alignment.pxi":36
* return sent_links
*
* cdef int* _get_sent_links(self, int sent_id, int* num_links): # <<<<<<<<<<<<<<
@@ -12718,7 +12756,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_9Alignment__get_sent_links(struct __pyx_obj_4
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_get_sent_links", 0);
- /* "alignment.pxi":39
+ /* "cdec/sa/alignment.pxi":39
* cdef int* sent_links
* cdef int i, start, end
* start = self.sent_index.arr[sent_id] # <<<<<<<<<<<<<<
@@ -12727,7 +12765,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_9Alignment__get_sent_links(struct __pyx_obj_4
*/
__pyx_v_start = (__pyx_v_self->sent_index->arr[__pyx_v_sent_id]);
- /* "alignment.pxi":40
+ /* "cdec/sa/alignment.pxi":40
* cdef int i, start, end
* start = self.sent_index.arr[sent_id]
* end = self.sent_index.arr[sent_id+1] # <<<<<<<<<<<<<<
@@ -12736,7 +12774,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_9Alignment__get_sent_links(struct __pyx_obj_4
*/
__pyx_v_end = (__pyx_v_self->sent_index->arr[(__pyx_v_sent_id + 1)]);
- /* "alignment.pxi":41
+ /* "cdec/sa/alignment.pxi":41
* start = self.sent_index.arr[sent_id]
* end = self.sent_index.arr[sent_id+1]
* num_links[0] = end - start # <<<<<<<<<<<<<<
@@ -12745,7 +12783,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_9Alignment__get_sent_links(struct __pyx_obj_4
*/
(__pyx_v_num_links[0]) = (__pyx_v_end - __pyx_v_start);
- /* "alignment.pxi":42
+ /* "cdec/sa/alignment.pxi":42
* end = self.sent_index.arr[sent_id+1]
* num_links[0] = end - start
* sent_links = <int*> malloc(2*num_links[0]*sizeof(int)) # <<<<<<<<<<<<<<
@@ -12754,7 +12792,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_9Alignment__get_sent_links(struct __pyx_obj_4
*/
__pyx_v_sent_links = ((int *)malloc(((2 * (__pyx_v_num_links[0])) * (sizeof(int)))));
- /* "alignment.pxi":43
+ /* "cdec/sa/alignment.pxi":43
* num_links[0] = end - start
* sent_links = <int*> malloc(2*num_links[0]*sizeof(int))
* for i from 0 <= i < num_links[0]: # <<<<<<<<<<<<<<
@@ -12764,7 +12802,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_9Alignment__get_sent_links(struct __pyx_obj_4
__pyx_t_1 = (__pyx_v_num_links[0]);
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {
- /* "alignment.pxi":44
+ /* "cdec/sa/alignment.pxi":44
* sent_links = <int*> malloc(2*num_links[0]*sizeof(int))
* for i from 0 <= i < num_links[0]:
* self._unlink(self.links.arr[start + i], sent_links + (2*i), sent_links + (2*i) + 1) # <<<<<<<<<<<<<<
@@ -12776,7 +12814,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_9Alignment__get_sent_links(struct __pyx_obj_4
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
}
- /* "alignment.pxi":45
+ /* "cdec/sa/alignment.pxi":45
* for i from 0 <= i < num_links[0]:
* self._unlink(self.links.arr[start + i], sent_links + (2*i), sent_links + (2*i) + 1)
* return sent_links # <<<<<<<<<<<<<<
@@ -12786,7 +12824,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_9Alignment__get_sent_links(struct __pyx_obj_4
__pyx_r = __pyx_v_sent_links;
goto __pyx_L0;
- /* "alignment.pxi":36
+ /* "cdec/sa/alignment.pxi":36
* return sent_links
*
* cdef int* _get_sent_links(self, int sent_id, int* num_links): # <<<<<<<<<<<<<<
@@ -12804,7 +12842,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_9Alignment__get_sent_links(struct __pyx_obj_4
return __pyx_r;
}
-/* "alignment.pxi":47
+/* "cdec/sa/alignment.pxi":47
* return sent_links
*
* def __cinit__(self, from_binary=None, from_text=None): # <<<<<<<<<<<<<<
@@ -12892,7 +12930,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9Alignment_4__cinit__(struct __pyx_obj_4cdec_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "alignment.pxi":48
+ /* "cdec/sa/alignment.pxi":48
*
* def __cinit__(self, from_binary=None, from_text=None):
* self.links = IntList(1000,1000) # <<<<<<<<<<<<<<
@@ -12907,7 +12945,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9Alignment_4__cinit__(struct __pyx_obj_4cdec_
__pyx_v_self->links = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "alignment.pxi":49
+ /* "cdec/sa/alignment.pxi":49
* def __cinit__(self, from_binary=None, from_text=None):
* self.links = IntList(1000,1000)
* self.sent_index = IntList(1000,1000) # <<<<<<<<<<<<<<
@@ -12922,7 +12960,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9Alignment_4__cinit__(struct __pyx_obj_4cdec_
__pyx_v_self->sent_index = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "alignment.pxi":50
+ /* "cdec/sa/alignment.pxi":50
* self.links = IntList(1000,1000)
* self.sent_index = IntList(1000,1000)
* if from_binary: # <<<<<<<<<<<<<<
@@ -12932,7 +12970,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9Alignment_4__cinit__(struct __pyx_obj_4cdec_
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_from_binary); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_2) {
- /* "alignment.pxi":51
+ /* "cdec/sa/alignment.pxi":51
* self.sent_index = IntList(1000,1000)
* if from_binary:
* self.read_binary(from_binary) # <<<<<<<<<<<<<<
@@ -12970,7 +13008,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9Alignment_4__cinit__(struct __pyx_obj_4cdec_
goto __pyx_L3;
}
- /* "alignment.pxi":52
+ /* "cdec/sa/alignment.pxi":52
* if from_binary:
* self.read_binary(from_binary)
* elif from_text: # <<<<<<<<<<<<<<
@@ -12980,7 +13018,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9Alignment_4__cinit__(struct __pyx_obj_4cdec_
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_from_text); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_2) {
- /* "alignment.pxi":53
+ /* "cdec/sa/alignment.pxi":53
* self.read_binary(from_binary)
* elif from_text:
* self.read_text(from_text) # <<<<<<<<<<<<<<
@@ -13019,7 +13057,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9Alignment_4__cinit__(struct __pyx_obj_4cdec_
}
__pyx_L3:;
- /* "alignment.pxi":47
+ /* "cdec/sa/alignment.pxi":47
* return sent_links
*
* def __cinit__(self, from_binary=None, from_text=None): # <<<<<<<<<<<<<<
@@ -13042,7 +13080,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9Alignment_4__cinit__(struct __pyx_obj_4cdec_
return __pyx_r;
}
-/* "alignment.pxi":55
+/* "cdec/sa/alignment.pxi":55
* self.read_text(from_text)
*
* def read_text(self, char* filename): # <<<<<<<<<<<<<<
@@ -13111,7 +13149,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_6read_text(struct __pyx_obj_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("read_text", 0);
- /* "alignment.pxi":56
+ /* "cdec/sa/alignment.pxi":56
*
* def read_text(self, char* filename):
* with gzip_or_text(filename) as f: # <<<<<<<<<<<<<<
@@ -13184,7 +13222,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_6read_text(struct __pyx_obj_
__pyx_v_f = __pyx_t_5;
__pyx_t_5 = 0;
- /* "alignment.pxi":57
+ /* "cdec/sa/alignment.pxi":57
* def read_text(self, char* filename):
* with gzip_or_text(filename) as f:
* for line in f: # <<<<<<<<<<<<<<
@@ -13231,7 +13269,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_6read_text(struct __pyx_obj_
__Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_1);
__pyx_t_1 = 0;
- /* "alignment.pxi":58
+ /* "cdec/sa/alignment.pxi":58
* with gzip_or_text(filename) as f:
* for line in f:
* self.sent_index.append(len(self.links)) # <<<<<<<<<<<<<<
@@ -13247,7 +13285,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_6read_text(struct __pyx_obj_
__pyx_t_13 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->sent_index), __pyx_t_1); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "alignment.pxi":59
+ /* "cdec/sa/alignment.pxi":59
* for line in f:
* self.sent_index.append(len(self.links))
* pairs = line.split() # <<<<<<<<<<<<<<
@@ -13277,7 +13315,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_6read_text(struct __pyx_obj_
__Pyx_XDECREF_SET(__pyx_v_pairs, __pyx_t_1);
__pyx_t_1 = 0;
- /* "alignment.pxi":60
+ /* "cdec/sa/alignment.pxi":60
* self.sent_index.append(len(self.links))
* pairs = line.split()
* for pair in pairs: # <<<<<<<<<<<<<<
@@ -13324,7 +13362,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_6read_text(struct __pyx_obj_
__Pyx_XDECREF_SET(__pyx_v_pair, __pyx_t_2);
__pyx_t_2 = 0;
- /* "alignment.pxi":61
+ /* "cdec/sa/alignment.pxi":61
* pairs = line.split()
* for pair in pairs:
* (i, j) = map(int, pair.split('-')) # <<<<<<<<<<<<<<
@@ -13402,7 +13440,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_6read_text(struct __pyx_obj_
__Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_4);
__pyx_t_4 = 0;
- /* "alignment.pxi":62
+ /* "cdec/sa/alignment.pxi":62
* for pair in pairs:
* (i, j) = map(int, pair.split('-'))
* self.links.append(self.link(i, j)) # <<<<<<<<<<<<<<
@@ -13416,7 +13454,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_6read_text(struct __pyx_obj_
__pyx_t_13 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->links), __pyx_t_3); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "alignment.pxi":60
+ /* "cdec/sa/alignment.pxi":60
* self.sent_index.append(len(self.links))
* pairs = line.split()
* for pair in pairs: # <<<<<<<<<<<<<<
@@ -13426,7 +13464,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_6read_text(struct __pyx_obj_
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "alignment.pxi":57
+ /* "cdec/sa/alignment.pxi":57
* def read_text(self, char* filename):
* with gzip_or_text(filename) as f:
* for line in f: # <<<<<<<<<<<<<<
@@ -13436,7 +13474,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_6read_text(struct __pyx_obj_
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "alignment.pxi":63
+ /* "cdec/sa/alignment.pxi":63
* (i, j) = map(int, pair.split('-'))
* self.links.append(self.link(i, j))
* self.sent_index.append(len(self.links)) # <<<<<<<<<<<<<<
@@ -13464,7 +13502,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_6read_text(struct __pyx_obj_
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "alignment.pxi":56
+ /* "cdec/sa/alignment.pxi":56
*
* def read_text(self, char* filename):
* with gzip_or_text(filename) as f: # <<<<<<<<<<<<<<
@@ -13535,7 +13573,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_6read_text(struct __pyx_obj_
__pyx_L24:;
}
- /* "alignment.pxi":55
+ /* "cdec/sa/alignment.pxi":55
* self.read_text(from_text)
*
* def read_text(self, char* filename): # <<<<<<<<<<<<<<
@@ -13567,7 +13605,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_6read_text(struct __pyx_obj_
return __pyx_r;
}
-/* "alignment.pxi":65
+/* "cdec/sa/alignment.pxi":65
* self.sent_index.append(len(self.links))
*
* def read_binary(self, char* filename): # <<<<<<<<<<<<<<
@@ -13607,7 +13645,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_8read_binary(struct __pyx_ob
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("read_binary", 0);
- /* "alignment.pxi":67
+ /* "cdec/sa/alignment.pxi":67
* def read_binary(self, char* filename):
* cdef FILE* f
* f = fopen(filename, "r") # <<<<<<<<<<<<<<
@@ -13616,7 +13654,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_8read_binary(struct __pyx_ob
*/
__pyx_v_f = fopen(__pyx_v_filename, __pyx_k_r);
- /* "alignment.pxi":68
+ /* "cdec/sa/alignment.pxi":68
* cdef FILE* f
* f = fopen(filename, "r")
* self.links.read_handle(f) # <<<<<<<<<<<<<<
@@ -13625,7 +13663,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_8read_binary(struct __pyx_ob
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->links->__pyx_vtab)->read_handle(__pyx_v_self->links, __pyx_v_f);
- /* "alignment.pxi":69
+ /* "cdec/sa/alignment.pxi":69
* f = fopen(filename, "r")
* self.links.read_handle(f)
* self.sent_index.read_handle(f) # <<<<<<<<<<<<<<
@@ -13634,7 +13672,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_8read_binary(struct __pyx_ob
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->sent_index->__pyx_vtab)->read_handle(__pyx_v_self->sent_index, __pyx_v_f);
- /* "alignment.pxi":70
+ /* "cdec/sa/alignment.pxi":70
* self.links.read_handle(f)
* self.sent_index.read_handle(f)
* fclose(f) # <<<<<<<<<<<<<<
@@ -13643,7 +13681,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_8read_binary(struct __pyx_ob
*/
fclose(__pyx_v_f);
- /* "alignment.pxi":65
+ /* "cdec/sa/alignment.pxi":65
* self.sent_index.append(len(self.links))
*
* def read_binary(self, char* filename): # <<<<<<<<<<<<<<
@@ -13658,7 +13696,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_8read_binary(struct __pyx_ob
return __pyx_r;
}
-/* "alignment.pxi":72
+/* "cdec/sa/alignment.pxi":72
* fclose(f)
*
* def write_text(self, char* filename): # <<<<<<<<<<<<<<
@@ -13721,7 +13759,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_10write_text(struct __pyx_ob
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("write_text", 0);
- /* "alignment.pxi":73
+ /* "cdec/sa/alignment.pxi":73
*
* def write_text(self, char* filename):
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -13777,7 +13815,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_10write_text(struct __pyx_ob
__pyx_v_f = __pyx_t_4;
__pyx_t_4 = 0;
- /* "alignment.pxi":74
+ /* "cdec/sa/alignment.pxi":74
* def write_text(self, char* filename):
* with open(filename, "w") as f:
* sent_num = 0 # <<<<<<<<<<<<<<
@@ -13787,7 +13825,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_10write_text(struct __pyx_ob
__Pyx_INCREF(__pyx_int_0);
__pyx_v_sent_num = __pyx_int_0;
- /* "alignment.pxi":75
+ /* "cdec/sa/alignment.pxi":75
* with open(filename, "w") as f:
* sent_num = 0
* for i, link in enumerate(self.links): # <<<<<<<<<<<<<<
@@ -13843,7 +13881,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_10write_text(struct __pyx_ob
__pyx_t_4 = __pyx_t_2;
__pyx_t_2 = 0;
- /* "alignment.pxi":76
+ /* "cdec/sa/alignment.pxi":76
* sent_num = 0
* for i, link in enumerate(self.links):
* while i >= self.sent_index[sent_num]: # <<<<<<<<<<<<<<
@@ -13859,7 +13897,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_10write_text(struct __pyx_ob
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (!__pyx_t_11) break;
- /* "alignment.pxi":77
+ /* "cdec/sa/alignment.pxi":77
* for i, link in enumerate(self.links):
* while i >= self.sent_index[sent_num]:
* f.write("\n") # <<<<<<<<<<<<<<
@@ -13873,7 +13911,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_10write_text(struct __pyx_ob
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "alignment.pxi":78
+ /* "cdec/sa/alignment.pxi":78
* while i >= self.sent_index[sent_num]:
* f.write("\n")
* sent_num = sent_num + 1 # <<<<<<<<<<<<<<
@@ -13886,7 +13924,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_10write_text(struct __pyx_ob
__pyx_t_2 = 0;
}
- /* "alignment.pxi":79
+ /* "cdec/sa/alignment.pxi":79
* f.write("\n")
* sent_num = sent_num + 1
* f.write("%d-%d " % self.unlink(link)) # <<<<<<<<<<<<<<
@@ -13953,7 +13991,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_10write_text(struct __pyx_ob
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "alignment.pxi":75
+ /* "cdec/sa/alignment.pxi":75
* with open(filename, "w") as f:
* sent_num = 0
* for i, link in enumerate(self.links): # <<<<<<<<<<<<<<
@@ -13964,7 +14002,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_10write_text(struct __pyx_ob
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "alignment.pxi":80
+ /* "cdec/sa/alignment.pxi":80
* sent_num = sent_num + 1
* f.write("%d-%d " % self.unlink(link))
* f.write("\n") # <<<<<<<<<<<<<<
@@ -13992,7 +14030,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_10write_text(struct __pyx_ob
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "alignment.pxi":73
+ /* "cdec/sa/alignment.pxi":73
*
* def write_text(self, char* filename):
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -14063,7 +14101,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_10write_text(struct __pyx_ob
__pyx_L22:;
}
- /* "alignment.pxi":72
+ /* "cdec/sa/alignment.pxi":72
* fclose(f)
*
* def write_text(self, char* filename): # <<<<<<<<<<<<<<
@@ -14095,7 +14133,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_10write_text(struct __pyx_ob
return __pyx_r;
}
-/* "alignment.pxi":82
+/* "cdec/sa/alignment.pxi":82
* f.write("\n")
*
* def write_binary(self, char* filename): # <<<<<<<<<<<<<<
@@ -14135,7 +14173,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_12write_binary(struct __pyx_
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("write_binary", 0);
- /* "alignment.pxi":84
+ /* "cdec/sa/alignment.pxi":84
* def write_binary(self, char* filename):
* cdef FILE* f
* f = fopen(filename, "w") # <<<<<<<<<<<<<<
@@ -14144,7 +14182,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_12write_binary(struct __pyx_
*/
__pyx_v_f = fopen(__pyx_v_filename, __pyx_k_w);
- /* "alignment.pxi":85
+ /* "cdec/sa/alignment.pxi":85
* cdef FILE* f
* f = fopen(filename, "w")
* self.links.write_handle(f) # <<<<<<<<<<<<<<
@@ -14153,7 +14191,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_12write_binary(struct __pyx_
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->links->__pyx_vtab)->write_handle(__pyx_v_self->links, __pyx_v_f);
- /* "alignment.pxi":86
+ /* "cdec/sa/alignment.pxi":86
* f = fopen(filename, "w")
* self.links.write_handle(f)
* self.sent_index.write_handle(f) # <<<<<<<<<<<<<<
@@ -14162,7 +14200,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_12write_binary(struct __pyx_
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->sent_index->__pyx_vtab)->write_handle(__pyx_v_self->sent_index, __pyx_v_f);
- /* "alignment.pxi":87
+ /* "cdec/sa/alignment.pxi":87
* self.links.write_handle(f)
* self.sent_index.write_handle(f)
* fclose(f) # <<<<<<<<<<<<<<
@@ -14171,7 +14209,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_12write_binary(struct __pyx_
*/
fclose(__pyx_v_f);
- /* "alignment.pxi":82
+ /* "cdec/sa/alignment.pxi":82
* f.write("\n")
*
* def write_binary(self, char* filename): # <<<<<<<<<<<<<<
@@ -14186,7 +14224,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_12write_binary(struct __pyx_
return __pyx_r;
}
-/* "alignment.pxi":89
+/* "cdec/sa/alignment.pxi":89
* fclose(f)
*
* def write_enhanced(self, char* filename): # <<<<<<<<<<<<<<
@@ -14246,7 +14284,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_14write_enhanced(struct __py
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("write_enhanced", 0);
- /* "alignment.pxi":90
+ /* "cdec/sa/alignment.pxi":90
*
* def write_enhanced(self, char* filename):
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -14302,7 +14340,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_14write_enhanced(struct __py
__pyx_v_f = __pyx_t_4;
__pyx_t_4 = 0;
- /* "alignment.pxi":91
+ /* "cdec/sa/alignment.pxi":91
* def write_enhanced(self, char* filename):
* with open(filename, "w") as f:
* for link in self.links: # <<<<<<<<<<<<<<
@@ -14349,7 +14387,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_14write_enhanced(struct __py
__Pyx_XDECREF_SET(__pyx_v_link, __pyx_t_1);
__pyx_t_1 = 0;
- /* "alignment.pxi":92
+ /* "cdec/sa/alignment.pxi":92
* with open(filename, "w") as f:
* for link in self.links:
* f.write("%d " % link) # <<<<<<<<<<<<<<
@@ -14388,7 +14426,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_14write_enhanced(struct __py
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "alignment.pxi":91
+ /* "cdec/sa/alignment.pxi":91
* def write_enhanced(self, char* filename):
* with open(filename, "w") as f:
* for link in self.links: # <<<<<<<<<<<<<<
@@ -14398,7 +14436,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_14write_enhanced(struct __py
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "alignment.pxi":93
+ /* "cdec/sa/alignment.pxi":93
* for link in self.links:
* f.write("%d " % link)
* f.write("\n") # <<<<<<<<<<<<<<
@@ -14412,7 +14450,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_14write_enhanced(struct __py
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "alignment.pxi":94
+ /* "cdec/sa/alignment.pxi":94
* f.write("%d " % link)
* f.write("\n")
* for i in self.sent_index: # <<<<<<<<<<<<<<
@@ -14459,7 +14497,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_14write_enhanced(struct __py
__Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4);
__pyx_t_4 = 0;
- /* "alignment.pxi":95
+ /* "cdec/sa/alignment.pxi":95
* f.write("\n")
* for i in self.sent_index:
* f.write("%d " % i) # <<<<<<<<<<<<<<
@@ -14498,7 +14536,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_14write_enhanced(struct __py
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "alignment.pxi":94
+ /* "cdec/sa/alignment.pxi":94
* f.write("%d " % link)
* f.write("\n")
* for i in self.sent_index: # <<<<<<<<<<<<<<
@@ -14508,7 +14546,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_14write_enhanced(struct __py
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "alignment.pxi":96
+ /* "cdec/sa/alignment.pxi":96
* for i in self.sent_index:
* f.write("%d " % i)
* f.write("\n") # <<<<<<<<<<<<<<
@@ -14534,7 +14572,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_14write_enhanced(struct __py
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "alignment.pxi":90
+ /* "cdec/sa/alignment.pxi":90
*
* def write_enhanced(self, char* filename):
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -14605,7 +14643,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_14write_enhanced(struct __py
__pyx_L22:;
}
- /* "alignment.pxi":89
+ /* "cdec/sa/alignment.pxi":89
* fclose(f)
*
* def write_enhanced(self, char* filename): # <<<<<<<<<<<<<<
@@ -14634,7 +14672,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_14write_enhanced(struct __py
return __pyx_r;
}
-/* "alignment.pxi":98
+/* "cdec/sa/alignment.pxi":98
* f.write("\n")
*
* def alignment(self, i): # <<<<<<<<<<<<<<
@@ -14676,7 +14714,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_16alignment(struct __pyx_obj
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("alignment", 0);
- /* "alignment.pxi":101
+ /* "cdec/sa/alignment.pxi":101
* """Return all (e,f) pairs for sentence i"""
* cdef int j, start, end
* result = [] # <<<<<<<<<<<<<<
@@ -14688,7 +14726,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_16alignment(struct __pyx_obj
__pyx_v_result = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "alignment.pxi":102
+ /* "cdec/sa/alignment.pxi":102
* cdef int j, start, end
* result = []
* start = self.sent_index.arr[i] # <<<<<<<<<<<<<<
@@ -14698,7 +14736,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_16alignment(struct __pyx_obj
__pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_start = (__pyx_v_self->sent_index->arr[__pyx_t_2]);
- /* "alignment.pxi":103
+ /* "cdec/sa/alignment.pxi":103
* result = []
* start = self.sent_index.arr[i]
* end = self.sent_index.arr[i+1] # <<<<<<<<<<<<<<
@@ -14711,7 +14749,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_16alignment(struct __pyx_obj
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_end = (__pyx_v_self->sent_index->arr[__pyx_t_2]);
- /* "alignment.pxi":104
+ /* "cdec/sa/alignment.pxi":104
* start = self.sent_index.arr[i]
* end = self.sent_index.arr[i+1]
* for j from start <= j < end: # <<<<<<<<<<<<<<
@@ -14721,7 +14759,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_16alignment(struct __pyx_obj
__pyx_t_3 = __pyx_v_end;
for (__pyx_v_j = __pyx_v_start; __pyx_v_j < __pyx_t_3; __pyx_v_j++) {
- /* "alignment.pxi":105
+ /* "cdec/sa/alignment.pxi":105
* end = self.sent_index.arr[i+1]
* for j from start <= j < end:
* result.append(self.unlink(self.links.arr[j])) # <<<<<<<<<<<<<<
@@ -14761,7 +14799,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_16alignment(struct __pyx_obj
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "alignment.pxi":106
+ /* "cdec/sa/alignment.pxi":106
* for j from start <= j < end:
* result.append(self.unlink(self.links.arr[j]))
* return result # <<<<<<<<<<<<<<
@@ -14771,7 +14809,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_16alignment(struct __pyx_obj
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "alignment.pxi":98
+ /* "cdec/sa/alignment.pxi":98
* f.write("\n")
*
* def alignment(self, i): # <<<<<<<<<<<<<<
@@ -14795,7 +14833,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9Alignment_16alignment(struct __pyx_obj
return __pyx_r;
}
-/* "bilex.pxi":15
+/* "cdec/sa/bilex.pxi":15
* int val
*
* cdef _node* new_node(int key): # <<<<<<<<<<<<<<
@@ -14809,7 +14847,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__node *__pyx_f_4cdec_2sa_3_sa_new_node(int
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("new_node", 0);
- /* "bilex.pxi":17
+ /* "cdec/sa/bilex.pxi":17
* cdef _node* new_node(int key):
* cdef _node* n
* n = <_node*> malloc(sizeof(_node)) # <<<<<<<<<<<<<<
@@ -14818,7 +14856,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__node *__pyx_f_4cdec_2sa_3_sa_new_node(int
*/
__pyx_v_n = ((struct __pyx_t_4cdec_2sa_3_sa__node *)malloc((sizeof(struct __pyx_t_4cdec_2sa_3_sa__node))));
- /* "bilex.pxi":18
+ /* "cdec/sa/bilex.pxi":18
* cdef _node* n
* n = <_node*> malloc(sizeof(_node))
* n.smaller = NULL # <<<<<<<<<<<<<<
@@ -14827,7 +14865,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__node *__pyx_f_4cdec_2sa_3_sa_new_node(int
*/
__pyx_v_n->smaller = NULL;
- /* "bilex.pxi":19
+ /* "cdec/sa/bilex.pxi":19
* n = <_node*> malloc(sizeof(_node))
* n.smaller = NULL
* n.bigger = NULL # <<<<<<<<<<<<<<
@@ -14836,7 +14874,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__node *__pyx_f_4cdec_2sa_3_sa_new_node(int
*/
__pyx_v_n->bigger = NULL;
- /* "bilex.pxi":20
+ /* "cdec/sa/bilex.pxi":20
* n.smaller = NULL
* n.bigger = NULL
* n.key = key # <<<<<<<<<<<<<<
@@ -14845,7 +14883,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__node *__pyx_f_4cdec_2sa_3_sa_new_node(int
*/
__pyx_v_n->key = __pyx_v_key;
- /* "bilex.pxi":21
+ /* "cdec/sa/bilex.pxi":21
* n.bigger = NULL
* n.key = key
* n.val = 0 # <<<<<<<<<<<<<<
@@ -14854,7 +14892,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__node *__pyx_f_4cdec_2sa_3_sa_new_node(int
*/
__pyx_v_n->val = 0;
- /* "bilex.pxi":22
+ /* "cdec/sa/bilex.pxi":22
* n.key = key
* n.val = 0
* return n # <<<<<<<<<<<<<<
@@ -14864,7 +14902,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__node *__pyx_f_4cdec_2sa_3_sa_new_node(int
__pyx_r = __pyx_v_n;
goto __pyx_L0;
- /* "bilex.pxi":15
+ /* "cdec/sa/bilex.pxi":15
* int val
*
* cdef _node* new_node(int key): # <<<<<<<<<<<<<<
@@ -14878,7 +14916,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__node *__pyx_f_4cdec_2sa_3_sa_new_node(int
return __pyx_r;
}
-/* "bilex.pxi":25
+/* "cdec/sa/bilex.pxi":25
*
*
* cdef del_node(_node* n): # <<<<<<<<<<<<<<
@@ -14896,7 +14934,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_del_node(struct __pyx_t_4cdec_2sa_3_sa__
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("del_node", 0);
- /* "bilex.pxi":26
+ /* "cdec/sa/bilex.pxi":26
*
* cdef del_node(_node* n):
* if n.smaller != NULL: # <<<<<<<<<<<<<<
@@ -14906,7 +14944,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_del_node(struct __pyx_t_4cdec_2sa_3_sa__
__pyx_t_1 = ((__pyx_v_n->smaller != NULL) != 0);
if (__pyx_t_1) {
- /* "bilex.pxi":27
+ /* "cdec/sa/bilex.pxi":27
* cdef del_node(_node* n):
* if n.smaller != NULL:
* del_node(n.smaller) # <<<<<<<<<<<<<<
@@ -14920,7 +14958,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_del_node(struct __pyx_t_4cdec_2sa_3_sa__
}
__pyx_L3:;
- /* "bilex.pxi":28
+ /* "cdec/sa/bilex.pxi":28
* if n.smaller != NULL:
* del_node(n.smaller)
* if n.bigger != NULL: # <<<<<<<<<<<<<<
@@ -14930,7 +14968,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_del_node(struct __pyx_t_4cdec_2sa_3_sa__
__pyx_t_1 = ((__pyx_v_n->bigger != NULL) != 0);
if (__pyx_t_1) {
- /* "bilex.pxi":29
+ /* "cdec/sa/bilex.pxi":29
* del_node(n.smaller)
* if n.bigger != NULL:
* del_node(n.bigger) # <<<<<<<<<<<<<<
@@ -14944,7 +14982,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_del_node(struct __pyx_t_4cdec_2sa_3_sa__
}
__pyx_L4:;
- /* "bilex.pxi":30
+ /* "cdec/sa/bilex.pxi":30
* if n.bigger != NULL:
* del_node(n.bigger)
* free(n) # <<<<<<<<<<<<<<
@@ -14953,7 +14991,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_del_node(struct __pyx_t_4cdec_2sa_3_sa__
*/
free(__pyx_v_n);
- /* "bilex.pxi":25
+ /* "cdec/sa/bilex.pxi":25
*
*
* cdef del_node(_node* n): # <<<<<<<<<<<<<<
@@ -14974,7 +15012,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_del_node(struct __pyx_t_4cdec_2sa_3_sa__
return __pyx_r;
}
-/* "bilex.pxi":32
+/* "cdec/sa/bilex.pxi":32
* free(n)
*
* cdef int* get_val(_node* n, int key): # <<<<<<<<<<<<<<
@@ -14988,7 +15026,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_get_val(struct __pyx_t_4cdec_2sa_3_sa__node *
int __pyx_t_1;
__Pyx_RefNannySetupContext("get_val", 0);
- /* "bilex.pxi":33
+ /* "cdec/sa/bilex.pxi":33
*
* cdef int* get_val(_node* n, int key):
* if key == n.key: # <<<<<<<<<<<<<<
@@ -14998,7 +15036,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_get_val(struct __pyx_t_4cdec_2sa_3_sa__node *
__pyx_t_1 = ((__pyx_v_key == __pyx_v_n->key) != 0);
if (__pyx_t_1) {
- /* "bilex.pxi":34
+ /* "cdec/sa/bilex.pxi":34
* cdef int* get_val(_node* n, int key):
* if key == n.key:
* return &n.val # <<<<<<<<<<<<<<
@@ -15009,7 +15047,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_get_val(struct __pyx_t_4cdec_2sa_3_sa__node *
goto __pyx_L0;
}
- /* "bilex.pxi":35
+ /* "cdec/sa/bilex.pxi":35
* if key == n.key:
* return &n.val
* elif key < n.key: # <<<<<<<<<<<<<<
@@ -15019,7 +15057,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_get_val(struct __pyx_t_4cdec_2sa_3_sa__node *
__pyx_t_1 = ((__pyx_v_key < __pyx_v_n->key) != 0);
if (__pyx_t_1) {
- /* "bilex.pxi":36
+ /* "cdec/sa/bilex.pxi":36
* return &n.val
* elif key < n.key:
* if n.smaller == NULL: # <<<<<<<<<<<<<<
@@ -15029,7 +15067,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_get_val(struct __pyx_t_4cdec_2sa_3_sa__node *
__pyx_t_1 = ((__pyx_v_n->smaller == NULL) != 0);
if (__pyx_t_1) {
- /* "bilex.pxi":37
+ /* "cdec/sa/bilex.pxi":37
* elif key < n.key:
* if n.smaller == NULL:
* n.smaller = new_node(key) # <<<<<<<<<<<<<<
@@ -15038,7 +15076,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_get_val(struct __pyx_t_4cdec_2sa_3_sa__node *
*/
__pyx_v_n->smaller = __pyx_f_4cdec_2sa_3_sa_new_node(__pyx_v_key);
- /* "bilex.pxi":38
+ /* "cdec/sa/bilex.pxi":38
* if n.smaller == NULL:
* n.smaller = new_node(key)
* return &(n.smaller.val) # <<<<<<<<<<<<<<
@@ -15049,7 +15087,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_get_val(struct __pyx_t_4cdec_2sa_3_sa__node *
goto __pyx_L0;
}
- /* "bilex.pxi":39
+ /* "cdec/sa/bilex.pxi":39
* n.smaller = new_node(key)
* return &(n.smaller.val)
* return get_val(n.smaller, key) # <<<<<<<<<<<<<<
@@ -15061,7 +15099,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_get_val(struct __pyx_t_4cdec_2sa_3_sa__node *
}
/*else*/ {
- /* "bilex.pxi":41
+ /* "cdec/sa/bilex.pxi":41
* return get_val(n.smaller, key)
* else:
* if n.bigger == NULL: # <<<<<<<<<<<<<<
@@ -15071,7 +15109,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_get_val(struct __pyx_t_4cdec_2sa_3_sa__node *
__pyx_t_1 = ((__pyx_v_n->bigger == NULL) != 0);
if (__pyx_t_1) {
- /* "bilex.pxi":42
+ /* "cdec/sa/bilex.pxi":42
* else:
* if n.bigger == NULL:
* n.bigger = new_node(key) # <<<<<<<<<<<<<<
@@ -15080,7 +15118,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_get_val(struct __pyx_t_4cdec_2sa_3_sa__node *
*/
__pyx_v_n->bigger = __pyx_f_4cdec_2sa_3_sa_new_node(__pyx_v_key);
- /* "bilex.pxi":43
+ /* "cdec/sa/bilex.pxi":43
* if n.bigger == NULL:
* n.bigger = new_node(key)
* return &(n.bigger.val) # <<<<<<<<<<<<<<
@@ -15091,7 +15129,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_get_val(struct __pyx_t_4cdec_2sa_3_sa__node *
goto __pyx_L0;
}
- /* "bilex.pxi":44
+ /* "cdec/sa/bilex.pxi":44
* n.bigger = new_node(key)
* return &(n.bigger.val)
* return get_val(n.bigger, key) # <<<<<<<<<<<<<<
@@ -15102,7 +15140,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_get_val(struct __pyx_t_4cdec_2sa_3_sa__node *
goto __pyx_L0;
}
- /* "bilex.pxi":32
+ /* "cdec/sa/bilex.pxi":32
* free(n)
*
* cdef int* get_val(_node* n, int key): # <<<<<<<<<<<<<<
@@ -15116,7 +15154,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_get_val(struct __pyx_t_4cdec_2sa_3_sa__node *
return __pyx_r;
}
-/* "bilex.pxi":54
+/* "cdec/sa/bilex.pxi":54
* cdef id2eword, id2fword, eword2id, fword2id
*
* def __cinit__(self, from_text=None, from_data=False, from_binary=None, # <<<<<<<<<<<<<<
@@ -15146,7 +15184,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_5BiLex_1__cinit__(PyObject *__pyx_v_self, PyO
values[1] = ((PyObject *)Py_False);
values[2] = ((PyObject *)Py_None);
- /* "bilex.pxi":55
+ /* "cdec/sa/bilex.pxi":55
*
* def __cinit__(self, from_text=None, from_data=False, from_binary=None,
* earray=None, fsarray=None, alignment=None): # <<<<<<<<<<<<<<
@@ -15234,7 +15272,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_5BiLex_1__cinit__(PyObject *__pyx_v_self, PyO
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_4cdec_2sa_3_sa_5BiLex___cinit__(((struct __pyx_obj_4cdec_2sa_3_sa_BiLex *)__pyx_v_self), __pyx_v_from_text, __pyx_v_from_data, __pyx_v_from_binary, __pyx_v_earray, __pyx_v_fsarray, __pyx_v_alignment);
- /* "bilex.pxi":54
+ /* "cdec/sa/bilex.pxi":54
* cdef id2eword, id2fword, eword2id, fword2id
*
* def __cinit__(self, from_text=None, from_data=False, from_binary=None, # <<<<<<<<<<<<<<
@@ -15260,7 +15298,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_5BiLex___cinit__(struct __pyx_obj_4cdec_2sa_3
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "bilex.pxi":56
+ /* "cdec/sa/bilex.pxi":56
* def __cinit__(self, from_text=None, from_data=False, from_binary=None,
* earray=None, fsarray=None, alignment=None):
* self.id2eword = [] # <<<<<<<<<<<<<<
@@ -15275,7 +15313,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_5BiLex___cinit__(struct __pyx_obj_4cdec_2sa_3
__pyx_v_self->id2eword = __pyx_t_1;
__pyx_t_1 = 0;
- /* "bilex.pxi":57
+ /* "cdec/sa/bilex.pxi":57
* earray=None, fsarray=None, alignment=None):
* self.id2eword = []
* self.id2fword = [] # <<<<<<<<<<<<<<
@@ -15290,7 +15328,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_5BiLex___cinit__(struct __pyx_obj_4cdec_2sa_3
__pyx_v_self->id2fword = __pyx_t_1;
__pyx_t_1 = 0;
- /* "bilex.pxi":58
+ /* "cdec/sa/bilex.pxi":58
* self.id2eword = []
* self.id2fword = []
* self.eword2id = {} # <<<<<<<<<<<<<<
@@ -15305,7 +15343,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_5BiLex___cinit__(struct __pyx_obj_4cdec_2sa_3
__pyx_v_self->eword2id = __pyx_t_1;
__pyx_t_1 = 0;
- /* "bilex.pxi":59
+ /* "cdec/sa/bilex.pxi":59
* self.id2fword = []
* self.eword2id = {}
* self.fword2id = {} # <<<<<<<<<<<<<<
@@ -15320,7 +15358,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_5BiLex___cinit__(struct __pyx_obj_4cdec_2sa_3
__pyx_v_self->fword2id = __pyx_t_1;
__pyx_t_1 = 0;
- /* "bilex.pxi":60
+ /* "cdec/sa/bilex.pxi":60
* self.eword2id = {}
* self.fword2id = {}
* self.e_index = IntList() # <<<<<<<<<<<<<<
@@ -15335,7 +15373,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_5BiLex___cinit__(struct __pyx_obj_4cdec_2sa_3
__pyx_v_self->e_index = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "bilex.pxi":61
+ /* "cdec/sa/bilex.pxi":61
* self.fword2id = {}
* self.e_index = IntList()
* self.f_index = IntList() # <<<<<<<<<<<<<<
@@ -15350,7 +15388,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_5BiLex___cinit__(struct __pyx_obj_4cdec_2sa_3
__pyx_v_self->f_index = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "bilex.pxi":62
+ /* "cdec/sa/bilex.pxi":62
* self.e_index = IntList()
* self.f_index = IntList()
* self.col1 = FloatList() # <<<<<<<<<<<<<<
@@ -15365,7 +15403,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_5BiLex___cinit__(struct __pyx_obj_4cdec_2sa_3
__pyx_v_self->col1 = ((struct __pyx_obj_4cdec_2sa_3_sa_FloatList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "bilex.pxi":63
+ /* "cdec/sa/bilex.pxi":63
* self.f_index = IntList()
* self.col1 = FloatList()
* self.col2 = FloatList() # <<<<<<<<<<<<<<
@@ -15380,7 +15418,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_5BiLex___cinit__(struct __pyx_obj_4cdec_2sa_3
__pyx_v_self->col2 = ((struct __pyx_obj_4cdec_2sa_3_sa_FloatList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "bilex.pxi":64
+ /* "cdec/sa/bilex.pxi":64
* self.col1 = FloatList()
* self.col2 = FloatList()
* if from_binary: # <<<<<<<<<<<<<<
@@ -15390,7 +15428,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_5BiLex___cinit__(struct __pyx_obj_4cdec_2sa_3
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_from_binary); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_2) {
- /* "bilex.pxi":65
+ /* "cdec/sa/bilex.pxi":65
* self.col2 = FloatList()
* if from_binary:
* self.read_binary(from_binary) # <<<<<<<<<<<<<<
@@ -15428,7 +15466,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_5BiLex___cinit__(struct __pyx_obj_4cdec_2sa_3
goto __pyx_L3;
}
- /* "bilex.pxi":66
+ /* "cdec/sa/bilex.pxi":66
* if from_binary:
* self.read_binary(from_binary)
* elif from_data: # <<<<<<<<<<<<<<
@@ -15438,7 +15476,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_5BiLex___cinit__(struct __pyx_obj_4cdec_2sa_3
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_from_data); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_2) {
- /* "bilex.pxi":67
+ /* "cdec/sa/bilex.pxi":67
* self.read_binary(from_binary)
* elif from_data:
* self.compute_from_data(fsarray, earray, alignment) # <<<<<<<<<<<<<<
@@ -15455,7 +15493,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_5BiLex___cinit__(struct __pyx_obj_4cdec_2sa_3
}
/*else*/ {
- /* "bilex.pxi":69
+ /* "cdec/sa/bilex.pxi":69
* self.compute_from_data(fsarray, earray, alignment)
* else:
* self.read_text(from_text) # <<<<<<<<<<<<<<
@@ -15493,7 +15531,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_5BiLex___cinit__(struct __pyx_obj_4cdec_2sa_3
}
__pyx_L3:;
- /* "bilex.pxi":54
+ /* "cdec/sa/bilex.pxi":54
* cdef id2eword, id2fword, eword2id, fword2id
*
* def __cinit__(self, from_text=None, from_data=False, from_binary=None, # <<<<<<<<<<<<<<
@@ -15516,7 +15554,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_5BiLex___cinit__(struct __pyx_obj_4cdec_2sa_3
return __pyx_r;
}
-/* "bilex.pxi":72
+/* "cdec/sa/bilex.pxi":72
*
*
* cdef compute_from_data(self, SuffixArray fsa, DataArray eda, Alignment aa): # <<<<<<<<<<<<<<
@@ -15570,7 +15608,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("compute_from_data", 0);
- /* "bilex.pxi":86
+ /* "cdec/sa/bilex.pxi":86
* cdef int null_word
*
* null_word = 0 # <<<<<<<<<<<<<<
@@ -15579,7 +15617,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
__pyx_v_null_word = 0;
- /* "bilex.pxi":87
+ /* "cdec/sa/bilex.pxi":87
*
* null_word = 0
* for word in fsa.darray.id2word: # I miss list comprehensions # <<<<<<<<<<<<<<
@@ -15626,7 +15664,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
__Pyx_XDECREF_SET(__pyx_v_word, __pyx_t_4);
__pyx_t_4 = 0;
- /* "bilex.pxi":88
+ /* "cdec/sa/bilex.pxi":88
* null_word = 0
* for word in fsa.darray.id2word: # I miss list comprehensions
* self.id2fword.append(word) # <<<<<<<<<<<<<<
@@ -15635,7 +15673,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
__pyx_t_5 = __Pyx_PyObject_Append(__pyx_v_self->id2fword, __pyx_v_word); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "bilex.pxi":87
+ /* "cdec/sa/bilex.pxi":87
*
* null_word = 0
* for word in fsa.darray.id2word: # I miss list comprehensions # <<<<<<<<<<<<<<
@@ -15645,7 +15683,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "bilex.pxi":89
+ /* "cdec/sa/bilex.pxi":89
* for word in fsa.darray.id2word: # I miss list comprehensions
* self.id2fword.append(word)
* self.id2fword[null_word] = "NULL" # <<<<<<<<<<<<<<
@@ -15654,7 +15692,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
if (unlikely(__Pyx_SetItemInt(__pyx_v_self->id2fword, __pyx_v_null_word, __pyx_n_s_NULL, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "bilex.pxi":90
+ /* "cdec/sa/bilex.pxi":90
* self.id2fword.append(word)
* self.id2fword[null_word] = "NULL"
* for id, word in enumerate(self.id2fword): # <<<<<<<<<<<<<<
@@ -15710,7 +15748,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
__pyx_t_1 = __pyx_t_6;
__pyx_t_6 = 0;
- /* "bilex.pxi":91
+ /* "cdec/sa/bilex.pxi":91
* self.id2fword[null_word] = "NULL"
* for id, word in enumerate(self.id2fword):
* self.fword2id[word] = id # <<<<<<<<<<<<<<
@@ -15719,7 +15757,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
if (unlikely(PyObject_SetItem(__pyx_v_self->fword2id, __pyx_v_word, __pyx_v_id) < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "bilex.pxi":90
+ /* "cdec/sa/bilex.pxi":90
* self.id2fword.append(word)
* self.id2fword[null_word] = "NULL"
* for id, word in enumerate(self.id2fword): # <<<<<<<<<<<<<<
@@ -15730,7 +15768,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "bilex.pxi":93
+ /* "cdec/sa/bilex.pxi":93
* self.fword2id[word] = id
*
* for word in eda.id2word: # <<<<<<<<<<<<<<
@@ -15777,7 +15815,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
__Pyx_XDECREF_SET(__pyx_v_word, __pyx_t_4);
__pyx_t_4 = 0;
- /* "bilex.pxi":94
+ /* "cdec/sa/bilex.pxi":94
*
* for word in eda.id2word:
* self.id2eword.append(word) # <<<<<<<<<<<<<<
@@ -15786,7 +15824,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
__pyx_t_5 = __Pyx_PyObject_Append(__pyx_v_self->id2eword, __pyx_v_word); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "bilex.pxi":93
+ /* "cdec/sa/bilex.pxi":93
* self.fword2id[word] = id
*
* for word in eda.id2word: # <<<<<<<<<<<<<<
@@ -15796,7 +15834,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "bilex.pxi":95
+ /* "cdec/sa/bilex.pxi":95
* for word in eda.id2word:
* self.id2eword.append(word)
* self.id2eword[null_word] = "NULL" # <<<<<<<<<<<<<<
@@ -15805,7 +15843,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
if (unlikely(__Pyx_SetItemInt(__pyx_v_self->id2eword, __pyx_v_null_word, __pyx_n_s_NULL, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "bilex.pxi":96
+ /* "cdec/sa/bilex.pxi":96
* self.id2eword.append(word)
* self.id2eword[null_word] = "NULL"
* for id, word in enumerate(self.id2eword): # <<<<<<<<<<<<<<
@@ -15861,7 +15899,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
__pyx_t_1 = __pyx_t_6;
__pyx_t_6 = 0;
- /* "bilex.pxi":97
+ /* "cdec/sa/bilex.pxi":97
* self.id2eword[null_word] = "NULL"
* for id, word in enumerate(self.id2eword):
* self.eword2id[word] = id # <<<<<<<<<<<<<<
@@ -15870,7 +15908,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
if (unlikely(PyObject_SetItem(__pyx_v_self->eword2id, __pyx_v_word, __pyx_v_id) < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "bilex.pxi":96
+ /* "cdec/sa/bilex.pxi":96
* self.id2eword.append(word)
* self.id2eword[null_word] = "NULL"
* for id, word in enumerate(self.id2eword): # <<<<<<<<<<<<<<
@@ -15881,7 +15919,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "bilex.pxi":99
+ /* "cdec/sa/bilex.pxi":99
* self.eword2id[word] = id
*
* num_pairs = 0 # <<<<<<<<<<<<<<
@@ -15890,7 +15928,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
__pyx_v_num_pairs = 0;
- /* "bilex.pxi":101
+ /* "cdec/sa/bilex.pxi":101
* num_pairs = 0
*
* V_E = len(eda.id2word) # <<<<<<<<<<<<<<
@@ -15903,7 +15941,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_V_E = __pyx_t_2;
- /* "bilex.pxi":102
+ /* "cdec/sa/bilex.pxi":102
*
* V_E = len(eda.id2word)
* V_F = len(fsa.darray.id2word) # <<<<<<<<<<<<<<
@@ -15916,7 +15954,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_V_F = __pyx_t_2;
- /* "bilex.pxi":103
+ /* "cdec/sa/bilex.pxi":103
* V_E = len(eda.id2word)
* V_F = len(fsa.darray.id2word)
* fmargin = <int*> malloc(V_F*sizeof(int)) # <<<<<<<<<<<<<<
@@ -15925,7 +15963,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
__pyx_v_fmargin = ((int *)malloc((__pyx_v_V_F * (sizeof(int)))));
- /* "bilex.pxi":104
+ /* "cdec/sa/bilex.pxi":104
* V_F = len(fsa.darray.id2word)
* fmargin = <int*> malloc(V_F*sizeof(int))
* emargin = <int*> malloc(V_E*sizeof(int)) # <<<<<<<<<<<<<<
@@ -15934,7 +15972,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
__pyx_v_emargin = ((int *)malloc((__pyx_v_V_E * (sizeof(int)))));
- /* "bilex.pxi":105
+ /* "cdec/sa/bilex.pxi":105
* fmargin = <int*> malloc(V_F*sizeof(int))
* emargin = <int*> malloc(V_E*sizeof(int))
* memset(fmargin, 0, V_F*sizeof(int)) # <<<<<<<<<<<<<<
@@ -15943,7 +15981,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
memset(__pyx_v_fmargin, 0, (__pyx_v_V_F * (sizeof(int))));
- /* "bilex.pxi":106
+ /* "cdec/sa/bilex.pxi":106
* emargin = <int*> malloc(V_E*sizeof(int))
* memset(fmargin, 0, V_F*sizeof(int))
* memset(emargin, 0, V_E*sizeof(int)) # <<<<<<<<<<<<<<
@@ -15952,7 +15990,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
memset(__pyx_v_emargin, 0, (__pyx_v_V_E * (sizeof(int))));
- /* "bilex.pxi":108
+ /* "cdec/sa/bilex.pxi":108
* memset(emargin, 0, V_E*sizeof(int))
*
* dict = <_node**> malloc(V_F*sizeof(_node*)) # <<<<<<<<<<<<<<
@@ -15961,7 +15999,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
__pyx_v_dict = ((struct __pyx_t_4cdec_2sa_3_sa__node **)malloc((__pyx_v_V_F * (sizeof(struct __pyx_t_4cdec_2sa_3_sa__node *)))));
- /* "bilex.pxi":109
+ /* "cdec/sa/bilex.pxi":109
*
* dict = <_node**> malloc(V_F*sizeof(_node*))
* memset(dict, 0, V_F*sizeof(_node*)) # <<<<<<<<<<<<<<
@@ -15970,7 +16008,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
memset(__pyx_v_dict, 0, (__pyx_v_V_F * (sizeof(struct __pyx_t_4cdec_2sa_3_sa__node *))));
- /* "bilex.pxi":111
+ /* "cdec/sa/bilex.pxi":111
* memset(dict, 0, V_F*sizeof(_node*))
*
* num_sents = len(fsa.darray.sent_index) # <<<<<<<<<<<<<<
@@ -15986,7 +16024,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
__pyx_v_num_sents = __pyx_t_1;
__pyx_t_1 = 0;
- /* "bilex.pxi":112
+ /* "cdec/sa/bilex.pxi":112
*
* num_sents = len(fsa.darray.sent_index)
* for sent_id from 0 <= sent_id < num_sents-1: # <<<<<<<<<<<<<<
@@ -15999,7 +16037,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
for (__pyx_v_sent_id = 0; __pyx_v_sent_id < __pyx_t_7; __pyx_v_sent_id++) {
- /* "bilex.pxi":114
+ /* "cdec/sa/bilex.pxi":114
* for sent_id from 0 <= sent_id < num_sents-1:
*
* fsent = fsa.darray.data.arr + fsa.darray.sent_index.arr[sent_id] # <<<<<<<<<<<<<<
@@ -16008,7 +16046,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
__pyx_v_fsent = (__pyx_v_fsa->darray->data->arr + (__pyx_v_fsa->darray->sent_index->arr[__pyx_v_sent_id]));
- /* "bilex.pxi":115
+ /* "cdec/sa/bilex.pxi":115
*
* fsent = fsa.darray.data.arr + fsa.darray.sent_index.arr[sent_id]
* I = fsa.darray.sent_index.arr[sent_id+1] - fsa.darray.sent_index.arr[sent_id] - 1 # <<<<<<<<<<<<<<
@@ -16017,7 +16055,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
__pyx_v_I = (((__pyx_v_fsa->darray->sent_index->arr[(__pyx_v_sent_id + 1)]) - (__pyx_v_fsa->darray->sent_index->arr[__pyx_v_sent_id])) - 1);
- /* "bilex.pxi":116
+ /* "cdec/sa/bilex.pxi":116
* fsent = fsa.darray.data.arr + fsa.darray.sent_index.arr[sent_id]
* I = fsa.darray.sent_index.arr[sent_id+1] - fsa.darray.sent_index.arr[sent_id] - 1
* faligned = <int*> malloc(I*sizeof(int)) # <<<<<<<<<<<<<<
@@ -16026,7 +16064,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
__pyx_v_faligned = ((int *)malloc((__pyx_v_I * (sizeof(int)))));
- /* "bilex.pxi":117
+ /* "cdec/sa/bilex.pxi":117
* I = fsa.darray.sent_index.arr[sent_id+1] - fsa.darray.sent_index.arr[sent_id] - 1
* faligned = <int*> malloc(I*sizeof(int))
* memset(faligned, 0, I*sizeof(int)) # <<<<<<<<<<<<<<
@@ -16035,7 +16073,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
memset(__pyx_v_faligned, 0, (__pyx_v_I * (sizeof(int))));
- /* "bilex.pxi":119
+ /* "cdec/sa/bilex.pxi":119
* memset(faligned, 0, I*sizeof(int))
*
* esent = eda.data.arr + eda.sent_index.arr[sent_id] # <<<<<<<<<<<<<<
@@ -16044,7 +16082,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
__pyx_v_esent = (__pyx_v_eda->data->arr + (__pyx_v_eda->sent_index->arr[__pyx_v_sent_id]));
- /* "bilex.pxi":120
+ /* "cdec/sa/bilex.pxi":120
*
* esent = eda.data.arr + eda.sent_index.arr[sent_id]
* J = eda.sent_index.arr[sent_id+1] - eda.sent_index.arr[sent_id] - 1 # <<<<<<<<<<<<<<
@@ -16053,7 +16091,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
__pyx_v_J = (((__pyx_v_eda->sent_index->arr[(__pyx_v_sent_id + 1)]) - (__pyx_v_eda->sent_index->arr[__pyx_v_sent_id])) - 1);
- /* "bilex.pxi":121
+ /* "cdec/sa/bilex.pxi":121
* esent = eda.data.arr + eda.sent_index.arr[sent_id]
* J = eda.sent_index.arr[sent_id+1] - eda.sent_index.arr[sent_id] - 1
* ealigned = <int*> malloc(J*sizeof(int)) # <<<<<<<<<<<<<<
@@ -16062,7 +16100,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
__pyx_v_ealigned = ((int *)malloc((__pyx_v_J * (sizeof(int)))));
- /* "bilex.pxi":122
+ /* "cdec/sa/bilex.pxi":122
* J = eda.sent_index.arr[sent_id+1] - eda.sent_index.arr[sent_id] - 1
* ealigned = <int*> malloc(J*sizeof(int))
* memset(ealigned, 0, J*sizeof(int)) # <<<<<<<<<<<<<<
@@ -16071,7 +16109,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
memset(__pyx_v_ealigned, 0, (__pyx_v_J * (sizeof(int))));
- /* "bilex.pxi":124
+ /* "cdec/sa/bilex.pxi":124
* memset(ealigned, 0, J*sizeof(int))
*
* links = aa._get_sent_links(sent_id, &num_links) # <<<<<<<<<<<<<<
@@ -16080,7 +16118,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
__pyx_v_links = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Alignment *)__pyx_v_aa->__pyx_vtab)->_get_sent_links(__pyx_v_aa, __pyx_v_sent_id, (&__pyx_v_num_links));
- /* "bilex.pxi":126
+ /* "cdec/sa/bilex.pxi":126
* links = aa._get_sent_links(sent_id, &num_links)
*
* for l from 0 <= l < num_links: # <<<<<<<<<<<<<<
@@ -16090,7 +16128,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
__pyx_t_8 = __pyx_v_num_links;
for (__pyx_v_l = 0; __pyx_v_l < __pyx_t_8; __pyx_v_l++) {
- /* "bilex.pxi":127
+ /* "cdec/sa/bilex.pxi":127
*
* for l from 0 <= l < num_links:
* i = links[l*2] # <<<<<<<<<<<<<<
@@ -16099,7 +16137,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
__pyx_v_i = (__pyx_v_links[(__pyx_v_l * 2)]);
- /* "bilex.pxi":128
+ /* "cdec/sa/bilex.pxi":128
* for l from 0 <= l < num_links:
* i = links[l*2]
* j = links[l*2+1] # <<<<<<<<<<<<<<
@@ -16108,7 +16146,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
__pyx_v_j = (__pyx_v_links[((__pyx_v_l * 2) + 1)]);
- /* "bilex.pxi":129
+ /* "cdec/sa/bilex.pxi":129
* i = links[l*2]
* j = links[l*2+1]
* if i >= I or j >= J: # <<<<<<<<<<<<<<
@@ -16128,7 +16166,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
__pyx_L16_bool_binop_done:;
if (__pyx_t_9) {
- /* "bilex.pxi":130
+ /* "cdec/sa/bilex.pxi":130
* j = links[l*2+1]
* if i >= I or j >= J:
* raise Exception("%d-%d out of bounds (I=%d,J=%d) in line %d\n" % (i,j,I,J,sent_id+1)) # <<<<<<<<<<<<<<
@@ -16178,7 +16216,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
{__pyx_filename = __pyx_f[5]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- /* "bilex.pxi":131
+ /* "cdec/sa/bilex.pxi":131
* if i >= I or j >= J:
* raise Exception("%d-%d out of bounds (I=%d,J=%d) in line %d\n" % (i,j,I,J,sent_id+1))
* f_i = fsent[i] # <<<<<<<<<<<<<<
@@ -16187,7 +16225,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
__pyx_v_f_i = (__pyx_v_fsent[__pyx_v_i]);
- /* "bilex.pxi":132
+ /* "cdec/sa/bilex.pxi":132
* raise Exception("%d-%d out of bounds (I=%d,J=%d) in line %d\n" % (i,j,I,J,sent_id+1))
* f_i = fsent[i]
* e_j = esent[j] # <<<<<<<<<<<<<<
@@ -16196,7 +16234,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
__pyx_v_e_j = (__pyx_v_esent[__pyx_v_j]);
- /* "bilex.pxi":133
+ /* "cdec/sa/bilex.pxi":133
* f_i = fsent[i]
* e_j = esent[j]
* fmargin[f_i] = fmargin[f_i]+1 # <<<<<<<<<<<<<<
@@ -16205,7 +16243,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
(__pyx_v_fmargin[__pyx_v_f_i]) = ((__pyx_v_fmargin[__pyx_v_f_i]) + 1);
- /* "bilex.pxi":134
+ /* "cdec/sa/bilex.pxi":134
* e_j = esent[j]
* fmargin[f_i] = fmargin[f_i]+1
* emargin[e_j] = emargin[e_j]+1 # <<<<<<<<<<<<<<
@@ -16214,7 +16252,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
(__pyx_v_emargin[__pyx_v_e_j]) = ((__pyx_v_emargin[__pyx_v_e_j]) + 1);
- /* "bilex.pxi":135
+ /* "cdec/sa/bilex.pxi":135
* fmargin[f_i] = fmargin[f_i]+1
* emargin[e_j] = emargin[e_j]+1
* if dict[f_i] == NULL: # <<<<<<<<<<<<<<
@@ -16224,7 +16262,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
__pyx_t_9 = (((__pyx_v_dict[__pyx_v_f_i]) == NULL) != 0);
if (__pyx_t_9) {
- /* "bilex.pxi":136
+ /* "cdec/sa/bilex.pxi":136
* emargin[e_j] = emargin[e_j]+1
* if dict[f_i] == NULL:
* dict[f_i] = new_node(e_j) # <<<<<<<<<<<<<<
@@ -16233,7 +16271,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
(__pyx_v_dict[__pyx_v_f_i]) = __pyx_f_4cdec_2sa_3_sa_new_node(__pyx_v_e_j);
- /* "bilex.pxi":137
+ /* "cdec/sa/bilex.pxi":137
* if dict[f_i] == NULL:
* dict[f_i] = new_node(e_j)
* dict[f_i].val = 1 # <<<<<<<<<<<<<<
@@ -16242,7 +16280,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
(__pyx_v_dict[__pyx_v_f_i])->val = 1;
- /* "bilex.pxi":138
+ /* "cdec/sa/bilex.pxi":138
* dict[f_i] = new_node(e_j)
* dict[f_i].val = 1
* num_pairs = num_pairs + 1 # <<<<<<<<<<<<<<
@@ -16254,7 +16292,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
}
/*else*/ {
- /* "bilex.pxi":140
+ /* "cdec/sa/bilex.pxi":140
* num_pairs = num_pairs + 1
* else:
* count = get_val(dict[f_i], e_j) # <<<<<<<<<<<<<<
@@ -16263,7 +16301,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
__pyx_v_count = __pyx_f_4cdec_2sa_3_sa_get_val((__pyx_v_dict[__pyx_v_f_i]), __pyx_v_e_j);
- /* "bilex.pxi":141
+ /* "cdec/sa/bilex.pxi":141
* else:
* count = get_val(dict[f_i], e_j)
* if count[0] == 0: # <<<<<<<<<<<<<<
@@ -16273,7 +16311,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
__pyx_t_9 = (((__pyx_v_count[0]) == 0) != 0);
if (__pyx_t_9) {
- /* "bilex.pxi":142
+ /* "cdec/sa/bilex.pxi":142
* count = get_val(dict[f_i], e_j)
* if count[0] == 0:
* num_pairs = num_pairs + 1 # <<<<<<<<<<<<<<
@@ -16285,7 +16323,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
}
__pyx_L19:;
- /* "bilex.pxi":143
+ /* "cdec/sa/bilex.pxi":143
* if count[0] == 0:
* num_pairs = num_pairs + 1
* count[0] = count[0] + 1 # <<<<<<<<<<<<<<
@@ -16296,7 +16334,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
}
__pyx_L18:;
- /* "bilex.pxi":145
+ /* "cdec/sa/bilex.pxi":145
* count[0] = count[0] + 1
* # add count
* faligned[i] = 1 # <<<<<<<<<<<<<<
@@ -16305,7 +16343,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
(__pyx_v_faligned[__pyx_v_i]) = 1;
- /* "bilex.pxi":146
+ /* "cdec/sa/bilex.pxi":146
* # add count
* faligned[i] = 1
* ealigned[j] = 1 # <<<<<<<<<<<<<<
@@ -16315,7 +16353,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
(__pyx_v_ealigned[__pyx_v_j]) = 1;
}
- /* "bilex.pxi":147
+ /* "cdec/sa/bilex.pxi":147
* faligned[i] = 1
* ealigned[j] = 1
* for i from 0 <= i < I: # <<<<<<<<<<<<<<
@@ -16325,7 +16363,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
__pyx_t_8 = __pyx_v_I;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_8; __pyx_v_i++) {
- /* "bilex.pxi":148
+ /* "cdec/sa/bilex.pxi":148
* ealigned[j] = 1
* for i from 0 <= i < I:
* if faligned[i] == 0: # <<<<<<<<<<<<<<
@@ -16335,7 +16373,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
__pyx_t_9 = (((__pyx_v_faligned[__pyx_v_i]) == 0) != 0);
if (__pyx_t_9) {
- /* "bilex.pxi":149
+ /* "cdec/sa/bilex.pxi":149
* for i from 0 <= i < I:
* if faligned[i] == 0:
* f_i = fsent[i] # <<<<<<<<<<<<<<
@@ -16344,7 +16382,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
__pyx_v_f_i = (__pyx_v_fsent[__pyx_v_i]);
- /* "bilex.pxi":150
+ /* "cdec/sa/bilex.pxi":150
* if faligned[i] == 0:
* f_i = fsent[i]
* fmargin[f_i] = fmargin[f_i] + 1 # <<<<<<<<<<<<<<
@@ -16353,7 +16391,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
(__pyx_v_fmargin[__pyx_v_f_i]) = ((__pyx_v_fmargin[__pyx_v_f_i]) + 1);
- /* "bilex.pxi":151
+ /* "cdec/sa/bilex.pxi":151
* f_i = fsent[i]
* fmargin[f_i] = fmargin[f_i] + 1
* emargin[null_word] = emargin[null_word] + 1 # <<<<<<<<<<<<<<
@@ -16362,7 +16400,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
(__pyx_v_emargin[__pyx_v_null_word]) = ((__pyx_v_emargin[__pyx_v_null_word]) + 1);
- /* "bilex.pxi":152
+ /* "cdec/sa/bilex.pxi":152
* fmargin[f_i] = fmargin[f_i] + 1
* emargin[null_word] = emargin[null_word] + 1
* if dict[f_i] == NULL: # <<<<<<<<<<<<<<
@@ -16372,7 +16410,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
__pyx_t_9 = (((__pyx_v_dict[__pyx_v_f_i]) == NULL) != 0);
if (__pyx_t_9) {
- /* "bilex.pxi":153
+ /* "cdec/sa/bilex.pxi":153
* emargin[null_word] = emargin[null_word] + 1
* if dict[f_i] == NULL:
* dict[f_i] = new_node(null_word) # <<<<<<<<<<<<<<
@@ -16381,7 +16419,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
(__pyx_v_dict[__pyx_v_f_i]) = __pyx_f_4cdec_2sa_3_sa_new_node(__pyx_v_null_word);
- /* "bilex.pxi":154
+ /* "cdec/sa/bilex.pxi":154
* if dict[f_i] == NULL:
* dict[f_i] = new_node(null_word)
* dict[f_i].val = 1 # <<<<<<<<<<<<<<
@@ -16390,7 +16428,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
(__pyx_v_dict[__pyx_v_f_i])->val = 1;
- /* "bilex.pxi":155
+ /* "cdec/sa/bilex.pxi":155
* dict[f_i] = new_node(null_word)
* dict[f_i].val = 1
* num_pairs = num_pairs + 1 # <<<<<<<<<<<<<<
@@ -16402,7 +16440,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
}
/*else*/ {
- /* "bilex.pxi":157
+ /* "cdec/sa/bilex.pxi":157
* num_pairs = num_pairs + 1
* else:
* count = get_val(dict[f_i], null_word) # <<<<<<<<<<<<<<
@@ -16411,7 +16449,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
__pyx_v_count = __pyx_f_4cdec_2sa_3_sa_get_val((__pyx_v_dict[__pyx_v_f_i]), __pyx_v_null_word);
- /* "bilex.pxi":158
+ /* "cdec/sa/bilex.pxi":158
* else:
* count = get_val(dict[f_i], null_word)
* if count[0] == 0: # <<<<<<<<<<<<<<
@@ -16421,7 +16459,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
__pyx_t_9 = (((__pyx_v_count[0]) == 0) != 0);
if (__pyx_t_9) {
- /* "bilex.pxi":159
+ /* "cdec/sa/bilex.pxi":159
* count = get_val(dict[f_i], null_word)
* if count[0] == 0:
* num_pairs = num_pairs + 1 # <<<<<<<<<<<<<<
@@ -16433,7 +16471,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
}
__pyx_L24:;
- /* "bilex.pxi":160
+ /* "cdec/sa/bilex.pxi":160
* if count[0] == 0:
* num_pairs = num_pairs + 1
* count[0] = count[0] + 1 # <<<<<<<<<<<<<<
@@ -16448,7 +16486,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
__pyx_L22:;
}
- /* "bilex.pxi":161
+ /* "cdec/sa/bilex.pxi":161
* num_pairs = num_pairs + 1
* count[0] = count[0] + 1
* for j from 0 <= j < J: # <<<<<<<<<<<<<<
@@ -16458,7 +16496,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
__pyx_t_8 = __pyx_v_J;
for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) {
- /* "bilex.pxi":162
+ /* "cdec/sa/bilex.pxi":162
* count[0] = count[0] + 1
* for j from 0 <= j < J:
* if ealigned[j] == 0: # <<<<<<<<<<<<<<
@@ -16468,7 +16506,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
__pyx_t_9 = (((__pyx_v_ealigned[__pyx_v_j]) == 0) != 0);
if (__pyx_t_9) {
- /* "bilex.pxi":163
+ /* "cdec/sa/bilex.pxi":163
* for j from 0 <= j < J:
* if ealigned[j] == 0:
* e_j = esent[j] # <<<<<<<<<<<<<<
@@ -16477,7 +16515,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
__pyx_v_e_j = (__pyx_v_esent[__pyx_v_j]);
- /* "bilex.pxi":164
+ /* "cdec/sa/bilex.pxi":164
* if ealigned[j] == 0:
* e_j = esent[j]
* fmargin[null_word] = fmargin[null_word] + 1 # <<<<<<<<<<<<<<
@@ -16486,7 +16524,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
(__pyx_v_fmargin[__pyx_v_null_word]) = ((__pyx_v_fmargin[__pyx_v_null_word]) + 1);
- /* "bilex.pxi":165
+ /* "cdec/sa/bilex.pxi":165
* e_j = esent[j]
* fmargin[null_word] = fmargin[null_word] + 1
* emargin[e_j] = emargin[e_j] + 1 # <<<<<<<<<<<<<<
@@ -16495,7 +16533,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
(__pyx_v_emargin[__pyx_v_e_j]) = ((__pyx_v_emargin[__pyx_v_e_j]) + 1);
- /* "bilex.pxi":166
+ /* "cdec/sa/bilex.pxi":166
* fmargin[null_word] = fmargin[null_word] + 1
* emargin[e_j] = emargin[e_j] + 1
* if dict[null_word] == NULL: # <<<<<<<<<<<<<<
@@ -16505,7 +16543,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
__pyx_t_9 = (((__pyx_v_dict[__pyx_v_null_word]) == NULL) != 0);
if (__pyx_t_9) {
- /* "bilex.pxi":167
+ /* "cdec/sa/bilex.pxi":167
* emargin[e_j] = emargin[e_j] + 1
* if dict[null_word] == NULL:
* dict[null_word] = new_node(e_j) # <<<<<<<<<<<<<<
@@ -16514,7 +16552,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
(__pyx_v_dict[__pyx_v_null_word]) = __pyx_f_4cdec_2sa_3_sa_new_node(__pyx_v_e_j);
- /* "bilex.pxi":168
+ /* "cdec/sa/bilex.pxi":168
* if dict[null_word] == NULL:
* dict[null_word] = new_node(e_j)
* dict[null_word].val = 1 # <<<<<<<<<<<<<<
@@ -16523,7 +16561,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
(__pyx_v_dict[__pyx_v_null_word])->val = 1;
- /* "bilex.pxi":169
+ /* "cdec/sa/bilex.pxi":169
* dict[null_word] = new_node(e_j)
* dict[null_word].val = 1
* num_pairs = num_pairs + 1 # <<<<<<<<<<<<<<
@@ -16535,7 +16573,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
}
/*else*/ {
- /* "bilex.pxi":171
+ /* "cdec/sa/bilex.pxi":171
* num_pairs = num_pairs + 1
* else:
* count = get_val(dict[null_word], e_j) # <<<<<<<<<<<<<<
@@ -16544,7 +16582,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
__pyx_v_count = __pyx_f_4cdec_2sa_3_sa_get_val((__pyx_v_dict[__pyx_v_null_word]), __pyx_v_e_j);
- /* "bilex.pxi":172
+ /* "cdec/sa/bilex.pxi":172
* else:
* count = get_val(dict[null_word], e_j)
* if count[0] == 0: # <<<<<<<<<<<<<<
@@ -16554,7 +16592,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
__pyx_t_9 = (((__pyx_v_count[0]) == 0) != 0);
if (__pyx_t_9) {
- /* "bilex.pxi":173
+ /* "cdec/sa/bilex.pxi":173
* count = get_val(dict[null_word], e_j)
* if count[0] == 0:
* num_pairs = num_pairs + 1 # <<<<<<<<<<<<<<
@@ -16566,7 +16604,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
}
__pyx_L29:;
- /* "bilex.pxi":174
+ /* "cdec/sa/bilex.pxi":174
* if count[0] == 0:
* num_pairs = num_pairs + 1
* count[0] = count[0] + 1 # <<<<<<<<<<<<<<
@@ -16581,7 +16619,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
__pyx_L27:;
}
- /* "bilex.pxi":175
+ /* "cdec/sa/bilex.pxi":175
* num_pairs = num_pairs + 1
* count[0] = count[0] + 1
* free(links) # <<<<<<<<<<<<<<
@@ -16590,7 +16628,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
free(__pyx_v_links);
- /* "bilex.pxi":176
+ /* "cdec/sa/bilex.pxi":176
* count[0] = count[0] + 1
* free(links)
* free(faligned) # <<<<<<<<<<<<<<
@@ -16599,7 +16637,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
free(__pyx_v_faligned);
- /* "bilex.pxi":177
+ /* "cdec/sa/bilex.pxi":177
* free(links)
* free(faligned)
* free(ealigned) # <<<<<<<<<<<<<<
@@ -16609,7 +16647,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
free(__pyx_v_ealigned);
}
- /* "bilex.pxi":178
+ /* "cdec/sa/bilex.pxi":178
* free(faligned)
* free(ealigned)
* self.f_index = IntList(initial_len=V_F) # <<<<<<<<<<<<<<
@@ -16631,7 +16669,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
__pyx_v_self->f_index = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_13);
__pyx_t_13 = 0;
- /* "bilex.pxi":179
+ /* "cdec/sa/bilex.pxi":179
* free(ealigned)
* self.f_index = IntList(initial_len=V_F)
* self.e_index = IntList(initial_len=num_pairs) # <<<<<<<<<<<<<<
@@ -16653,7 +16691,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
__pyx_v_self->e_index = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_12);
__pyx_t_12 = 0;
- /* "bilex.pxi":180
+ /* "cdec/sa/bilex.pxi":180
* self.f_index = IntList(initial_len=V_F)
* self.e_index = IntList(initial_len=num_pairs)
* self.col1 = FloatList(initial_len=num_pairs) # <<<<<<<<<<<<<<
@@ -16675,7 +16713,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
__pyx_v_self->col1 = ((struct __pyx_obj_4cdec_2sa_3_sa_FloatList *)__pyx_t_13);
__pyx_t_13 = 0;
- /* "bilex.pxi":181
+ /* "cdec/sa/bilex.pxi":181
* self.e_index = IntList(initial_len=num_pairs)
* self.col1 = FloatList(initial_len=num_pairs)
* self.col2 = FloatList(initial_len=num_pairs) # <<<<<<<<<<<<<<
@@ -16697,7 +16735,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
__pyx_v_self->col2 = ((struct __pyx_obj_4cdec_2sa_3_sa_FloatList *)__pyx_t_12);
__pyx_t_12 = 0;
- /* "bilex.pxi":183
+ /* "cdec/sa/bilex.pxi":183
* self.col2 = FloatList(initial_len=num_pairs)
*
* num_pairs = 0 # <<<<<<<<<<<<<<
@@ -16706,7 +16744,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
__pyx_v_num_pairs = 0;
- /* "bilex.pxi":184
+ /* "cdec/sa/bilex.pxi":184
*
* num_pairs = 0
* for i from 0 <= i < V_F: # <<<<<<<<<<<<<<
@@ -16716,7 +16754,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
__pyx_t_7 = __pyx_v_V_F;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {
- /* "bilex.pxi":186
+ /* "cdec/sa/bilex.pxi":186
* for i from 0 <= i < V_F:
* #self.f_index[i] = num_pairs
* self.f_index.set(i, num_pairs) # <<<<<<<<<<<<<<
@@ -16725,7 +16763,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->f_index->__pyx_vtab)->set(__pyx_v_self->f_index, __pyx_v_i, __pyx_v_num_pairs);
- /* "bilex.pxi":187
+ /* "cdec/sa/bilex.pxi":187
* #self.f_index[i] = num_pairs
* self.f_index.set(i, num_pairs)
* if dict[i] != NULL: # <<<<<<<<<<<<<<
@@ -16735,7 +16773,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
__pyx_t_9 = (((__pyx_v_dict[__pyx_v_i]) != NULL) != 0);
if (__pyx_t_9) {
- /* "bilex.pxi":188
+ /* "cdec/sa/bilex.pxi":188
* self.f_index.set(i, num_pairs)
* if dict[i] != NULL:
* self._add_node(dict[i], &num_pairs, float(fmargin[i]), emargin) # <<<<<<<<<<<<<<
@@ -16746,7 +16784,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- /* "bilex.pxi":189
+ /* "cdec/sa/bilex.pxi":189
* if dict[i] != NULL:
* self._add_node(dict[i], &num_pairs, float(fmargin[i]), emargin)
* del_node(dict[i]) # <<<<<<<<<<<<<<
@@ -16761,7 +16799,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
__pyx_L32:;
}
- /* "bilex.pxi":190
+ /* "cdec/sa/bilex.pxi":190
* self._add_node(dict[i], &num_pairs, float(fmargin[i]), emargin)
* del_node(dict[i])
* free(fmargin) # <<<<<<<<<<<<<<
@@ -16770,7 +16808,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
free(__pyx_v_fmargin);
- /* "bilex.pxi":191
+ /* "cdec/sa/bilex.pxi":191
* del_node(dict[i])
* free(fmargin)
* free(emargin) # <<<<<<<<<<<<<<
@@ -16779,7 +16817,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
free(__pyx_v_emargin);
- /* "bilex.pxi":192
+ /* "cdec/sa/bilex.pxi":192
* free(fmargin)
* free(emargin)
* free(dict) # <<<<<<<<<<<<<<
@@ -16788,7 +16826,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
*/
free(__pyx_v_dict);
- /* "bilex.pxi":193
+ /* "cdec/sa/bilex.pxi":193
* free(emargin)
* free(dict)
* return # <<<<<<<<<<<<<<
@@ -16799,7 +16837,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
- /* "bilex.pxi":72
+ /* "cdec/sa/bilex.pxi":72
*
*
* cdef compute_from_data(self, SuffixArray fsa, DataArray eda, Alignment aa): # <<<<<<<<<<<<<<
@@ -16826,7 +16864,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_compute_from_data(struct __pyx_ob
return __pyx_r;
}
-/* "bilex.pxi":196
+/* "cdec/sa/bilex.pxi":196
*
*
* cdef _add_node(self, _node* n, int* num_pairs, float fmargin, int* emargin): # <<<<<<<<<<<<<<
@@ -16845,7 +16883,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex__add_node(struct __pyx_obj_4cdec_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_add_node", 0);
- /* "bilex.pxi":198
+ /* "cdec/sa/bilex.pxi":198
* cdef _add_node(self, _node* n, int* num_pairs, float fmargin, int* emargin):
* cdef int loc
* if n.smaller != NULL: # <<<<<<<<<<<<<<
@@ -16855,7 +16893,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex__add_node(struct __pyx_obj_4cdec_
__pyx_t_1 = ((__pyx_v_n->smaller != NULL) != 0);
if (__pyx_t_1) {
- /* "bilex.pxi":199
+ /* "cdec/sa/bilex.pxi":199
* cdef int loc
* if n.smaller != NULL:
* self._add_node(n.smaller, num_pairs, fmargin, emargin) # <<<<<<<<<<<<<<
@@ -16869,7 +16907,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex__add_node(struct __pyx_obj_4cdec_
}
__pyx_L3:;
- /* "bilex.pxi":200
+ /* "cdec/sa/bilex.pxi":200
* if n.smaller != NULL:
* self._add_node(n.smaller, num_pairs, fmargin, emargin)
* loc = num_pairs[0] # <<<<<<<<<<<<<<
@@ -16878,7 +16916,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex__add_node(struct __pyx_obj_4cdec_
*/
__pyx_v_loc = (__pyx_v_num_pairs[0]);
- /* "bilex.pxi":201
+ /* "cdec/sa/bilex.pxi":201
* self._add_node(n.smaller, num_pairs, fmargin, emargin)
* loc = num_pairs[0]
* self.e_index.set(loc, n.key) # <<<<<<<<<<<<<<
@@ -16887,7 +16925,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex__add_node(struct __pyx_obj_4cdec_
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->e_index->__pyx_vtab)->set(__pyx_v_self->e_index, __pyx_v_loc, __pyx_v_n->key);
- /* "bilex.pxi":202
+ /* "cdec/sa/bilex.pxi":202
* loc = num_pairs[0]
* self.e_index.set(loc, n.key)
* self.col1.set(loc, float(n.val)/fmargin) # <<<<<<<<<<<<<<
@@ -16906,7 +16944,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex__add_node(struct __pyx_obj_4cdec_
}
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_FloatList *)__pyx_v_self->col1->__pyx_vtab)->set(__pyx_v_self->col1, __pyx_v_loc, (((double)__pyx_v_n->val) / __pyx_v_fmargin));
- /* "bilex.pxi":203
+ /* "cdec/sa/bilex.pxi":203
* self.e_index.set(loc, n.key)
* self.col1.set(loc, float(n.val)/fmargin)
* self.col2.set(loc, float(n.val)/float(emargin[n.key])) # <<<<<<<<<<<<<<
@@ -16925,7 +16963,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex__add_node(struct __pyx_obj_4cdec_
}
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_FloatList *)__pyx_v_self->col2->__pyx_vtab)->set(__pyx_v_self->col2, __pyx_v_loc, (((double)__pyx_v_n->val) / ((double)(__pyx_v_emargin[__pyx_v_n->key]))));
- /* "bilex.pxi":204
+ /* "cdec/sa/bilex.pxi":204
* self.col1.set(loc, float(n.val)/fmargin)
* self.col2.set(loc, float(n.val)/float(emargin[n.key]))
* num_pairs[0] = loc + 1 # <<<<<<<<<<<<<<
@@ -16934,7 +16972,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex__add_node(struct __pyx_obj_4cdec_
*/
(__pyx_v_num_pairs[0]) = (__pyx_v_loc + 1);
- /* "bilex.pxi":205
+ /* "cdec/sa/bilex.pxi":205
* self.col2.set(loc, float(n.val)/float(emargin[n.key]))
* num_pairs[0] = loc + 1
* if n.bigger != NULL: # <<<<<<<<<<<<<<
@@ -16944,7 +16982,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex__add_node(struct __pyx_obj_4cdec_
__pyx_t_1 = ((__pyx_v_n->bigger != NULL) != 0);
if (__pyx_t_1) {
- /* "bilex.pxi":206
+ /* "cdec/sa/bilex.pxi":206
* num_pairs[0] = loc + 1
* if n.bigger != NULL:
* self._add_node(n.bigger, num_pairs, fmargin, emargin) # <<<<<<<<<<<<<<
@@ -16958,7 +16996,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex__add_node(struct __pyx_obj_4cdec_
}
__pyx_L4:;
- /* "bilex.pxi":196
+ /* "cdec/sa/bilex.pxi":196
*
*
* cdef _add_node(self, _node* n, int* num_pairs, float fmargin, int* emargin): # <<<<<<<<<<<<<<
@@ -16979,7 +17017,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex__add_node(struct __pyx_obj_4cdec_
return __pyx_r;
}
-/* "bilex.pxi":209
+/* "cdec/sa/bilex.pxi":209
*
*
* def write_binary(self, char* filename): # <<<<<<<<<<<<<<
@@ -17024,7 +17062,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_2write_binary(struct __pyx_obj_4
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("write_binary", 0);
- /* "bilex.pxi":211
+ /* "cdec/sa/bilex.pxi":211
* def write_binary(self, char* filename):
* cdef FILE* f
* f = fopen(filename, "w") # <<<<<<<<<<<<<<
@@ -17033,7 +17071,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_2write_binary(struct __pyx_obj_4
*/
__pyx_v_f = fopen(__pyx_v_filename, __pyx_k_w);
- /* "bilex.pxi":212
+ /* "cdec/sa/bilex.pxi":212
* cdef FILE* f
* f = fopen(filename, "w")
* self.f_index.write_handle(f) # <<<<<<<<<<<<<<
@@ -17042,7 +17080,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_2write_binary(struct __pyx_obj_4
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->f_index->__pyx_vtab)->write_handle(__pyx_v_self->f_index, __pyx_v_f);
- /* "bilex.pxi":213
+ /* "cdec/sa/bilex.pxi":213
* f = fopen(filename, "w")
* self.f_index.write_handle(f)
* self.e_index.write_handle(f) # <<<<<<<<<<<<<<
@@ -17051,7 +17089,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_2write_binary(struct __pyx_obj_4
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->e_index->__pyx_vtab)->write_handle(__pyx_v_self->e_index, __pyx_v_f);
- /* "bilex.pxi":214
+ /* "cdec/sa/bilex.pxi":214
* self.f_index.write_handle(f)
* self.e_index.write_handle(f)
* self.col1.write_handle(f) # <<<<<<<<<<<<<<
@@ -17060,7 +17098,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_2write_binary(struct __pyx_obj_4
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_FloatList *)__pyx_v_self->col1->__pyx_vtab)->write_handle(__pyx_v_self->col1, __pyx_v_f);
- /* "bilex.pxi":215
+ /* "cdec/sa/bilex.pxi":215
* self.e_index.write_handle(f)
* self.col1.write_handle(f)
* self.col2.write_handle(f) # <<<<<<<<<<<<<<
@@ -17069,7 +17107,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_2write_binary(struct __pyx_obj_4
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_FloatList *)__pyx_v_self->col2->__pyx_vtab)->write_handle(__pyx_v_self->col2, __pyx_v_f);
- /* "bilex.pxi":216
+ /* "cdec/sa/bilex.pxi":216
* self.col1.write_handle(f)
* self.col2.write_handle(f)
* self.write_wordlist(self.id2fword, f) # <<<<<<<<<<<<<<
@@ -17083,7 +17121,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_2write_binary(struct __pyx_obj_4
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "bilex.pxi":217
+ /* "cdec/sa/bilex.pxi":217
* self.col2.write_handle(f)
* self.write_wordlist(self.id2fword, f)
* self.write_wordlist(self.id2eword, f) # <<<<<<<<<<<<<<
@@ -17097,7 +17135,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_2write_binary(struct __pyx_obj_4
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "bilex.pxi":218
+ /* "cdec/sa/bilex.pxi":218
* self.write_wordlist(self.id2fword, f)
* self.write_wordlist(self.id2eword, f)
* fclose(f) # <<<<<<<<<<<<<<
@@ -17106,7 +17144,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_2write_binary(struct __pyx_obj_4
*/
fclose(__pyx_v_f);
- /* "bilex.pxi":209
+ /* "cdec/sa/bilex.pxi":209
*
*
* def write_binary(self, char* filename): # <<<<<<<<<<<<<<
@@ -17128,7 +17166,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_2write_binary(struct __pyx_obj_4
return __pyx_r;
}
-/* "bilex.pxi":221
+/* "cdec/sa/bilex.pxi":221
*
*
* cdef write_wordlist(self, wordlist, FILE* f): # <<<<<<<<<<<<<<
@@ -17153,7 +17191,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_write_wordlist(CYTHON_UNUSED stru
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("write_wordlist", 0);
- /* "bilex.pxi":225
+ /* "cdec/sa/bilex.pxi":225
* cdef int num_words
*
* num_words = len(wordlist) # <<<<<<<<<<<<<<
@@ -17163,7 +17201,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_write_wordlist(CYTHON_UNUSED stru
__pyx_t_1 = PyObject_Length(__pyx_v_wordlist); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_num_words = __pyx_t_1;
- /* "bilex.pxi":226
+ /* "cdec/sa/bilex.pxi":226
*
* num_words = len(wordlist)
* fwrite(&(num_words), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -17172,7 +17210,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_write_wordlist(CYTHON_UNUSED stru
*/
fwrite((&__pyx_v_num_words), (sizeof(int)), 1, __pyx_v_f);
- /* "bilex.pxi":227
+ /* "cdec/sa/bilex.pxi":227
* num_words = len(wordlist)
* fwrite(&(num_words), sizeof(int), 1, f)
* for word in wordlist: # <<<<<<<<<<<<<<
@@ -17219,7 +17257,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_write_wordlist(CYTHON_UNUSED stru
__Pyx_XDECREF_SET(__pyx_v_word, __pyx_t_4);
__pyx_t_4 = 0;
- /* "bilex.pxi":228
+ /* "cdec/sa/bilex.pxi":228
* fwrite(&(num_words), sizeof(int), 1, f)
* for word in wordlist:
* word_len = len(word) + 1 # <<<<<<<<<<<<<<
@@ -17229,7 +17267,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_write_wordlist(CYTHON_UNUSED stru
__pyx_t_5 = PyObject_Length(__pyx_v_word); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_word_len = (__pyx_t_5 + 1);
- /* "bilex.pxi":229
+ /* "cdec/sa/bilex.pxi":229
* for word in wordlist:
* word_len = len(word) + 1
* fwrite(&(word_len), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -17238,7 +17276,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_write_wordlist(CYTHON_UNUSED stru
*/
fwrite((&__pyx_v_word_len), (sizeof(int)), 1, __pyx_v_f);
- /* "bilex.pxi":230
+ /* "cdec/sa/bilex.pxi":230
* word_len = len(word) + 1
* fwrite(&(word_len), sizeof(int), 1, f)
* fwrite(<char *>word, sizeof(char), word_len, f) # <<<<<<<<<<<<<<
@@ -17248,7 +17286,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_write_wordlist(CYTHON_UNUSED stru
__pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_word); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
fwrite(((char *)__pyx_t_6), (sizeof(char)), __pyx_v_word_len, __pyx_v_f);
- /* "bilex.pxi":227
+ /* "cdec/sa/bilex.pxi":227
* num_words = len(wordlist)
* fwrite(&(num_words), sizeof(int), 1, f)
* for word in wordlist: # <<<<<<<<<<<<<<
@@ -17258,7 +17296,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_write_wordlist(CYTHON_UNUSED stru
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "bilex.pxi":221
+ /* "cdec/sa/bilex.pxi":221
*
*
* cdef write_wordlist(self, wordlist, FILE* f): # <<<<<<<<<<<<<<
@@ -17281,7 +17319,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_write_wordlist(CYTHON_UNUSED stru
return __pyx_r;
}
-/* "bilex.pxi":233
+/* "cdec/sa/bilex.pxi":233
*
*
* cdef read_wordlist(self, word2id, id2word, FILE* f): # <<<<<<<<<<<<<<
@@ -17306,7 +17344,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_read_wordlist(CYTHON_UNUSED struc
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("read_wordlist", 0);
- /* "bilex.pxi":238
+ /* "cdec/sa/bilex.pxi":238
* cdef char* word
*
* fread(&(num_words), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -17315,7 +17353,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_read_wordlist(CYTHON_UNUSED struc
*/
fread((&__pyx_v_num_words), (sizeof(int)), 1, __pyx_v_f);
- /* "bilex.pxi":239
+ /* "cdec/sa/bilex.pxi":239
*
* fread(&(num_words), sizeof(int), 1, f)
* for i from 0 <= i < num_words: # <<<<<<<<<<<<<<
@@ -17325,7 +17363,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_read_wordlist(CYTHON_UNUSED struc
__pyx_t_1 = __pyx_v_num_words;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {
- /* "bilex.pxi":240
+ /* "cdec/sa/bilex.pxi":240
* fread(&(num_words), sizeof(int), 1, f)
* for i from 0 <= i < num_words:
* fread(&(word_len), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -17334,7 +17372,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_read_wordlist(CYTHON_UNUSED struc
*/
fread((&__pyx_v_word_len), (sizeof(int)), 1, __pyx_v_f);
- /* "bilex.pxi":241
+ /* "cdec/sa/bilex.pxi":241
* for i from 0 <= i < num_words:
* fread(&(word_len), sizeof(int), 1, f)
* word = <char*> malloc (word_len * sizeof(char)) # <<<<<<<<<<<<<<
@@ -17343,7 +17381,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_read_wordlist(CYTHON_UNUSED struc
*/
__pyx_v_word = ((char *)malloc((__pyx_v_word_len * (sizeof(char)))));
- /* "bilex.pxi":242
+ /* "cdec/sa/bilex.pxi":242
* fread(&(word_len), sizeof(int), 1, f)
* word = <char*> malloc (word_len * sizeof(char))
* fread(word, sizeof(char), word_len, f) # <<<<<<<<<<<<<<
@@ -17352,7 +17390,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_read_wordlist(CYTHON_UNUSED struc
*/
fread(__pyx_v_word, (sizeof(char)), __pyx_v_word_len, __pyx_v_f);
- /* "bilex.pxi":243
+ /* "cdec/sa/bilex.pxi":243
* word = <char*> malloc (word_len * sizeof(char))
* fread(word, sizeof(char), word_len, f)
* word2id[word] = len(id2word) # <<<<<<<<<<<<<<
@@ -17368,7 +17406,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_read_wordlist(CYTHON_UNUSED struc
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "bilex.pxi":244
+ /* "cdec/sa/bilex.pxi":244
* fread(word, sizeof(char), word_len, f)
* word2id[word] = len(id2word)
* id2word.append(word) # <<<<<<<<<<<<<<
@@ -17380,7 +17418,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_read_wordlist(CYTHON_UNUSED struc
__pyx_t_5 = __Pyx_PyObject_Append(__pyx_v_id2word, __pyx_t_3); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "bilex.pxi":245
+ /* "cdec/sa/bilex.pxi":245
* word2id[word] = len(id2word)
* id2word.append(word)
* free(word) # <<<<<<<<<<<<<<
@@ -17390,7 +17428,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_read_wordlist(CYTHON_UNUSED struc
free(__pyx_v_word);
}
- /* "bilex.pxi":233
+ /* "cdec/sa/bilex.pxi":233
*
*
* cdef read_wordlist(self, word2id, id2word, FILE* f): # <<<<<<<<<<<<<<
@@ -17412,7 +17450,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_read_wordlist(CYTHON_UNUSED struc
return __pyx_r;
}
-/* "bilex.pxi":247
+/* "cdec/sa/bilex.pxi":247
* free(word)
*
* def read_binary(self, char* filename): # <<<<<<<<<<<<<<
@@ -17458,7 +17496,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_4read_binary(struct __pyx_obj_4c
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("read_binary", 0);
- /* "bilex.pxi":249
+ /* "cdec/sa/bilex.pxi":249
* def read_binary(self, char* filename):
* cdef FILE* f
* f = fopen(filename, "r") # <<<<<<<<<<<<<<
@@ -17467,7 +17505,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_4read_binary(struct __pyx_obj_4c
*/
__pyx_v_f = fopen(__pyx_v_filename, __pyx_k_r);
- /* "bilex.pxi":250
+ /* "cdec/sa/bilex.pxi":250
* cdef FILE* f
* f = fopen(filename, "r")
* self.f_index.read_handle(f) # <<<<<<<<<<<<<<
@@ -17476,7 +17514,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_4read_binary(struct __pyx_obj_4c
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->f_index->__pyx_vtab)->read_handle(__pyx_v_self->f_index, __pyx_v_f);
- /* "bilex.pxi":251
+ /* "cdec/sa/bilex.pxi":251
* f = fopen(filename, "r")
* self.f_index.read_handle(f)
* self.e_index.read_handle(f) # <<<<<<<<<<<<<<
@@ -17485,7 +17523,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_4read_binary(struct __pyx_obj_4c
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->e_index->__pyx_vtab)->read_handle(__pyx_v_self->e_index, __pyx_v_f);
- /* "bilex.pxi":252
+ /* "cdec/sa/bilex.pxi":252
* self.f_index.read_handle(f)
* self.e_index.read_handle(f)
* self.col1.read_handle(f) # <<<<<<<<<<<<<<
@@ -17494,7 +17532,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_4read_binary(struct __pyx_obj_4c
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_FloatList *)__pyx_v_self->col1->__pyx_vtab)->read_handle(__pyx_v_self->col1, __pyx_v_f);
- /* "bilex.pxi":253
+ /* "cdec/sa/bilex.pxi":253
* self.e_index.read_handle(f)
* self.col1.read_handle(f)
* self.col2.read_handle(f) # <<<<<<<<<<<<<<
@@ -17503,7 +17541,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_4read_binary(struct __pyx_obj_4c
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_FloatList *)__pyx_v_self->col2->__pyx_vtab)->read_handle(__pyx_v_self->col2, __pyx_v_f);
- /* "bilex.pxi":254
+ /* "cdec/sa/bilex.pxi":254
* self.col1.read_handle(f)
* self.col2.read_handle(f)
* self.read_wordlist(self.fword2id, self.id2fword, f) # <<<<<<<<<<<<<<
@@ -17520,7 +17558,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_4read_binary(struct __pyx_obj_4c
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "bilex.pxi":255
+ /* "cdec/sa/bilex.pxi":255
* self.col2.read_handle(f)
* self.read_wordlist(self.fword2id, self.id2fword, f)
* self.read_wordlist(self.eword2id, self.id2eword, f) # <<<<<<<<<<<<<<
@@ -17537,7 +17575,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_4read_binary(struct __pyx_obj_4c
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "bilex.pxi":256
+ /* "cdec/sa/bilex.pxi":256
* self.read_wordlist(self.fword2id, self.id2fword, f)
* self.read_wordlist(self.eword2id, self.id2eword, f)
* fclose(f) # <<<<<<<<<<<<<<
@@ -17546,7 +17584,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_4read_binary(struct __pyx_obj_4c
*/
fclose(__pyx_v_f);
- /* "bilex.pxi":247
+ /* "cdec/sa/bilex.pxi":247
* free(word)
*
* def read_binary(self, char* filename): # <<<<<<<<<<<<<<
@@ -17569,7 +17607,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_4read_binary(struct __pyx_obj_4c
return __pyx_r;
}
-/* "bilex.pxi":259
+/* "cdec/sa/bilex.pxi":259
*
*
* def contains_e_word(self, eword): # <<<<<<<<<<<<<<
@@ -17600,7 +17638,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_6contains_e_word(struct __pyx_ob
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("contains_e_word", 0);
- /* "bilex.pxi":260
+ /* "cdec/sa/bilex.pxi":260
*
* def contains_e_word(self, eword):
* return (eword in self.eword2id) # <<<<<<<<<<<<<<
@@ -17615,7 +17653,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_6contains_e_word(struct __pyx_ob
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "bilex.pxi":259
+ /* "cdec/sa/bilex.pxi":259
*
*
* def contains_e_word(self, eword): # <<<<<<<<<<<<<<
@@ -17634,7 +17672,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_6contains_e_word(struct __pyx_ob
return __pyx_r;
}
-/* "bilex.pxi":263
+/* "cdec/sa/bilex.pxi":263
*
*
* def contains_f_word(self, fword): # <<<<<<<<<<<<<<
@@ -17665,7 +17703,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_8contains_f_word(struct __pyx_ob
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("contains_f_word", 0);
- /* "bilex.pxi":264
+ /* "cdec/sa/bilex.pxi":264
*
* def contains_f_word(self, fword):
* return (fword in self.fword2id) # <<<<<<<<<<<<<<
@@ -17680,7 +17718,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_8contains_f_word(struct __pyx_ob
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "bilex.pxi":263
+ /* "cdec/sa/bilex.pxi":263
*
*
* def contains_f_word(self, fword): # <<<<<<<<<<<<<<
@@ -17699,7 +17737,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_8contains_f_word(struct __pyx_ob
return __pyx_r;
}
-/* "bilex.pxi":267
+/* "cdec/sa/bilex.pxi":267
*
*
* def get_e_id(self, eword): # <<<<<<<<<<<<<<
@@ -17734,7 +17772,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_10get_e_id(struct __pyx_obj_4cde
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("get_e_id", 0);
- /* "bilex.pxi":268
+ /* "cdec/sa/bilex.pxi":268
*
* def get_e_id(self, eword):
* if eword not in self.eword2id: # <<<<<<<<<<<<<<
@@ -17745,7 +17783,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_10get_e_id(struct __pyx_obj_4cde
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "bilex.pxi":269
+ /* "cdec/sa/bilex.pxi":269
* def get_e_id(self, eword):
* if eword not in self.eword2id:
* e_id = len(self.id2eword) # <<<<<<<<<<<<<<
@@ -17758,7 +17796,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_10get_e_id(struct __pyx_obj_4cde
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_e_id = __pyx_t_4;
- /* "bilex.pxi":270
+ /* "cdec/sa/bilex.pxi":270
* if eword not in self.eword2id:
* e_id = len(self.id2eword)
* self.id2eword.append(eword) # <<<<<<<<<<<<<<
@@ -17767,7 +17805,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_10get_e_id(struct __pyx_obj_4cde
*/
__pyx_t_5 = __Pyx_PyObject_Append(__pyx_v_self->id2eword, __pyx_v_eword); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "bilex.pxi":271
+ /* "cdec/sa/bilex.pxi":271
* e_id = len(self.id2eword)
* self.id2eword.append(eword)
* self.eword2id[eword] = e_id # <<<<<<<<<<<<<<
@@ -17782,7 +17820,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_10get_e_id(struct __pyx_obj_4cde
}
__pyx_L3:;
- /* "bilex.pxi":272
+ /* "cdec/sa/bilex.pxi":272
* self.id2eword.append(eword)
* self.eword2id[eword] = e_id
* return self.eword2id[eword] # <<<<<<<<<<<<<<
@@ -17796,7 +17834,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_10get_e_id(struct __pyx_obj_4cde
__pyx_t_3 = 0;
goto __pyx_L0;
- /* "bilex.pxi":267
+ /* "cdec/sa/bilex.pxi":267
*
*
* def get_e_id(self, eword): # <<<<<<<<<<<<<<
@@ -17815,7 +17853,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_10get_e_id(struct __pyx_obj_4cde
return __pyx_r;
}
-/* "bilex.pxi":275
+/* "cdec/sa/bilex.pxi":275
*
*
* def get_f_id(self, fword): # <<<<<<<<<<<<<<
@@ -17850,7 +17888,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_12get_f_id(struct __pyx_obj_4cde
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("get_f_id", 0);
- /* "bilex.pxi":276
+ /* "cdec/sa/bilex.pxi":276
*
* def get_f_id(self, fword):
* if fword not in self.fword2id: # <<<<<<<<<<<<<<
@@ -17861,7 +17899,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_12get_f_id(struct __pyx_obj_4cde
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "bilex.pxi":277
+ /* "cdec/sa/bilex.pxi":277
* def get_f_id(self, fword):
* if fword not in self.fword2id:
* f_id = len(self.id2fword) # <<<<<<<<<<<<<<
@@ -17874,7 +17912,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_12get_f_id(struct __pyx_obj_4cde
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_f_id = __pyx_t_4;
- /* "bilex.pxi":278
+ /* "cdec/sa/bilex.pxi":278
* if fword not in self.fword2id:
* f_id = len(self.id2fword)
* self.id2fword.append(fword) # <<<<<<<<<<<<<<
@@ -17883,7 +17921,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_12get_f_id(struct __pyx_obj_4cde
*/
__pyx_t_5 = __Pyx_PyObject_Append(__pyx_v_self->id2fword, __pyx_v_fword); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "bilex.pxi":279
+ /* "cdec/sa/bilex.pxi":279
* f_id = len(self.id2fword)
* self.id2fword.append(fword)
* self.fword2id[fword] = f_id # <<<<<<<<<<<<<<
@@ -17898,7 +17936,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_12get_f_id(struct __pyx_obj_4cde
}
__pyx_L3:;
- /* "bilex.pxi":280
+ /* "cdec/sa/bilex.pxi":280
* self.id2fword.append(fword)
* self.fword2id[fword] = f_id
* return self.fword2id[fword] # <<<<<<<<<<<<<<
@@ -17912,7 +17950,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_12get_f_id(struct __pyx_obj_4cde
__pyx_t_3 = 0;
goto __pyx_L0;
- /* "bilex.pxi":275
+ /* "cdec/sa/bilex.pxi":275
*
*
* def get_f_id(self, fword): # <<<<<<<<<<<<<<
@@ -17931,7 +17969,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_12get_f_id(struct __pyx_obj_4cde
return __pyx_r;
}
-/* "bilex.pxi":283
+/* "cdec/sa/bilex.pxi":283
*
*
* def read_text(self, char* filename): # <<<<<<<<<<<<<<
@@ -18013,7 +18051,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("read_text", 0);
- /* "bilex.pxi":287
+ /* "cdec/sa/bilex.pxi":287
* cdef IntList fcount
*
* fcount = IntList() # <<<<<<<<<<<<<<
@@ -18025,7 +18063,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd
__pyx_v_fcount = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "bilex.pxi":288
+ /* "cdec/sa/bilex.pxi":288
*
* fcount = IntList()
* with gzip_or_text(filename) as f: # <<<<<<<<<<<<<<
@@ -18098,7 +18136,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd
__pyx_v_f = __pyx_t_5;
__pyx_t_5 = 0;
- /* "bilex.pxi":290
+ /* "cdec/sa/bilex.pxi":290
* with gzip_or_text(filename) as f:
* # first loop merely establishes size of array objects
* for line in f: # <<<<<<<<<<<<<<
@@ -18145,7 +18183,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd
__Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_1);
__pyx_t_1 = 0;
- /* "bilex.pxi":291
+ /* "cdec/sa/bilex.pxi":291
* # first loop merely establishes size of array objects
* for line in f:
* (fword, eword, score1, score2) = line.split() # <<<<<<<<<<<<<<
@@ -18244,7 +18282,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd
__Pyx_XDECREF_SET(__pyx_v_score2, __pyx_t_12);
__pyx_t_12 = 0;
- /* "bilex.pxi":292
+ /* "cdec/sa/bilex.pxi":292
* for line in f:
* (fword, eword, score1, score2) = line.split()
* f_id = self.get_f_id(fword) # <<<<<<<<<<<<<<
@@ -18281,7 +18319,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd
__Pyx_XDECREF_SET(__pyx_v_f_id, __pyx_t_1);
__pyx_t_1 = 0;
- /* "bilex.pxi":293
+ /* "cdec/sa/bilex.pxi":293
* (fword, eword, score1, score2) = line.split()
* f_id = self.get_f_id(fword)
* e_id = self.get_e_id(eword) # <<<<<<<<<<<<<<
@@ -18318,7 +18356,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd
__Pyx_XDECREF_SET(__pyx_v_e_id, __pyx_t_1);
__pyx_t_1 = 0;
- /* "bilex.pxi":294
+ /* "cdec/sa/bilex.pxi":294
* f_id = self.get_f_id(fword)
* e_id = self.get_e_id(eword)
* while f_id >= len(fcount): # <<<<<<<<<<<<<<
@@ -18335,7 +18373,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
if (!__pyx_t_16) break;
- /* "bilex.pxi":295
+ /* "cdec/sa/bilex.pxi":295
* e_id = self.get_e_id(eword)
* while f_id >= len(fcount):
* fcount.append(0) # <<<<<<<<<<<<<<
@@ -18345,7 +18383,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd
__pyx_t_17 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_fcount), __pyx_int_0); if (unlikely(__pyx_t_17 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
}
- /* "bilex.pxi":296
+ /* "cdec/sa/bilex.pxi":296
* while f_id >= len(fcount):
* fcount.append(0)
* fcount.arr[f_id] = fcount.arr[f_id] + 1 # <<<<<<<<<<<<<<
@@ -18356,7 +18394,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd
__pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_f_id); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
(__pyx_v_fcount->arr[__pyx_t_18]) = ((__pyx_v_fcount->arr[__pyx_t_15]) + 1);
- /* "bilex.pxi":290
+ /* "cdec/sa/bilex.pxi":290
* with gzip_or_text(filename) as f:
* # first loop merely establishes size of array objects
* for line in f: # <<<<<<<<<<<<<<
@@ -18366,7 +18404,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "bilex.pxi":299
+ /* "cdec/sa/bilex.pxi":299
*
* # Allocate space for dictionary in arrays
* N = 0 # <<<<<<<<<<<<<<
@@ -18376,7 +18414,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd
__Pyx_INCREF(__pyx_int_0);
__pyx_v_N = __pyx_int_0;
- /* "bilex.pxi":300
+ /* "cdec/sa/bilex.pxi":300
* # Allocate space for dictionary in arrays
* N = 0
* n_f = len(fcount) # <<<<<<<<<<<<<<
@@ -18389,7 +18427,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd
__pyx_v_n_f = __pyx_t_5;
__pyx_t_5 = 0;
- /* "bilex.pxi":301
+ /* "cdec/sa/bilex.pxi":301
* N = 0
* n_f = len(fcount)
* self.f_index = IntList(initial_len=n_f+1) # <<<<<<<<<<<<<<
@@ -18411,7 +18449,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd
__pyx_v_self->f_index = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_12);
__pyx_t_12 = 0;
- /* "bilex.pxi":302
+ /* "cdec/sa/bilex.pxi":302
* n_f = len(fcount)
* self.f_index = IntList(initial_len=n_f+1)
* for i from 0 <= i < n_f: # <<<<<<<<<<<<<<
@@ -18425,7 +18463,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd
__Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_12);
__pyx_t_12 = 0;
- /* "bilex.pxi":303
+ /* "cdec/sa/bilex.pxi":303
* self.f_index = IntList(initial_len=n_f+1)
* for i from 0 <= i < n_f:
* self.f_index.arr[i] = N # <<<<<<<<<<<<<<
@@ -18436,7 +18474,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd
__pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
(__pyx_v_self->f_index->arr[__pyx_t_10]) = __pyx_t_21;
- /* "bilex.pxi":304
+ /* "cdec/sa/bilex.pxi":304
* for i from 0 <= i < n_f:
* self.f_index.arr[i] = N
* N = N + fcount.arr[i] # <<<<<<<<<<<<<<
@@ -18452,7 +18490,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd
__Pyx_DECREF_SET(__pyx_v_N, __pyx_t_5);
__pyx_t_5 = 0;
- /* "bilex.pxi":305
+ /* "cdec/sa/bilex.pxi":305
* self.f_index.arr[i] = N
* N = N + fcount.arr[i]
* fcount.arr[i] = 0 # <<<<<<<<<<<<<<
@@ -18464,7 +18502,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd
__pyx_t_20 = __Pyx_PyInt_As_long(__pyx_v_i); if (unlikely((__pyx_t_20 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
}
- /* "bilex.pxi":302
+ /* "cdec/sa/bilex.pxi":302
* n_f = len(fcount)
* self.f_index = IntList(initial_len=n_f+1)
* for i from 0 <= i < n_f: # <<<<<<<<<<<<<<
@@ -18476,7 +18514,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd
__Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_5);
__pyx_t_5 = 0;
- /* "bilex.pxi":306
+ /* "cdec/sa/bilex.pxi":306
* N = N + fcount.arr[i]
* fcount.arr[i] = 0
* self.f_index.arr[n_f] = N # <<<<<<<<<<<<<<
@@ -18487,7 +18525,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd
__pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n_f); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
(__pyx_v_self->f_index->arr[__pyx_t_10]) = __pyx_t_21;
- /* "bilex.pxi":307
+ /* "cdec/sa/bilex.pxi":307
* fcount.arr[i] = 0
* self.f_index.arr[n_f] = N
* self.e_index = IntList(initial_len=N) # <<<<<<<<<<<<<<
@@ -18506,7 +18544,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd
__pyx_v_self->e_index = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_12);
__pyx_t_12 = 0;
- /* "bilex.pxi":308
+ /* "cdec/sa/bilex.pxi":308
* self.f_index.arr[n_f] = N
* self.e_index = IntList(initial_len=N)
* self.col1 = FloatList(initial_len=N) # <<<<<<<<<<<<<<
@@ -18525,7 +18563,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd
__pyx_v_self->col1 = ((struct __pyx_obj_4cdec_2sa_3_sa_FloatList *)__pyx_t_5);
__pyx_t_5 = 0;
- /* "bilex.pxi":309
+ /* "cdec/sa/bilex.pxi":309
* self.e_index = IntList(initial_len=N)
* self.col1 = FloatList(initial_len=N)
* self.col2 = FloatList(initial_len=N) # <<<<<<<<<<<<<<
@@ -18544,7 +18582,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd
__pyx_v_self->col2 = ((struct __pyx_obj_4cdec_2sa_3_sa_FloatList *)__pyx_t_12);
__pyx_t_12 = 0;
- /* "bilex.pxi":312
+ /* "cdec/sa/bilex.pxi":312
*
* # Re-read file, placing words into buckets
* f.seek(0) # <<<<<<<<<<<<<<
@@ -18558,7 +18596,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "bilex.pxi":313
+ /* "cdec/sa/bilex.pxi":313
* # Re-read file, placing words into buckets
* f.seek(0)
* for line in f: # <<<<<<<<<<<<<<
@@ -18605,7 +18643,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd
__Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_12);
__pyx_t_12 = 0;
- /* "bilex.pxi":314
+ /* "cdec/sa/bilex.pxi":314
* f.seek(0)
* for line in f:
* (fword, eword, score1, score2) = line.split() # <<<<<<<<<<<<<<
@@ -18704,7 +18742,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd
__Pyx_XDECREF_SET(__pyx_v_score2, __pyx_t_2);
__pyx_t_2 = 0;
- /* "bilex.pxi":315
+ /* "cdec/sa/bilex.pxi":315
* for line in f:
* (fword, eword, score1, score2) = line.split()
* f_id = self.get_f_id(fword) # <<<<<<<<<<<<<<
@@ -18741,7 +18779,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd
__Pyx_XDECREF_SET(__pyx_v_f_id, __pyx_t_12);
__pyx_t_12 = 0;
- /* "bilex.pxi":316
+ /* "cdec/sa/bilex.pxi":316
* (fword, eword, score1, score2) = line.split()
* f_id = self.get_f_id(fword)
* e_id = self.get_e_id(eword) # <<<<<<<<<<<<<<
@@ -18778,7 +18816,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd
__Pyx_XDECREF_SET(__pyx_v_e_id, __pyx_t_12);
__pyx_t_12 = 0;
- /* "bilex.pxi":317
+ /* "cdec/sa/bilex.pxi":317
* f_id = self.get_f_id(fword)
* e_id = self.get_e_id(eword)
* index = self.f_index.arr[f_id] + fcount.arr[f_id] # <<<<<<<<<<<<<<
@@ -18792,7 +18830,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd
__Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_12);
__pyx_t_12 = 0;
- /* "bilex.pxi":318
+ /* "cdec/sa/bilex.pxi":318
* e_id = self.get_e_id(eword)
* index = self.f_index.arr[f_id] + fcount.arr[f_id]
* fcount.arr[f_id] = fcount.arr[f_id] + 1 # <<<<<<<<<<<<<<
@@ -18803,7 +18841,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd
__pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_f_id); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
(__pyx_v_fcount->arr[__pyx_t_15]) = ((__pyx_v_fcount->arr[__pyx_t_18]) + 1);
- /* "bilex.pxi":319
+ /* "cdec/sa/bilex.pxi":319
* index = self.f_index.arr[f_id] + fcount.arr[f_id]
* fcount.arr[f_id] = fcount.arr[f_id] + 1
* self.e_index.arr[index] = int(e_id) # <<<<<<<<<<<<<<
@@ -18817,7 +18855,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd
__pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
(__pyx_v_self->e_index->arr[__pyx_t_18]) = __pyx_t_21;
- /* "bilex.pxi":320
+ /* "cdec/sa/bilex.pxi":320
* fcount.arr[f_id] = fcount.arr[f_id] + 1
* self.e_index.arr[index] = int(e_id)
* self.col1[index] = float(score1) # <<<<<<<<<<<<<<
@@ -18830,7 +18868,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd
if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self->col1), __pyx_v_index, __pyx_t_12) < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- /* "bilex.pxi":321
+ /* "cdec/sa/bilex.pxi":321
* self.e_index.arr[index] = int(e_id)
* self.col1[index] = float(score1)
* self.col2[index] = float(score2) # <<<<<<<<<<<<<<
@@ -18843,7 +18881,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd
if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self->col2), __pyx_v_index, __pyx_t_12) < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- /* "bilex.pxi":313
+ /* "cdec/sa/bilex.pxi":313
* # Re-read file, placing words into buckets
* f.seek(0)
* for line in f: # <<<<<<<<<<<<<<
@@ -18866,7 +18904,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd
__Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "bilex.pxi":288
+ /* "cdec/sa/bilex.pxi":288
*
* fcount = IntList()
* with gzip_or_text(filename) as f: # <<<<<<<<<<<<<<
@@ -18937,7 +18975,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd
__pyx_L30:;
}
- /* "bilex.pxi":324
+ /* "cdec/sa/bilex.pxi":324
*
* # Sort buckets by eword
* for b from 0 <= b < n_f: # <<<<<<<<<<<<<<
@@ -18952,7 +18990,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd
__Pyx_XDECREF_SET(__pyx_v_b, __pyx_t_2);
__pyx_t_2 = 0;
- /* "bilex.pxi":325
+ /* "cdec/sa/bilex.pxi":325
* # Sort buckets by eword
* for b from 0 <= b < n_f:
* i = self.f_index.arr[b] # <<<<<<<<<<<<<<
@@ -18965,7 +19003,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd
__Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
__pyx_t_2 = 0;
- /* "bilex.pxi":326
+ /* "cdec/sa/bilex.pxi":326
* for b from 0 <= b < n_f:
* i = self.f_index.arr[b]
* j = self.f_index.arr[b+1] # <<<<<<<<<<<<<<
@@ -18981,7 +19019,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd
__Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_2);
__pyx_t_2 = 0;
- /* "bilex.pxi":327
+ /* "cdec/sa/bilex.pxi":327
* i = self.f_index.arr[b]
* j = self.f_index.arr[b+1]
* self.qsort(i,j, "") # <<<<<<<<<<<<<<
@@ -18996,7 +19034,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd
__pyx_t_19 = __Pyx_PyInt_As_long(__pyx_v_b); if (unlikely((__pyx_t_19 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- /* "bilex.pxi":324
+ /* "cdec/sa/bilex.pxi":324
*
* # Sort buckets by eword
* for b from 0 <= b < n_f: # <<<<<<<<<<<<<<
@@ -19008,7 +19046,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd
__Pyx_XDECREF_SET(__pyx_v_b, __pyx_t_2);
__pyx_t_2 = 0;
- /* "bilex.pxi":283
+ /* "cdec/sa/bilex.pxi":283
*
*
* def read_text(self, char* filename): # <<<<<<<<<<<<<<
@@ -19050,7 +19088,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_14read_text(struct __pyx_obj_4cd
return __pyx_r;
}
-/* "bilex.pxi":330
+/* "cdec/sa/bilex.pxi":330
*
*
* cdef swap(self, int i, int j): # <<<<<<<<<<<<<<
@@ -19066,7 +19104,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_swap(struct __pyx_obj_4cdec_2sa_3
int __pyx_t_1;
__Pyx_RefNannySetupContext("swap", 0);
- /* "bilex.pxi":334
+ /* "cdec/sa/bilex.pxi":334
* cdef float ftmp
*
* if i == j: # <<<<<<<<<<<<<<
@@ -19076,7 +19114,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_swap(struct __pyx_obj_4cdec_2sa_3
__pyx_t_1 = ((__pyx_v_i == __pyx_v_j) != 0);
if (__pyx_t_1) {
- /* "bilex.pxi":335
+ /* "cdec/sa/bilex.pxi":335
*
* if i == j:
* return # <<<<<<<<<<<<<<
@@ -19088,7 +19126,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_swap(struct __pyx_obj_4cdec_2sa_3
goto __pyx_L0;
}
- /* "bilex.pxi":337
+ /* "cdec/sa/bilex.pxi":337
* return
*
* itmp = self.e_index.arr[i] # <<<<<<<<<<<<<<
@@ -19097,7 +19135,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_swap(struct __pyx_obj_4cdec_2sa_3
*/
__pyx_v_itmp = (__pyx_v_self->e_index->arr[__pyx_v_i]);
- /* "bilex.pxi":338
+ /* "cdec/sa/bilex.pxi":338
*
* itmp = self.e_index.arr[i]
* self.e_index.arr[i] = self.e_index.arr[j] # <<<<<<<<<<<<<<
@@ -19106,7 +19144,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_swap(struct __pyx_obj_4cdec_2sa_3
*/
(__pyx_v_self->e_index->arr[__pyx_v_i]) = (__pyx_v_self->e_index->arr[__pyx_v_j]);
- /* "bilex.pxi":339
+ /* "cdec/sa/bilex.pxi":339
* itmp = self.e_index.arr[i]
* self.e_index.arr[i] = self.e_index.arr[j]
* self.e_index.arr[j] = itmp # <<<<<<<<<<<<<<
@@ -19115,7 +19153,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_swap(struct __pyx_obj_4cdec_2sa_3
*/
(__pyx_v_self->e_index->arr[__pyx_v_j]) = __pyx_v_itmp;
- /* "bilex.pxi":341
+ /* "cdec/sa/bilex.pxi":341
* self.e_index.arr[j] = itmp
*
* ftmp = self.col1.arr[i] # <<<<<<<<<<<<<<
@@ -19124,7 +19162,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_swap(struct __pyx_obj_4cdec_2sa_3
*/
__pyx_v_ftmp = (__pyx_v_self->col1->arr[__pyx_v_i]);
- /* "bilex.pxi":342
+ /* "cdec/sa/bilex.pxi":342
*
* ftmp = self.col1.arr[i]
* self.col1.arr[i] = self.col1.arr[j] # <<<<<<<<<<<<<<
@@ -19133,7 +19171,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_swap(struct __pyx_obj_4cdec_2sa_3
*/
(__pyx_v_self->col1->arr[__pyx_v_i]) = (__pyx_v_self->col1->arr[__pyx_v_j]);
- /* "bilex.pxi":343
+ /* "cdec/sa/bilex.pxi":343
* ftmp = self.col1.arr[i]
* self.col1.arr[i] = self.col1.arr[j]
* self.col1.arr[j] = ftmp # <<<<<<<<<<<<<<
@@ -19142,7 +19180,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_swap(struct __pyx_obj_4cdec_2sa_3
*/
(__pyx_v_self->col1->arr[__pyx_v_j]) = __pyx_v_ftmp;
- /* "bilex.pxi":345
+ /* "cdec/sa/bilex.pxi":345
* self.col1.arr[j] = ftmp
*
* ftmp = self.col2.arr[i] # <<<<<<<<<<<<<<
@@ -19151,7 +19189,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_swap(struct __pyx_obj_4cdec_2sa_3
*/
__pyx_v_ftmp = (__pyx_v_self->col2->arr[__pyx_v_i]);
- /* "bilex.pxi":346
+ /* "cdec/sa/bilex.pxi":346
*
* ftmp = self.col2.arr[i]
* self.col2.arr[i] = self.col2.arr[j] # <<<<<<<<<<<<<<
@@ -19160,7 +19198,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_swap(struct __pyx_obj_4cdec_2sa_3
*/
(__pyx_v_self->col2->arr[__pyx_v_i]) = (__pyx_v_self->col2->arr[__pyx_v_j]);
- /* "bilex.pxi":347
+ /* "cdec/sa/bilex.pxi":347
* ftmp = self.col2.arr[i]
* self.col2.arr[i] = self.col2.arr[j]
* self.col2.arr[j] = ftmp # <<<<<<<<<<<<<<
@@ -19169,7 +19207,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_swap(struct __pyx_obj_4cdec_2sa_3
*/
(__pyx_v_self->col2->arr[__pyx_v_j]) = __pyx_v_ftmp;
- /* "bilex.pxi":330
+ /* "cdec/sa/bilex.pxi":330
*
*
* cdef swap(self, int i, int j): # <<<<<<<<<<<<<<
@@ -19185,7 +19223,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_swap(struct __pyx_obj_4cdec_2sa_3
return __pyx_r;
}
-/* "bilex.pxi":350
+/* "cdec/sa/bilex.pxi":350
*
*
* cdef qsort(self, int i, int j, pad): # <<<<<<<<<<<<<<
@@ -19208,7 +19246,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_qsort(struct __pyx_obj_4cdec_2sa_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("qsort", 0);
- /* "bilex.pxi":353
+ /* "cdec/sa/bilex.pxi":353
* cdef int pval, p
*
* if i > j: # <<<<<<<<<<<<<<
@@ -19218,7 +19256,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_qsort(struct __pyx_obj_4cdec_2sa_
__pyx_t_1 = ((__pyx_v_i > __pyx_v_j) != 0);
if (__pyx_t_1) {
- /* "bilex.pxi":354
+ /* "cdec/sa/bilex.pxi":354
*
* if i > j:
* raise Exception("Sort error in CLex") # <<<<<<<<<<<<<<
@@ -19232,7 +19270,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_qsort(struct __pyx_obj_4cdec_2sa_
{__pyx_filename = __pyx_f[5]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- /* "bilex.pxi":355
+ /* "cdec/sa/bilex.pxi":355
* if i > j:
* raise Exception("Sort error in CLex")
* if i == j: #empty interval # <<<<<<<<<<<<<<
@@ -19242,7 +19280,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_qsort(struct __pyx_obj_4cdec_2sa_
__pyx_t_1 = ((__pyx_v_i == __pyx_v_j) != 0);
if (__pyx_t_1) {
- /* "bilex.pxi":356
+ /* "cdec/sa/bilex.pxi":356
* raise Exception("Sort error in CLex")
* if i == j: #empty interval
* return # <<<<<<<<<<<<<<
@@ -19254,7 +19292,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_qsort(struct __pyx_obj_4cdec_2sa_
goto __pyx_L0;
}
- /* "bilex.pxi":357
+ /* "cdec/sa/bilex.pxi":357
* if i == j: #empty interval
* return
* if i == j-1: # singleton interval # <<<<<<<<<<<<<<
@@ -19264,7 +19302,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_qsort(struct __pyx_obj_4cdec_2sa_
__pyx_t_1 = ((__pyx_v_i == (__pyx_v_j - 1)) != 0);
if (__pyx_t_1) {
- /* "bilex.pxi":358
+ /* "cdec/sa/bilex.pxi":358
* return
* if i == j-1: # singleton interval
* return # <<<<<<<<<<<<<<
@@ -19276,7 +19314,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_qsort(struct __pyx_obj_4cdec_2sa_
goto __pyx_L0;
}
- /* "bilex.pxi":360
+ /* "cdec/sa/bilex.pxi":360
* return
*
* p = (i+j)/2 # <<<<<<<<<<<<<<
@@ -19285,7 +19323,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_qsort(struct __pyx_obj_4cdec_2sa_
*/
__pyx_v_p = __Pyx_div_long((__pyx_v_i + __pyx_v_j), 2);
- /* "bilex.pxi":361
+ /* "cdec/sa/bilex.pxi":361
*
* p = (i+j)/2
* pval = self.e_index.arr[p] # <<<<<<<<<<<<<<
@@ -19294,7 +19332,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_qsort(struct __pyx_obj_4cdec_2sa_
*/
__pyx_v_pval = (__pyx_v_self->e_index->arr[__pyx_v_p]);
- /* "bilex.pxi":362
+ /* "cdec/sa/bilex.pxi":362
* p = (i+j)/2
* pval = self.e_index.arr[p]
* self.swap(i, p) # <<<<<<<<<<<<<<
@@ -19305,7 +19343,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_qsort(struct __pyx_obj_4cdec_2sa_
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "bilex.pxi":363
+ /* "cdec/sa/bilex.pxi":363
* pval = self.e_index.arr[p]
* self.swap(i, p)
* p = i # <<<<<<<<<<<<<<
@@ -19314,7 +19352,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_qsort(struct __pyx_obj_4cdec_2sa_
*/
__pyx_v_p = __pyx_v_i;
- /* "bilex.pxi":364
+ /* "cdec/sa/bilex.pxi":364
* self.swap(i, p)
* p = i
* for k from i+1 <= k < j: # <<<<<<<<<<<<<<
@@ -19324,7 +19362,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_qsort(struct __pyx_obj_4cdec_2sa_
__pyx_t_3 = __pyx_v_j;
for (__pyx_v_k = (__pyx_v_i + 1); __pyx_v_k < __pyx_t_3; __pyx_v_k++) {
- /* "bilex.pxi":365
+ /* "cdec/sa/bilex.pxi":365
* p = i
* for k from i+1 <= k < j:
* if pval >= self.e_index.arr[k]: # <<<<<<<<<<<<<<
@@ -19334,7 +19372,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_qsort(struct __pyx_obj_4cdec_2sa_
__pyx_t_1 = ((__pyx_v_pval >= (__pyx_v_self->e_index->arr[__pyx_v_k])) != 0);
if (__pyx_t_1) {
- /* "bilex.pxi":366
+ /* "cdec/sa/bilex.pxi":366
* for k from i+1 <= k < j:
* if pval >= self.e_index.arr[k]:
* self.swap(p+1, k) # <<<<<<<<<<<<<<
@@ -19345,7 +19383,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_qsort(struct __pyx_obj_4cdec_2sa_
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "bilex.pxi":367
+ /* "cdec/sa/bilex.pxi":367
* if pval >= self.e_index.arr[k]:
* self.swap(p+1, k)
* self.swap(p, p+1) # <<<<<<<<<<<<<<
@@ -19356,7 +19394,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_qsort(struct __pyx_obj_4cdec_2sa_
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "bilex.pxi":368
+ /* "cdec/sa/bilex.pxi":368
* self.swap(p+1, k)
* self.swap(p, p+1)
* p = p + 1 # <<<<<<<<<<<<<<
@@ -19369,7 +19407,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_qsort(struct __pyx_obj_4cdec_2sa_
__pyx_L8:;
}
- /* "bilex.pxi":369
+ /* "cdec/sa/bilex.pxi":369
* self.swap(p, p+1)
* p = p + 1
* self.qsort(i,p, pad+" ") # <<<<<<<<<<<<<<
@@ -19383,7 +19421,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_qsort(struct __pyx_obj_4cdec_2sa_
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "bilex.pxi":370
+ /* "cdec/sa/bilex.pxi":370
* p = p + 1
* self.qsort(i,p, pad+" ")
* self.qsort(p+1,j, pad+" ") # <<<<<<<<<<<<<<
@@ -19397,7 +19435,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_qsort(struct __pyx_obj_4cdec_2sa_
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "bilex.pxi":350
+ /* "cdec/sa/bilex.pxi":350
*
*
* cdef qsort(self, int i, int j, pad): # <<<<<<<<<<<<<<
@@ -19419,7 +19457,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_5BiLex_qsort(struct __pyx_obj_4cdec_2sa_
return __pyx_r;
}
-/* "bilex.pxi":373
+/* "cdec/sa/bilex.pxi":373
*
*
* def write_enhanced(self, char* filename): # <<<<<<<<<<<<<<
@@ -19483,7 +19521,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_16write_enhanced(struct __pyx_ob
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("write_enhanced", 0);
- /* "bilex.pxi":374
+ /* "cdec/sa/bilex.pxi":374
*
* def write_enhanced(self, char* filename):
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -19539,7 +19577,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_16write_enhanced(struct __pyx_ob
__pyx_v_f = __pyx_t_4;
__pyx_t_4 = 0;
- /* "bilex.pxi":375
+ /* "cdec/sa/bilex.pxi":375
* def write_enhanced(self, char* filename):
* with open(filename, "w") as f:
* for i in self.f_index: # <<<<<<<<<<<<<<
@@ -19586,7 +19624,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_16write_enhanced(struct __pyx_ob
__Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
__pyx_t_1 = 0;
- /* "bilex.pxi":376
+ /* "cdec/sa/bilex.pxi":376
* with open(filename, "w") as f:
* for i in self.f_index:
* f.write("%d " % i) # <<<<<<<<<<<<<<
@@ -19625,7 +19663,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_16write_enhanced(struct __pyx_ob
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "bilex.pxi":375
+ /* "cdec/sa/bilex.pxi":375
* def write_enhanced(self, char* filename):
* with open(filename, "w") as f:
* for i in self.f_index: # <<<<<<<<<<<<<<
@@ -19635,7 +19673,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_16write_enhanced(struct __pyx_ob
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "bilex.pxi":377
+ /* "cdec/sa/bilex.pxi":377
* for i in self.f_index:
* f.write("%d " % i)
* f.write("\n") # <<<<<<<<<<<<<<
@@ -19649,7 +19687,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_16write_enhanced(struct __pyx_ob
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "bilex.pxi":378
+ /* "cdec/sa/bilex.pxi":378
* f.write("%d " % i)
* f.write("\n")
* for i, s1, s2 in zip(self.e_index, self.col1, self.col2): # <<<<<<<<<<<<<<
@@ -19772,7 +19810,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_16write_enhanced(struct __pyx_ob
__Pyx_XDECREF_SET(__pyx_v_s2, __pyx_t_5);
__pyx_t_5 = 0;
- /* "bilex.pxi":379
+ /* "cdec/sa/bilex.pxi":379
* f.write("\n")
* for i, s1, s2 in zip(self.e_index, self.col1, self.col2):
* f.write("%d %f %f " % (i, s1, s2)) # <<<<<<<<<<<<<<
@@ -19823,7 +19861,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_16write_enhanced(struct __pyx_ob
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "bilex.pxi":378
+ /* "cdec/sa/bilex.pxi":378
* f.write("%d " % i)
* f.write("\n")
* for i, s1, s2 in zip(self.e_index, self.col1, self.col2): # <<<<<<<<<<<<<<
@@ -19833,7 +19871,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_16write_enhanced(struct __pyx_ob
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "bilex.pxi":380
+ /* "cdec/sa/bilex.pxi":380
* for i, s1, s2 in zip(self.e_index, self.col1, self.col2):
* f.write("%d %f %f " % (i, s1, s2))
* f.write("\n") # <<<<<<<<<<<<<<
@@ -19847,7 +19885,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_16write_enhanced(struct __pyx_ob
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "bilex.pxi":381
+ /* "cdec/sa/bilex.pxi":381
* f.write("%d %f %f " % (i, s1, s2))
* f.write("\n")
* for i, w in enumerate(self.id2fword): # <<<<<<<<<<<<<<
@@ -19903,7 +19941,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_16write_enhanced(struct __pyx_ob
__pyx_t_4 = __pyx_t_5;
__pyx_t_5 = 0;
- /* "bilex.pxi":382
+ /* "cdec/sa/bilex.pxi":382
* f.write("\n")
* for i, w in enumerate(self.id2fword):
* f.write("%d %s " % (i, w)) # <<<<<<<<<<<<<<
@@ -19951,7 +19989,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_16write_enhanced(struct __pyx_ob
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "bilex.pxi":381
+ /* "cdec/sa/bilex.pxi":381
* f.write("%d %f %f " % (i, s1, s2))
* f.write("\n")
* for i, w in enumerate(self.id2fword): # <<<<<<<<<<<<<<
@@ -19962,7 +20000,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_16write_enhanced(struct __pyx_ob
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "bilex.pxi":383
+ /* "cdec/sa/bilex.pxi":383
* for i, w in enumerate(self.id2fword):
* f.write("%d %s " % (i, w))
* f.write("\n") # <<<<<<<<<<<<<<
@@ -19976,7 +20014,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_16write_enhanced(struct __pyx_ob
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "bilex.pxi":384
+ /* "cdec/sa/bilex.pxi":384
* f.write("%d %s " % (i, w))
* f.write("\n")
* for i, w in enumerate(self.id2eword): # <<<<<<<<<<<<<<
@@ -20032,7 +20070,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_16write_enhanced(struct __pyx_ob
__pyx_t_1 = __pyx_t_5;
__pyx_t_5 = 0;
- /* "bilex.pxi":385
+ /* "cdec/sa/bilex.pxi":385
* f.write("\n")
* for i, w in enumerate(self.id2eword):
* f.write("%d %s " % (i, w)) # <<<<<<<<<<<<<<
@@ -20080,7 +20118,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_16write_enhanced(struct __pyx_ob
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "bilex.pxi":384
+ /* "cdec/sa/bilex.pxi":384
* f.write("%d %s " % (i, w))
* f.write("\n")
* for i, w in enumerate(self.id2eword): # <<<<<<<<<<<<<<
@@ -20091,7 +20129,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_16write_enhanced(struct __pyx_ob
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "bilex.pxi":386
+ /* "cdec/sa/bilex.pxi":386
* for i, w in enumerate(self.id2eword):
* f.write("%d %s " % (i, w))
* f.write("\n") # <<<<<<<<<<<<<<
@@ -20118,7 +20156,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_16write_enhanced(struct __pyx_ob
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "bilex.pxi":374
+ /* "cdec/sa/bilex.pxi":374
*
* def write_enhanced(self, char* filename):
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -20189,7 +20227,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_16write_enhanced(struct __pyx_ob
__pyx_L28:;
}
- /* "bilex.pxi":373
+ /* "cdec/sa/bilex.pxi":373
*
*
* def write_enhanced(self, char* filename): # <<<<<<<<<<<<<<
@@ -20221,7 +20259,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_16write_enhanced(struct __pyx_ob
return __pyx_r;
}
-/* "bilex.pxi":389
+/* "cdec/sa/bilex.pxi":389
*
*
* def get_score(self, fword, eword, col): # <<<<<<<<<<<<<<
@@ -20318,7 +20356,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_18get_score(struct __pyx_obj_4cd
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("get_score", 0);
- /* "bilex.pxi":392
+ /* "cdec/sa/bilex.pxi":392
* cdef e_id, f_id, low, high, midpoint, val
*
* if eword not in self.eword2id: # <<<<<<<<<<<<<<
@@ -20329,7 +20367,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_18get_score(struct __pyx_obj_4cd
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "bilex.pxi":393
+ /* "cdec/sa/bilex.pxi":393
*
* if eword not in self.eword2id:
* return None # <<<<<<<<<<<<<<
@@ -20342,7 +20380,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_18get_score(struct __pyx_obj_4cd
goto __pyx_L0;
}
- /* "bilex.pxi":394
+ /* "cdec/sa/bilex.pxi":394
* if eword not in self.eword2id:
* return None
* if fword not in self.fword2id: # <<<<<<<<<<<<<<
@@ -20353,7 +20391,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_18get_score(struct __pyx_obj_4cd
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "bilex.pxi":395
+ /* "cdec/sa/bilex.pxi":395
* return None
* if fword not in self.fword2id:
* return None # <<<<<<<<<<<<<<
@@ -20366,7 +20404,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_18get_score(struct __pyx_obj_4cd
goto __pyx_L0;
}
- /* "bilex.pxi":396
+ /* "cdec/sa/bilex.pxi":396
* if fword not in self.fword2id:
* return None
* f_id = self.fword2id[fword] # <<<<<<<<<<<<<<
@@ -20378,7 +20416,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_18get_score(struct __pyx_obj_4cd
__pyx_v_f_id = __pyx_t_3;
__pyx_t_3 = 0;
- /* "bilex.pxi":397
+ /* "cdec/sa/bilex.pxi":397
* return None
* f_id = self.fword2id[fword]
* e_id = self.eword2id[eword] # <<<<<<<<<<<<<<
@@ -20390,7 +20428,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_18get_score(struct __pyx_obj_4cd
__pyx_v_e_id = __pyx_t_3;
__pyx_t_3 = 0;
- /* "bilex.pxi":398
+ /* "cdec/sa/bilex.pxi":398
* f_id = self.fword2id[fword]
* e_id = self.eword2id[eword]
* low = self.f_index.arr[f_id] # <<<<<<<<<<<<<<
@@ -20403,7 +20441,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_18get_score(struct __pyx_obj_4cd
__pyx_v_low = __pyx_t_3;
__pyx_t_3 = 0;
- /* "bilex.pxi":399
+ /* "cdec/sa/bilex.pxi":399
* e_id = self.eword2id[eword]
* low = self.f_index.arr[f_id]
* high = self.f_index.arr[f_id+1] # <<<<<<<<<<<<<<
@@ -20419,7 +20457,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_18get_score(struct __pyx_obj_4cd
__pyx_v_high = __pyx_t_3;
__pyx_t_3 = 0;
- /* "bilex.pxi":400
+ /* "cdec/sa/bilex.pxi":400
* low = self.f_index.arr[f_id]
* high = self.f_index.arr[f_id+1]
* while high - low > 0: # <<<<<<<<<<<<<<
@@ -20435,7 +20473,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_18get_score(struct __pyx_obj_4cd
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (!__pyx_t_1) break;
- /* "bilex.pxi":401
+ /* "cdec/sa/bilex.pxi":401
* high = self.f_index.arr[f_id+1]
* while high - low > 0:
* midpoint = (low+high)/2 # <<<<<<<<<<<<<<
@@ -20450,7 +20488,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_18get_score(struct __pyx_obj_4cd
__Pyx_XDECREF_SET(__pyx_v_midpoint, __pyx_t_3);
__pyx_t_3 = 0;
- /* "bilex.pxi":402
+ /* "cdec/sa/bilex.pxi":402
* while high - low > 0:
* midpoint = (low+high)/2
* val = self.e_index.arr[midpoint] # <<<<<<<<<<<<<<
@@ -20463,7 +20501,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_18get_score(struct __pyx_obj_4cd
__Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_3);
__pyx_t_3 = 0;
- /* "bilex.pxi":403
+ /* "cdec/sa/bilex.pxi":403
* midpoint = (low+high)/2
* val = self.e_index.arr[midpoint]
* if val == e_id: # <<<<<<<<<<<<<<
@@ -20475,7 +20513,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_18get_score(struct __pyx_obj_4cd
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_1) {
- /* "bilex.pxi":404
+ /* "cdec/sa/bilex.pxi":404
* val = self.e_index.arr[midpoint]
* if val == e_id:
* if col == 0: # <<<<<<<<<<<<<<
@@ -20487,7 +20525,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_18get_score(struct __pyx_obj_4cd
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_1) {
- /* "bilex.pxi":405
+ /* "cdec/sa/bilex.pxi":405
* if val == e_id:
* if col == 0:
* return self.col1.arr[midpoint] # <<<<<<<<<<<<<<
@@ -20503,7 +20541,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_18get_score(struct __pyx_obj_4cd
goto __pyx_L0;
}
- /* "bilex.pxi":406
+ /* "cdec/sa/bilex.pxi":406
* if col == 0:
* return self.col1.arr[midpoint]
* if col == 1: # <<<<<<<<<<<<<<
@@ -20515,7 +20553,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_18get_score(struct __pyx_obj_4cd
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_1) {
- /* "bilex.pxi":407
+ /* "cdec/sa/bilex.pxi":407
* return self.col1.arr[midpoint]
* if col == 1:
* return self.col2.arr[midpoint] # <<<<<<<<<<<<<<
@@ -20534,7 +20572,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_18get_score(struct __pyx_obj_4cd
}
__pyx_L7:;
- /* "bilex.pxi":408
+ /* "cdec/sa/bilex.pxi":408
* if col == 1:
* return self.col2.arr[midpoint]
* if val > e_id: # <<<<<<<<<<<<<<
@@ -20546,7 +20584,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_18get_score(struct __pyx_obj_4cd
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_1) {
- /* "bilex.pxi":409
+ /* "cdec/sa/bilex.pxi":409
* return self.col2.arr[midpoint]
* if val > e_id:
* high = midpoint # <<<<<<<<<<<<<<
@@ -20559,7 +20597,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_18get_score(struct __pyx_obj_4cd
}
__pyx_L10:;
- /* "bilex.pxi":410
+ /* "cdec/sa/bilex.pxi":410
* if val > e_id:
* high = midpoint
* if val < e_id: # <<<<<<<<<<<<<<
@@ -20571,7 +20609,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_18get_score(struct __pyx_obj_4cd
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_1) {
- /* "bilex.pxi":411
+ /* "cdec/sa/bilex.pxi":411
* high = midpoint
* if val < e_id:
* low = midpoint + 1 # <<<<<<<<<<<<<<
@@ -20587,7 +20625,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_18get_score(struct __pyx_obj_4cd
__pyx_L11:;
}
- /* "bilex.pxi":412
+ /* "cdec/sa/bilex.pxi":412
* if val < e_id:
* low = midpoint + 1
* return None # <<<<<<<<<<<<<<
@@ -20599,7 +20637,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_18get_score(struct __pyx_obj_4cd
__pyx_r = Py_None;
goto __pyx_L0;
- /* "bilex.pxi":389
+ /* "cdec/sa/bilex.pxi":389
*
*
* def get_score(self, fword, eword, col): # <<<<<<<<<<<<<<
@@ -20625,7 +20663,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_18get_score(struct __pyx_obj_4cd
return __pyx_r;
}
-/* "bilex.pxi":415
+/* "cdec/sa/bilex.pxi":415
*
*
* def write_text(self, char* filename): # <<<<<<<<<<<<<<
@@ -20690,7 +20728,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_20write_text(struct __pyx_obj_4c
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("write_text", 0);
- /* "bilex.pxi":419
+ /* "cdec/sa/bilex.pxi":419
* cdef i, N, e_id, f_id
*
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -20746,7 +20784,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_20write_text(struct __pyx_obj_4c
__pyx_v_f = __pyx_t_4;
__pyx_t_4 = 0;
- /* "bilex.pxi":420
+ /* "cdec/sa/bilex.pxi":420
*
* with open(filename, "w") as f:
* N = len(self.e_index) # <<<<<<<<<<<<<<
@@ -20762,7 +20800,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_20write_text(struct __pyx_obj_4c
__pyx_v_N = __pyx_t_4;
__pyx_t_4 = 0;
- /* "bilex.pxi":421
+ /* "cdec/sa/bilex.pxi":421
* with open(filename, "w") as f:
* N = len(self.e_index)
* f_id = 0 # <<<<<<<<<<<<<<
@@ -20772,7 +20810,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_20write_text(struct __pyx_obj_4c
__Pyx_INCREF(__pyx_int_0);
__pyx_v_f_id = __pyx_int_0;
- /* "bilex.pxi":422
+ /* "cdec/sa/bilex.pxi":422
* N = len(self.e_index)
* f_id = 0
* for i from 0 <= i < N: # <<<<<<<<<<<<<<
@@ -20786,7 +20824,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_20write_text(struct __pyx_obj_4c
__Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4);
__pyx_t_4 = 0;
- /* "bilex.pxi":423
+ /* "cdec/sa/bilex.pxi":423
* f_id = 0
* for i from 0 <= i < N:
* while self.f_index.arr[f_id+1] == i: # <<<<<<<<<<<<<<
@@ -20806,7 +20844,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_20write_text(struct __pyx_obj_4c
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!__pyx_t_12) break;
- /* "bilex.pxi":424
+ /* "cdec/sa/bilex.pxi":424
* for i from 0 <= i < N:
* while self.f_index.arr[f_id+1] == i:
* f_id = f_id + 1 # <<<<<<<<<<<<<<
@@ -20819,7 +20857,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_20write_text(struct __pyx_obj_4c
__pyx_t_1 = 0;
}
- /* "bilex.pxi":425
+ /* "cdec/sa/bilex.pxi":425
* while self.f_index.arr[f_id+1] == i:
* f_id = f_id + 1
* e_id = self.e_index.arr[i] # <<<<<<<<<<<<<<
@@ -20832,7 +20870,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_20write_text(struct __pyx_obj_4c
__Pyx_XDECREF_SET(__pyx_v_e_id, __pyx_t_1);
__pyx_t_1 = 0;
- /* "bilex.pxi":426
+ /* "cdec/sa/bilex.pxi":426
* f_id = f_id + 1
* e_id = self.e_index.arr[i]
* score1 = self.col1.arr[i] # <<<<<<<<<<<<<<
@@ -20845,7 +20883,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_20write_text(struct __pyx_obj_4c
__Pyx_XDECREF_SET(__pyx_v_score1, __pyx_t_1);
__pyx_t_1 = 0;
- /* "bilex.pxi":427
+ /* "cdec/sa/bilex.pxi":427
* e_id = self.e_index.arr[i]
* score1 = self.col1.arr[i]
* score2 = self.col2.arr[i] # <<<<<<<<<<<<<<
@@ -20857,7 +20895,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_20write_text(struct __pyx_obj_4c
__Pyx_XDECREF_SET(__pyx_v_score2, __pyx_t_1);
__pyx_t_1 = 0;
- /* "bilex.pxi":428
+ /* "cdec/sa/bilex.pxi":428
* score1 = self.col1.arr[i]
* score2 = self.col2.arr[i]
* f.write("%s %s %.6f %.6f\n" % (self.id2fword[f_id], self.id2eword[e_id], score1, score2)) # <<<<<<<<<<<<<<
@@ -20915,7 +20953,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_20write_text(struct __pyx_obj_4c
__pyx_t_11 = __Pyx_PyInt_As_long(__pyx_v_i); if (unlikely((__pyx_t_11 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
}
- /* "bilex.pxi":422
+ /* "cdec/sa/bilex.pxi":422
* N = len(self.e_index)
* f_id = 0
* for i from 0 <= i < N: # <<<<<<<<<<<<<<
@@ -20938,7 +20976,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_20write_text(struct __pyx_obj_4c
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "bilex.pxi":419
+ /* "cdec/sa/bilex.pxi":419
* cdef i, N, e_id, f_id
*
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -21009,7 +21047,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_20write_text(struct __pyx_obj_4c
__pyx_L22:;
}
- /* "bilex.pxi":415
+ /* "cdec/sa/bilex.pxi":415
*
*
* def write_text(self, char* filename): # <<<<<<<<<<<<<<
@@ -21041,7 +21079,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_5BiLex_20write_text(struct __pyx_obj_4c
return __pyx_r;
}
-/* "veb.pxi":21
+/* "cdec/sa/veb.pxi":21
* cdef int LOWER_MASK[32]
*
* cdef void _init_lower_mask(): # <<<<<<<<<<<<<<
@@ -21057,7 +21095,7 @@ static void __pyx_f_4cdec_2sa_3_sa__init_lower_mask(void) {
unsigned int __pyx_t_2;
__Pyx_RefNannySetupContext("_init_lower_mask", 0);
- /* "veb.pxi":23
+ /* "cdec/sa/veb.pxi":23
* cdef void _init_lower_mask():
* cdef unsigned i
* cdef int mask = 0 # <<<<<<<<<<<<<<
@@ -21066,7 +21104,7 @@ static void __pyx_f_4cdec_2sa_3_sa__init_lower_mask(void) {
*/
__pyx_v_mask = 0;
- /* "veb.pxi":24
+ /* "cdec/sa/veb.pxi":24
* cdef unsigned i
* cdef int mask = 0
* for i in range(MIN_BOTTOM_SIZE): # <<<<<<<<<<<<<<
@@ -21077,7 +21115,7 @@ static void __pyx_f_4cdec_2sa_3_sa__init_lower_mask(void) {
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "veb.pxi":25
+ /* "cdec/sa/veb.pxi":25
* cdef int mask = 0
* for i in range(MIN_BOTTOM_SIZE):
* mask = (mask << 1) + 1 # <<<<<<<<<<<<<<
@@ -21086,7 +21124,7 @@ static void __pyx_f_4cdec_2sa_3_sa__init_lower_mask(void) {
*/
__pyx_v_mask = ((__pyx_v_mask << 1) + 1);
- /* "veb.pxi":26
+ /* "cdec/sa/veb.pxi":26
* for i in range(MIN_BOTTOM_SIZE):
* mask = (mask << 1) + 1
* LOWER_MASK[i] = mask # <<<<<<<<<<<<<<
@@ -21096,7 +21134,7 @@ static void __pyx_f_4cdec_2sa_3_sa__init_lower_mask(void) {
(__pyx_v_4cdec_2sa_3_sa_LOWER_MASK[__pyx_v_i]) = __pyx_v_mask;
}
- /* "veb.pxi":21
+ /* "cdec/sa/veb.pxi":21
* cdef int LOWER_MASK[32]
*
* cdef void _init_lower_mask(): # <<<<<<<<<<<<<<
@@ -21108,7 +21146,7 @@ static void __pyx_f_4cdec_2sa_3_sa__init_lower_mask(void) {
__Pyx_RefNannyFinishContext();
}
-/* "veb.pxi":37
+/* "cdec/sa/veb.pxi":37
*
*
* cdef _BitSet* new_BitSet(): # <<<<<<<<<<<<<<
@@ -21122,7 +21160,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__BitSet *__pyx_f_4cdec_2sa_3_sa_new_BitSet(
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("new_BitSet", 0);
- /* "veb.pxi":40
+ /* "cdec/sa/veb.pxi":40
* cdef _BitSet* b
*
* b = <_BitSet*> malloc(sizeof(_BitSet)) # <<<<<<<<<<<<<<
@@ -21131,7 +21169,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__BitSet *__pyx_f_4cdec_2sa_3_sa_new_BitSet(
*/
__pyx_v_b = ((struct __pyx_t_4cdec_2sa_3_sa__BitSet *)malloc((sizeof(struct __pyx_t_4cdec_2sa_3_sa__BitSet))));
- /* "veb.pxi":41
+ /* "cdec/sa/veb.pxi":41
*
* b = <_BitSet*> malloc(sizeof(_BitSet))
* b.bitset = 0 # <<<<<<<<<<<<<<
@@ -21140,7 +21178,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__BitSet *__pyx_f_4cdec_2sa_3_sa_new_BitSet(
*/
__pyx_v_b->bitset = 0;
- /* "veb.pxi":42
+ /* "cdec/sa/veb.pxi":42
* b = <_BitSet*> malloc(sizeof(_BitSet))
* b.bitset = 0
* b.min_val = -1 # <<<<<<<<<<<<<<
@@ -21149,7 +21187,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__BitSet *__pyx_f_4cdec_2sa_3_sa_new_BitSet(
*/
__pyx_v_b->min_val = -1;
- /* "veb.pxi":43
+ /* "cdec/sa/veb.pxi":43
* b.bitset = 0
* b.min_val = -1
* b.max_val = -1 # <<<<<<<<<<<<<<
@@ -21158,7 +21196,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__BitSet *__pyx_f_4cdec_2sa_3_sa_new_BitSet(
*/
__pyx_v_b->max_val = -1;
- /* "veb.pxi":44
+ /* "cdec/sa/veb.pxi":44
* b.min_val = -1
* b.max_val = -1
* b.size = 0 # <<<<<<<<<<<<<<
@@ -21167,7 +21205,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__BitSet *__pyx_f_4cdec_2sa_3_sa_new_BitSet(
*/
__pyx_v_b->size = 0;
- /* "veb.pxi":45
+ /* "cdec/sa/veb.pxi":45
* b.max_val = -1
* b.size = 0
* return b # <<<<<<<<<<<<<<
@@ -21177,7 +21215,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__BitSet *__pyx_f_4cdec_2sa_3_sa_new_BitSet(
__pyx_r = __pyx_v_b;
goto __pyx_L0;
- /* "veb.pxi":37
+ /* "cdec/sa/veb.pxi":37
*
*
* cdef _BitSet* new_BitSet(): # <<<<<<<<<<<<<<
@@ -21191,7 +21229,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__BitSet *__pyx_f_4cdec_2sa_3_sa_new_BitSet(
return __pyx_r;
}
-/* "veb.pxi":48
+/* "cdec/sa/veb.pxi":48
*
*
* cdef int bitset_findsucc(_BitSet* b, int i): # <<<<<<<<<<<<<<
@@ -21211,7 +21249,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_findsucc(struct __pyx_t_4cdec_2sa_3_sa_
int __pyx_t_2;
__Pyx_RefNannySetupContext("bitset_findsucc", 0);
- /* "veb.pxi":52
+ /* "cdec/sa/veb.pxi":52
* cdef int low, high, mid
*
* if b.max_val == -1 or i >= b.max_val: # <<<<<<<<<<<<<<
@@ -21231,7 +21269,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_findsucc(struct __pyx_t_4cdec_2sa_3_sa_
__pyx_L4_bool_binop_done:;
if (__pyx_t_1) {
- /* "veb.pxi":53
+ /* "cdec/sa/veb.pxi":53
*
* if b.max_val == -1 or i >= b.max_val:
* return -1 # <<<<<<<<<<<<<<
@@ -21242,7 +21280,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_findsucc(struct __pyx_t_4cdec_2sa_3_sa_
goto __pyx_L0;
}
- /* "veb.pxi":54
+ /* "cdec/sa/veb.pxi":54
* if b.max_val == -1 or i >= b.max_val:
* return -1
* if i < b.min_val: # <<<<<<<<<<<<<<
@@ -21252,7 +21290,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_findsucc(struct __pyx_t_4cdec_2sa_3_sa_
__pyx_t_1 = ((__pyx_v_i < __pyx_v_b->min_val) != 0);
if (__pyx_t_1) {
- /* "veb.pxi":55
+ /* "cdec/sa/veb.pxi":55
* return -1
* if i < b.min_val:
* return b.min_val # <<<<<<<<<<<<<<
@@ -21263,7 +21301,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_findsucc(struct __pyx_t_4cdec_2sa_3_sa_
goto __pyx_L0;
}
- /* "veb.pxi":57
+ /* "cdec/sa/veb.pxi":57
* return b.min_val
*
* bitset = b.bitset & ~LOWER_MASK[i] # <<<<<<<<<<<<<<
@@ -21272,7 +21310,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_findsucc(struct __pyx_t_4cdec_2sa_3_sa_
*/
__pyx_v_bitset = (__pyx_v_b->bitset & (~(__pyx_v_4cdec_2sa_3_sa_LOWER_MASK[__pyx_v_i])));
- /* "veb.pxi":58
+ /* "cdec/sa/veb.pxi":58
*
* bitset = b.bitset & ~LOWER_MASK[i]
* low = i+1 # <<<<<<<<<<<<<<
@@ -21281,7 +21319,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_findsucc(struct __pyx_t_4cdec_2sa_3_sa_
*/
__pyx_v_low = (__pyx_v_i + 1);
- /* "veb.pxi":59
+ /* "cdec/sa/veb.pxi":59
* bitset = b.bitset & ~LOWER_MASK[i]
* low = i+1
* high = b.max_val+1 # <<<<<<<<<<<<<<
@@ -21290,7 +21328,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_findsucc(struct __pyx_t_4cdec_2sa_3_sa_
*/
__pyx_v_high = (__pyx_v_b->max_val + 1);
- /* "veb.pxi":60
+ /* "cdec/sa/veb.pxi":60
* low = i+1
* high = b.max_val+1
* while low < high-1: # <<<<<<<<<<<<<<
@@ -21301,7 +21339,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_findsucc(struct __pyx_t_4cdec_2sa_3_sa_
__pyx_t_1 = ((__pyx_v_low < (__pyx_v_high - 1)) != 0);
if (!__pyx_t_1) break;
- /* "veb.pxi":61
+ /* "cdec/sa/veb.pxi":61
* high = b.max_val+1
* while low < high-1:
* mid = (high + low)/2 # <<<<<<<<<<<<<<
@@ -21310,7 +21348,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_findsucc(struct __pyx_t_4cdec_2sa_3_sa_
*/
__pyx_v_mid = __Pyx_div_long((__pyx_v_high + __pyx_v_low), 2);
- /* "veb.pxi":62
+ /* "cdec/sa/veb.pxi":62
* while low < high-1:
* mid = (high + low)/2
* mask = ~(LOWER_MASK[high-1] ^ LOWER_MASK[mid-1]) # <<<<<<<<<<<<<<
@@ -21319,7 +21357,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_findsucc(struct __pyx_t_4cdec_2sa_3_sa_
*/
__pyx_v_mask = (~((__pyx_v_4cdec_2sa_3_sa_LOWER_MASK[(__pyx_v_high - 1)]) ^ (__pyx_v_4cdec_2sa_3_sa_LOWER_MASK[(__pyx_v_mid - 1)])));
- /* "veb.pxi":63
+ /* "cdec/sa/veb.pxi":63
* mid = (high + low)/2
* mask = ~(LOWER_MASK[high-1] ^ LOWER_MASK[mid-1])
* if bitset & mask == 0: # <<<<<<<<<<<<<<
@@ -21329,7 +21367,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_findsucc(struct __pyx_t_4cdec_2sa_3_sa_
__pyx_t_1 = (((__pyx_v_bitset & __pyx_v_mask) == 0) != 0);
if (__pyx_t_1) {
- /* "veb.pxi":64
+ /* "cdec/sa/veb.pxi":64
* mask = ~(LOWER_MASK[high-1] ^ LOWER_MASK[mid-1])
* if bitset & mask == 0:
* low = mid # <<<<<<<<<<<<<<
@@ -21341,7 +21379,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_findsucc(struct __pyx_t_4cdec_2sa_3_sa_
}
/*else*/ {
- /* "veb.pxi":66
+ /* "cdec/sa/veb.pxi":66
* low = mid
* else:
* bitset = bitset & mask # <<<<<<<<<<<<<<
@@ -21350,7 +21388,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_findsucc(struct __pyx_t_4cdec_2sa_3_sa_
*/
__pyx_v_bitset = (__pyx_v_bitset & __pyx_v_mask);
- /* "veb.pxi":67
+ /* "cdec/sa/veb.pxi":67
* else:
* bitset = bitset & mask
* high = mid # <<<<<<<<<<<<<<
@@ -21362,7 +21400,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_findsucc(struct __pyx_t_4cdec_2sa_3_sa_
__pyx_L9:;
}
- /* "veb.pxi":68
+ /* "cdec/sa/veb.pxi":68
* bitset = bitset & mask
* high = mid
* return low # <<<<<<<<<<<<<<
@@ -21372,7 +21410,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_findsucc(struct __pyx_t_4cdec_2sa_3_sa_
__pyx_r = __pyx_v_low;
goto __pyx_L0;
- /* "veb.pxi":48
+ /* "cdec/sa/veb.pxi":48
*
*
* cdef int bitset_findsucc(_BitSet* b, int i): # <<<<<<<<<<<<<<
@@ -21386,7 +21424,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_findsucc(struct __pyx_t_4cdec_2sa_3_sa_
return __pyx_r;
}
-/* "veb.pxi":71
+/* "cdec/sa/veb.pxi":71
*
*
* cdef int bitset_insert(_BitSet* b, int i): # <<<<<<<<<<<<<<
@@ -21401,7 +21439,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_insert(struct __pyx_t_4cdec_2sa_3_sa__B
int __pyx_t_1;
__Pyx_RefNannySetupContext("bitset_insert", 0);
- /* "veb.pxi":74
+ /* "cdec/sa/veb.pxi":74
* cdef int val
*
* val = 1 << i # <<<<<<<<<<<<<<
@@ -21410,7 +21448,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_insert(struct __pyx_t_4cdec_2sa_3_sa__B
*/
__pyx_v_val = (1 << __pyx_v_i);
- /* "veb.pxi":75
+ /* "cdec/sa/veb.pxi":75
*
* val = 1 << i
* if b.bitset & val == 0: # <<<<<<<<<<<<<<
@@ -21420,7 +21458,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_insert(struct __pyx_t_4cdec_2sa_3_sa__B
__pyx_t_1 = (((__pyx_v_b->bitset & __pyx_v_val) == 0) != 0);
if (__pyx_t_1) {
- /* "veb.pxi":76
+ /* "cdec/sa/veb.pxi":76
* val = 1 << i
* if b.bitset & val == 0:
* b.bitset = b.bitset | val # <<<<<<<<<<<<<<
@@ -21429,7 +21467,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_insert(struct __pyx_t_4cdec_2sa_3_sa__B
*/
__pyx_v_b->bitset = (__pyx_v_b->bitset | __pyx_v_val);
- /* "veb.pxi":77
+ /* "cdec/sa/veb.pxi":77
* if b.bitset & val == 0:
* b.bitset = b.bitset | val
* if b.size == 0: # <<<<<<<<<<<<<<
@@ -21439,7 +21477,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_insert(struct __pyx_t_4cdec_2sa_3_sa__B
__pyx_t_1 = ((__pyx_v_b->size == 0) != 0);
if (__pyx_t_1) {
- /* "veb.pxi":78
+ /* "cdec/sa/veb.pxi":78
* b.bitset = b.bitset | val
* if b.size == 0:
* b.min_val = i # <<<<<<<<<<<<<<
@@ -21448,7 +21486,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_insert(struct __pyx_t_4cdec_2sa_3_sa__B
*/
__pyx_v_b->min_val = __pyx_v_i;
- /* "veb.pxi":79
+ /* "cdec/sa/veb.pxi":79
* if b.size == 0:
* b.min_val = i
* b.max_val = i # <<<<<<<<<<<<<<
@@ -21460,7 +21498,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_insert(struct __pyx_t_4cdec_2sa_3_sa__B
}
/*else*/ {
- /* "veb.pxi":81
+ /* "cdec/sa/veb.pxi":81
* b.max_val = i
* else:
* if i < b.min_val: # <<<<<<<<<<<<<<
@@ -21470,7 +21508,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_insert(struct __pyx_t_4cdec_2sa_3_sa__B
__pyx_t_1 = ((__pyx_v_i < __pyx_v_b->min_val) != 0);
if (__pyx_t_1) {
- /* "veb.pxi":82
+ /* "cdec/sa/veb.pxi":82
* else:
* if i < b.min_val:
* b.min_val = i # <<<<<<<<<<<<<<
@@ -21482,7 +21520,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_insert(struct __pyx_t_4cdec_2sa_3_sa__B
}
__pyx_L5:;
- /* "veb.pxi":83
+ /* "cdec/sa/veb.pxi":83
* if i < b.min_val:
* b.min_val = i
* if i > b.max_val: # <<<<<<<<<<<<<<
@@ -21492,7 +21530,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_insert(struct __pyx_t_4cdec_2sa_3_sa__B
__pyx_t_1 = ((__pyx_v_i > __pyx_v_b->max_val) != 0);
if (__pyx_t_1) {
- /* "veb.pxi":84
+ /* "cdec/sa/veb.pxi":84
* b.min_val = i
* if i > b.max_val:
* b.max_val = i # <<<<<<<<<<<<<<
@@ -21506,7 +21544,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_insert(struct __pyx_t_4cdec_2sa_3_sa__B
}
__pyx_L4:;
- /* "veb.pxi":85
+ /* "cdec/sa/veb.pxi":85
* if i > b.max_val:
* b.max_val = i
* b.size = b.size + 1 # <<<<<<<<<<<<<<
@@ -21515,7 +21553,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_insert(struct __pyx_t_4cdec_2sa_3_sa__B
*/
__pyx_v_b->size = (__pyx_v_b->size + 1);
- /* "veb.pxi":86
+ /* "cdec/sa/veb.pxi":86
* b.max_val = i
* b.size = b.size + 1
* return 1 # <<<<<<<<<<<<<<
@@ -21526,7 +21564,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_insert(struct __pyx_t_4cdec_2sa_3_sa__B
goto __pyx_L0;
}
- /* "veb.pxi":87
+ /* "cdec/sa/veb.pxi":87
* b.size = b.size + 1
* return 1
* return 0 # <<<<<<<<<<<<<<
@@ -21536,7 +21574,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_insert(struct __pyx_t_4cdec_2sa_3_sa__B
__pyx_r = 0;
goto __pyx_L0;
- /* "veb.pxi":71
+ /* "cdec/sa/veb.pxi":71
*
*
* cdef int bitset_insert(_BitSet* b, int i): # <<<<<<<<<<<<<<
@@ -21550,7 +21588,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_insert(struct __pyx_t_4cdec_2sa_3_sa__B
return __pyx_r;
}
-/* "veb.pxi":90
+/* "cdec/sa/veb.pxi":90
*
*
* cdef int bitset_contains(_BitSet* b, int i): # <<<<<<<<<<<<<<
@@ -21565,7 +21603,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_contains(struct __pyx_t_4cdec_2sa_3_sa_
int __pyx_t_1;
__Pyx_RefNannySetupContext("bitset_contains", 0);
- /* "veb.pxi":93
+ /* "cdec/sa/veb.pxi":93
* cdef int val
*
* val = 1 << i # <<<<<<<<<<<<<<
@@ -21574,7 +21612,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_contains(struct __pyx_t_4cdec_2sa_3_sa_
*/
__pyx_v_val = (1 << __pyx_v_i);
- /* "veb.pxi":94
+ /* "cdec/sa/veb.pxi":94
*
* val = 1 << i
* if b.bitset & val == 0: # <<<<<<<<<<<<<<
@@ -21584,7 +21622,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_contains(struct __pyx_t_4cdec_2sa_3_sa_
__pyx_t_1 = (((__pyx_v_b->bitset & __pyx_v_val) == 0) != 0);
if (__pyx_t_1) {
- /* "veb.pxi":95
+ /* "cdec/sa/veb.pxi":95
* val = 1 << i
* if b.bitset & val == 0:
* return 0 # <<<<<<<<<<<<<<
@@ -21596,7 +21634,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_contains(struct __pyx_t_4cdec_2sa_3_sa_
}
/*else*/ {
- /* "veb.pxi":97
+ /* "cdec/sa/veb.pxi":97
* return 0
* else:
* return 1 # <<<<<<<<<<<<<<
@@ -21607,7 +21645,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_contains(struct __pyx_t_4cdec_2sa_3_sa_
goto __pyx_L0;
}
- /* "veb.pxi":90
+ /* "cdec/sa/veb.pxi":90
*
*
* cdef int bitset_contains(_BitSet* b, int i): # <<<<<<<<<<<<<<
@@ -21621,7 +21659,7 @@ static int __pyx_f_4cdec_2sa_3_sa_bitset_contains(struct __pyx_t_4cdec_2sa_3_sa_
return __pyx_r;
}
-/* "veb.pxi":104
+/* "cdec/sa/veb.pxi":104
* cdef int next_val
*
* def __next__(self): # <<<<<<<<<<<<<<
@@ -21654,7 +21692,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14BitSetIterator___next__(struct __pyx_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__next__", 0);
- /* "veb.pxi":107
+ /* "cdec/sa/veb.pxi":107
* cdef int ret_val
*
* if self.next_val == -1: # <<<<<<<<<<<<<<
@@ -21664,7 +21702,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14BitSetIterator___next__(struct __pyx_
__pyx_t_1 = ((__pyx_v_self->next_val == -1) != 0);
if (__pyx_t_1) {
- /* "veb.pxi":108
+ /* "cdec/sa/veb.pxi":108
*
* if self.next_val == -1:
* raise StopIteration() # <<<<<<<<<<<<<<
@@ -21678,7 +21716,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14BitSetIterator___next__(struct __pyx_
{__pyx_filename = __pyx_f[6]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- /* "veb.pxi":109
+ /* "cdec/sa/veb.pxi":109
* if self.next_val == -1:
* raise StopIteration()
* ret_val = self.next_val # <<<<<<<<<<<<<<
@@ -21688,7 +21726,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14BitSetIterator___next__(struct __pyx_
__pyx_t_3 = __pyx_v_self->next_val;
__pyx_v_ret_val = __pyx_t_3;
- /* "veb.pxi":110
+ /* "cdec/sa/veb.pxi":110
* raise StopIteration()
* ret_val = self.next_val
* self.next_val = bitset_findsucc(self.b, ret_val) # <<<<<<<<<<<<<<
@@ -21697,7 +21735,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14BitSetIterator___next__(struct __pyx_
*/
__pyx_v_self->next_val = __pyx_f_4cdec_2sa_3_sa_bitset_findsucc(__pyx_v_self->b, __pyx_v_ret_val);
- /* "veb.pxi":111
+ /* "cdec/sa/veb.pxi":111
* ret_val = self.next_val
* self.next_val = bitset_findsucc(self.b, ret_val)
* return ret_val # <<<<<<<<<<<<<<
@@ -21711,7 +21749,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14BitSetIterator___next__(struct __pyx_
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "veb.pxi":104
+ /* "cdec/sa/veb.pxi":104
* cdef int next_val
*
* def __next__(self): # <<<<<<<<<<<<<<
@@ -21730,7 +21768,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14BitSetIterator___next__(struct __pyx_
return __pyx_r;
}
-/* "veb.pxi":122
+/* "cdec/sa/veb.pxi":122
* cdef _BitSet* b
*
* def __cinit__(self): # <<<<<<<<<<<<<<
@@ -21759,7 +21797,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6BitSet___cinit__(struct __pyx_obj_4cdec_2sa_
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "veb.pxi":123
+ /* "cdec/sa/veb.pxi":123
*
* def __cinit__(self):
* self.b = new_BitSet() # <<<<<<<<<<<<<<
@@ -21768,7 +21806,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6BitSet___cinit__(struct __pyx_obj_4cdec_2sa_
*/
__pyx_v_self->b = __pyx_f_4cdec_2sa_3_sa_new_BitSet();
- /* "veb.pxi":122
+ /* "cdec/sa/veb.pxi":122
* cdef _BitSet* b
*
* def __cinit__(self): # <<<<<<<<<<<<<<
@@ -21782,7 +21820,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6BitSet___cinit__(struct __pyx_obj_4cdec_2sa_
return __pyx_r;
}
-/* "veb.pxi":125
+/* "cdec/sa/veb.pxi":125
* self.b = new_BitSet()
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -21805,7 +21843,7 @@ static void __pyx_pf_4cdec_2sa_3_sa_6BitSet_2__dealloc__(struct __pyx_obj_4cdec_
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "veb.pxi":126
+ /* "cdec/sa/veb.pxi":126
*
* def __dealloc__(self):
* free(self.b) # <<<<<<<<<<<<<<
@@ -21814,7 +21852,7 @@ static void __pyx_pf_4cdec_2sa_3_sa_6BitSet_2__dealloc__(struct __pyx_obj_4cdec_
*/
free(__pyx_v_self->b);
- /* "veb.pxi":125
+ /* "cdec/sa/veb.pxi":125
* self.b = new_BitSet()
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -21826,7 +21864,7 @@ static void __pyx_pf_4cdec_2sa_3_sa_6BitSet_2__dealloc__(struct __pyx_obj_4cdec_
__Pyx_RefNannyFinishContext();
}
-/* "veb.pxi":128
+/* "cdec/sa/veb.pxi":128
* free(self.b)
*
* def __iter__(self): # <<<<<<<<<<<<<<
@@ -21859,7 +21897,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6BitSet_4__iter__(struct __pyx_obj_4cde
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__iter__", 0);
- /* "veb.pxi":130
+ /* "cdec/sa/veb.pxi":130
* def __iter__(self):
* cdef BitSetIterator it
* it = BitSetIterator() # <<<<<<<<<<<<<<
@@ -21871,7 +21909,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6BitSet_4__iter__(struct __pyx_obj_4cde
__pyx_v_it = ((struct __pyx_obj_4cdec_2sa_3_sa_BitSetIterator *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "veb.pxi":131
+ /* "cdec/sa/veb.pxi":131
* cdef BitSetIterator it
* it = BitSetIterator()
* it.b = self.b # <<<<<<<<<<<<<<
@@ -21881,7 +21919,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6BitSet_4__iter__(struct __pyx_obj_4cde
__pyx_t_2 = __pyx_v_self->b;
__pyx_v_it->b = __pyx_t_2;
- /* "veb.pxi":132
+ /* "cdec/sa/veb.pxi":132
* it = BitSetIterator()
* it.b = self.b
* it.next_val = self.b.min_val # <<<<<<<<<<<<<<
@@ -21891,7 +21929,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6BitSet_4__iter__(struct __pyx_obj_4cde
__pyx_t_3 = __pyx_v_self->b->min_val;
__pyx_v_it->next_val = __pyx_t_3;
- /* "veb.pxi":133
+ /* "cdec/sa/veb.pxi":133
* it.b = self.b
* it.next_val = self.b.min_val
* return it # <<<<<<<<<<<<<<
@@ -21903,7 +21941,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6BitSet_4__iter__(struct __pyx_obj_4cde
__pyx_r = ((PyObject *)__pyx_v_it);
goto __pyx_L0;
- /* "veb.pxi":128
+ /* "cdec/sa/veb.pxi":128
* free(self.b)
*
* def __iter__(self): # <<<<<<<<<<<<<<
@@ -21923,7 +21961,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6BitSet_4__iter__(struct __pyx_obj_4cde
return __pyx_r;
}
-/* "veb.pxi":135
+/* "cdec/sa/veb.pxi":135
* return it
*
* def insert(self, i): # <<<<<<<<<<<<<<
@@ -21954,7 +21992,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6BitSet_6insert(struct __pyx_obj_4cdec_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("insert", 0);
- /* "veb.pxi":136
+ /* "cdec/sa/veb.pxi":136
*
* def insert(self, i):
* return bitset_insert(self.b, i) # <<<<<<<<<<<<<<
@@ -21969,7 +22007,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6BitSet_6insert(struct __pyx_obj_4cdec_
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "veb.pxi":135
+ /* "cdec/sa/veb.pxi":135
* return it
*
* def insert(self, i): # <<<<<<<<<<<<<<
@@ -21988,7 +22026,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6BitSet_6insert(struct __pyx_obj_4cdec_
return __pyx_r;
}
-/* "veb.pxi":138
+/* "cdec/sa/veb.pxi":138
* return bitset_insert(self.b, i)
*
* def findsucc(self, i): # <<<<<<<<<<<<<<
@@ -22019,7 +22057,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6BitSet_8findsucc(struct __pyx_obj_4cde
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("findsucc", 0);
- /* "veb.pxi":139
+ /* "cdec/sa/veb.pxi":139
*
* def findsucc(self, i):
* return bitset_findsucc(self.b, i) # <<<<<<<<<<<<<<
@@ -22034,7 +22072,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6BitSet_8findsucc(struct __pyx_obj_4cde
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "veb.pxi":138
+ /* "cdec/sa/veb.pxi":138
* return bitset_insert(self.b, i)
*
* def findsucc(self, i): # <<<<<<<<<<<<<<
@@ -22053,7 +22091,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6BitSet_8findsucc(struct __pyx_obj_4cde
return __pyx_r;
}
-/* "veb.pxi":141
+/* "cdec/sa/veb.pxi":141
* return bitset_findsucc(self.b, i)
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -22085,7 +22123,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6BitSet_10__str__(struct __pyx_obj_4cde
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__str__", 0);
- /* "veb.pxi":142
+ /* "cdec/sa/veb.pxi":142
*
* def __str__(self):
* return dec2bin(self.b.bitset)+" ("+str(self.b.size)+","+str(self.b.min_val)+","+str(self.b.max_val)+")" # <<<<<<<<<<<<<<
@@ -22153,7 +22191,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6BitSet_10__str__(struct __pyx_obj_4cde
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "veb.pxi":141
+ /* "cdec/sa/veb.pxi":141
* return bitset_findsucc(self.b, i)
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -22174,7 +22212,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6BitSet_10__str__(struct __pyx_obj_4cde
return __pyx_r;
}
-/* "veb.pxi":144
+/* "cdec/sa/veb.pxi":144
* return dec2bin(self.b.bitset)+" ("+str(self.b.size)+","+str(self.b.min_val)+","+str(self.b.max_val)+")"
*
* def min(self): # <<<<<<<<<<<<<<
@@ -22204,7 +22242,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6BitSet_12min(struct __pyx_obj_4cdec_2s
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("min", 0);
- /* "veb.pxi":145
+ /* "cdec/sa/veb.pxi":145
*
* def min(self):
* return self.b.min_val # <<<<<<<<<<<<<<
@@ -22218,7 +22256,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6BitSet_12min(struct __pyx_obj_4cdec_2s
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "veb.pxi":144
+ /* "cdec/sa/veb.pxi":144
* return dec2bin(self.b.bitset)+" ("+str(self.b.size)+","+str(self.b.min_val)+","+str(self.b.max_val)+")"
*
* def min(self): # <<<<<<<<<<<<<<
@@ -22237,7 +22275,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6BitSet_12min(struct __pyx_obj_4cdec_2s
return __pyx_r;
}
-/* "veb.pxi":147
+/* "cdec/sa/veb.pxi":147
* return self.b.min_val
*
* def max(self): # <<<<<<<<<<<<<<
@@ -22267,7 +22305,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6BitSet_14max(struct __pyx_obj_4cdec_2s
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("max", 0);
- /* "veb.pxi":148
+ /* "cdec/sa/veb.pxi":148
*
* def max(self):
* return self.b.max_val # <<<<<<<<<<<<<<
@@ -22281,7 +22319,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6BitSet_14max(struct __pyx_obj_4cdec_2s
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "veb.pxi":147
+ /* "cdec/sa/veb.pxi":147
* return self.b.min_val
*
* def max(self): # <<<<<<<<<<<<<<
@@ -22300,7 +22338,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6BitSet_14max(struct __pyx_obj_4cdec_2s
return __pyx_r;
}
-/* "veb.pxi":150
+/* "cdec/sa/veb.pxi":150
* return self.b.max_val
*
* def __len__(self): # <<<<<<<<<<<<<<
@@ -22326,7 +22364,7 @@ static Py_ssize_t __pyx_pf_4cdec_2sa_3_sa_6BitSet_16__len__(struct __pyx_obj_4cd
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__len__", 0);
- /* "veb.pxi":151
+ /* "cdec/sa/veb.pxi":151
*
* def __len__(self):
* return self.b.size # <<<<<<<<<<<<<<
@@ -22336,7 +22374,7 @@ static Py_ssize_t __pyx_pf_4cdec_2sa_3_sa_6BitSet_16__len__(struct __pyx_obj_4cd
__pyx_r = __pyx_v_self->b->size;
goto __pyx_L0;
- /* "veb.pxi":150
+ /* "cdec/sa/veb.pxi":150
* return self.b.max_val
*
* def __len__(self): # <<<<<<<<<<<<<<
@@ -22350,7 +22388,7 @@ static Py_ssize_t __pyx_pf_4cdec_2sa_3_sa_6BitSet_16__len__(struct __pyx_obj_4cd
return __pyx_r;
}
-/* "veb.pxi":153
+/* "cdec/sa/veb.pxi":153
* return self.b.size
*
* def __contains__(self, i): # <<<<<<<<<<<<<<
@@ -22382,7 +22420,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6BitSet_18__contains__(struct __pyx_obj_4cdec
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__contains__", 0);
- /* "veb.pxi":154
+ /* "cdec/sa/veb.pxi":154
*
* def __contains__(self, i):
* return bool(bitset_contains(self.b, i)) # <<<<<<<<<<<<<<
@@ -22397,7 +22435,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6BitSet_18__contains__(struct __pyx_obj_4cdec
__pyx_r = (!(!__pyx_t_3));
goto __pyx_L0;
- /* "veb.pxi":153
+ /* "cdec/sa/veb.pxi":153
* return self.b.size
*
* def __contains__(self, i): # <<<<<<<<<<<<<<
@@ -22415,7 +22453,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6BitSet_18__contains__(struct __pyx_obj_4cdec
return __pyx_r;
}
-/* "veb.pxi":157
+/* "cdec/sa/veb.pxi":157
*
*
* cdef str dec2bin(long i): # <<<<<<<<<<<<<<
@@ -22437,7 +22475,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_dec2bin(long __pyx_v_i) {
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("dec2bin", 0);
- /* "veb.pxi":158
+ /* "cdec/sa/veb.pxi":158
*
* cdef str dec2bin(long i):
* cdef str result = "" # <<<<<<<<<<<<<<
@@ -22447,7 +22485,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_dec2bin(long __pyx_v_i) {
__Pyx_INCREF(__pyx_kp_s__32);
__pyx_v_result = __pyx_kp_s__32;
- /* "veb.pxi":160
+ /* "cdec/sa/veb.pxi":160
* cdef str result = ""
* cdef unsigned d
* for d in range(MIN_BOTTOM_SIZE): # <<<<<<<<<<<<<<
@@ -22458,7 +22496,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_dec2bin(long __pyx_v_i) {
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_d = __pyx_t_2;
- /* "veb.pxi":161
+ /* "cdec/sa/veb.pxi":161
* cdef unsigned d
* for d in range(MIN_BOTTOM_SIZE):
* if i & LOWER_MASK[0] == 0: # <<<<<<<<<<<<<<
@@ -22468,7 +22506,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_dec2bin(long __pyx_v_i) {
__pyx_t_3 = (((__pyx_v_i & (__pyx_v_4cdec_2sa_3_sa_LOWER_MASK[0])) == 0) != 0);
if (__pyx_t_3) {
- /* "veb.pxi":162
+ /* "cdec/sa/veb.pxi":162
* for d in range(MIN_BOTTOM_SIZE):
* if i & LOWER_MASK[0] == 0:
* result = "0"+result # <<<<<<<<<<<<<<
@@ -22483,7 +22521,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_dec2bin(long __pyx_v_i) {
}
/*else*/ {
- /* "veb.pxi":164
+ /* "cdec/sa/veb.pxi":164
* result = "0"+result
* else:
* result = "1"+result # <<<<<<<<<<<<<<
@@ -22497,7 +22535,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_dec2bin(long __pyx_v_i) {
}
__pyx_L5:;
- /* "veb.pxi":165
+ /* "cdec/sa/veb.pxi":165
* else:
* result = "1"+result
* i = i >> 1 # <<<<<<<<<<<<<<
@@ -22507,7 +22545,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_dec2bin(long __pyx_v_i) {
__pyx_v_i = (__pyx_v_i >> 1);
}
- /* "veb.pxi":166
+ /* "cdec/sa/veb.pxi":166
* result = "1"+result
* i = i >> 1
* return result # <<<<<<<<<<<<<<
@@ -22519,7 +22557,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_dec2bin(long __pyx_v_i) {
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "veb.pxi":157
+ /* "cdec/sa/veb.pxi":157
*
*
* cdef str dec2bin(long i): # <<<<<<<<<<<<<<
@@ -22539,7 +22577,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_dec2bin(long __pyx_v_i) {
return __pyx_r;
}
-/* "veb.pxi":177
+/* "cdec/sa/veb.pxi":177
* void** bottom
*
* cdef _VEB* new_VEB(int n): # <<<<<<<<<<<<<<
@@ -22560,7 +22598,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__VEB *__pyx_f_4cdec_2sa_3_sa_new_VEB(int __
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("new_VEB", 0);
- /* "veb.pxi":181
+ /* "cdec/sa/veb.pxi":181
* cdef int num_bits, num_top_bits, i
*
* veb = <_VEB*> malloc(sizeof(_VEB)) # <<<<<<<<<<<<<<
@@ -22569,7 +22607,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__VEB *__pyx_f_4cdec_2sa_3_sa_new_VEB(int __
*/
__pyx_v_veb = ((struct __pyx_t_4cdec_2sa_3_sa__VEB *)malloc((sizeof(struct __pyx_t_4cdec_2sa_3_sa__VEB))));
- /* "veb.pxi":183
+ /* "cdec/sa/veb.pxi":183
* veb = <_VEB*> malloc(sizeof(_VEB))
*
* num_bits = int(ceil(log(n) / log(2))) # <<<<<<<<<<<<<<
@@ -22590,7 +22628,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__VEB *__pyx_f_4cdec_2sa_3_sa_new_VEB(int __
}
__pyx_v_num_bits = ((int)ceil((__pyx_t_1 / __pyx_t_2)));
- /* "veb.pxi":184
+ /* "cdec/sa/veb.pxi":184
*
* num_bits = int(ceil(log(n) / log(2)))
* veb.num_bottom_bits = num_bits/2 # <<<<<<<<<<<<<<
@@ -22599,7 +22637,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__VEB *__pyx_f_4cdec_2sa_3_sa_new_VEB(int __
*/
__pyx_v_veb->num_bottom_bits = __Pyx_div_long(__pyx_v_num_bits, 2);
- /* "veb.pxi":185
+ /* "cdec/sa/veb.pxi":185
* num_bits = int(ceil(log(n) / log(2)))
* veb.num_bottom_bits = num_bits/2
* if veb.num_bottom_bits < MIN_BOTTOM_BITS: # <<<<<<<<<<<<<<
@@ -22609,7 +22647,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__VEB *__pyx_f_4cdec_2sa_3_sa_new_VEB(int __
__pyx_t_3 = ((__pyx_v_veb->num_bottom_bits < __pyx_v_4cdec_2sa_3_sa_MIN_BOTTOM_BITS) != 0);
if (__pyx_t_3) {
- /* "veb.pxi":186
+ /* "cdec/sa/veb.pxi":186
* veb.num_bottom_bits = num_bits/2
* if veb.num_bottom_bits < MIN_BOTTOM_BITS:
* veb.num_bottom_bits = MIN_BOTTOM_BITS # <<<<<<<<<<<<<<
@@ -22621,7 +22659,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__VEB *__pyx_f_4cdec_2sa_3_sa_new_VEB(int __
}
__pyx_L3:;
- /* "veb.pxi":187
+ /* "cdec/sa/veb.pxi":187
* if veb.num_bottom_bits < MIN_BOTTOM_BITS:
* veb.num_bottom_bits = MIN_BOTTOM_BITS
* veb.top_universe_size = (n >> veb.num_bottom_bits) + 1 # <<<<<<<<<<<<<<
@@ -22630,7 +22668,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__VEB *__pyx_f_4cdec_2sa_3_sa_new_VEB(int __
*/
__pyx_v_veb->top_universe_size = ((__pyx_v_n >> __pyx_v_veb->num_bottom_bits) + 1);
- /* "veb.pxi":189
+ /* "cdec/sa/veb.pxi":189
* veb.top_universe_size = (n >> veb.num_bottom_bits) + 1
*
* veb.bottom = <void**> malloc(veb.top_universe_size * sizeof(void*)) # <<<<<<<<<<<<<<
@@ -22639,7 +22677,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__VEB *__pyx_f_4cdec_2sa_3_sa_new_VEB(int __
*/
__pyx_v_veb->bottom = ((void **)malloc((__pyx_v_veb->top_universe_size * (sizeof(void *)))));
- /* "veb.pxi":190
+ /* "cdec/sa/veb.pxi":190
*
* veb.bottom = <void**> malloc(veb.top_universe_size * sizeof(void*))
* memset(veb.bottom, 0, veb.top_universe_size * sizeof(void*)) # <<<<<<<<<<<<<<
@@ -22648,7 +22686,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__VEB *__pyx_f_4cdec_2sa_3_sa_new_VEB(int __
*/
memset(__pyx_v_veb->bottom, 0, (__pyx_v_veb->top_universe_size * (sizeof(void *))));
- /* "veb.pxi":192
+ /* "cdec/sa/veb.pxi":192
* memset(veb.bottom, 0, veb.top_universe_size * sizeof(void*))
*
* if veb.top_universe_size > MIN_BOTTOM_SIZE: # <<<<<<<<<<<<<<
@@ -22658,7 +22696,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__VEB *__pyx_f_4cdec_2sa_3_sa_new_VEB(int __
__pyx_t_3 = ((__pyx_v_veb->top_universe_size > __pyx_v_4cdec_2sa_3_sa_MIN_BOTTOM_SIZE) != 0);
if (__pyx_t_3) {
- /* "veb.pxi":193
+ /* "cdec/sa/veb.pxi":193
*
* if veb.top_universe_size > MIN_BOTTOM_SIZE:
* veb.top = new_VEB(veb.top_universe_size) # <<<<<<<<<<<<<<
@@ -22670,7 +22708,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__VEB *__pyx_f_4cdec_2sa_3_sa_new_VEB(int __
}
/*else*/ {
- /* "veb.pxi":195
+ /* "cdec/sa/veb.pxi":195
* veb.top = new_VEB(veb.top_universe_size)
* else:
* veb.top = new_BitSet() # <<<<<<<<<<<<<<
@@ -22681,7 +22719,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__VEB *__pyx_f_4cdec_2sa_3_sa_new_VEB(int __
}
__pyx_L4:;
- /* "veb.pxi":197
+ /* "cdec/sa/veb.pxi":197
* veb.top = new_BitSet()
*
* veb.max_val = -1 # <<<<<<<<<<<<<<
@@ -22690,7 +22728,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__VEB *__pyx_f_4cdec_2sa_3_sa_new_VEB(int __
*/
__pyx_v_veb->max_val = -1;
- /* "veb.pxi":198
+ /* "cdec/sa/veb.pxi":198
*
* veb.max_val = -1
* veb.min_val = -1 # <<<<<<<<<<<<<<
@@ -22699,7 +22737,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__VEB *__pyx_f_4cdec_2sa_3_sa_new_VEB(int __
*/
__pyx_v_veb->min_val = -1;
- /* "veb.pxi":199
+ /* "cdec/sa/veb.pxi":199
* veb.max_val = -1
* veb.min_val = -1
* veb.size = 0 # <<<<<<<<<<<<<<
@@ -22708,7 +22746,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__VEB *__pyx_f_4cdec_2sa_3_sa_new_VEB(int __
*/
__pyx_v_veb->size = 0;
- /* "veb.pxi":200
+ /* "cdec/sa/veb.pxi":200
* veb.min_val = -1
* veb.size = 0
* return veb # <<<<<<<<<<<<<<
@@ -22718,7 +22756,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__VEB *__pyx_f_4cdec_2sa_3_sa_new_VEB(int __
__pyx_r = __pyx_v_veb;
goto __pyx_L0;
- /* "veb.pxi":177
+ /* "cdec/sa/veb.pxi":177
* void** bottom
*
* cdef _VEB* new_VEB(int n): # <<<<<<<<<<<<<<
@@ -22735,7 +22773,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__VEB *__pyx_f_4cdec_2sa_3_sa_new_VEB(int __
return __pyx_r;
}
-/* "veb.pxi":203
+/* "cdec/sa/veb.pxi":203
*
*
* cdef int VEB_insert(_VEB* veb, int i): # <<<<<<<<<<<<<<
@@ -22756,7 +22794,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB
int __pyx_t_3;
__Pyx_RefNannySetupContext("VEB_insert", 0);
- /* "veb.pxi":208
+ /* "cdec/sa/veb.pxi":208
* cdef int a, b, tmp
*
* if veb.size == 0: # <<<<<<<<<<<<<<
@@ -22766,7 +22804,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB
__pyx_t_1 = ((__pyx_v_veb->size == 0) != 0);
if (__pyx_t_1) {
- /* "veb.pxi":209
+ /* "cdec/sa/veb.pxi":209
*
* if veb.size == 0:
* veb.min_val = i # <<<<<<<<<<<<<<
@@ -22775,7 +22813,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB
*/
__pyx_v_veb->min_val = __pyx_v_i;
- /* "veb.pxi":210
+ /* "cdec/sa/veb.pxi":210
* if veb.size == 0:
* veb.min_val = i
* veb.max_val = i # <<<<<<<<<<<<<<
@@ -22786,7 +22824,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB
goto __pyx_L3;
}
- /* "veb.pxi":211
+ /* "cdec/sa/veb.pxi":211
* veb.min_val = i
* veb.max_val = i
* elif i == veb.min_val or i == veb.max_val: # <<<<<<<<<<<<<<
@@ -22806,7 +22844,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB
__pyx_L4_bool_binop_done:;
if (__pyx_t_1) {
- /* "veb.pxi":212
+ /* "cdec/sa/veb.pxi":212
* veb.max_val = i
* elif i == veb.min_val or i == veb.max_val:
* return 0 # <<<<<<<<<<<<<<
@@ -22818,7 +22856,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB
}
/*else*/ {
- /* "veb.pxi":214
+ /* "cdec/sa/veb.pxi":214
* return 0
* else:
* if i < veb.min_val: # <<<<<<<<<<<<<<
@@ -22828,7 +22866,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB
__pyx_t_1 = ((__pyx_v_i < __pyx_v_veb->min_val) != 0);
if (__pyx_t_1) {
- /* "veb.pxi":215
+ /* "cdec/sa/veb.pxi":215
* else:
* if i < veb.min_val:
* tmp = i # <<<<<<<<<<<<<<
@@ -22837,7 +22875,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB
*/
__pyx_v_tmp = __pyx_v_i;
- /* "veb.pxi":216
+ /* "cdec/sa/veb.pxi":216
* if i < veb.min_val:
* tmp = i
* i = veb.min_val # <<<<<<<<<<<<<<
@@ -22847,7 +22885,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB
__pyx_t_3 = __pyx_v_veb->min_val;
__pyx_v_i = __pyx_t_3;
- /* "veb.pxi":217
+ /* "cdec/sa/veb.pxi":217
* tmp = i
* i = veb.min_val
* veb.min_val = tmp # <<<<<<<<<<<<<<
@@ -22859,7 +22897,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB
}
__pyx_L6:;
- /* "veb.pxi":218
+ /* "cdec/sa/veb.pxi":218
* i = veb.min_val
* veb.min_val = tmp
* a = i >> veb.num_bottom_bits # <<<<<<<<<<<<<<
@@ -22868,7 +22906,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB
*/
__pyx_v_a = (__pyx_v_i >> __pyx_v_veb->num_bottom_bits);
- /* "veb.pxi":219
+ /* "cdec/sa/veb.pxi":219
* veb.min_val = tmp
* a = i >> veb.num_bottom_bits
* b = i & LOWER_MASK[veb.num_bottom_bits-1] # <<<<<<<<<<<<<<
@@ -22877,7 +22915,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB
*/
__pyx_v_b = (__pyx_v_i & (__pyx_v_4cdec_2sa_3_sa_LOWER_MASK[(__pyx_v_veb->num_bottom_bits - 1)]));
- /* "veb.pxi":220
+ /* "cdec/sa/veb.pxi":220
* a = i >> veb.num_bottom_bits
* b = i & LOWER_MASK[veb.num_bottom_bits-1]
* if veb.bottom[a] == NULL: # <<<<<<<<<<<<<<
@@ -22887,7 +22925,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB
__pyx_t_1 = (((__pyx_v_veb->bottom[__pyx_v_a]) == NULL) != 0);
if (__pyx_t_1) {
- /* "veb.pxi":221
+ /* "cdec/sa/veb.pxi":221
* b = i & LOWER_MASK[veb.num_bottom_bits-1]
* if veb.bottom[a] == NULL:
* if veb.top_universe_size > MIN_BOTTOM_SIZE: # <<<<<<<<<<<<<<
@@ -22897,7 +22935,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB
__pyx_t_1 = ((__pyx_v_veb->top_universe_size > __pyx_v_4cdec_2sa_3_sa_MIN_BOTTOM_SIZE) != 0);
if (__pyx_t_1) {
- /* "veb.pxi":222
+ /* "cdec/sa/veb.pxi":222
* if veb.bottom[a] == NULL:
* if veb.top_universe_size > MIN_BOTTOM_SIZE:
* subv = <_VEB*> veb.top # <<<<<<<<<<<<<<
@@ -22906,7 +22944,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB
*/
__pyx_v_subv = ((struct __pyx_t_4cdec_2sa_3_sa__VEB *)__pyx_v_veb->top);
- /* "veb.pxi":223
+ /* "cdec/sa/veb.pxi":223
* if veb.top_universe_size > MIN_BOTTOM_SIZE:
* subv = <_VEB*> veb.top
* VEB_insert(subv, a) # <<<<<<<<<<<<<<
@@ -22918,7 +22956,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB
}
/*else*/ {
- /* "veb.pxi":225
+ /* "cdec/sa/veb.pxi":225
* VEB_insert(subv, a)
* else:
* subb = <_BitSet*> veb.top # <<<<<<<<<<<<<<
@@ -22927,7 +22965,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB
*/
__pyx_v_subb = ((struct __pyx_t_4cdec_2sa_3_sa__BitSet *)__pyx_v_veb->top);
- /* "veb.pxi":226
+ /* "cdec/sa/veb.pxi":226
* else:
* subb = <_BitSet*> veb.top
* bitset_insert(subb, a) # <<<<<<<<<<<<<<
@@ -22938,7 +22976,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB
}
__pyx_L8:;
- /* "veb.pxi":227
+ /* "cdec/sa/veb.pxi":227
* subb = <_BitSet*> veb.top
* bitset_insert(subb, a)
* if veb.num_bottom_bits > MIN_BOTTOM_BITS: # <<<<<<<<<<<<<<
@@ -22948,7 +22986,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB
__pyx_t_1 = ((__pyx_v_veb->num_bottom_bits > __pyx_v_4cdec_2sa_3_sa_MIN_BOTTOM_BITS) != 0);
if (__pyx_t_1) {
- /* "veb.pxi":228
+ /* "cdec/sa/veb.pxi":228
* bitset_insert(subb, a)
* if veb.num_bottom_bits > MIN_BOTTOM_BITS:
* veb.bottom[a] = new_VEB(1 << veb.num_bottom_bits) # <<<<<<<<<<<<<<
@@ -22960,7 +22998,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB
}
/*else*/ {
- /* "veb.pxi":230
+ /* "cdec/sa/veb.pxi":230
* veb.bottom[a] = new_VEB(1 << veb.num_bottom_bits)
* else:
* veb.bottom[a] = new_BitSet() # <<<<<<<<<<<<<<
@@ -22974,7 +23012,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB
}
__pyx_L7:;
- /* "veb.pxi":231
+ /* "cdec/sa/veb.pxi":231
* else:
* veb.bottom[a] = new_BitSet()
* if veb.num_bottom_bits > MIN_BOTTOM_BITS: # <<<<<<<<<<<<<<
@@ -22984,7 +23022,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB
__pyx_t_1 = ((__pyx_v_veb->num_bottom_bits > __pyx_v_4cdec_2sa_3_sa_MIN_BOTTOM_BITS) != 0);
if (__pyx_t_1) {
- /* "veb.pxi":232
+ /* "cdec/sa/veb.pxi":232
* veb.bottom[a] = new_BitSet()
* if veb.num_bottom_bits > MIN_BOTTOM_BITS:
* subv = <_VEB*> veb.bottom[a] # <<<<<<<<<<<<<<
@@ -22993,7 +23031,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB
*/
__pyx_v_subv = ((struct __pyx_t_4cdec_2sa_3_sa__VEB *)(__pyx_v_veb->bottom[__pyx_v_a]));
- /* "veb.pxi":233
+ /* "cdec/sa/veb.pxi":233
* if veb.num_bottom_bits > MIN_BOTTOM_BITS:
* subv = <_VEB*> veb.bottom[a]
* if VEB_insert(subv, b) == 0: # <<<<<<<<<<<<<<
@@ -23003,7 +23041,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB
__pyx_t_1 = ((__pyx_f_4cdec_2sa_3_sa_VEB_insert(__pyx_v_subv, __pyx_v_b) == 0) != 0);
if (__pyx_t_1) {
- /* "veb.pxi":234
+ /* "cdec/sa/veb.pxi":234
* subv = <_VEB*> veb.bottom[a]
* if VEB_insert(subv, b) == 0:
* return 0 # <<<<<<<<<<<<<<
@@ -23017,7 +23055,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB
}
/*else*/ {
- /* "veb.pxi":236
+ /* "cdec/sa/veb.pxi":236
* return 0
* else:
* subb = <_BitSet*> veb.bottom[a] # <<<<<<<<<<<<<<
@@ -23026,7 +23064,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB
*/
__pyx_v_subb = ((struct __pyx_t_4cdec_2sa_3_sa__BitSet *)(__pyx_v_veb->bottom[__pyx_v_a]));
- /* "veb.pxi":237
+ /* "cdec/sa/veb.pxi":237
* else:
* subb = <_BitSet*> veb.bottom[a]
* if bitset_insert(subb, b) == 0: # <<<<<<<<<<<<<<
@@ -23036,7 +23074,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB
__pyx_t_1 = ((__pyx_f_4cdec_2sa_3_sa_bitset_insert(__pyx_v_subb, __pyx_v_b) == 0) != 0);
if (__pyx_t_1) {
- /* "veb.pxi":238
+ /* "cdec/sa/veb.pxi":238
* subb = <_BitSet*> veb.bottom[a]
* if bitset_insert(subb, b) == 0:
* return 0 # <<<<<<<<<<<<<<
@@ -23049,7 +23087,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB
}
__pyx_L10:;
- /* "veb.pxi":240
+ /* "cdec/sa/veb.pxi":240
* return 0
*
* if i > veb.max_val: # <<<<<<<<<<<<<<
@@ -23059,7 +23097,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB
__pyx_t_1 = ((__pyx_v_i > __pyx_v_veb->max_val) != 0);
if (__pyx_t_1) {
- /* "veb.pxi":241
+ /* "cdec/sa/veb.pxi":241
*
* if i > veb.max_val:
* veb.max_val = i # <<<<<<<<<<<<<<
@@ -23073,7 +23111,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB
}
__pyx_L3:;
- /* "veb.pxi":242
+ /* "cdec/sa/veb.pxi":242
* if i > veb.max_val:
* veb.max_val = i
* veb.size = veb.size + 1 # <<<<<<<<<<<<<<
@@ -23082,7 +23120,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB
*/
__pyx_v_veb->size = (__pyx_v_veb->size + 1);
- /* "veb.pxi":243
+ /* "cdec/sa/veb.pxi":243
* veb.max_val = i
* veb.size = veb.size + 1
* return 1 # <<<<<<<<<<<<<<
@@ -23092,7 +23130,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB
__pyx_r = 1;
goto __pyx_L0;
- /* "veb.pxi":203
+ /* "cdec/sa/veb.pxi":203
*
*
* cdef int VEB_insert(_VEB* veb, int i): # <<<<<<<<<<<<<<
@@ -23106,7 +23144,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_insert(struct __pyx_t_4cdec_2sa_3_sa__VEB
return __pyx_r;
}
-/* "veb.pxi":246
+/* "cdec/sa/veb.pxi":246
*
*
* cdef del_VEB(_VEB* veb): # <<<<<<<<<<<<<<
@@ -23126,7 +23164,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_del_VEB(struct __pyx_t_4cdec_2sa_3_sa__V
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("del_VEB", 0);
- /* "veb.pxi":249
+ /* "cdec/sa/veb.pxi":249
* cdef int i
*
* if veb.top_universe_size > MIN_BOTTOM_SIZE: # <<<<<<<<<<<<<<
@@ -23136,7 +23174,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_del_VEB(struct __pyx_t_4cdec_2sa_3_sa__V
__pyx_t_1 = ((__pyx_v_veb->top_universe_size > __pyx_v_4cdec_2sa_3_sa_MIN_BOTTOM_SIZE) != 0);
if (__pyx_t_1) {
- /* "veb.pxi":250
+ /* "cdec/sa/veb.pxi":250
*
* if veb.top_universe_size > MIN_BOTTOM_SIZE:
* i = (<_VEB*> veb.top).min_val # <<<<<<<<<<<<<<
@@ -23149,7 +23187,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_del_VEB(struct __pyx_t_4cdec_2sa_3_sa__V
}
/*else*/ {
- /* "veb.pxi":252
+ /* "cdec/sa/veb.pxi":252
* i = (<_VEB*> veb.top).min_val
* else:
* i = (<_BitSet*> veb.top).min_val # <<<<<<<<<<<<<<
@@ -23161,7 +23199,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_del_VEB(struct __pyx_t_4cdec_2sa_3_sa__V
}
__pyx_L3:;
- /* "veb.pxi":254
+ /* "cdec/sa/veb.pxi":254
* i = (<_BitSet*> veb.top).min_val
*
* while i != -1: # <<<<<<<<<<<<<<
@@ -23172,7 +23210,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_del_VEB(struct __pyx_t_4cdec_2sa_3_sa__V
__pyx_t_1 = ((__pyx_v_i != -1) != 0);
if (!__pyx_t_1) break;
- /* "veb.pxi":255
+ /* "cdec/sa/veb.pxi":255
*
* while i != -1:
* if veb.num_bottom_bits > MIN_BOTTOM_BITS: # <<<<<<<<<<<<<<
@@ -23182,7 +23220,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_del_VEB(struct __pyx_t_4cdec_2sa_3_sa__V
__pyx_t_1 = ((__pyx_v_veb->num_bottom_bits > __pyx_v_4cdec_2sa_3_sa_MIN_BOTTOM_BITS) != 0);
if (__pyx_t_1) {
- /* "veb.pxi":256
+ /* "cdec/sa/veb.pxi":256
* while i != -1:
* if veb.num_bottom_bits > MIN_BOTTOM_BITS:
* del_VEB(<_VEB*> veb.bottom[i]) # <<<<<<<<<<<<<<
@@ -23196,7 +23234,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_del_VEB(struct __pyx_t_4cdec_2sa_3_sa__V
}
/*else*/ {
- /* "veb.pxi":258
+ /* "cdec/sa/veb.pxi":258
* del_VEB(<_VEB*> veb.bottom[i])
* else:
* free(<_BitSet*> veb.bottom[i]) # <<<<<<<<<<<<<<
@@ -23207,7 +23245,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_del_VEB(struct __pyx_t_4cdec_2sa_3_sa__V
}
__pyx_L6:;
- /* "veb.pxi":260
+ /* "cdec/sa/veb.pxi":260
* free(<_BitSet*> veb.bottom[i])
*
* if veb.top_universe_size > MIN_BOTTOM_SIZE: # <<<<<<<<<<<<<<
@@ -23217,7 +23255,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_del_VEB(struct __pyx_t_4cdec_2sa_3_sa__V
__pyx_t_1 = ((__pyx_v_veb->top_universe_size > __pyx_v_4cdec_2sa_3_sa_MIN_BOTTOM_SIZE) != 0);
if (__pyx_t_1) {
- /* "veb.pxi":261
+ /* "cdec/sa/veb.pxi":261
*
* if veb.top_universe_size > MIN_BOTTOM_SIZE:
* i = VEB_findsucc(<_VEB*> veb.top, i) # <<<<<<<<<<<<<<
@@ -23229,7 +23267,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_del_VEB(struct __pyx_t_4cdec_2sa_3_sa__V
}
/*else*/ {
- /* "veb.pxi":263
+ /* "cdec/sa/veb.pxi":263
* i = VEB_findsucc(<_VEB*> veb.top, i)
* else:
* i = bitset_findsucc(<_BitSet*> veb.top, i) # <<<<<<<<<<<<<<
@@ -23241,7 +23279,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_del_VEB(struct __pyx_t_4cdec_2sa_3_sa__V
__pyx_L7:;
}
- /* "veb.pxi":265
+ /* "cdec/sa/veb.pxi":265
* i = bitset_findsucc(<_BitSet*> veb.top, i)
*
* if veb.top_universe_size > MIN_BOTTOM_SIZE: # <<<<<<<<<<<<<<
@@ -23251,7 +23289,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_del_VEB(struct __pyx_t_4cdec_2sa_3_sa__V
__pyx_t_1 = ((__pyx_v_veb->top_universe_size > __pyx_v_4cdec_2sa_3_sa_MIN_BOTTOM_SIZE) != 0);
if (__pyx_t_1) {
- /* "veb.pxi":266
+ /* "cdec/sa/veb.pxi":266
*
* if veb.top_universe_size > MIN_BOTTOM_SIZE:
* del_VEB(<_VEB*> veb.top) # <<<<<<<<<<<<<<
@@ -23265,7 +23303,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_del_VEB(struct __pyx_t_4cdec_2sa_3_sa__V
}
/*else*/ {
- /* "veb.pxi":268
+ /* "cdec/sa/veb.pxi":268
* del_VEB(<_VEB*> veb.top)
* else:
* free(<_BitSet*> veb.top) # <<<<<<<<<<<<<<
@@ -23276,7 +23314,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_del_VEB(struct __pyx_t_4cdec_2sa_3_sa__V
}
__pyx_L8:;
- /* "veb.pxi":269
+ /* "cdec/sa/veb.pxi":269
* else:
* free(<_BitSet*> veb.top)
* free(veb.bottom) # <<<<<<<<<<<<<<
@@ -23285,7 +23323,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_del_VEB(struct __pyx_t_4cdec_2sa_3_sa__V
*/
free(__pyx_v_veb->bottom);
- /* "veb.pxi":270
+ /* "cdec/sa/veb.pxi":270
* free(<_BitSet*> veb.top)
* free(veb.bottom)
* free(veb) # <<<<<<<<<<<<<<
@@ -23294,7 +23332,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_del_VEB(struct __pyx_t_4cdec_2sa_3_sa__V
*/
free(__pyx_v_veb);
- /* "veb.pxi":246
+ /* "cdec/sa/veb.pxi":246
*
*
* cdef del_VEB(_VEB* veb): # <<<<<<<<<<<<<<
@@ -23315,7 +23353,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_del_VEB(struct __pyx_t_4cdec_2sa_3_sa__V
return __pyx_r;
}
-/* "veb.pxi":273
+/* "cdec/sa/veb.pxi":273
*
*
* cdef int VEB_findsucc(_VEB* veb, int i): # <<<<<<<<<<<<<<
@@ -23337,7 +23375,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE
int __pyx_t_2;
__Pyx_RefNannySetupContext("VEB_findsucc", 0);
- /* "veb.pxi":278
+ /* "cdec/sa/veb.pxi":278
* cdef int a, b, j, c, found
*
* if veb.max_val == -1 or i>=veb.max_val: # <<<<<<<<<<<<<<
@@ -23357,7 +23395,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE
__pyx_L4_bool_binop_done:;
if (__pyx_t_1) {
- /* "veb.pxi":279
+ /* "cdec/sa/veb.pxi":279
*
* if veb.max_val == -1 or i>=veb.max_val:
* return -1 # <<<<<<<<<<<<<<
@@ -23368,7 +23406,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE
goto __pyx_L0;
}
- /* "veb.pxi":280
+ /* "cdec/sa/veb.pxi":280
* if veb.max_val == -1 or i>=veb.max_val:
* return -1
* if i < veb.min_val: # <<<<<<<<<<<<<<
@@ -23378,7 +23416,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE
__pyx_t_1 = ((__pyx_v_i < __pyx_v_veb->min_val) != 0);
if (__pyx_t_1) {
- /* "veb.pxi":281
+ /* "cdec/sa/veb.pxi":281
* return -1
* if i < veb.min_val:
* return veb.min_val # <<<<<<<<<<<<<<
@@ -23389,7 +23427,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE
goto __pyx_L0;
}
- /* "veb.pxi":283
+ /* "cdec/sa/veb.pxi":283
* return veb.min_val
*
* a = i >> veb.num_bottom_bits # <<<<<<<<<<<<<<
@@ -23398,7 +23436,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE
*/
__pyx_v_a = (__pyx_v_i >> __pyx_v_veb->num_bottom_bits);
- /* "veb.pxi":284
+ /* "cdec/sa/veb.pxi":284
*
* a = i >> veb.num_bottom_bits
* b = i & LOWER_MASK[veb.num_bottom_bits-1] # <<<<<<<<<<<<<<
@@ -23407,7 +23445,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE
*/
__pyx_v_b = (__pyx_v_i & (__pyx_v_4cdec_2sa_3_sa_LOWER_MASK[(__pyx_v_veb->num_bottom_bits - 1)]));
- /* "veb.pxi":285
+ /* "cdec/sa/veb.pxi":285
* a = i >> veb.num_bottom_bits
* b = i & LOWER_MASK[veb.num_bottom_bits-1]
* found = 0 # <<<<<<<<<<<<<<
@@ -23416,7 +23454,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE
*/
__pyx_v_found = 0;
- /* "veb.pxi":286
+ /* "cdec/sa/veb.pxi":286
* b = i & LOWER_MASK[veb.num_bottom_bits-1]
* found = 0
* if veb.bottom[a] != NULL: # <<<<<<<<<<<<<<
@@ -23426,7 +23464,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE
__pyx_t_1 = (((__pyx_v_veb->bottom[__pyx_v_a]) != NULL) != 0);
if (__pyx_t_1) {
- /* "veb.pxi":287
+ /* "cdec/sa/veb.pxi":287
* found = 0
* if veb.bottom[a] != NULL:
* if veb.num_bottom_bits > MIN_BOTTOM_BITS: # <<<<<<<<<<<<<<
@@ -23436,7 +23474,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE
__pyx_t_1 = ((__pyx_v_veb->num_bottom_bits > __pyx_v_4cdec_2sa_3_sa_MIN_BOTTOM_BITS) != 0);
if (__pyx_t_1) {
- /* "veb.pxi":288
+ /* "cdec/sa/veb.pxi":288
* if veb.bottom[a] != NULL:
* if veb.num_bottom_bits > MIN_BOTTOM_BITS:
* subv = <_VEB*> veb.bottom[a] # <<<<<<<<<<<<<<
@@ -23445,7 +23483,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE
*/
__pyx_v_subv = ((struct __pyx_t_4cdec_2sa_3_sa__VEB *)(__pyx_v_veb->bottom[__pyx_v_a]));
- /* "veb.pxi":289
+ /* "cdec/sa/veb.pxi":289
* if veb.num_bottom_bits > MIN_BOTTOM_BITS:
* subv = <_VEB*> veb.bottom[a]
* if subv.max_val > b: # <<<<<<<<<<<<<<
@@ -23455,7 +23493,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE
__pyx_t_1 = ((__pyx_v_subv->max_val > __pyx_v_b) != 0);
if (__pyx_t_1) {
- /* "veb.pxi":290
+ /* "cdec/sa/veb.pxi":290
* subv = <_VEB*> veb.bottom[a]
* if subv.max_val > b:
* j = (a << veb.num_bottom_bits) + VEB_findsucc(subv, b) # <<<<<<<<<<<<<<
@@ -23464,7 +23502,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE
*/
__pyx_v_j = ((__pyx_v_a << __pyx_v_veb->num_bottom_bits) + __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(__pyx_v_subv, __pyx_v_b));
- /* "veb.pxi":291
+ /* "cdec/sa/veb.pxi":291
* if subv.max_val > b:
* j = (a << veb.num_bottom_bits) + VEB_findsucc(subv, b)
* found = 1 # <<<<<<<<<<<<<<
@@ -23479,7 +23517,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE
}
/*else*/ {
- /* "veb.pxi":293
+ /* "cdec/sa/veb.pxi":293
* found = 1
* else:
* subb = <_BitSet*> veb.bottom[a] # <<<<<<<<<<<<<<
@@ -23488,7 +23526,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE
*/
__pyx_v_subb = ((struct __pyx_t_4cdec_2sa_3_sa__BitSet *)(__pyx_v_veb->bottom[__pyx_v_a]));
- /* "veb.pxi":294
+ /* "cdec/sa/veb.pxi":294
* else:
* subb = <_BitSet*> veb.bottom[a]
* if subb.max_val > b: # <<<<<<<<<<<<<<
@@ -23498,7 +23536,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE
__pyx_t_1 = ((__pyx_v_subb->max_val > __pyx_v_b) != 0);
if (__pyx_t_1) {
- /* "veb.pxi":295
+ /* "cdec/sa/veb.pxi":295
* subb = <_BitSet*> veb.bottom[a]
* if subb.max_val > b:
* j = (a << veb.num_bottom_bits) + bitset_findsucc(subb, b) # <<<<<<<<<<<<<<
@@ -23507,7 +23545,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE
*/
__pyx_v_j = ((__pyx_v_a << __pyx_v_veb->num_bottom_bits) + __pyx_f_4cdec_2sa_3_sa_bitset_findsucc(__pyx_v_subb, __pyx_v_b));
- /* "veb.pxi":296
+ /* "cdec/sa/veb.pxi":296
* if subb.max_val > b:
* j = (a << veb.num_bottom_bits) + bitset_findsucc(subb, b)
* found = 1 # <<<<<<<<<<<<<<
@@ -23524,7 +23562,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE
}
__pyx_L7:;
- /* "veb.pxi":297
+ /* "cdec/sa/veb.pxi":297
* j = (a << veb.num_bottom_bits) + bitset_findsucc(subb, b)
* found = 1
* if found==0: # <<<<<<<<<<<<<<
@@ -23534,7 +23572,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE
__pyx_t_1 = ((__pyx_v_found == 0) != 0);
if (__pyx_t_1) {
- /* "veb.pxi":298
+ /* "cdec/sa/veb.pxi":298
* found = 1
* if found==0:
* if veb.top_universe_size > MIN_BOTTOM_SIZE: # <<<<<<<<<<<<<<
@@ -23544,7 +23582,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE
__pyx_t_1 = ((__pyx_v_veb->top_universe_size > __pyx_v_4cdec_2sa_3_sa_MIN_BOTTOM_SIZE) != 0);
if (__pyx_t_1) {
- /* "veb.pxi":299
+ /* "cdec/sa/veb.pxi":299
* if found==0:
* if veb.top_universe_size > MIN_BOTTOM_SIZE:
* subv = <_VEB*> veb.top # <<<<<<<<<<<<<<
@@ -23553,7 +23591,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE
*/
__pyx_v_subv = ((struct __pyx_t_4cdec_2sa_3_sa__VEB *)__pyx_v_veb->top);
- /* "veb.pxi":300
+ /* "cdec/sa/veb.pxi":300
* if veb.top_universe_size > MIN_BOTTOM_SIZE:
* subv = <_VEB*> veb.top
* c = VEB_findsucc(subv, a) # <<<<<<<<<<<<<<
@@ -23565,7 +23603,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE
}
/*else*/ {
- /* "veb.pxi":302
+ /* "cdec/sa/veb.pxi":302
* c = VEB_findsucc(subv, a)
* else:
* subb = <_BitSet*> veb.top # <<<<<<<<<<<<<<
@@ -23574,7 +23612,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE
*/
__pyx_v_subb = ((struct __pyx_t_4cdec_2sa_3_sa__BitSet *)__pyx_v_veb->top);
- /* "veb.pxi":303
+ /* "cdec/sa/veb.pxi":303
* else:
* subb = <_BitSet*> veb.top
* c = bitset_findsucc(subb, a) # <<<<<<<<<<<<<<
@@ -23585,7 +23623,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE
}
__pyx_L12:;
- /* "veb.pxi":304
+ /* "cdec/sa/veb.pxi":304
* subb = <_BitSet*> veb.top
* c = bitset_findsucc(subb, a)
* if veb.num_bottom_bits > MIN_BOTTOM_BITS: # <<<<<<<<<<<<<<
@@ -23595,7 +23633,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE
__pyx_t_1 = ((__pyx_v_veb->num_bottom_bits > __pyx_v_4cdec_2sa_3_sa_MIN_BOTTOM_BITS) != 0);
if (__pyx_t_1) {
- /* "veb.pxi":305
+ /* "cdec/sa/veb.pxi":305
* c = bitset_findsucc(subb, a)
* if veb.num_bottom_bits > MIN_BOTTOM_BITS:
* subv = <_VEB*> veb.bottom[c] # <<<<<<<<<<<<<<
@@ -23604,7 +23642,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE
*/
__pyx_v_subv = ((struct __pyx_t_4cdec_2sa_3_sa__VEB *)(__pyx_v_veb->bottom[__pyx_v_c]));
- /* "veb.pxi":306
+ /* "cdec/sa/veb.pxi":306
* if veb.num_bottom_bits > MIN_BOTTOM_BITS:
* subv = <_VEB*> veb.bottom[c]
* j = (c << veb.num_bottom_bits) + subv.min_val # <<<<<<<<<<<<<<
@@ -23616,7 +23654,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE
}
/*else*/ {
- /* "veb.pxi":308
+ /* "cdec/sa/veb.pxi":308
* j = (c << veb.num_bottom_bits) + subv.min_val
* else:
* subb = <_BitSet*> veb.bottom[c] # <<<<<<<<<<<<<<
@@ -23625,7 +23663,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE
*/
__pyx_v_subb = ((struct __pyx_t_4cdec_2sa_3_sa__BitSet *)(__pyx_v_veb->bottom[__pyx_v_c]));
- /* "veb.pxi":309
+ /* "cdec/sa/veb.pxi":309
* else:
* subb = <_BitSet*> veb.bottom[c]
* j = (c << veb.num_bottom_bits) + subb.min_val # <<<<<<<<<<<<<<
@@ -23639,7 +23677,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE
}
__pyx_L11:;
- /* "veb.pxi":310
+ /* "cdec/sa/veb.pxi":310
* subb = <_BitSet*> veb.bottom[c]
* j = (c << veb.num_bottom_bits) + subb.min_val
* return j # <<<<<<<<<<<<<<
@@ -23649,7 +23687,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE
__pyx_r = __pyx_v_j;
goto __pyx_L0;
- /* "veb.pxi":273
+ /* "cdec/sa/veb.pxi":273
*
*
* cdef int VEB_findsucc(_VEB* veb, int i): # <<<<<<<<<<<<<<
@@ -23663,7 +23701,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(struct __pyx_t_4cdec_2sa_3_sa__VE
return __pyx_r;
}
-/* "veb.pxi":313
+/* "cdec/sa/veb.pxi":313
*
*
* cdef int VEB_contains(_VEB* veb, int i): # <<<<<<<<<<<<<<
@@ -23682,7 +23720,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_contains(struct __pyx_t_4cdec_2sa_3_sa__VE
int __pyx_t_2;
__Pyx_RefNannySetupContext("VEB_contains", 0);
- /* "veb.pxi":318
+ /* "cdec/sa/veb.pxi":318
* cdef int a, b
*
* if veb.size == 0 or i < veb.min_val or i > veb.max_val: # <<<<<<<<<<<<<<
@@ -23710,7 +23748,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_contains(struct __pyx_t_4cdec_2sa_3_sa__VE
__pyx_L4_bool_binop_done:;
if (__pyx_t_1) {
- /* "veb.pxi":319
+ /* "cdec/sa/veb.pxi":319
*
* if veb.size == 0 or i < veb.min_val or i > veb.max_val:
* return 0 # <<<<<<<<<<<<<<
@@ -23721,7 +23759,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_contains(struct __pyx_t_4cdec_2sa_3_sa__VE
goto __pyx_L0;
}
- /* "veb.pxi":321
+ /* "cdec/sa/veb.pxi":321
* return 0
*
* if veb.min_val == i: # <<<<<<<<<<<<<<
@@ -23731,7 +23769,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_contains(struct __pyx_t_4cdec_2sa_3_sa__VE
__pyx_t_1 = ((__pyx_v_veb->min_val == __pyx_v_i) != 0);
if (__pyx_t_1) {
- /* "veb.pxi":322
+ /* "cdec/sa/veb.pxi":322
*
* if veb.min_val == i:
* return 1 # <<<<<<<<<<<<<<
@@ -23743,7 +23781,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_contains(struct __pyx_t_4cdec_2sa_3_sa__VE
}
/*else*/ {
- /* "veb.pxi":324
+ /* "cdec/sa/veb.pxi":324
* return 1
* else:
* if veb.size == 1: # <<<<<<<<<<<<<<
@@ -23753,7 +23791,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_contains(struct __pyx_t_4cdec_2sa_3_sa__VE
__pyx_t_1 = ((__pyx_v_veb->size == 1) != 0);
if (__pyx_t_1) {
- /* "veb.pxi":325
+ /* "cdec/sa/veb.pxi":325
* else:
* if veb.size == 1:
* return 0 # <<<<<<<<<<<<<<
@@ -23765,7 +23803,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_contains(struct __pyx_t_4cdec_2sa_3_sa__VE
}
}
- /* "veb.pxi":327
+ /* "cdec/sa/veb.pxi":327
* return 0
*
* a = i >> veb.num_bottom_bits # <<<<<<<<<<<<<<
@@ -23774,7 +23812,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_contains(struct __pyx_t_4cdec_2sa_3_sa__VE
*/
__pyx_v_a = (__pyx_v_i >> __pyx_v_veb->num_bottom_bits);
- /* "veb.pxi":328
+ /* "cdec/sa/veb.pxi":328
*
* a = i >> veb.num_bottom_bits
* b = i & LOWER_MASK[veb.num_bottom_bits-1] # <<<<<<<<<<<<<<
@@ -23783,7 +23821,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_contains(struct __pyx_t_4cdec_2sa_3_sa__VE
*/
__pyx_v_b = (__pyx_v_i & (__pyx_v_4cdec_2sa_3_sa_LOWER_MASK[(__pyx_v_veb->num_bottom_bits - 1)]));
- /* "veb.pxi":329
+ /* "cdec/sa/veb.pxi":329
* a = i >> veb.num_bottom_bits
* b = i & LOWER_MASK[veb.num_bottom_bits-1]
* if veb.bottom[a] == NULL: # <<<<<<<<<<<<<<
@@ -23793,7 +23831,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_contains(struct __pyx_t_4cdec_2sa_3_sa__VE
__pyx_t_1 = (((__pyx_v_veb->bottom[__pyx_v_a]) == NULL) != 0);
if (__pyx_t_1) {
- /* "veb.pxi":330
+ /* "cdec/sa/veb.pxi":330
* b = i & LOWER_MASK[veb.num_bottom_bits-1]
* if veb.bottom[a] == NULL:
* return 0 # <<<<<<<<<<<<<<
@@ -23805,7 +23843,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_contains(struct __pyx_t_4cdec_2sa_3_sa__VE
}
/*else*/ {
- /* "veb.pxi":332
+ /* "cdec/sa/veb.pxi":332
* return 0
* else:
* if veb.num_bottom_bits > MIN_BOTTOM_BITS: # <<<<<<<<<<<<<<
@@ -23815,7 +23853,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_contains(struct __pyx_t_4cdec_2sa_3_sa__VE
__pyx_t_1 = ((__pyx_v_veb->num_bottom_bits > __pyx_v_4cdec_2sa_3_sa_MIN_BOTTOM_BITS) != 0);
if (__pyx_t_1) {
- /* "veb.pxi":333
+ /* "cdec/sa/veb.pxi":333
* else:
* if veb.num_bottom_bits > MIN_BOTTOM_BITS:
* subv = <_VEB*> veb.bottom[a] # <<<<<<<<<<<<<<
@@ -23824,7 +23862,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_contains(struct __pyx_t_4cdec_2sa_3_sa__VE
*/
__pyx_v_subv = ((struct __pyx_t_4cdec_2sa_3_sa__VEB *)(__pyx_v_veb->bottom[__pyx_v_a]));
- /* "veb.pxi":334
+ /* "cdec/sa/veb.pxi":334
* if veb.num_bottom_bits > MIN_BOTTOM_BITS:
* subv = <_VEB*> veb.bottom[a]
* return VEB_contains(subv, b) # <<<<<<<<<<<<<<
@@ -23836,7 +23874,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_contains(struct __pyx_t_4cdec_2sa_3_sa__VE
}
/*else*/ {
- /* "veb.pxi":336
+ /* "cdec/sa/veb.pxi":336
* return VEB_contains(subv, b)
* else:
* subb = <_BitSet*> veb.bottom[a] # <<<<<<<<<<<<<<
@@ -23845,7 +23883,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_contains(struct __pyx_t_4cdec_2sa_3_sa__VE
*/
__pyx_v_subb = ((struct __pyx_t_4cdec_2sa_3_sa__BitSet *)(__pyx_v_veb->bottom[__pyx_v_a]));
- /* "veb.pxi":337
+ /* "cdec/sa/veb.pxi":337
* else:
* subb = <_BitSet*> veb.bottom[a]
* return bitset_contains(subb, b) # <<<<<<<<<<<<<<
@@ -23857,7 +23895,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_contains(struct __pyx_t_4cdec_2sa_3_sa__VE
}
}
- /* "veb.pxi":313
+ /* "cdec/sa/veb.pxi":313
*
*
* cdef int VEB_contains(_VEB* veb, int i): # <<<<<<<<<<<<<<
@@ -23871,7 +23909,7 @@ static int __pyx_f_4cdec_2sa_3_sa_VEB_contains(struct __pyx_t_4cdec_2sa_3_sa__VE
return __pyx_r;
}
-/* "veb.pxi":344
+/* "cdec/sa/veb.pxi":344
* cdef int next_val
*
* def __next__(self): # <<<<<<<<<<<<<<
@@ -23904,7 +23942,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11VEBIterator___next__(struct __pyx_obj
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__next__", 0);
- /* "veb.pxi":347
+ /* "cdec/sa/veb.pxi":347
* cdef int ret_val
*
* if self.next_val == -1: # <<<<<<<<<<<<<<
@@ -23914,7 +23952,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11VEBIterator___next__(struct __pyx_obj
__pyx_t_1 = ((__pyx_v_self->next_val == -1) != 0);
if (__pyx_t_1) {
- /* "veb.pxi":348
+ /* "cdec/sa/veb.pxi":348
*
* if self.next_val == -1:
* raise StopIteration() # <<<<<<<<<<<<<<
@@ -23928,7 +23966,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11VEBIterator___next__(struct __pyx_obj
{__pyx_filename = __pyx_f[6]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- /* "veb.pxi":349
+ /* "cdec/sa/veb.pxi":349
* if self.next_val == -1:
* raise StopIteration()
* ret_val = self.next_val # <<<<<<<<<<<<<<
@@ -23938,7 +23976,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11VEBIterator___next__(struct __pyx_obj
__pyx_t_3 = __pyx_v_self->next_val;
__pyx_v_ret_val = __pyx_t_3;
- /* "veb.pxi":350
+ /* "cdec/sa/veb.pxi":350
* raise StopIteration()
* ret_val = self.next_val
* self.next_val = VEB_findsucc(self.v, ret_val) # <<<<<<<<<<<<<<
@@ -23947,7 +23985,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11VEBIterator___next__(struct __pyx_obj
*/
__pyx_v_self->next_val = __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(__pyx_v_self->v, __pyx_v_ret_val);
- /* "veb.pxi":351
+ /* "cdec/sa/veb.pxi":351
* ret_val = self.next_val
* self.next_val = VEB_findsucc(self.v, ret_val)
* return ret_val # <<<<<<<<<<<<<<
@@ -23961,7 +23999,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11VEBIterator___next__(struct __pyx_obj
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "veb.pxi":344
+ /* "cdec/sa/veb.pxi":344
* cdef int next_val
*
* def __next__(self): # <<<<<<<<<<<<<<
@@ -23980,7 +24018,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11VEBIterator___next__(struct __pyx_obj
return __pyx_r;
}
-/* "veb.pxi":360
+/* "cdec/sa/veb.pxi":360
* cdef int _first(self)
*
* def __cinit__(self, int size): # <<<<<<<<<<<<<<
@@ -24045,7 +24083,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_3VEB___cinit__(struct __pyx_obj_4cdec_2sa_3_s
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "veb.pxi":361
+ /* "cdec/sa/veb.pxi":361
*
* def __cinit__(self, int size):
* self.veb = new_VEB(size) # <<<<<<<<<<<<<<
@@ -24054,7 +24092,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_3VEB___cinit__(struct __pyx_obj_4cdec_2sa_3_s
*/
__pyx_v_self->veb = __pyx_f_4cdec_2sa_3_sa_new_VEB(__pyx_v_size);
- /* "veb.pxi":360
+ /* "cdec/sa/veb.pxi":360
* cdef int _first(self)
*
* def __cinit__(self, int size): # <<<<<<<<<<<<<<
@@ -24068,7 +24106,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_3VEB___cinit__(struct __pyx_obj_4cdec_2sa_3_s
return __pyx_r;
}
-/* "veb.pxi":363
+/* "cdec/sa/veb.pxi":363
* self.veb = new_VEB(size)
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -24095,7 +24133,7 @@ static void __pyx_pf_4cdec_2sa_3_sa_3VEB_2__dealloc__(struct __pyx_obj_4cdec_2sa
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "veb.pxi":364
+ /* "cdec/sa/veb.pxi":364
*
* def __dealloc__(self):
* del_VEB(self.veb) # <<<<<<<<<<<<<<
@@ -24106,7 +24144,7 @@ static void __pyx_pf_4cdec_2sa_3_sa_3VEB_2__dealloc__(struct __pyx_obj_4cdec_2sa
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "veb.pxi":363
+ /* "cdec/sa/veb.pxi":363
* self.veb = new_VEB(size)
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -24123,7 +24161,7 @@ static void __pyx_pf_4cdec_2sa_3_sa_3VEB_2__dealloc__(struct __pyx_obj_4cdec_2sa
__Pyx_RefNannyFinishContext();
}
-/* "veb.pxi":366
+/* "cdec/sa/veb.pxi":366
* del_VEB(self.veb)
*
* def __iter__(self): # <<<<<<<<<<<<<<
@@ -24156,7 +24194,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_3VEB_4__iter__(struct __pyx_obj_4cdec_2
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__iter__", 0);
- /* "veb.pxi":368
+ /* "cdec/sa/veb.pxi":368
* def __iter__(self):
* cdef VEBIterator it
* it = VEBIterator() # <<<<<<<<<<<<<<
@@ -24168,7 +24206,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_3VEB_4__iter__(struct __pyx_obj_4cdec_2
__pyx_v_it = ((struct __pyx_obj_4cdec_2sa_3_sa_VEBIterator *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "veb.pxi":369
+ /* "cdec/sa/veb.pxi":369
* cdef VEBIterator it
* it = VEBIterator()
* it.v = self.veb # <<<<<<<<<<<<<<
@@ -24178,7 +24216,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_3VEB_4__iter__(struct __pyx_obj_4cdec_2
__pyx_t_2 = __pyx_v_self->veb;
__pyx_v_it->v = __pyx_t_2;
- /* "veb.pxi":370
+ /* "cdec/sa/veb.pxi":370
* it = VEBIterator()
* it.v = self.veb
* it.next_val = self.veb.min_val # <<<<<<<<<<<<<<
@@ -24188,7 +24226,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_3VEB_4__iter__(struct __pyx_obj_4cdec_2
__pyx_t_3 = __pyx_v_self->veb->min_val;
__pyx_v_it->next_val = __pyx_t_3;
- /* "veb.pxi":371
+ /* "cdec/sa/veb.pxi":371
* it.v = self.veb
* it.next_val = self.veb.min_val
* return it # <<<<<<<<<<<<<<
@@ -24200,7 +24238,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_3VEB_4__iter__(struct __pyx_obj_4cdec_2
__pyx_r = ((PyObject *)__pyx_v_it);
goto __pyx_L0;
- /* "veb.pxi":366
+ /* "cdec/sa/veb.pxi":366
* del_VEB(self.veb)
*
* def __iter__(self): # <<<<<<<<<<<<<<
@@ -24220,7 +24258,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_3VEB_4__iter__(struct __pyx_obj_4cdec_2
return __pyx_r;
}
-/* "veb.pxi":373
+/* "cdec/sa/veb.pxi":373
* return it
*
* def insert(self, i): # <<<<<<<<<<<<<<
@@ -24251,7 +24289,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_3VEB_6insert(struct __pyx_obj_4cdec_2sa
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("insert", 0);
- /* "veb.pxi":374
+ /* "cdec/sa/veb.pxi":374
*
* def insert(self, i):
* return VEB_insert(self.veb, i) # <<<<<<<<<<<<<<
@@ -24266,7 +24304,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_3VEB_6insert(struct __pyx_obj_4cdec_2sa
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "veb.pxi":373
+ /* "cdec/sa/veb.pxi":373
* return it
*
* def insert(self, i): # <<<<<<<<<<<<<<
@@ -24285,7 +24323,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_3VEB_6insert(struct __pyx_obj_4cdec_2sa
return __pyx_r;
}
-/* "veb.pxi":376
+/* "cdec/sa/veb.pxi":376
* return VEB_insert(self.veb, i)
*
* cdef int _insert(self, int i): # <<<<<<<<<<<<<<
@@ -24298,7 +24336,7 @@ static int __pyx_f_4cdec_2sa_3_sa_3VEB__insert(struct __pyx_obj_4cdec_2sa_3_sa_V
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_insert", 0);
- /* "veb.pxi":377
+ /* "cdec/sa/veb.pxi":377
*
* cdef int _insert(self, int i):
* return VEB_insert(self.veb, i) # <<<<<<<<<<<<<<
@@ -24308,7 +24346,7 @@ static int __pyx_f_4cdec_2sa_3_sa_3VEB__insert(struct __pyx_obj_4cdec_2sa_3_sa_V
__pyx_r = __pyx_f_4cdec_2sa_3_sa_VEB_insert(__pyx_v_self->veb, __pyx_v_i);
goto __pyx_L0;
- /* "veb.pxi":376
+ /* "cdec/sa/veb.pxi":376
* return VEB_insert(self.veb, i)
*
* cdef int _insert(self, int i): # <<<<<<<<<<<<<<
@@ -24322,7 +24360,7 @@ static int __pyx_f_4cdec_2sa_3_sa_3VEB__insert(struct __pyx_obj_4cdec_2sa_3_sa_V
return __pyx_r;
}
-/* "veb.pxi":379
+/* "cdec/sa/veb.pxi":379
* return VEB_insert(self.veb, i)
*
* def findsucc(self, i): # <<<<<<<<<<<<<<
@@ -24353,7 +24391,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_3VEB_8findsucc(struct __pyx_obj_4cdec_2
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("findsucc", 0);
- /* "veb.pxi":380
+ /* "cdec/sa/veb.pxi":380
*
* def findsucc(self, i):
* return VEB_findsucc(self.veb, i) # <<<<<<<<<<<<<<
@@ -24368,7 +24406,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_3VEB_8findsucc(struct __pyx_obj_4cdec_2
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "veb.pxi":379
+ /* "cdec/sa/veb.pxi":379
* return VEB_insert(self.veb, i)
*
* def findsucc(self, i): # <<<<<<<<<<<<<<
@@ -24387,7 +24425,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_3VEB_8findsucc(struct __pyx_obj_4cdec_2
return __pyx_r;
}
-/* "veb.pxi":382
+/* "cdec/sa/veb.pxi":382
* return VEB_findsucc(self.veb, i)
*
* cdef int _first(self): # <<<<<<<<<<<<<<
@@ -24400,7 +24438,7 @@ static int __pyx_f_4cdec_2sa_3_sa_3VEB__first(struct __pyx_obj_4cdec_2sa_3_sa_VE
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_first", 0);
- /* "veb.pxi":383
+ /* "cdec/sa/veb.pxi":383
*
* cdef int _first(self):
* return self.veb.min_val # <<<<<<<<<<<<<<
@@ -24410,7 +24448,7 @@ static int __pyx_f_4cdec_2sa_3_sa_3VEB__first(struct __pyx_obj_4cdec_2sa_3_sa_VE
__pyx_r = __pyx_v_self->veb->min_val;
goto __pyx_L0;
- /* "veb.pxi":382
+ /* "cdec/sa/veb.pxi":382
* return VEB_findsucc(self.veb, i)
*
* cdef int _first(self): # <<<<<<<<<<<<<<
@@ -24424,7 +24462,7 @@ static int __pyx_f_4cdec_2sa_3_sa_3VEB__first(struct __pyx_obj_4cdec_2sa_3_sa_VE
return __pyx_r;
}
-/* "veb.pxi":385
+/* "cdec/sa/veb.pxi":385
* return self.veb.min_val
*
* cdef int _findsucc(self, int i): # <<<<<<<<<<<<<<
@@ -24437,7 +24475,7 @@ static int __pyx_f_4cdec_2sa_3_sa_3VEB__findsucc(struct __pyx_obj_4cdec_2sa_3_sa
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_findsucc", 0);
- /* "veb.pxi":386
+ /* "cdec/sa/veb.pxi":386
*
* cdef int _findsucc(self, int i):
* return VEB_findsucc(self.veb, i) # <<<<<<<<<<<<<<
@@ -24447,7 +24485,7 @@ static int __pyx_f_4cdec_2sa_3_sa_3VEB__findsucc(struct __pyx_obj_4cdec_2sa_3_sa
__pyx_r = __pyx_f_4cdec_2sa_3_sa_VEB_findsucc(__pyx_v_self->veb, __pyx_v_i);
goto __pyx_L0;
- /* "veb.pxi":385
+ /* "cdec/sa/veb.pxi":385
* return self.veb.min_val
*
* cdef int _findsucc(self, int i): # <<<<<<<<<<<<<<
@@ -24461,7 +24499,7 @@ static int __pyx_f_4cdec_2sa_3_sa_3VEB__findsucc(struct __pyx_obj_4cdec_2sa_3_sa
return __pyx_r;
}
-/* "veb.pxi":388
+/* "cdec/sa/veb.pxi":388
* return VEB_findsucc(self.veb, i)
*
* def __len__(self): # <<<<<<<<<<<<<<
@@ -24487,7 +24525,7 @@ static Py_ssize_t __pyx_pf_4cdec_2sa_3_sa_3VEB_10__len__(struct __pyx_obj_4cdec_
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__len__", 0);
- /* "veb.pxi":389
+ /* "cdec/sa/veb.pxi":389
*
* def __len__(self):
* return self.veb.size # <<<<<<<<<<<<<<
@@ -24497,7 +24535,7 @@ static Py_ssize_t __pyx_pf_4cdec_2sa_3_sa_3VEB_10__len__(struct __pyx_obj_4cdec_
__pyx_r = __pyx_v_self->veb->size;
goto __pyx_L0;
- /* "veb.pxi":388
+ /* "cdec/sa/veb.pxi":388
* return VEB_findsucc(self.veb, i)
*
* def __len__(self): # <<<<<<<<<<<<<<
@@ -24511,7 +24549,7 @@ static Py_ssize_t __pyx_pf_4cdec_2sa_3_sa_3VEB_10__len__(struct __pyx_obj_4cdec_
return __pyx_r;
}
-/* "veb.pxi":391
+/* "cdec/sa/veb.pxi":391
* return self.veb.size
*
* def __contains__(self, i): # <<<<<<<<<<<<<<
@@ -24540,7 +24578,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_3VEB_12__contains__(struct __pyx_obj_4cdec_2s
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__contains__", 0);
- /* "veb.pxi":392
+ /* "cdec/sa/veb.pxi":392
*
* def __contains__(self, i):
* return VEB_contains(self.veb, i) # <<<<<<<<<<<<<<
@@ -24549,7 +24587,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_3VEB_12__contains__(struct __pyx_obj_4cdec_2s
__pyx_r = __pyx_f_4cdec_2sa_3_sa_VEB_contains(__pyx_v_self->veb, __pyx_t_1);
goto __pyx_L0;
- /* "veb.pxi":391
+ /* "cdec/sa/veb.pxi":391
* return self.veb.size
*
* def __contains__(self, i): # <<<<<<<<<<<<<<
@@ -24565,7 +24603,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_3VEB_12__contains__(struct __pyx_obj_4cdec_2s
return __pyx_r;
}
-/* "lcp.pxi":9
+/* "cdec/sa/lcp.pxi":9
* cdef IntList lcp
*
* def __cinit__(self, SuffixArray sa): # <<<<<<<<<<<<<<
@@ -24649,7 +24687,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_3LCP___cinit__(struct __pyx_obj_4cdec_2sa_3_s
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "lcp.pxi":13
+ /* "cdec/sa/lcp.pxi":13
* cdef IntList rank
*
* logger.info("Constructing LCP array") # <<<<<<<<<<<<<<
@@ -24666,7 +24704,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_3LCP___cinit__(struct __pyx_obj_4cdec_2sa_3_s
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "lcp.pxi":14
+ /* "cdec/sa/lcp.pxi":14
*
* logger.info("Constructing LCP array")
* self.sa = sa # <<<<<<<<<<<<<<
@@ -24679,7 +24717,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_3LCP___cinit__(struct __pyx_obj_4cdec_2sa_3_s
__Pyx_DECREF(((PyObject *)__pyx_v_self->sa));
__pyx_v_self->sa = __pyx_v_sa;
- /* "lcp.pxi":15
+ /* "cdec/sa/lcp.pxi":15
* logger.info("Constructing LCP array")
* self.sa = sa
* n = self.sa.sa.len # <<<<<<<<<<<<<<
@@ -24689,7 +24727,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_3LCP___cinit__(struct __pyx_obj_4cdec_2sa_3_s
__pyx_t_3 = __pyx_v_self->sa->sa->len;
__pyx_v_n = __pyx_t_3;
- /* "lcp.pxi":16
+ /* "cdec/sa/lcp.pxi":16
* self.sa = sa
* n = self.sa.sa.len
* self.lcp = IntList(initial_len=n) # <<<<<<<<<<<<<<
@@ -24711,7 +24749,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_3LCP___cinit__(struct __pyx_obj_4cdec_2sa_3_s
__pyx_v_self->lcp = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "lcp.pxi":18
+ /* "cdec/sa/lcp.pxi":18
* self.lcp = IntList(initial_len=n)
*
* rank = IntList(initial_len=n) # <<<<<<<<<<<<<<
@@ -24730,7 +24768,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_3LCP___cinit__(struct __pyx_obj_4cdec_2sa_3_s
__pyx_v_rank = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "lcp.pxi":19
+ /* "cdec/sa/lcp.pxi":19
*
* rank = IntList(initial_len=n)
* for i from 0 <= i < n: # <<<<<<<<<<<<<<
@@ -24740,7 +24778,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_3LCP___cinit__(struct __pyx_obj_4cdec_2sa_3_s
__pyx_t_3 = __pyx_v_n;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) {
- /* "lcp.pxi":20
+ /* "cdec/sa/lcp.pxi":20
* rank = IntList(initial_len=n)
* for i from 0 <= i < n:
* rank.arr[sa.sa.arr[i]] = i # <<<<<<<<<<<<<<
@@ -24750,7 +24788,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_3LCP___cinit__(struct __pyx_obj_4cdec_2sa_3_s
(__pyx_v_rank->arr[(__pyx_v_sa->sa->arr[__pyx_v_i])]) = __pyx_v_i;
}
- /* "lcp.pxi":22
+ /* "cdec/sa/lcp.pxi":22
* rank.arr[sa.sa.arr[i]] = i
*
* h = 0 # <<<<<<<<<<<<<<
@@ -24759,7 +24797,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_3LCP___cinit__(struct __pyx_obj_4cdec_2sa_3_s
*/
__pyx_v_h = 0;
- /* "lcp.pxi":23
+ /* "cdec/sa/lcp.pxi":23
*
* h = 0
* for i from 0 <= i < n: # <<<<<<<<<<<<<<
@@ -24769,7 +24807,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_3LCP___cinit__(struct __pyx_obj_4cdec_2sa_3_s
__pyx_t_3 = __pyx_v_n;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) {
- /* "lcp.pxi":24
+ /* "cdec/sa/lcp.pxi":24
* h = 0
* for i from 0 <= i < n:
* k = rank.arr[i] # <<<<<<<<<<<<<<
@@ -24778,7 +24816,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_3LCP___cinit__(struct __pyx_obj_4cdec_2sa_3_s
*/
__pyx_v_k = (__pyx_v_rank->arr[__pyx_v_i]);
- /* "lcp.pxi":25
+ /* "cdec/sa/lcp.pxi":25
* for i from 0 <= i < n:
* k = rank.arr[i]
* if k == 0: # <<<<<<<<<<<<<<
@@ -24788,7 +24826,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_3LCP___cinit__(struct __pyx_obj_4cdec_2sa_3_s
__pyx_t_4 = ((__pyx_v_k == 0) != 0);
if (__pyx_t_4) {
- /* "lcp.pxi":26
+ /* "cdec/sa/lcp.pxi":26
* k = rank.arr[i]
* if k == 0:
* self.lcp.arr[k] = -1 # <<<<<<<<<<<<<<
@@ -24800,7 +24838,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_3LCP___cinit__(struct __pyx_obj_4cdec_2sa_3_s
}
/*else*/ {
- /* "lcp.pxi":28
+ /* "cdec/sa/lcp.pxi":28
* self.lcp.arr[k] = -1
* else:
* j = sa.sa.arr[k-1] # <<<<<<<<<<<<<<
@@ -24809,7 +24847,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_3LCP___cinit__(struct __pyx_obj_4cdec_2sa_3_s
*/
__pyx_v_j = (__pyx_v_sa->sa->arr[(__pyx_v_k - 1)]);
- /* "lcp.pxi":29
+ /* "cdec/sa/lcp.pxi":29
* else:
* j = sa.sa.arr[k-1]
* while i+h < n and j+h < n and sa.darray.data.arr[i+h] == sa.darray.data.arr[j+h]: # <<<<<<<<<<<<<<
@@ -24838,7 +24876,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_3LCP___cinit__(struct __pyx_obj_4cdec_2sa_3_s
__pyx_L10_bool_binop_done:;
if (!__pyx_t_4) break;
- /* "lcp.pxi":30
+ /* "cdec/sa/lcp.pxi":30
* j = sa.sa.arr[k-1]
* while i+h < n and j+h < n and sa.darray.data.arr[i+h] == sa.darray.data.arr[j+h]:
* h = h+1 # <<<<<<<<<<<<<<
@@ -24848,7 +24886,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_3LCP___cinit__(struct __pyx_obj_4cdec_2sa_3_s
__pyx_v_h = (__pyx_v_h + 1);
}
- /* "lcp.pxi":31
+ /* "cdec/sa/lcp.pxi":31
* while i+h < n and j+h < n and sa.darray.data.arr[i+h] == sa.darray.data.arr[j+h]:
* h = h+1
* self.lcp.arr[k] = h # <<<<<<<<<<<<<<
@@ -24859,7 +24897,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_3LCP___cinit__(struct __pyx_obj_4cdec_2sa_3_s
}
__pyx_L7:;
- /* "lcp.pxi":32
+ /* "cdec/sa/lcp.pxi":32
* h = h+1
* self.lcp.arr[k] = h
* if h > 0: # <<<<<<<<<<<<<<
@@ -24869,7 +24907,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_3LCP___cinit__(struct __pyx_obj_4cdec_2sa_3_s
__pyx_t_4 = ((__pyx_v_h > 0) != 0);
if (__pyx_t_4) {
- /* "lcp.pxi":33
+ /* "cdec/sa/lcp.pxi":33
* self.lcp.arr[k] = h
* if h > 0:
* h = h-1 # <<<<<<<<<<<<<<
@@ -24882,7 +24920,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_3LCP___cinit__(struct __pyx_obj_4cdec_2sa_3_s
__pyx_L13:;
}
- /* "lcp.pxi":34
+ /* "cdec/sa/lcp.pxi":34
* if h > 0:
* h = h-1
* logger.info("LCP array completed") # <<<<<<<<<<<<<<
@@ -24899,7 +24937,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_3LCP___cinit__(struct __pyx_obj_4cdec_2sa_3_s
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "lcp.pxi":9
+ /* "cdec/sa/lcp.pxi":9
* cdef IntList lcp
*
* def __cinit__(self, SuffixArray sa): # <<<<<<<<<<<<<<
@@ -24922,7 +24960,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_3LCP___cinit__(struct __pyx_obj_4cdec_2sa_3_s
}
static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-/* "lcp.pxi":36
+/* "cdec/sa/lcp.pxi":36
* logger.info("LCP array completed")
*
* def compute_stats(self, int max_n): # <<<<<<<<<<<<<<
@@ -25020,7 +25058,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject
__pyx_L3_first_run:;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "lcp.pxi":48
+ /* "cdec/sa/lcp.pxi":48
* cdef VEB veb
*
* N = self.sa.sa.len # <<<<<<<<<<<<<<
@@ -25030,7 +25068,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject
__pyx_t_1 = __pyx_cur_scope->__pyx_v_self->sa->sa->len;
__pyx_cur_scope->__pyx_v_N = __pyx_t_1;
- /* "lcp.pxi":50
+ /* "cdec/sa/lcp.pxi":50
* N = self.sa.sa.len
*
* ngram_starts = [] # <<<<<<<<<<<<<<
@@ -25043,7 +25081,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject
__pyx_cur_scope->__pyx_v_ngram_starts = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
- /* "lcp.pxi":51
+ /* "cdec/sa/lcp.pxi":51
*
* ngram_starts = []
* for n from 0 <= n < max_n: # <<<<<<<<<<<<<<
@@ -25053,7 +25091,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject
__pyx_t_1 = __pyx_cur_scope->__pyx_v_max_n;
for (__pyx_cur_scope->__pyx_v_n = 0; __pyx_cur_scope->__pyx_v_n < __pyx_t_1; __pyx_cur_scope->__pyx_v_n++) {
- /* "lcp.pxi":52
+ /* "cdec/sa/lcp.pxi":52
* ngram_starts = []
* for n from 0 <= n < max_n:
* ngram_starts.append(IntList(initial_len=N)) # <<<<<<<<<<<<<<
@@ -25073,7 +25111,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
- /* "lcp.pxi":54
+ /* "cdec/sa/lcp.pxi":54
* ngram_starts.append(IntList(initial_len=N))
*
* run_start = IntList(initial_len=max_n) # <<<<<<<<<<<<<<
@@ -25093,7 +25131,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject
__pyx_cur_scope->__pyx_v_run_start = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "lcp.pxi":55
+ /* "cdec/sa/lcp.pxi":55
*
* run_start = IntList(initial_len=max_n)
* veb = VEB(N) # <<<<<<<<<<<<<<
@@ -25114,7 +25152,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject
__pyx_cur_scope->__pyx_v_veb = ((struct __pyx_obj_4cdec_2sa_3_sa_VEB *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "lcp.pxi":57
+ /* "cdec/sa/lcp.pxi":57
* veb = VEB(N)
*
* for i from 0 <= i < N: # <<<<<<<<<<<<<<
@@ -25124,7 +25162,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject
__pyx_t_1 = __pyx_cur_scope->__pyx_v_N;
for (__pyx_cur_scope->__pyx_v_i = 0; __pyx_cur_scope->__pyx_v_i < __pyx_t_1; __pyx_cur_scope->__pyx_v_i++) {
- /* "lcp.pxi":58
+ /* "cdec/sa/lcp.pxi":58
*
* for i from 0 <= i < N:
* h = self.lcp.arr[i] # <<<<<<<<<<<<<<
@@ -25133,7 +25171,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject
*/
__pyx_cur_scope->__pyx_v_h = (__pyx_cur_scope->__pyx_v_self->lcp->arr[__pyx_cur_scope->__pyx_v_i]);
- /* "lcp.pxi":59
+ /* "cdec/sa/lcp.pxi":59
* for i from 0 <= i < N:
* h = self.lcp.arr[i]
* if h < 0: # <<<<<<<<<<<<<<
@@ -25143,7 +25181,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject
__pyx_t_5 = ((__pyx_cur_scope->__pyx_v_h < 0) != 0);
if (__pyx_t_5) {
- /* "lcp.pxi":60
+ /* "cdec/sa/lcp.pxi":60
* h = self.lcp.arr[i]
* if h < 0:
* h = 0 # <<<<<<<<<<<<<<
@@ -25155,7 +25193,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject
}
__pyx_L8:;
- /* "lcp.pxi":61
+ /* "cdec/sa/lcp.pxi":61
* if h < 0:
* h = 0
* for n from h <= n < max_n: # <<<<<<<<<<<<<<
@@ -25165,7 +25203,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject
__pyx_t_6 = __pyx_cur_scope->__pyx_v_max_n;
for (__pyx_cur_scope->__pyx_v_n = __pyx_cur_scope->__pyx_v_h; __pyx_cur_scope->__pyx_v_n < __pyx_t_6; __pyx_cur_scope->__pyx_v_n++) {
- /* "lcp.pxi":62
+ /* "cdec/sa/lcp.pxi":62
* h = 0
* for n from h <= n < max_n:
* rs = run_start.arr[n] # <<<<<<<<<<<<<<
@@ -25174,7 +25212,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject
*/
__pyx_cur_scope->__pyx_v_rs = (__pyx_cur_scope->__pyx_v_run_start->arr[__pyx_cur_scope->__pyx_v_n]);
- /* "lcp.pxi":63
+ /* "cdec/sa/lcp.pxi":63
* for n from h <= n < max_n:
* rs = run_start.arr[n]
* run_start.arr[n] = i # <<<<<<<<<<<<<<
@@ -25183,7 +25221,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject
*/
(__pyx_cur_scope->__pyx_v_run_start->arr[__pyx_cur_scope->__pyx_v_n]) = __pyx_cur_scope->__pyx_v_i;
- /* "lcp.pxi":64
+ /* "cdec/sa/lcp.pxi":64
* rs = run_start.arr[n]
* run_start.arr[n] = i
* freq = i - rs # <<<<<<<<<<<<<<
@@ -25192,7 +25230,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject
*/
__pyx_cur_scope->__pyx_v_freq = (__pyx_cur_scope->__pyx_v_i - __pyx_cur_scope->__pyx_v_rs);
- /* "lcp.pxi":65
+ /* "cdec/sa/lcp.pxi":65
* run_start.arr[n] = i
* freq = i - rs
* if freq > 1000: # arbitrary, but see note below # <<<<<<<<<<<<<<
@@ -25202,7 +25240,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject
__pyx_t_5 = ((__pyx_cur_scope->__pyx_v_freq > 1000) != 0);
if (__pyx_t_5) {
- /* "lcp.pxi":66
+ /* "cdec/sa/lcp.pxi":66
* freq = i - rs
* if freq > 1000: # arbitrary, but see note below
* veb._insert(freq) # <<<<<<<<<<<<<<
@@ -25211,7 +25249,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_VEB *)__pyx_cur_scope->__pyx_v_veb->__pyx_vtab)->_insert(__pyx_cur_scope->__pyx_v_veb, __pyx_cur_scope->__pyx_v_freq);
- /* "lcp.pxi":67
+ /* "cdec/sa/lcp.pxi":67
* if freq > 1000: # arbitrary, but see note below
* veb._insert(freq)
* ngram_start = ngram_starts[n] # <<<<<<<<<<<<<<
@@ -25226,7 +25264,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject
__Pyx_GIVEREF(__pyx_t_2);
__pyx_t_2 = 0;
- /* "lcp.pxi":68
+ /* "cdec/sa/lcp.pxi":68
* veb._insert(freq)
* ngram_start = ngram_starts[n]
* while ngram_start.arr[freq] > 0: # <<<<<<<<<<<<<<
@@ -25237,7 +25275,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject
__pyx_t_5 = (((__pyx_cur_scope->__pyx_v_ngram_start->arr[__pyx_cur_scope->__pyx_v_freq]) > 0) != 0);
if (!__pyx_t_5) break;
- /* "lcp.pxi":69
+ /* "cdec/sa/lcp.pxi":69
* ngram_start = ngram_starts[n]
* while ngram_start.arr[freq] > 0:
* freq = freq + 1 # cheating a bit, should be ok for sparse histogram # <<<<<<<<<<<<<<
@@ -25247,7 +25285,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject
__pyx_cur_scope->__pyx_v_freq = (__pyx_cur_scope->__pyx_v_freq + 1);
}
- /* "lcp.pxi":70
+ /* "cdec/sa/lcp.pxi":70
* while ngram_start.arr[freq] > 0:
* freq = freq + 1 # cheating a bit, should be ok for sparse histogram
* ngram_start.arr[freq] = rs # <<<<<<<<<<<<<<
@@ -25261,7 +25299,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject
}
}
- /* "lcp.pxi":71
+ /* "cdec/sa/lcp.pxi":71
* freq = freq + 1 # cheating a bit, should be ok for sparse histogram
* ngram_start.arr[freq] = rs
* i = veb.veb.min_val # <<<<<<<<<<<<<<
@@ -25271,7 +25309,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject
__pyx_t_1 = __pyx_cur_scope->__pyx_v_veb->veb->min_val;
__pyx_cur_scope->__pyx_v_i = __pyx_t_1;
- /* "lcp.pxi":72
+ /* "cdec/sa/lcp.pxi":72
* ngram_start.arr[freq] = rs
* i = veb.veb.min_val
* while i != -1: # <<<<<<<<<<<<<<
@@ -25282,7 +25320,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject
__pyx_t_5 = ((__pyx_cur_scope->__pyx_v_i != -1) != 0);
if (!__pyx_t_5) break;
- /* "lcp.pxi":73
+ /* "cdec/sa/lcp.pxi":73
* i = veb.veb.min_val
* while i != -1:
* ii = veb._findsucc(i) # <<<<<<<<<<<<<<
@@ -25291,7 +25329,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject
*/
__pyx_cur_scope->__pyx_v_ii = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_VEB *)__pyx_cur_scope->__pyx_v_veb->__pyx_vtab)->_findsucc(__pyx_cur_scope->__pyx_v_veb, __pyx_cur_scope->__pyx_v_i);
- /* "lcp.pxi":74
+ /* "cdec/sa/lcp.pxi":74
* while i != -1:
* ii = veb._findsucc(i)
* for n from 0 <= n < max_n: # <<<<<<<<<<<<<<
@@ -25301,7 +25339,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject
__pyx_t_1 = __pyx_cur_scope->__pyx_v_max_n;
for (__pyx_cur_scope->__pyx_v_n = 0; __pyx_cur_scope->__pyx_v_n < __pyx_t_1; __pyx_cur_scope->__pyx_v_n++) {
- /* "lcp.pxi":75
+ /* "cdec/sa/lcp.pxi":75
* ii = veb._findsucc(i)
* for n from 0 <= n < max_n:
* ngram_start = ngram_starts[n] # <<<<<<<<<<<<<<
@@ -25316,7 +25354,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject
__Pyx_GIVEREF(__pyx_t_2);
__pyx_t_2 = 0;
- /* "lcp.pxi":76
+ /* "cdec/sa/lcp.pxi":76
* for n from 0 <= n < max_n:
* ngram_start = ngram_starts[n]
* iii = i # <<<<<<<<<<<<<<
@@ -25325,7 +25363,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject
*/
__pyx_cur_scope->__pyx_v_iii = __pyx_cur_scope->__pyx_v_i;
- /* "lcp.pxi":77
+ /* "cdec/sa/lcp.pxi":77
* ngram_start = ngram_starts[n]
* iii = i
* rs = ngram_start.arr[iii] # <<<<<<<<<<<<<<
@@ -25334,7 +25372,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject
*/
__pyx_cur_scope->__pyx_v_rs = (__pyx_cur_scope->__pyx_v_ngram_start->arr[__pyx_cur_scope->__pyx_v_iii]);
- /* "lcp.pxi":78
+ /* "cdec/sa/lcp.pxi":78
* iii = i
* rs = ngram_start.arr[iii]
* while (ii==-1 or iii < ii) and rs != 0: # <<<<<<<<<<<<<<
@@ -25362,7 +25400,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject
__pyx_L20_bool_binop_done:;
if (!__pyx_t_5) break;
- /* "lcp.pxi":79
+ /* "cdec/sa/lcp.pxi":79
* rs = ngram_start.arr[iii]
* while (ii==-1 or iii < ii) and rs != 0:
* j = self.sa.sa.arr[rs] # <<<<<<<<<<<<<<
@@ -25371,7 +25409,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject
*/
__pyx_cur_scope->__pyx_v_j = (__pyx_cur_scope->__pyx_v_self->sa->sa->arr[__pyx_cur_scope->__pyx_v_rs]);
- /* "lcp.pxi":80
+ /* "cdec/sa/lcp.pxi":80
* while (ii==-1 or iii < ii) and rs != 0:
* j = self.sa.sa.arr[rs]
* valid = 1 # <<<<<<<<<<<<<<
@@ -25380,7 +25418,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject
*/
__pyx_cur_scope->__pyx_v_valid = 1;
- /* "lcp.pxi":81
+ /* "cdec/sa/lcp.pxi":81
* j = self.sa.sa.arr[rs]
* valid = 1
* for k from 0 <= k < n+1: # <<<<<<<<<<<<<<
@@ -25390,7 +25428,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject
__pyx_t_8 = (__pyx_cur_scope->__pyx_v_n + 1);
for (__pyx_cur_scope->__pyx_v_k = 0; __pyx_cur_scope->__pyx_v_k < __pyx_t_8; __pyx_cur_scope->__pyx_v_k++) {
- /* "lcp.pxi":82
+ /* "cdec/sa/lcp.pxi":82
* valid = 1
* for k from 0 <= k < n+1:
* if self.sa.darray.data.arr[j+k] < 2: # <<<<<<<<<<<<<<
@@ -25400,7 +25438,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject
__pyx_t_5 = (((__pyx_cur_scope->__pyx_v_self->sa->darray->data->arr[(__pyx_cur_scope->__pyx_v_j + __pyx_cur_scope->__pyx_v_k)]) < 2) != 0);
if (__pyx_t_5) {
- /* "lcp.pxi":83
+ /* "cdec/sa/lcp.pxi":83
* for k from 0 <= k < n+1:
* if self.sa.darray.data.arr[j+k] < 2:
* valid = 0 # <<<<<<<<<<<<<<
@@ -25413,7 +25451,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject
__pyx_L25:;
}
- /* "lcp.pxi":84
+ /* "cdec/sa/lcp.pxi":84
* if self.sa.darray.data.arr[j+k] < 2:
* valid = 0
* if valid: # <<<<<<<<<<<<<<
@@ -25423,7 +25461,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject
__pyx_t_5 = (__pyx_cur_scope->__pyx_v_valid != 0);
if (__pyx_t_5) {
- /* "lcp.pxi":85
+ /* "cdec/sa/lcp.pxi":85
* valid = 0
* if valid:
* ngram = tuple([self.sa.darray.data.arr[j+k] for k in range(n+1)]) # <<<<<<<<<<<<<<
@@ -25448,7 +25486,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject
__Pyx_GIVEREF(__pyx_t_3);
__pyx_t_3 = 0;
- /* "lcp.pxi":86
+ /* "cdec/sa/lcp.pxi":86
* if valid:
* ngram = tuple([self.sa.darray.data.arr[j+k] for k in range(n+1)])
* yield i, n+1, ngram # <<<<<<<<<<<<<<
@@ -25485,7 +25523,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject
}
__pyx_L26:;
- /* "lcp.pxi":87
+ /* "cdec/sa/lcp.pxi":87
* ngram = tuple([self.sa.darray.data.arr[j+k] for k in range(n+1)])
* yield i, n+1, ngram
* iii = iii + 1 # <<<<<<<<<<<<<<
@@ -25494,7 +25532,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject
*/
__pyx_cur_scope->__pyx_v_iii = (__pyx_cur_scope->__pyx_v_iii + 1);
- /* "lcp.pxi":88
+ /* "cdec/sa/lcp.pxi":88
* yield i, n+1, ngram
* iii = iii + 1
* rs = ngram_start.arr[iii] # <<<<<<<<<<<<<<
@@ -25504,7 +25542,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject
}
}
- /* "lcp.pxi":89
+ /* "cdec/sa/lcp.pxi":89
* iii = iii + 1
* rs = ngram_start.arr[iii]
* i = ii # <<<<<<<<<<<<<<
@@ -25512,7 +25550,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject
__pyx_cur_scope->__pyx_v_i = __pyx_cur_scope->__pyx_v_ii;
}
- /* "lcp.pxi":36
+ /* "cdec/sa/lcp.pxi":36
* logger.info("LCP array completed")
*
* def compute_stats(self, int max_n): # <<<<<<<<<<<<<<
@@ -25536,7 +25574,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_3LCP_4generator1(__pyx_GeneratorObject
return NULL;
}
-/* "sym.pxi":12
+/* "cdec/sa/sym.pxi":12
* cdef dict id2sym
*
* def __cinit__(self): # <<<<<<<<<<<<<<
@@ -25569,7 +25607,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_8Alphabet___cinit__(struct __pyx_obj_4cdec_2s
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "sym.pxi":13
+ /* "cdec/sa/sym.pxi":13
*
* def __cinit__(self):
* self.terminals = StringMap() # <<<<<<<<<<<<<<
@@ -25584,7 +25622,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_8Alphabet___cinit__(struct __pyx_obj_4cdec_2s
__pyx_v_self->terminals = ((struct __pyx_obj_4cdec_2sa_3_sa_StringMap *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "sym.pxi":14
+ /* "cdec/sa/sym.pxi":14
* def __cinit__(self):
* self.terminals = StringMap()
* self.nonterminals = StringMap() # <<<<<<<<<<<<<<
@@ -25599,7 +25637,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_8Alphabet___cinit__(struct __pyx_obj_4cdec_2s
__pyx_v_self->nonterminals = ((struct __pyx_obj_4cdec_2sa_3_sa_StringMap *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "sym.pxi":15
+ /* "cdec/sa/sym.pxi":15
* self.terminals = StringMap()
* self.nonterminals = StringMap()
* self.id2sym = {} # <<<<<<<<<<<<<<
@@ -25614,7 +25652,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_8Alphabet___cinit__(struct __pyx_obj_4cdec_2s
__pyx_v_self->id2sym = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "sym.pxi":16
+ /* "cdec/sa/sym.pxi":16
* self.nonterminals = StringMap()
* self.id2sym = {}
* self.first_nonterminal = -1 # <<<<<<<<<<<<<<
@@ -25623,7 +25661,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_8Alphabet___cinit__(struct __pyx_obj_4cdec_2s
*/
__pyx_v_self->first_nonterminal = -1;
- /* "sym.pxi":12
+ /* "cdec/sa/sym.pxi":12
* cdef dict id2sym
*
* def __cinit__(self): # <<<<<<<<<<<<<<
@@ -25643,7 +25681,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_8Alphabet___cinit__(struct __pyx_obj_4cdec_2s
return __pyx_r;
}
-/* "sym.pxi":18
+/* "cdec/sa/sym.pxi":18
* self.first_nonterminal = -1
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -25670,7 +25708,7 @@ static void __pyx_pf_4cdec_2sa_3_sa_8Alphabet_2__dealloc__(CYTHON_UNUSED struct
__Pyx_RefNannyFinishContext();
}
-/* "sym.pxi":21
+/* "cdec/sa/sym.pxi":21
* pass
*
* cdef int isvar(self, int sym): # <<<<<<<<<<<<<<
@@ -25683,7 +25721,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_isvar(CYTHON_UNUSED struct __pyx_obj
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("isvar", 0);
- /* "sym.pxi":22
+ /* "cdec/sa/sym.pxi":22
*
* cdef int isvar(self, int sym):
* return sym < 0 # <<<<<<<<<<<<<<
@@ -25693,7 +25731,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_isvar(CYTHON_UNUSED struct __pyx_obj
__pyx_r = (__pyx_v_sym < 0);
goto __pyx_L0;
- /* "sym.pxi":21
+ /* "cdec/sa/sym.pxi":21
* pass
*
* cdef int isvar(self, int sym): # <<<<<<<<<<<<<<
@@ -25707,7 +25745,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_isvar(CYTHON_UNUSED struct __pyx_obj
return __pyx_r;
}
-/* "sym.pxi":24
+/* "cdec/sa/sym.pxi":24
* return sym < 0
*
* cdef int isword(self, int sym): # <<<<<<<<<<<<<<
@@ -25720,7 +25758,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_isword(CYTHON_UNUSED struct __pyx_ob
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("isword", 0);
- /* "sym.pxi":25
+ /* "cdec/sa/sym.pxi":25
*
* cdef int isword(self, int sym):
* return sym >= 0 # <<<<<<<<<<<<<<
@@ -25730,7 +25768,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_isword(CYTHON_UNUSED struct __pyx_ob
__pyx_r = (__pyx_v_sym >= 0);
goto __pyx_L0;
- /* "sym.pxi":24
+ /* "cdec/sa/sym.pxi":24
* return sym < 0
*
* cdef int isword(self, int sym): # <<<<<<<<<<<<<<
@@ -25744,7 +25782,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_isword(CYTHON_UNUSED struct __pyx_ob
return __pyx_r;
}
-/* "sym.pxi":27
+/* "cdec/sa/sym.pxi":27
* return sym >= 0
*
* cdef int getindex(self, int sym): # <<<<<<<<<<<<<<
@@ -25757,7 +25795,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_getindex(CYTHON_UNUSED struct __pyx_
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getindex", 0);
- /* "sym.pxi":28
+ /* "cdec/sa/sym.pxi":28
*
* cdef int getindex(self, int sym):
* return -sym & INDEX_MASK # <<<<<<<<<<<<<<
@@ -25767,7 +25805,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_getindex(CYTHON_UNUSED struct __pyx_
__pyx_r = ((-__pyx_v_sym) & __pyx_v_4cdec_2sa_3_sa_INDEX_MASK);
goto __pyx_L0;
- /* "sym.pxi":27
+ /* "cdec/sa/sym.pxi":27
* return sym >= 0
*
* cdef int getindex(self, int sym): # <<<<<<<<<<<<<<
@@ -25781,7 +25819,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_getindex(CYTHON_UNUSED struct __pyx_
return __pyx_r;
}
-/* "sym.pxi":30
+/* "cdec/sa/sym.pxi":30
* return -sym & INDEX_MASK
*
* cdef int setindex(self, int sym, int ind): # <<<<<<<<<<<<<<
@@ -25794,7 +25832,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_setindex(CYTHON_UNUSED struct __pyx_
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setindex", 0);
- /* "sym.pxi":31
+ /* "cdec/sa/sym.pxi":31
*
* cdef int setindex(self, int sym, int ind):
* return -(-sym & ~INDEX_MASK | ind) # <<<<<<<<<<<<<<
@@ -25804,7 +25842,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_setindex(CYTHON_UNUSED struct __pyx_
__pyx_r = (-(((-__pyx_v_sym) & (~__pyx_v_4cdec_2sa_3_sa_INDEX_MASK)) | __pyx_v_ind));
goto __pyx_L0;
- /* "sym.pxi":30
+ /* "cdec/sa/sym.pxi":30
* return -sym & INDEX_MASK
*
* cdef int setindex(self, int sym, int ind): # <<<<<<<<<<<<<<
@@ -25818,7 +25856,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_setindex(CYTHON_UNUSED struct __pyx_
return __pyx_r;
}
-/* "sym.pxi":33
+/* "cdec/sa/sym.pxi":33
* return -(-sym & ~INDEX_MASK | ind)
*
* cdef int clearindex(self, int sym): # <<<<<<<<<<<<<<
@@ -25831,7 +25869,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_clearindex(CYTHON_UNUSED struct __py
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("clearindex", 0);
- /* "sym.pxi":34
+ /* "cdec/sa/sym.pxi":34
*
* cdef int clearindex(self, int sym):
* return -(-sym& ~INDEX_MASK) # <<<<<<<<<<<<<<
@@ -25841,7 +25879,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_clearindex(CYTHON_UNUSED struct __py
__pyx_r = (-((-__pyx_v_sym) & (~__pyx_v_4cdec_2sa_3_sa_INDEX_MASK)));
goto __pyx_L0;
- /* "sym.pxi":33
+ /* "cdec/sa/sym.pxi":33
* return -(-sym & ~INDEX_MASK | ind)
*
* cdef int clearindex(self, int sym): # <<<<<<<<<<<<<<
@@ -25855,7 +25893,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_clearindex(CYTHON_UNUSED struct __py
return __pyx_r;
}
-/* "sym.pxi":36
+/* "cdec/sa/sym.pxi":36
* return -(-sym& ~INDEX_MASK)
*
* cdef int match(self, int sym1, int sym2): # <<<<<<<<<<<<<<
@@ -25868,7 +25906,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_match(struct __pyx_obj_4cdec_2sa_3_s
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("match", 0);
- /* "sym.pxi":37
+ /* "cdec/sa/sym.pxi":37
*
* cdef int match(self, int sym1, int sym2):
* return self.clearindex(sym1) == self.clearindex(sym2); # <<<<<<<<<<<<<<
@@ -25878,7 +25916,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_match(struct __pyx_obj_4cdec_2sa_3_s
__pyx_r = (((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Alphabet *)__pyx_v_self->__pyx_vtab)->clearindex(__pyx_v_self, __pyx_v_sym1) == ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Alphabet *)__pyx_v_self->__pyx_vtab)->clearindex(__pyx_v_self, __pyx_v_sym2));
goto __pyx_L0;
- /* "sym.pxi":36
+ /* "cdec/sa/sym.pxi":36
* return -(-sym& ~INDEX_MASK)
*
* cdef int match(self, int sym1, int sym2): # <<<<<<<<<<<<<<
@@ -25892,7 +25930,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_match(struct __pyx_obj_4cdec_2sa_3_s
return __pyx_r;
}
-/* "sym.pxi":39
+/* "cdec/sa/sym.pxi":39
* return self.clearindex(sym1) == self.clearindex(sym2);
*
* cdef char* tocat(self, int sym): # <<<<<<<<<<<<<<
@@ -25905,7 +25943,7 @@ static char *__pyx_f_4cdec_2sa_3_sa_8Alphabet_tocat(struct __pyx_obj_4cdec_2sa_3
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("tocat", 0);
- /* "sym.pxi":40
+ /* "cdec/sa/sym.pxi":40
*
* cdef char* tocat(self, int sym):
* return self.nonterminals.word((-sym >> INDEX_SHIFT)-1) # <<<<<<<<<<<<<<
@@ -25915,7 +25953,7 @@ static char *__pyx_f_4cdec_2sa_3_sa_8Alphabet_tocat(struct __pyx_obj_4cdec_2sa_3
__pyx_r = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_StringMap *)__pyx_v_self->nonterminals->__pyx_vtab)->word(__pyx_v_self->nonterminals, (((-__pyx_v_sym) >> __pyx_v_4cdec_2sa_3_sa_INDEX_SHIFT) - 1));
goto __pyx_L0;
- /* "sym.pxi":39
+ /* "cdec/sa/sym.pxi":39
* return self.clearindex(sym1) == self.clearindex(sym2);
*
* cdef char* tocat(self, int sym): # <<<<<<<<<<<<<<
@@ -25929,7 +25967,7 @@ static char *__pyx_f_4cdec_2sa_3_sa_8Alphabet_tocat(struct __pyx_obj_4cdec_2sa_3
return __pyx_r;
}
-/* "sym.pxi":42
+/* "cdec/sa/sym.pxi":42
* return self.nonterminals.word((-sym >> INDEX_SHIFT)-1)
*
* cdef int fromcat(self, char *s): # <<<<<<<<<<<<<<
@@ -25944,7 +25982,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_fromcat(struct __pyx_obj_4cdec_2sa_3
int __pyx_t_1;
__Pyx_RefNannySetupContext("fromcat", 0);
- /* "sym.pxi":44
+ /* "cdec/sa/sym.pxi":44
* cdef int fromcat(self, char *s):
* cdef int i
* i = self.nonterminals.index(s) # <<<<<<<<<<<<<<
@@ -25953,7 +25991,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_fromcat(struct __pyx_obj_4cdec_2sa_3
*/
__pyx_v_i = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_StringMap *)__pyx_v_self->nonterminals->__pyx_vtab)->index(__pyx_v_self->nonterminals, __pyx_v_s);
- /* "sym.pxi":45
+ /* "cdec/sa/sym.pxi":45
* cdef int i
* i = self.nonterminals.index(s)
* if self.first_nonterminal == -1: # <<<<<<<<<<<<<<
@@ -25963,7 +26001,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_fromcat(struct __pyx_obj_4cdec_2sa_3
__pyx_t_1 = ((__pyx_v_self->first_nonterminal == -1) != 0);
if (__pyx_t_1) {
- /* "sym.pxi":46
+ /* "cdec/sa/sym.pxi":46
* i = self.nonterminals.index(s)
* if self.first_nonterminal == -1:
* self.first_nonterminal = i # <<<<<<<<<<<<<<
@@ -25975,7 +26013,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_fromcat(struct __pyx_obj_4cdec_2sa_3
}
__pyx_L3:;
- /* "sym.pxi":47
+ /* "cdec/sa/sym.pxi":47
* if self.first_nonterminal == -1:
* self.first_nonterminal = i
* if i > self.last_nonterminal: # <<<<<<<<<<<<<<
@@ -25985,7 +26023,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_fromcat(struct __pyx_obj_4cdec_2sa_3
__pyx_t_1 = ((__pyx_v_i > __pyx_v_self->last_nonterminal) != 0);
if (__pyx_t_1) {
- /* "sym.pxi":48
+ /* "cdec/sa/sym.pxi":48
* self.first_nonterminal = i
* if i > self.last_nonterminal:
* self.last_nonterminal = i # <<<<<<<<<<<<<<
@@ -25997,7 +26035,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_fromcat(struct __pyx_obj_4cdec_2sa_3
}
__pyx_L4:;
- /* "sym.pxi":49
+ /* "cdec/sa/sym.pxi":49
* if i > self.last_nonterminal:
* self.last_nonterminal = i
* return -(i+1 << INDEX_SHIFT) # <<<<<<<<<<<<<<
@@ -26007,7 +26045,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_fromcat(struct __pyx_obj_4cdec_2sa_3
__pyx_r = (-((__pyx_v_i + 1) << __pyx_v_4cdec_2sa_3_sa_INDEX_SHIFT));
goto __pyx_L0;
- /* "sym.pxi":42
+ /* "cdec/sa/sym.pxi":42
* return self.nonterminals.word((-sym >> INDEX_SHIFT)-1)
*
* cdef int fromcat(self, char *s): # <<<<<<<<<<<<<<
@@ -26021,7 +26059,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_fromcat(struct __pyx_obj_4cdec_2sa_3
return __pyx_r;
}
-/* "sym.pxi":51
+/* "cdec/sa/sym.pxi":51
* return -(i+1 << INDEX_SHIFT)
*
* cdef char* tostring(self, int sym): # <<<<<<<<<<<<<<
@@ -26044,7 +26082,7 @@ static char *__pyx_f_4cdec_2sa_3_sa_8Alphabet_tostring(struct __pyx_obj_4cdec_2s
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("tostring", 0);
- /* "sym.pxi":53
+ /* "cdec/sa/sym.pxi":53
* cdef char* tostring(self, int sym):
* cdef int ind
* if self.isvar(sym): # <<<<<<<<<<<<<<
@@ -26054,7 +26092,7 @@ static char *__pyx_f_4cdec_2sa_3_sa_8Alphabet_tostring(struct __pyx_obj_4cdec_2s
__pyx_t_1 = (((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Alphabet *)__pyx_v_self->__pyx_vtab)->isvar(__pyx_v_self, __pyx_v_sym) != 0);
if (__pyx_t_1) {
- /* "sym.pxi":54
+ /* "cdec/sa/sym.pxi":54
* cdef int ind
* if self.isvar(sym):
* if sym in self.id2sym: # <<<<<<<<<<<<<<
@@ -26072,7 +26110,7 @@ static char *__pyx_f_4cdec_2sa_3_sa_8Alphabet_tostring(struct __pyx_obj_4cdec_2s
__pyx_t_3 = (__pyx_t_1 != 0);
if (__pyx_t_3) {
- /* "sym.pxi":55
+ /* "cdec/sa/sym.pxi":55
* if self.isvar(sym):
* if sym in self.id2sym:
* return self.id2sym[sym] # <<<<<<<<<<<<<<
@@ -26094,7 +26132,7 @@ static char *__pyx_f_4cdec_2sa_3_sa_8Alphabet_tostring(struct __pyx_obj_4cdec_2s
goto __pyx_L0;
}
- /* "sym.pxi":56
+ /* "cdec/sa/sym.pxi":56
* if sym in self.id2sym:
* return self.id2sym[sym]
* ind = self.getindex(sym) # <<<<<<<<<<<<<<
@@ -26103,7 +26141,7 @@ static char *__pyx_f_4cdec_2sa_3_sa_8Alphabet_tostring(struct __pyx_obj_4cdec_2s
*/
__pyx_v_ind = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Alphabet *)__pyx_v_self->__pyx_vtab)->getindex(__pyx_v_self, __pyx_v_sym);
- /* "sym.pxi":57
+ /* "cdec/sa/sym.pxi":57
* return self.id2sym[sym]
* ind = self.getindex(sym)
* if ind > 0: # <<<<<<<<<<<<<<
@@ -26113,7 +26151,7 @@ static char *__pyx_f_4cdec_2sa_3_sa_8Alphabet_tostring(struct __pyx_obj_4cdec_2s
__pyx_t_3 = ((__pyx_v_ind > 0) != 0);
if (__pyx_t_3) {
- /* "sym.pxi":58
+ /* "cdec/sa/sym.pxi":58
* ind = self.getindex(sym)
* if ind > 0:
* self.id2sym[sym] = "[%s,%d]" % (self.tocat(sym), ind) # <<<<<<<<<<<<<<
@@ -26148,7 +26186,7 @@ static char *__pyx_f_4cdec_2sa_3_sa_8Alphabet_tostring(struct __pyx_obj_4cdec_2s
}
/*else*/ {
- /* "sym.pxi":60
+ /* "cdec/sa/sym.pxi":60
* self.id2sym[sym] = "[%s,%d]" % (self.tocat(sym), ind)
* else:
* self.id2sym[sym] = "[%s]" % self.tocat(sym) # <<<<<<<<<<<<<<
@@ -26172,7 +26210,7 @@ static char *__pyx_f_4cdec_2sa_3_sa_8Alphabet_tostring(struct __pyx_obj_4cdec_2s
}
__pyx_L5:;
- /* "sym.pxi":61
+ /* "cdec/sa/sym.pxi":61
* else:
* self.id2sym[sym] = "[%s]" % self.tocat(sym)
* return self.id2sym[sym] # <<<<<<<<<<<<<<
@@ -26195,7 +26233,7 @@ static char *__pyx_f_4cdec_2sa_3_sa_8Alphabet_tostring(struct __pyx_obj_4cdec_2s
}
/*else*/ {
- /* "sym.pxi":63
+ /* "cdec/sa/sym.pxi":63
* return self.id2sym[sym]
* else:
* return self.terminals.word(sym) # <<<<<<<<<<<<<<
@@ -26206,7 +26244,7 @@ static char *__pyx_f_4cdec_2sa_3_sa_8Alphabet_tostring(struct __pyx_obj_4cdec_2s
goto __pyx_L0;
}
- /* "sym.pxi":51
+ /* "cdec/sa/sym.pxi":51
* return -(i+1 << INDEX_SHIFT)
*
* cdef char* tostring(self, int sym): # <<<<<<<<<<<<<<
@@ -26226,7 +26264,7 @@ static char *__pyx_f_4cdec_2sa_3_sa_8Alphabet_tostring(struct __pyx_obj_4cdec_2s
return __pyx_r;
}
-/* "sym.pxi":65
+/* "cdec/sa/sym.pxi":65
* return self.terminals.word(sym)
*
* cdef int fromstring(self, char *s, bint terminal): # <<<<<<<<<<<<<<
@@ -26251,7 +26289,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_fromstring(struct __pyx_obj_4cdec_2s
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("fromstring", 0);
- /* "sym.pxi":69
+ /* "cdec/sa/sym.pxi":69
* cdef char *comma
* cdef int n
* n = strlen(s) # <<<<<<<<<<<<<<
@@ -26260,7 +26298,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_fromstring(struct __pyx_obj_4cdec_2s
*/
__pyx_v_n = strlen(__pyx_v_s);
- /* "sym.pxi":71
+ /* "cdec/sa/sym.pxi":71
* n = strlen(s)
* cdef char *sep
* sep = strstr(s,"_SEP_") # <<<<<<<<<<<<<<
@@ -26269,7 +26307,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_fromstring(struct __pyx_obj_4cdec_2s
*/
__pyx_v_sep = strstr(__pyx_v_s, __pyx_k_SEP);
- /* "sym.pxi":72
+ /* "cdec/sa/sym.pxi":72
* cdef char *sep
* sep = strstr(s,"_SEP_")
* if n >= 3 and s[0] == c'[' and s[n-1] == c']' and sep == NULL: # <<<<<<<<<<<<<<
@@ -26305,7 +26343,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_fromstring(struct __pyx_obj_4cdec_2s
__pyx_L4_bool_binop_done:;
if (__pyx_t_1) {
- /* "sym.pxi":73
+ /* "cdec/sa/sym.pxi":73
* sep = strstr(s,"_SEP_")
* if n >= 3 and s[0] == c'[' and s[n-1] == c']' and sep == NULL:
* if terminal: # <<<<<<<<<<<<<<
@@ -26315,7 +26353,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_fromstring(struct __pyx_obj_4cdec_2s
__pyx_t_1 = (__pyx_v_terminal != 0);
if (__pyx_t_1) {
- /* "sym.pxi":74
+ /* "cdec/sa/sym.pxi":74
* if n >= 3 and s[0] == c'[' and s[n-1] == c']' and sep == NULL:
* if terminal:
* s1 = "\\"+s # <<<<<<<<<<<<<<
@@ -26330,7 +26368,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_fromstring(struct __pyx_obj_4cdec_2s
__pyx_v_s1 = __pyx_t_4;
__pyx_t_4 = 0;
- /* "sym.pxi":75
+ /* "cdec/sa/sym.pxi":75
* if terminal:
* s1 = "\\"+s
* return self.terminals.index(s1) # <<<<<<<<<<<<<<
@@ -26342,7 +26380,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_fromstring(struct __pyx_obj_4cdec_2s
goto __pyx_L0;
}
- /* "sym.pxi":76
+ /* "cdec/sa/sym.pxi":76
* s1 = "\\"+s
* return self.terminals.index(s1)
* s[n-1] = c'\0' # <<<<<<<<<<<<<<
@@ -26351,7 +26389,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_fromstring(struct __pyx_obj_4cdec_2s
*/
(__pyx_v_s[(__pyx_v_n - 1)]) = '\x00';
- /* "sym.pxi":77
+ /* "cdec/sa/sym.pxi":77
* return self.terminals.index(s1)
* s[n-1] = c'\0'
* s = s + 1 # <<<<<<<<<<<<<<
@@ -26360,7 +26398,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_fromstring(struct __pyx_obj_4cdec_2s
*/
__pyx_v_s = (__pyx_v_s + 1);
- /* "sym.pxi":78
+ /* "cdec/sa/sym.pxi":78
* s[n-1] = c'\0'
* s = s + 1
* comma = strrchr(s, c',') # <<<<<<<<<<<<<<
@@ -26369,7 +26407,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_fromstring(struct __pyx_obj_4cdec_2s
*/
__pyx_v_comma = strrchr(__pyx_v_s, ',');
- /* "sym.pxi":79
+ /* "cdec/sa/sym.pxi":79
* s = s + 1
* comma = strrchr(s, c',')
* if comma != NULL: # <<<<<<<<<<<<<<
@@ -26379,7 +26417,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_fromstring(struct __pyx_obj_4cdec_2s
__pyx_t_1 = ((__pyx_v_comma != NULL) != 0);
if (__pyx_t_1) {
- /* "sym.pxi":80
+ /* "cdec/sa/sym.pxi":80
* comma = strrchr(s, c',')
* if comma != NULL:
* comma[0] = c'\0' # <<<<<<<<<<<<<<
@@ -26388,7 +26426,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_fromstring(struct __pyx_obj_4cdec_2s
*/
(__pyx_v_comma[0]) = '\x00';
- /* "sym.pxi":81
+ /* "cdec/sa/sym.pxi":81
* if comma != NULL:
* comma[0] = c'\0'
* return self.setindex(self.fromcat(s), strtol(comma+1, NULL, 10)) # <<<<<<<<<<<<<<
@@ -26400,7 +26438,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_fromstring(struct __pyx_obj_4cdec_2s
}
/*else*/ {
- /* "sym.pxi":83
+ /* "cdec/sa/sym.pxi":83
* return self.setindex(self.fromcat(s), strtol(comma+1, NULL, 10))
* else:
* return self.fromcat(s) # <<<<<<<<<<<<<<
@@ -26413,7 +26451,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_fromstring(struct __pyx_obj_4cdec_2s
}
/*else*/ {
- /* "sym.pxi":85
+ /* "cdec/sa/sym.pxi":85
* return self.fromcat(s)
* else:
* return self.terminals.index(s) # <<<<<<<<<<<<<<
@@ -26424,7 +26462,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_fromstring(struct __pyx_obj_4cdec_2s
goto __pyx_L0;
}
- /* "sym.pxi":65
+ /* "cdec/sa/sym.pxi":65
* return self.terminals.word(sym)
*
* cdef int fromstring(self, char *s, bint terminal): # <<<<<<<<<<<<<<
@@ -26444,7 +26482,7 @@ static int __pyx_f_4cdec_2sa_3_sa_8Alphabet_fromstring(struct __pyx_obj_4cdec_2s
return __pyx_r;
}
-/* "sym.pxi":8
+/* "cdec/sa/sym.pxi":8
*
* cdef class Alphabet:
* cdef readonly StringMap terminals, nonterminals # <<<<<<<<<<<<<<
@@ -26510,7 +26548,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_8Alphabet_12nonterminals___get__(struct
return __pyx_r;
}
-/* "sym.pxi":89
+/* "cdec/sa/sym.pxi":89
* cdef Alphabet ALPHABET = Alphabet()
*
* cdef char* sym_tostring(int sym): # <<<<<<<<<<<<<<
@@ -26523,7 +26561,7 @@ static char *__pyx_f_4cdec_2sa_3_sa_sym_tostring(int __pyx_v_sym) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("sym_tostring", 0);
- /* "sym.pxi":90
+ /* "cdec/sa/sym.pxi":90
*
* cdef char* sym_tostring(int sym):
* return ALPHABET.tostring(sym) # <<<<<<<<<<<<<<
@@ -26533,7 +26571,7 @@ static char *__pyx_f_4cdec_2sa_3_sa_sym_tostring(int __pyx_v_sym) {
__pyx_r = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Alphabet *)__pyx_v_4cdec_2sa_3_sa_ALPHABET->__pyx_vtab)->tostring(__pyx_v_4cdec_2sa_3_sa_ALPHABET, __pyx_v_sym);
goto __pyx_L0;
- /* "sym.pxi":89
+ /* "cdec/sa/sym.pxi":89
* cdef Alphabet ALPHABET = Alphabet()
*
* cdef char* sym_tostring(int sym): # <<<<<<<<<<<<<<
@@ -26547,7 +26585,7 @@ static char *__pyx_f_4cdec_2sa_3_sa_sym_tostring(int __pyx_v_sym) {
return __pyx_r;
}
-/* "sym.pxi":92
+/* "cdec/sa/sym.pxi":92
* return ALPHABET.tostring(sym)
*
* cdef char* sym_tocat(int sym): # <<<<<<<<<<<<<<
@@ -26560,7 +26598,7 @@ static char *__pyx_f_4cdec_2sa_3_sa_sym_tocat(int __pyx_v_sym) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("sym_tocat", 0);
- /* "sym.pxi":93
+ /* "cdec/sa/sym.pxi":93
*
* cdef char* sym_tocat(int sym):
* return ALPHABET.tocat(sym) # <<<<<<<<<<<<<<
@@ -26570,7 +26608,7 @@ static char *__pyx_f_4cdec_2sa_3_sa_sym_tocat(int __pyx_v_sym) {
__pyx_r = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Alphabet *)__pyx_v_4cdec_2sa_3_sa_ALPHABET->__pyx_vtab)->tocat(__pyx_v_4cdec_2sa_3_sa_ALPHABET, __pyx_v_sym);
goto __pyx_L0;
- /* "sym.pxi":92
+ /* "cdec/sa/sym.pxi":92
* return ALPHABET.tostring(sym)
*
* cdef char* sym_tocat(int sym): # <<<<<<<<<<<<<<
@@ -26584,7 +26622,7 @@ static char *__pyx_f_4cdec_2sa_3_sa_sym_tocat(int __pyx_v_sym) {
return __pyx_r;
}
-/* "sym.pxi":95
+/* "cdec/sa/sym.pxi":95
* return ALPHABET.tocat(sym)
*
* cdef int sym_isvar(int sym): # <<<<<<<<<<<<<<
@@ -26597,7 +26635,7 @@ static int __pyx_f_4cdec_2sa_3_sa_sym_isvar(int __pyx_v_sym) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("sym_isvar", 0);
- /* "sym.pxi":96
+ /* "cdec/sa/sym.pxi":96
*
* cdef int sym_isvar(int sym):
* return ALPHABET.isvar(sym) # <<<<<<<<<<<<<<
@@ -26607,7 +26645,7 @@ static int __pyx_f_4cdec_2sa_3_sa_sym_isvar(int __pyx_v_sym) {
__pyx_r = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Alphabet *)__pyx_v_4cdec_2sa_3_sa_ALPHABET->__pyx_vtab)->isvar(__pyx_v_4cdec_2sa_3_sa_ALPHABET, __pyx_v_sym);
goto __pyx_L0;
- /* "sym.pxi":95
+ /* "cdec/sa/sym.pxi":95
* return ALPHABET.tocat(sym)
*
* cdef int sym_isvar(int sym): # <<<<<<<<<<<<<<
@@ -26621,7 +26659,7 @@ static int __pyx_f_4cdec_2sa_3_sa_sym_isvar(int __pyx_v_sym) {
return __pyx_r;
}
-/* "sym.pxi":98
+/* "cdec/sa/sym.pxi":98
* return ALPHABET.isvar(sym)
*
* cdef int sym_getindex(int sym): # <<<<<<<<<<<<<<
@@ -26634,7 +26672,7 @@ static int __pyx_f_4cdec_2sa_3_sa_sym_getindex(int __pyx_v_sym) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("sym_getindex", 0);
- /* "sym.pxi":99
+ /* "cdec/sa/sym.pxi":99
*
* cdef int sym_getindex(int sym):
* return ALPHABET.getindex(sym) # <<<<<<<<<<<<<<
@@ -26644,7 +26682,7 @@ static int __pyx_f_4cdec_2sa_3_sa_sym_getindex(int __pyx_v_sym) {
__pyx_r = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Alphabet *)__pyx_v_4cdec_2sa_3_sa_ALPHABET->__pyx_vtab)->getindex(__pyx_v_4cdec_2sa_3_sa_ALPHABET, __pyx_v_sym);
goto __pyx_L0;
- /* "sym.pxi":98
+ /* "cdec/sa/sym.pxi":98
* return ALPHABET.isvar(sym)
*
* cdef int sym_getindex(int sym): # <<<<<<<<<<<<<<
@@ -26658,7 +26696,7 @@ static int __pyx_f_4cdec_2sa_3_sa_sym_getindex(int __pyx_v_sym) {
return __pyx_r;
}
-/* "sym.pxi":101
+/* "cdec/sa/sym.pxi":101
* return ALPHABET.getindex(sym)
*
* cdef int sym_setindex(int sym, int id): # <<<<<<<<<<<<<<
@@ -26671,7 +26709,7 @@ static int __pyx_f_4cdec_2sa_3_sa_sym_setindex(int __pyx_v_sym, int __pyx_v_id)
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("sym_setindex", 0);
- /* "sym.pxi":102
+ /* "cdec/sa/sym.pxi":102
*
* cdef int sym_setindex(int sym, int id):
* return ALPHABET.setindex(sym, id) # <<<<<<<<<<<<<<
@@ -26681,7 +26719,7 @@ static int __pyx_f_4cdec_2sa_3_sa_sym_setindex(int __pyx_v_sym, int __pyx_v_id)
__pyx_r = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Alphabet *)__pyx_v_4cdec_2sa_3_sa_ALPHABET->__pyx_vtab)->setindex(__pyx_v_4cdec_2sa_3_sa_ALPHABET, __pyx_v_sym, __pyx_v_id);
goto __pyx_L0;
- /* "sym.pxi":101
+ /* "cdec/sa/sym.pxi":101
* return ALPHABET.getindex(sym)
*
* cdef int sym_setindex(int sym, int id): # <<<<<<<<<<<<<<
@@ -26695,7 +26733,7 @@ static int __pyx_f_4cdec_2sa_3_sa_sym_setindex(int __pyx_v_sym, int __pyx_v_id)
return __pyx_r;
}
-/* "sym.pxi":104
+/* "cdec/sa/sym.pxi":104
* return ALPHABET.setindex(sym, id)
*
* cdef int sym_fromstring(char* string, bint terminal): # <<<<<<<<<<<<<<
@@ -26708,7 +26746,7 @@ static int __pyx_f_4cdec_2sa_3_sa_sym_fromstring(char *__pyx_v_string, int __pyx
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("sym_fromstring", 0);
- /* "sym.pxi":105
+ /* "cdec/sa/sym.pxi":105
*
* cdef int sym_fromstring(char* string, bint terminal):
* return ALPHABET.fromstring(string, terminal) # <<<<<<<<<<<<<<
@@ -26718,7 +26756,7 @@ static int __pyx_f_4cdec_2sa_3_sa_sym_fromstring(char *__pyx_v_string, int __pyx
__pyx_r = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Alphabet *)__pyx_v_4cdec_2sa_3_sa_ALPHABET->__pyx_vtab)->fromstring(__pyx_v_4cdec_2sa_3_sa_ALPHABET, __pyx_v_string, __pyx_v_terminal);
goto __pyx_L0;
- /* "sym.pxi":104
+ /* "cdec/sa/sym.pxi":104
* return ALPHABET.setindex(sym, id)
*
* cdef int sym_fromstring(char* string, bint terminal): # <<<<<<<<<<<<<<
@@ -26732,7 +26770,7 @@ static int __pyx_f_4cdec_2sa_3_sa_sym_fromstring(char *__pyx_v_string, int __pyx
return __pyx_r;
}
-/* "sym.pxi":107
+/* "cdec/sa/sym.pxi":107
* return ALPHABET.fromstring(string, terminal)
*
* def isvar(sym): # <<<<<<<<<<<<<<
@@ -26764,7 +26802,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_4isvar(CYTHON_UNUSED PyObject *__pyx_se
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("isvar", 0);
- /* "sym.pxi":108
+ /* "cdec/sa/sym.pxi":108
*
* def isvar(sym):
* return sym_isvar(sym) # <<<<<<<<<<<<<<
@@ -26779,7 +26817,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_4isvar(CYTHON_UNUSED PyObject *__pyx_se
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "sym.pxi":107
+ /* "cdec/sa/sym.pxi":107
* return ALPHABET.fromstring(string, terminal)
*
* def isvar(sym): # <<<<<<<<<<<<<<
@@ -26798,7 +26836,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_4isvar(CYTHON_UNUSED PyObject *__pyx_se
return __pyx_r;
}
-/* "sym.pxi":110
+/* "cdec/sa/sym.pxi":110
* return sym_isvar(sym)
*
* def make_lattice(words): # <<<<<<<<<<<<<<
@@ -26819,9 +26857,9 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7make_lattice(PyObject *__pyx_self, PyO
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_2sa_3_sa_12make_lattice_2generator7(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4cdec_2sa_3_sa_12make_lattice_2generator8(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-/* "sym.pxi":111
+/* "cdec/sa/sym.pxi":111
*
* def make_lattice(words):
* word_ids = (sym_fromstring(word, True) for word in words) # <<<<<<<<<<<<<<
@@ -26847,7 +26885,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_12make_lattice_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_4cdec_2sa_3_sa_12make_lattice_2generator7, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_make_lattice_locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_12make_lattice_2generator8, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_make_lattice_locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_cur_scope);
__Pyx_RefNannyFinishContext();
return (PyObject *) gen;
@@ -26863,7 +26901,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_12make_lattice_genexpr(PyObject *__pyx_
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_2sa_3_sa_12make_lattice_2generator7(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4cdec_2sa_3_sa_12make_lattice_2generator8(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_5_genexpr *)__pyx_generator->closure);
PyObject *__pyx_r = NULL;
@@ -26966,9 +27004,9 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_12make_lattice_2generator7(__pyx_Genera
__Pyx_RefNannyFinishContext();
return NULL;
}
-static PyObject *__pyx_gb_4cdec_2sa_3_sa_12make_lattice_5generator8(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4cdec_2sa_3_sa_12make_lattice_5generator9(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-/* "sym.pxi":112
+/* "cdec/sa/sym.pxi":112
* def make_lattice(words):
* word_ids = (sym_fromstring(word, True) for word in words)
* return tuple(((word, None, 1), ) for word in word_ids) # <<<<<<<<<<<<<<
@@ -26994,7 +27032,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_12make_lattice_3genexpr(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_4cdec_2sa_3_sa_12make_lattice_5generator8, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_make_lattice_locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_12make_lattice_5generator9, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_make_lattice_locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_cur_scope);
__Pyx_RefNannyFinishContext();
return (PyObject *) gen;
@@ -27010,7 +27048,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_12make_lattice_3genexpr(PyObject *__pyx
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_2sa_3_sa_12make_lattice_5generator8(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4cdec_2sa_3_sa_12make_lattice_5generator9(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr *)__pyx_generator->closure);
PyObject *__pyx_r = NULL;
@@ -27128,7 +27166,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_12make_lattice_5generator8(__pyx_Genera
return NULL;
}
-/* "sym.pxi":110
+/* "cdec/sa/sym.pxi":110
* return sym_isvar(sym)
*
* def make_lattice(words): # <<<<<<<<<<<<<<
@@ -27156,7 +27194,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6make_lattice(CYTHON_UNUSED PyObject *_
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_words);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_words);
- /* "sym.pxi":111
+ /* "cdec/sa/sym.pxi":111
*
* def make_lattice(words):
* word_ids = (sym_fromstring(word, True) for word in words) # <<<<<<<<<<<<<<
@@ -27169,7 +27207,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6make_lattice(CYTHON_UNUSED PyObject *_
__pyx_cur_scope->__pyx_v_word_ids = __pyx_t_1;
__pyx_t_1 = 0;
- /* "sym.pxi":112
+ /* "cdec/sa/sym.pxi":112
* def make_lattice(words):
* word_ids = (sym_fromstring(word, True) for word in words)
* return tuple(((word, None, 1), ) for word in word_ids) # <<<<<<<<<<<<<<
@@ -27191,7 +27229,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6make_lattice(CYTHON_UNUSED PyObject *_
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "sym.pxi":110
+ /* "cdec/sa/sym.pxi":110
* return sym_isvar(sym)
*
* def make_lattice(words): # <<<<<<<<<<<<<<
@@ -27212,7 +27250,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6make_lattice(CYTHON_UNUSED PyObject *_
return __pyx_r;
}
-/* "sym.pxi":114
+/* "cdec/sa/sym.pxi":114
* return tuple(((word, None, 1), ) for word in word_ids)
*
* def decode_lattice(lattice): # <<<<<<<<<<<<<<
@@ -27233,9 +27271,9 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9decode_lattice(PyObject *__pyx_self, P
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_2sa_3_sa_14decode_lattice_2generator9(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4cdec_2sa_3_sa_14decode_lattice_2generator10(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-/* "sym.pxi":115
+/* "cdec/sa/sym.pxi":115
*
* def decode_lattice(lattice):
* return tuple((sym_tostring(sym), weight, dist) for (sym, weight, dist) in arc # <<<<<<<<<<<<<<
@@ -27261,7 +27299,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14decode_lattice_genexpr(PyObject *__py
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
{
- __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_14decode_lattice_2generator9, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_decode_lattice_locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_14decode_lattice_2generator10, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_decode_lattice_locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_cur_scope);
__Pyx_RefNannyFinishContext();
return (PyObject *) gen;
@@ -27277,7 +27315,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14decode_lattice_genexpr(PyObject *__py
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_2sa_3_sa_14decode_lattice_2generator9(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4cdec_2sa_3_sa_14decode_lattice_2generator10(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_8_genexpr *)__pyx_generator->closure);
PyObject *__pyx_r = NULL;
@@ -27310,7 +27348,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_14decode_lattice_2generator9(__pyx_Gene
__pyx_L3_first_run:;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "sym.pxi":116
+ /* "cdec/sa/sym.pxi":116
* def decode_lattice(lattice):
* return tuple((sym_tostring(sym), weight, dist) for (sym, weight, dist) in arc
* for arc in node for node in lattice) # <<<<<<<<<<<<<<
@@ -27319,7 +27357,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_14decode_lattice_2generator9(__pyx_Gene
*/
if (unlikely(!__pyx_cur_scope->__pyx_v_arc)) { __Pyx_RaiseUnboundLocalError("arc"); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- /* "sym.pxi":115
+ /* "cdec/sa/sym.pxi":115
*
* def decode_lattice(lattice):
* return tuple((sym_tostring(sym), weight, dist) for (sym, weight, dist) in arc # <<<<<<<<<<<<<<
@@ -27433,7 +27471,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_14decode_lattice_2generator9(__pyx_Gene
__Pyx_GIVEREF(__pyx_t_7);
__pyx_t_7 = 0;
- /* "sym.pxi":116
+ /* "cdec/sa/sym.pxi":116
* def decode_lattice(lattice):
* return tuple((sym_tostring(sym), weight, dist) for (sym, weight, dist) in arc
* for arc in node for node in lattice) # <<<<<<<<<<<<<<
@@ -27525,7 +27563,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_14decode_lattice_2generator9(__pyx_Gene
__Pyx_GIVEREF(__pyx_t_6);
__pyx_t_6 = 0;
- /* "sym.pxi":115
+ /* "cdec/sa/sym.pxi":115
*
* def decode_lattice(lattice):
* return tuple((sym_tostring(sym), weight, dist) for (sym, weight, dist) in arc # <<<<<<<<<<<<<<
@@ -27583,7 +27621,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_14decode_lattice_2generator9(__pyx_Gene
__pyx_t_13 = __pyx_cur_scope->__pyx_t_8;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "sym.pxi":116
+ /* "cdec/sa/sym.pxi":116
* def decode_lattice(lattice):
* return tuple((sym_tostring(sym), weight, dist) for (sym, weight, dist) in arc
* for arc in node for node in lattice) # <<<<<<<<<<<<<<
@@ -27595,7 +27633,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_14decode_lattice_2generator9(__pyx_Gene
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "sym.pxi":115
+ /* "cdec/sa/sym.pxi":115
*
* def decode_lattice(lattice):
* return tuple((sym_tostring(sym), weight, dist) for (sym, weight, dist) in arc # <<<<<<<<<<<<<<
@@ -27624,7 +27662,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_14decode_lattice_2generator9(__pyx_Gene
return NULL;
}
-/* "sym.pxi":114
+/* "cdec/sa/sym.pxi":114
* return tuple(((word, None, 1), ) for word in word_ids)
*
* def decode_lattice(lattice): # <<<<<<<<<<<<<<
@@ -27652,7 +27690,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_8decode_lattice(CYTHON_UNUSED PyObject
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_lattice);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_lattice);
- /* "sym.pxi":115
+ /* "cdec/sa/sym.pxi":115
*
* def decode_lattice(lattice):
* return tuple((sym_tostring(sym), weight, dist) for (sym, weight, dist) in arc # <<<<<<<<<<<<<<
@@ -27674,7 +27712,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_8decode_lattice(CYTHON_UNUSED PyObject
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "sym.pxi":114
+ /* "cdec/sa/sym.pxi":114
* return tuple(((word, None, 1), ) for word in word_ids)
*
* def decode_lattice(lattice): # <<<<<<<<<<<<<<
@@ -27695,7 +27733,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_8decode_lattice(CYTHON_UNUSED PyObject
return __pyx_r;
}
-/* "sym.pxi":118
+/* "cdec/sa/sym.pxi":118
* for arc in node for node in lattice)
*
* def decode_sentence(lattice): # <<<<<<<<<<<<<<
@@ -27716,9 +27754,9 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11decode_sentence(PyObject *__pyx_self,
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_2sa_3_sa_15decode_sentence_2generator10(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4cdec_2sa_3_sa_15decode_sentence_2generator11(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-/* "sym.pxi":119
+/* "cdec/sa/sym.pxi":119
*
* def decode_sentence(lattice):
* return tuple(sym_tostring(sym) for ((sym, _, _),) in lattice) # <<<<<<<<<<<<<<
@@ -27744,7 +27782,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_15decode_sentence_genexpr(PyObject *__p
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
{
- __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_15decode_sentence_2generator10, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_decode_sentence_locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_15decode_sentence_2generator11, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_decode_sentence_locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_cur_scope);
__Pyx_RefNannyFinishContext();
return (PyObject *) gen;
@@ -27760,7 +27798,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_15decode_sentence_genexpr(PyObject *__p
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_2sa_3_sa_15decode_sentence_2generator10(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4cdec_2sa_3_sa_15decode_sentence_2generator11(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr *)__pyx_generator->closure);
PyObject *__pyx_r = NULL;
@@ -27983,7 +28021,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_15decode_sentence_2generator10(__pyx_Ge
return NULL;
}
-/* "sym.pxi":118
+/* "cdec/sa/sym.pxi":118
* for arc in node for node in lattice)
*
* def decode_sentence(lattice): # <<<<<<<<<<<<<<
@@ -28011,7 +28049,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_10decode_sentence(CYTHON_UNUSED PyObjec
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_lattice);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_lattice);
- /* "sym.pxi":119
+ /* "cdec/sa/sym.pxi":119
*
* def decode_sentence(lattice):
* return tuple(sym_tostring(sym) for ((sym, _, _),) in lattice) # <<<<<<<<<<<<<<
@@ -28033,7 +28071,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_10decode_sentence(CYTHON_UNUSED PyObjec
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "sym.pxi":118
+ /* "cdec/sa/sym.pxi":118
* for arc in node for node in lattice)
*
* def decode_sentence(lattice): # <<<<<<<<<<<<<<
@@ -28054,7 +28092,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_10decode_sentence(CYTHON_UNUSED PyObjec
return __pyx_r;
}
-/* "sym.pxi":121
+/* "cdec/sa/sym.pxi":121
* return tuple(sym_tostring(sym) for ((sym, _, _),) in lattice)
*
* def encode_words(words): # <<<<<<<<<<<<<<
@@ -28075,9 +28113,9 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_13encode_words(PyObject *__pyx_self, Py
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_2sa_3_sa_12encode_words_2generator11(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4cdec_2sa_3_sa_12encode_words_2generator12(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-/* "sym.pxi":122
+/* "cdec/sa/sym.pxi":122
*
* def encode_words(words):
* return tuple(sym_fromstring(word, True) for word in words) # <<<<<<<<<<<<<<
@@ -28103,7 +28141,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_12encode_words_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_4cdec_2sa_3_sa_12encode_words_2generator11, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_encode_words_locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_12encode_words_2generator12, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_encode_words_locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_cur_scope);
__Pyx_RefNannyFinishContext();
return (PyObject *) gen;
@@ -28119,7 +28157,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_12encode_words_genexpr(PyObject *__pyx_
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_2sa_3_sa_12encode_words_2generator11(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4cdec_2sa_3_sa_12encode_words_2generator12(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr *)__pyx_generator->closure);
PyObject *__pyx_r = NULL;
@@ -28223,7 +28261,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_12encode_words_2generator11(__pyx_Gener
return NULL;
}
-/* "sym.pxi":121
+/* "cdec/sa/sym.pxi":121
* return tuple(sym_tostring(sym) for ((sym, _, _),) in lattice)
*
* def encode_words(words): # <<<<<<<<<<<<<<
@@ -28251,7 +28289,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_12encode_words(CYTHON_UNUSED PyObject *
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_words);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_words);
- /* "sym.pxi":122
+ /* "cdec/sa/sym.pxi":122
*
* def encode_words(words):
* return tuple(sym_fromstring(word, True) for word in words) # <<<<<<<<<<<<<<
@@ -28273,7 +28311,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_12encode_words(CYTHON_UNUSED PyObject *
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "sym.pxi":121
+ /* "cdec/sa/sym.pxi":121
* return tuple(sym_tostring(sym) for ((sym, _, _),) in lattice)
*
* def encode_words(words): # <<<<<<<<<<<<<<
@@ -28294,7 +28332,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_12encode_words(CYTHON_UNUSED PyObject *
return __pyx_r;
}
-/* "sym.pxi":124
+/* "cdec/sa/sym.pxi":124
* return tuple(sym_fromstring(word, True) for word in words)
*
* def decode_words(syms): # <<<<<<<<<<<<<<
@@ -28314,9 +28352,9 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_15decode_words(PyObject *__pyx_self, Py
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_2sa_3_sa_12decode_words_2generator12(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4cdec_2sa_3_sa_12decode_words_2generator13(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-/* "sym.pxi":125
+/* "cdec/sa/sym.pxi":125
*
* def decode_words(syms):
* return tuple(sym_tostring(sym) for sym in syms) # <<<<<<<<<<<<<<
@@ -28340,7 +28378,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_12decode_words_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_4cdec_2sa_3_sa_12decode_words_2generator12, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_decode_words_locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_12decode_words_2generator13, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_decode_words_locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_cur_scope);
__Pyx_RefNannyFinishContext();
return (PyObject *) gen;
@@ -28356,7 +28394,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_12decode_words_genexpr(PyObject *__pyx_
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_2sa_3_sa_12decode_words_2generator12(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4cdec_2sa_3_sa_12decode_words_2generator13(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_14_genexpr *)__pyx_generator->closure);
PyObject *__pyx_r = NULL;
@@ -28460,7 +28498,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_12decode_words_2generator12(__pyx_Gener
return NULL;
}
-/* "sym.pxi":124
+/* "cdec/sa/sym.pxi":124
* return tuple(sym_fromstring(word, True) for word in words)
*
* def decode_words(syms): # <<<<<<<<<<<<<<
@@ -28487,7 +28525,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14decode_words(CYTHON_UNUSED PyObject *
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_syms);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_syms);
- /* "sym.pxi":125
+ /* "cdec/sa/sym.pxi":125
*
* def decode_words(syms):
* return tuple(sym_tostring(sym) for sym in syms) # <<<<<<<<<<<<<<
@@ -28507,7 +28545,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14decode_words(CYTHON_UNUSED PyObject *
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "sym.pxi":124
+ /* "cdec/sa/sym.pxi":124
* return tuple(sym_fromstring(word, True) for word in words)
*
* def decode_words(syms): # <<<<<<<<<<<<<<
@@ -28527,7 +28565,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14decode_words(CYTHON_UNUSED PyObject *
return __pyx_r;
}
-/* "rule.pxi":6
+/* "cdec/sa/rule.pxi":6
* cdef class Phrase:
*
* def __cinit__(self, words): # <<<<<<<<<<<<<<
@@ -28604,7 +28642,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase___cinit__(struct __pyx_obj_4cdec_2sa_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "rule.pxi":8
+ /* "cdec/sa/rule.pxi":8
* def __cinit__(self, words):
* cdef int i, j, n, n_vars
* n_vars = 0 # <<<<<<<<<<<<<<
@@ -28613,7 +28651,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase___cinit__(struct __pyx_obj_4cdec_2sa_
*/
__pyx_v_n_vars = 0;
- /* "rule.pxi":9
+ /* "cdec/sa/rule.pxi":9
* cdef int i, j, n, n_vars
* n_vars = 0
* n = len(words) # <<<<<<<<<<<<<<
@@ -28623,7 +28661,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase___cinit__(struct __pyx_obj_4cdec_2sa_
__pyx_t_1 = PyObject_Length(__pyx_v_words); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_n = __pyx_t_1;
- /* "rule.pxi":10
+ /* "cdec/sa/rule.pxi":10
* n_vars = 0
* n = len(words)
* self.syms = <int *>malloc(n*sizeof(int)) # <<<<<<<<<<<<<<
@@ -28632,7 +28670,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase___cinit__(struct __pyx_obj_4cdec_2sa_
*/
__pyx_v_self->syms = ((int *)malloc((__pyx_v_n * (sizeof(int)))));
- /* "rule.pxi":11
+ /* "cdec/sa/rule.pxi":11
* n = len(words)
* self.syms = <int *>malloc(n*sizeof(int))
* for i from 0 <= i < n: # <<<<<<<<<<<<<<
@@ -28642,7 +28680,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase___cinit__(struct __pyx_obj_4cdec_2sa_
__pyx_t_2 = __pyx_v_n;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {
- /* "rule.pxi":12
+ /* "cdec/sa/rule.pxi":12
* self.syms = <int *>malloc(n*sizeof(int))
* for i from 0 <= i < n:
* self.syms[i] = words[i] # <<<<<<<<<<<<<<
@@ -28655,7 +28693,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase___cinit__(struct __pyx_obj_4cdec_2sa_
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
(__pyx_v_self->syms[__pyx_v_i]) = __pyx_t_4;
- /* "rule.pxi":13
+ /* "cdec/sa/rule.pxi":13
* for i from 0 <= i < n:
* self.syms[i] = words[i]
* if sym_isvar(self.syms[i]): # <<<<<<<<<<<<<<
@@ -28665,7 +28703,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase___cinit__(struct __pyx_obj_4cdec_2sa_
__pyx_t_5 = (__pyx_f_4cdec_2sa_3_sa_sym_isvar((__pyx_v_self->syms[__pyx_v_i])) != 0);
if (__pyx_t_5) {
- /* "rule.pxi":14
+ /* "cdec/sa/rule.pxi":14
* self.syms[i] = words[i]
* if sym_isvar(self.syms[i]):
* n_vars += 1 # <<<<<<<<<<<<<<
@@ -28678,7 +28716,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase___cinit__(struct __pyx_obj_4cdec_2sa_
__pyx_L5:;
}
- /* "rule.pxi":15
+ /* "cdec/sa/rule.pxi":15
* if sym_isvar(self.syms[i]):
* n_vars += 1
* self.n = n # <<<<<<<<<<<<<<
@@ -28687,7 +28725,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase___cinit__(struct __pyx_obj_4cdec_2sa_
*/
__pyx_v_self->n = __pyx_v_n;
- /* "rule.pxi":16
+ /* "cdec/sa/rule.pxi":16
* n_vars += 1
* self.n = n
* self.n_vars = n_vars # <<<<<<<<<<<<<<
@@ -28702,7 +28740,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase___cinit__(struct __pyx_obj_4cdec_2sa_
__pyx_v_self->n_vars = __pyx_t_3;
__pyx_t_3 = 0;
- /* "rule.pxi":17
+ /* "cdec/sa/rule.pxi":17
* self.n = n
* self.n_vars = n_vars
* self.varpos = <int *>malloc(n_vars*sizeof(int)) # <<<<<<<<<<<<<<
@@ -28711,7 +28749,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase___cinit__(struct __pyx_obj_4cdec_2sa_
*/
__pyx_v_self->varpos = ((int *)malloc((__pyx_v_n_vars * (sizeof(int)))));
- /* "rule.pxi":18
+ /* "cdec/sa/rule.pxi":18
* self.n_vars = n_vars
* self.varpos = <int *>malloc(n_vars*sizeof(int))
* j = 0 # <<<<<<<<<<<<<<
@@ -28720,7 +28758,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase___cinit__(struct __pyx_obj_4cdec_2sa_
*/
__pyx_v_j = 0;
- /* "rule.pxi":19
+ /* "cdec/sa/rule.pxi":19
* self.varpos = <int *>malloc(n_vars*sizeof(int))
* j = 0
* for i from 0 <= i < n: # <<<<<<<<<<<<<<
@@ -28730,7 +28768,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase___cinit__(struct __pyx_obj_4cdec_2sa_
__pyx_t_2 = __pyx_v_n;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {
- /* "rule.pxi":20
+ /* "cdec/sa/rule.pxi":20
* j = 0
* for i from 0 <= i < n:
* if sym_isvar(self.syms[i]): # <<<<<<<<<<<<<<
@@ -28740,7 +28778,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase___cinit__(struct __pyx_obj_4cdec_2sa_
__pyx_t_5 = (__pyx_f_4cdec_2sa_3_sa_sym_isvar((__pyx_v_self->syms[__pyx_v_i])) != 0);
if (__pyx_t_5) {
- /* "rule.pxi":21
+ /* "cdec/sa/rule.pxi":21
* for i from 0 <= i < n:
* if sym_isvar(self.syms[i]):
* self.varpos[j] = i # <<<<<<<<<<<<<<
@@ -28749,7 +28787,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase___cinit__(struct __pyx_obj_4cdec_2sa_
*/
(__pyx_v_self->varpos[__pyx_v_j]) = __pyx_v_i;
- /* "rule.pxi":22
+ /* "cdec/sa/rule.pxi":22
* if sym_isvar(self.syms[i]):
* self.varpos[j] = i
* j = j + 1 # <<<<<<<<<<<<<<
@@ -28762,7 +28800,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase___cinit__(struct __pyx_obj_4cdec_2sa_
__pyx_L8:;
}
- /* "rule.pxi":6
+ /* "cdec/sa/rule.pxi":6
* cdef class Phrase:
*
* def __cinit__(self, words): # <<<<<<<<<<<<<<
@@ -28782,7 +28820,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase___cinit__(struct __pyx_obj_4cdec_2sa_
return __pyx_r;
}
-/* "rule.pxi":24
+/* "cdec/sa/rule.pxi":24
* j = j + 1
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -28805,7 +28843,7 @@ static void __pyx_pf_4cdec_2sa_3_sa_6Phrase_2__dealloc__(struct __pyx_obj_4cdec_
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "rule.pxi":25
+ /* "cdec/sa/rule.pxi":25
*
* def __dealloc__(self):
* free(self.syms) # <<<<<<<<<<<<<<
@@ -28814,7 +28852,7 @@ static void __pyx_pf_4cdec_2sa_3_sa_6Phrase_2__dealloc__(struct __pyx_obj_4cdec_
*/
free(__pyx_v_self->syms);
- /* "rule.pxi":26
+ /* "cdec/sa/rule.pxi":26
* def __dealloc__(self):
* free(self.syms)
* free(self.varpos) # <<<<<<<<<<<<<<
@@ -28823,7 +28861,7 @@ static void __pyx_pf_4cdec_2sa_3_sa_6Phrase_2__dealloc__(struct __pyx_obj_4cdec_
*/
free(__pyx_v_self->varpos);
- /* "rule.pxi":24
+ /* "cdec/sa/rule.pxi":24
* j = j + 1
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -28835,7 +28873,7 @@ static void __pyx_pf_4cdec_2sa_3_sa_6Phrase_2__dealloc__(struct __pyx_obj_4cdec_
__Pyx_RefNannyFinishContext();
}
-/* "rule.pxi":28
+/* "cdec/sa/rule.pxi":28
* free(self.varpos)
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -28870,7 +28908,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_4__str__(struct __pyx_obj_4cdec
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__str__", 0);
- /* "rule.pxi":29
+ /* "cdec/sa/rule.pxi":29
*
* def __str__(self):
* strs = [] # <<<<<<<<<<<<<<
@@ -28882,7 +28920,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_4__str__(struct __pyx_obj_4cdec
__pyx_v_strs = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "rule.pxi":31
+ /* "cdec/sa/rule.pxi":31
* strs = []
* cdef int i, s
* for i from 0 <= i < self.n: # <<<<<<<<<<<<<<
@@ -28892,7 +28930,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_4__str__(struct __pyx_obj_4cdec
__pyx_t_2 = __pyx_v_self->n;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {
- /* "rule.pxi":32
+ /* "cdec/sa/rule.pxi":32
* cdef int i, s
* for i from 0 <= i < self.n:
* s = self.syms[i] # <<<<<<<<<<<<<<
@@ -28901,7 +28939,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_4__str__(struct __pyx_obj_4cdec
*/
__pyx_v_s = (__pyx_v_self->syms[__pyx_v_i]);
- /* "rule.pxi":33
+ /* "cdec/sa/rule.pxi":33
* for i from 0 <= i < self.n:
* s = self.syms[i]
* strs.append(sym_tostring(s)) # <<<<<<<<<<<<<<
@@ -28914,7 +28952,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_4__str__(struct __pyx_obj_4cdec
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "rule.pxi":34
+ /* "cdec/sa/rule.pxi":34
* s = self.syms[i]
* strs.append(sym_tostring(s))
* return ' '.join(strs) # <<<<<<<<<<<<<<
@@ -28928,7 +28966,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_4__str__(struct __pyx_obj_4cdec
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "rule.pxi":28
+ /* "cdec/sa/rule.pxi":28
* free(self.varpos)
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -28948,7 +28986,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_4__str__(struct __pyx_obj_4cdec
return __pyx_r;
}
-/* "rule.pxi":36
+/* "cdec/sa/rule.pxi":36
* return ' '.join(strs)
*
* def handle(self): # <<<<<<<<<<<<<<
@@ -28986,7 +29024,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_6handle(struct __pyx_obj_4cdec_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("handle", 0);
- /* "rule.pxi":39
+ /* "cdec/sa/rule.pxi":39
* """return a hashable representation that normalizes the ordering
* of the nonterminal indices"""
* norm = [] # <<<<<<<<<<<<<<
@@ -28998,7 +29036,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_6handle(struct __pyx_obj_4cdec_
__pyx_v_norm = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "rule.pxi":41
+ /* "cdec/sa/rule.pxi":41
* norm = []
* cdef int i, j, s
* i = 1 # <<<<<<<<<<<<<<
@@ -29007,7 +29045,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_6handle(struct __pyx_obj_4cdec_
*/
__pyx_v_i = 1;
- /* "rule.pxi":42
+ /* "cdec/sa/rule.pxi":42
* cdef int i, j, s
* i = 1
* j = 0 # <<<<<<<<<<<<<<
@@ -29016,7 +29054,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_6handle(struct __pyx_obj_4cdec_
*/
__pyx_v_j = 0;
- /* "rule.pxi":43
+ /* "cdec/sa/rule.pxi":43
* i = 1
* j = 0
* for j from 0 <= j < self.n: # <<<<<<<<<<<<<<
@@ -29026,7 +29064,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_6handle(struct __pyx_obj_4cdec_
__pyx_t_2 = __pyx_v_self->n;
for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_2; __pyx_v_j++) {
- /* "rule.pxi":44
+ /* "cdec/sa/rule.pxi":44
* j = 0
* for j from 0 <= j < self.n:
* s = self.syms[j] # <<<<<<<<<<<<<<
@@ -29035,7 +29073,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_6handle(struct __pyx_obj_4cdec_
*/
__pyx_v_s = (__pyx_v_self->syms[__pyx_v_j]);
- /* "rule.pxi":45
+ /* "cdec/sa/rule.pxi":45
* for j from 0 <= j < self.n:
* s = self.syms[j]
* if sym_isvar(s): # <<<<<<<<<<<<<<
@@ -29045,7 +29083,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_6handle(struct __pyx_obj_4cdec_
__pyx_t_3 = (__pyx_f_4cdec_2sa_3_sa_sym_isvar(__pyx_v_s) != 0);
if (__pyx_t_3) {
- /* "rule.pxi":46
+ /* "cdec/sa/rule.pxi":46
* s = self.syms[j]
* if sym_isvar(s):
* s = sym_setindex(s,i) # <<<<<<<<<<<<<<
@@ -29054,7 +29092,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_6handle(struct __pyx_obj_4cdec_
*/
__pyx_v_s = __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_s, __pyx_v_i);
- /* "rule.pxi":47
+ /* "cdec/sa/rule.pxi":47
* if sym_isvar(s):
* s = sym_setindex(s,i)
* i = i + 1 # <<<<<<<<<<<<<<
@@ -29066,7 +29104,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_6handle(struct __pyx_obj_4cdec_
}
__pyx_L5:;
- /* "rule.pxi":48
+ /* "cdec/sa/rule.pxi":48
* s = sym_setindex(s,i)
* i = i + 1
* norm.append(s) # <<<<<<<<<<<<<<
@@ -29079,7 +29117,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_6handle(struct __pyx_obj_4cdec_
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "rule.pxi":49
+ /* "cdec/sa/rule.pxi":49
* i = i + 1
* norm.append(s)
* return tuple(norm) # <<<<<<<<<<<<<<
@@ -29093,7 +29131,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_6handle(struct __pyx_obj_4cdec_
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "rule.pxi":36
+ /* "cdec/sa/rule.pxi":36
* return ' '.join(strs)
*
* def handle(self): # <<<<<<<<<<<<<<
@@ -29113,7 +29151,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_6handle(struct __pyx_obj_4cdec_
return __pyx_r;
}
-/* "rule.pxi":51
+/* "cdec/sa/rule.pxi":51
* return tuple(norm)
*
* def strhandle(self): # <<<<<<<<<<<<<<
@@ -29150,7 +29188,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_8strhandle(struct __pyx_obj_4cd
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("strhandle", 0);
- /* "rule.pxi":52
+ /* "cdec/sa/rule.pxi":52
*
* def strhandle(self):
* norm = [] # <<<<<<<<<<<<<<
@@ -29162,7 +29200,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_8strhandle(struct __pyx_obj_4cd
__pyx_v_norm = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "rule.pxi":54
+ /* "cdec/sa/rule.pxi":54
* norm = []
* cdef int i, j, s
* i = 1 # <<<<<<<<<<<<<<
@@ -29171,7 +29209,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_8strhandle(struct __pyx_obj_4cd
*/
__pyx_v_i = 1;
- /* "rule.pxi":55
+ /* "cdec/sa/rule.pxi":55
* cdef int i, j, s
* i = 1
* j = 0 # <<<<<<<<<<<<<<
@@ -29180,7 +29218,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_8strhandle(struct __pyx_obj_4cd
*/
__pyx_v_j = 0;
- /* "rule.pxi":56
+ /* "cdec/sa/rule.pxi":56
* i = 1
* j = 0
* for j from 0 <= j < self.n: # <<<<<<<<<<<<<<
@@ -29190,7 +29228,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_8strhandle(struct __pyx_obj_4cd
__pyx_t_2 = __pyx_v_self->n;
for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_2; __pyx_v_j++) {
- /* "rule.pxi":57
+ /* "cdec/sa/rule.pxi":57
* j = 0
* for j from 0 <= j < self.n:
* s = self.syms[j] # <<<<<<<<<<<<<<
@@ -29199,7 +29237,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_8strhandle(struct __pyx_obj_4cd
*/
__pyx_v_s = (__pyx_v_self->syms[__pyx_v_j]);
- /* "rule.pxi":58
+ /* "cdec/sa/rule.pxi":58
* for j from 0 <= j < self.n:
* s = self.syms[j]
* if sym_isvar(s): # <<<<<<<<<<<<<<
@@ -29209,7 +29247,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_8strhandle(struct __pyx_obj_4cd
__pyx_t_3 = (__pyx_f_4cdec_2sa_3_sa_sym_isvar(__pyx_v_s) != 0);
if (__pyx_t_3) {
- /* "rule.pxi":59
+ /* "cdec/sa/rule.pxi":59
* s = self.syms[j]
* if sym_isvar(s):
* s = sym_setindex(s,i) # <<<<<<<<<<<<<<
@@ -29218,7 +29256,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_8strhandle(struct __pyx_obj_4cd
*/
__pyx_v_s = __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_s, __pyx_v_i);
- /* "rule.pxi":60
+ /* "cdec/sa/rule.pxi":60
* if sym_isvar(s):
* s = sym_setindex(s,i)
* i = i + 1 # <<<<<<<<<<<<<<
@@ -29230,7 +29268,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_8strhandle(struct __pyx_obj_4cd
}
__pyx_L5:;
- /* "rule.pxi":61
+ /* "cdec/sa/rule.pxi":61
* s = sym_setindex(s,i)
* i = i + 1
* norm.append(sym_tostring(s)) # <<<<<<<<<<<<<<
@@ -29243,7 +29281,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_8strhandle(struct __pyx_obj_4cd
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "rule.pxi":62
+ /* "cdec/sa/rule.pxi":62
* i = i + 1
* norm.append(sym_tostring(s))
* return ' '.join(norm) # <<<<<<<<<<<<<<
@@ -29257,7 +29295,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_8strhandle(struct __pyx_obj_4cd
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "rule.pxi":51
+ /* "cdec/sa/rule.pxi":51
* return tuple(norm)
*
* def strhandle(self): # <<<<<<<<<<<<<<
@@ -29277,7 +29315,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_8strhandle(struct __pyx_obj_4cd
return __pyx_r;
}
-/* "rule.pxi":64
+/* "cdec/sa/rule.pxi":64
* return ' '.join(norm)
*
* def arity(self): # <<<<<<<<<<<<<<
@@ -29303,7 +29341,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_10arity(struct __pyx_obj_4cdec_
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("arity", 0);
- /* "rule.pxi":65
+ /* "cdec/sa/rule.pxi":65
*
* def arity(self):
* return self.n_vars # <<<<<<<<<<<<<<
@@ -29315,7 +29353,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_10arity(struct __pyx_obj_4cdec_
__pyx_r = __pyx_v_self->n_vars;
goto __pyx_L0;
- /* "rule.pxi":64
+ /* "cdec/sa/rule.pxi":64
* return ' '.join(norm)
*
* def arity(self): # <<<<<<<<<<<<<<
@@ -29330,7 +29368,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_10arity(struct __pyx_obj_4cdec_
return __pyx_r;
}
-/* "rule.pxi":67
+/* "cdec/sa/rule.pxi":67
* return self.n_vars
*
* def getvarpos(self, i): # <<<<<<<<<<<<<<
@@ -29362,7 +29400,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_12getvarpos(struct __pyx_obj_4c
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getvarpos", 0);
- /* "rule.pxi":68
+ /* "cdec/sa/rule.pxi":68
*
* def getvarpos(self, i):
* if 0 <= i < self.n_vars: # <<<<<<<<<<<<<<
@@ -29378,7 +29416,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_12getvarpos(struct __pyx_obj_4c
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
- /* "rule.pxi":69
+ /* "cdec/sa/rule.pxi":69
* def getvarpos(self, i):
* if 0 <= i < self.n_vars:
* return self.varpos[i] # <<<<<<<<<<<<<<
@@ -29395,7 +29433,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_12getvarpos(struct __pyx_obj_4c
}
/*else*/ {
- /* "rule.pxi":71
+ /* "cdec/sa/rule.pxi":71
* return self.varpos[i]
* else:
* raise IndexError # <<<<<<<<<<<<<<
@@ -29406,7 +29444,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_12getvarpos(struct __pyx_obj_4c
{__pyx_filename = __pyx_f[7]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- /* "rule.pxi":67
+ /* "cdec/sa/rule.pxi":67
* return self.n_vars
*
* def getvarpos(self, i): # <<<<<<<<<<<<<<
@@ -29425,7 +29463,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_12getvarpos(struct __pyx_obj_4c
return __pyx_r;
}
-/* "rule.pxi":73
+/* "cdec/sa/rule.pxi":73
* raise IndexError
*
* def getvar(self, i): # <<<<<<<<<<<<<<
@@ -29457,7 +29495,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_14getvar(struct __pyx_obj_4cdec
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getvar", 0);
- /* "rule.pxi":74
+ /* "cdec/sa/rule.pxi":74
*
* def getvar(self, i):
* if 0 <= i < self.n_vars: # <<<<<<<<<<<<<<
@@ -29473,7 +29511,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_14getvar(struct __pyx_obj_4cdec
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
- /* "rule.pxi":75
+ /* "cdec/sa/rule.pxi":75
* def getvar(self, i):
* if 0 <= i < self.n_vars:
* return self.syms[self.varpos[i]] # <<<<<<<<<<<<<<
@@ -29490,7 +29528,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_14getvar(struct __pyx_obj_4cdec
}
/*else*/ {
- /* "rule.pxi":77
+ /* "cdec/sa/rule.pxi":77
* return self.syms[self.varpos[i]]
* else:
* raise IndexError # <<<<<<<<<<<<<<
@@ -29501,7 +29539,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_14getvar(struct __pyx_obj_4cdec
{__pyx_filename = __pyx_f[7]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- /* "rule.pxi":73
+ /* "cdec/sa/rule.pxi":73
* raise IndexError
*
* def getvar(self, i): # <<<<<<<<<<<<<<
@@ -29520,7 +29558,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_14getvar(struct __pyx_obj_4cdec
return __pyx_r;
}
-/* "rule.pxi":79
+/* "cdec/sa/rule.pxi":79
* raise IndexError
*
* cdef int chunkpos(self, int k): # <<<<<<<<<<<<<<
@@ -29534,7 +29572,7 @@ int __pyx_f_4cdec_2sa_3_sa_6Phrase_chunkpos(struct __pyx_obj_4cdec_2sa_3_sa_Phra
int __pyx_t_1;
__Pyx_RefNannySetupContext("chunkpos", 0);
- /* "rule.pxi":80
+ /* "cdec/sa/rule.pxi":80
*
* cdef int chunkpos(self, int k):
* if k == 0: # <<<<<<<<<<<<<<
@@ -29544,7 +29582,7 @@ int __pyx_f_4cdec_2sa_3_sa_6Phrase_chunkpos(struct __pyx_obj_4cdec_2sa_3_sa_Phra
__pyx_t_1 = ((__pyx_v_k == 0) != 0);
if (__pyx_t_1) {
- /* "rule.pxi":81
+ /* "cdec/sa/rule.pxi":81
* cdef int chunkpos(self, int k):
* if k == 0:
* return 0 # <<<<<<<<<<<<<<
@@ -29556,7 +29594,7 @@ int __pyx_f_4cdec_2sa_3_sa_6Phrase_chunkpos(struct __pyx_obj_4cdec_2sa_3_sa_Phra
}
/*else*/ {
- /* "rule.pxi":83
+ /* "cdec/sa/rule.pxi":83
* return 0
* else:
* return self.varpos[k-1]+1 # <<<<<<<<<<<<<<
@@ -29567,7 +29605,7 @@ int __pyx_f_4cdec_2sa_3_sa_6Phrase_chunkpos(struct __pyx_obj_4cdec_2sa_3_sa_Phra
goto __pyx_L0;
}
- /* "rule.pxi":79
+ /* "cdec/sa/rule.pxi":79
* raise IndexError
*
* cdef int chunkpos(self, int k): # <<<<<<<<<<<<<<
@@ -29581,7 +29619,7 @@ int __pyx_f_4cdec_2sa_3_sa_6Phrase_chunkpos(struct __pyx_obj_4cdec_2sa_3_sa_Phra
return __pyx_r;
}
-/* "rule.pxi":85
+/* "cdec/sa/rule.pxi":85
* return self.varpos[k-1]+1
*
* cdef int chunklen(self, int k): # <<<<<<<<<<<<<<
@@ -29600,7 +29638,7 @@ int __pyx_f_4cdec_2sa_3_sa_6Phrase_chunklen(struct __pyx_obj_4cdec_2sa_3_sa_Phra
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("chunklen", 0);
- /* "rule.pxi":86
+ /* "cdec/sa/rule.pxi":86
*
* cdef int chunklen(self, int k):
* if self.n_vars == 0: # <<<<<<<<<<<<<<
@@ -29612,7 +29650,7 @@ int __pyx_f_4cdec_2sa_3_sa_6Phrase_chunklen(struct __pyx_obj_4cdec_2sa_3_sa_Phra
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
- /* "rule.pxi":87
+ /* "cdec/sa/rule.pxi":87
* cdef int chunklen(self, int k):
* if self.n_vars == 0:
* return self.n # <<<<<<<<<<<<<<
@@ -29623,7 +29661,7 @@ int __pyx_f_4cdec_2sa_3_sa_6Phrase_chunklen(struct __pyx_obj_4cdec_2sa_3_sa_Phra
goto __pyx_L0;
}
- /* "rule.pxi":88
+ /* "cdec/sa/rule.pxi":88
* if self.n_vars == 0:
* return self.n
* elif k == 0: # <<<<<<<<<<<<<<
@@ -29633,7 +29671,7 @@ int __pyx_f_4cdec_2sa_3_sa_6Phrase_chunklen(struct __pyx_obj_4cdec_2sa_3_sa_Phra
__pyx_t_2 = ((__pyx_v_k == 0) != 0);
if (__pyx_t_2) {
- /* "rule.pxi":89
+ /* "cdec/sa/rule.pxi":89
* return self.n
* elif k == 0:
* return self.varpos[0] # <<<<<<<<<<<<<<
@@ -29644,7 +29682,7 @@ int __pyx_f_4cdec_2sa_3_sa_6Phrase_chunklen(struct __pyx_obj_4cdec_2sa_3_sa_Phra
goto __pyx_L0;
}
- /* "rule.pxi":90
+ /* "cdec/sa/rule.pxi":90
* elif k == 0:
* return self.varpos[0]
* elif k == self.n_vars: # <<<<<<<<<<<<<<
@@ -29659,7 +29697,7 @@ int __pyx_f_4cdec_2sa_3_sa_6Phrase_chunklen(struct __pyx_obj_4cdec_2sa_3_sa_Phra
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_2) {
- /* "rule.pxi":91
+ /* "cdec/sa/rule.pxi":91
* return self.varpos[0]
* elif k == self.n_vars:
* return self.n-self.varpos[k-1]-1 # <<<<<<<<<<<<<<
@@ -29671,7 +29709,7 @@ int __pyx_f_4cdec_2sa_3_sa_6Phrase_chunklen(struct __pyx_obj_4cdec_2sa_3_sa_Phra
}
/*else*/ {
- /* "rule.pxi":93
+ /* "cdec/sa/rule.pxi":93
* return self.n-self.varpos[k-1]-1
* else:
* return self.varpos[k]-self.varpos[k-1]-1 # <<<<<<<<<<<<<<
@@ -29682,7 +29720,7 @@ int __pyx_f_4cdec_2sa_3_sa_6Phrase_chunklen(struct __pyx_obj_4cdec_2sa_3_sa_Phra
goto __pyx_L0;
}
- /* "rule.pxi":85
+ /* "cdec/sa/rule.pxi":85
* return self.varpos[k-1]+1
*
* cdef int chunklen(self, int k): # <<<<<<<<<<<<<<
@@ -29701,7 +29739,7 @@ int __pyx_f_4cdec_2sa_3_sa_6Phrase_chunklen(struct __pyx_obj_4cdec_2sa_3_sa_Phra
return __pyx_r;
}
-/* "rule.pxi":95
+/* "cdec/sa/rule.pxi":95
* return self.varpos[k]-self.varpos[k-1]-1
*
* def clen(self, k): # <<<<<<<<<<<<<<
@@ -29732,7 +29770,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_16clen(struct __pyx_obj_4cdec_2
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("clen", 0);
- /* "rule.pxi":96
+ /* "cdec/sa/rule.pxi":96
*
* def clen(self, k):
* return self.chunklen(k) # <<<<<<<<<<<<<<
@@ -29747,7 +29785,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_16clen(struct __pyx_obj_4cdec_2
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "rule.pxi":95
+ /* "cdec/sa/rule.pxi":95
* return self.varpos[k]-self.varpos[k-1]-1
*
* def clen(self, k): # <<<<<<<<<<<<<<
@@ -29766,7 +29804,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_16clen(struct __pyx_obj_4cdec_2
return __pyx_r;
}
-/* "rule.pxi":98
+/* "cdec/sa/rule.pxi":98
* return self.chunklen(k)
*
* def getchunk(self, ci): # <<<<<<<<<<<<<<
@@ -29802,7 +29840,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_18getchunk(struct __pyx_obj_4cd
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getchunk", 0);
- /* "rule.pxi":100
+ /* "cdec/sa/rule.pxi":100
* def getchunk(self, ci):
* cdef int start, stop
* start = self.chunkpos(ci) # <<<<<<<<<<<<<<
@@ -29812,7 +29850,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_18getchunk(struct __pyx_obj_4cd
__pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_ci); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_start = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Phrase *)__pyx_v_self->__pyx_vtab)->chunkpos(__pyx_v_self, __pyx_t_1);
- /* "rule.pxi":101
+ /* "cdec/sa/rule.pxi":101
* cdef int start, stop
* start = self.chunkpos(ci)
* stop = start+self.chunklen(ci) # <<<<<<<<<<<<<<
@@ -29822,7 +29860,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_18getchunk(struct __pyx_obj_4cd
__pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_ci); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_stop = (__pyx_v_start + ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Phrase *)__pyx_v_self->__pyx_vtab)->chunklen(__pyx_v_self, __pyx_t_1));
- /* "rule.pxi":102
+ /* "cdec/sa/rule.pxi":102
* start = self.chunkpos(ci)
* stop = start+self.chunklen(ci)
* chunk = [] # <<<<<<<<<<<<<<
@@ -29834,7 +29872,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_18getchunk(struct __pyx_obj_4cd
__pyx_v_chunk = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
- /* "rule.pxi":103
+ /* "cdec/sa/rule.pxi":103
* stop = start+self.chunklen(ci)
* chunk = []
* for i from start <= i < stop: # <<<<<<<<<<<<<<
@@ -29844,7 +29882,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_18getchunk(struct __pyx_obj_4cd
__pyx_t_1 = __pyx_v_stop;
for (__pyx_v_i = __pyx_v_start; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {
- /* "rule.pxi":104
+ /* "cdec/sa/rule.pxi":104
* chunk = []
* for i from start <= i < stop:
* chunk.append(self.syms[i]) # <<<<<<<<<<<<<<
@@ -29857,7 +29895,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_18getchunk(struct __pyx_obj_4cd
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
}
- /* "rule.pxi":105
+ /* "cdec/sa/rule.pxi":105
* for i from start <= i < stop:
* chunk.append(self.syms[i])
* return chunk # <<<<<<<<<<<<<<
@@ -29869,7 +29907,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_18getchunk(struct __pyx_obj_4cd
__pyx_r = __pyx_v_chunk;
goto __pyx_L0;
- /* "rule.pxi":98
+ /* "cdec/sa/rule.pxi":98
* return self.chunklen(k)
*
* def getchunk(self, ci): # <<<<<<<<<<<<<<
@@ -29889,7 +29927,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_18getchunk(struct __pyx_obj_4cd
return __pyx_r;
}
-/* "rule.pxi":107
+/* "cdec/sa/rule.pxi":107
* return chunk
*
* def __cmp__(self, other): # <<<<<<<<<<<<<<
@@ -29928,7 +29966,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase_20__cmp__(struct __pyx_obj_4cdec_2sa_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cmp__", 0);
- /* "rule.pxi":110
+ /* "cdec/sa/rule.pxi":110
* cdef Phrase otherp
* cdef int i
* otherp = other # <<<<<<<<<<<<<<
@@ -29941,7 +29979,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase_20__cmp__(struct __pyx_obj_4cdec_2sa_
__pyx_v_otherp = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "rule.pxi":111
+ /* "cdec/sa/rule.pxi":111
* cdef int i
* otherp = other
* for i from 0 <= i < min(self.n, otherp.n): # <<<<<<<<<<<<<<
@@ -29958,7 +29996,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase_20__cmp__(struct __pyx_obj_4cdec_2sa_
__pyx_t_2 = __pyx_t_4;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {
- /* "rule.pxi":112
+ /* "cdec/sa/rule.pxi":112
* otherp = other
* for i from 0 <= i < min(self.n, otherp.n):
* if self.syms[i] < otherp.syms[i]: # <<<<<<<<<<<<<<
@@ -29968,7 +30006,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase_20__cmp__(struct __pyx_obj_4cdec_2sa_
__pyx_t_5 = (((__pyx_v_self->syms[__pyx_v_i]) < (__pyx_v_otherp->syms[__pyx_v_i])) != 0);
if (__pyx_t_5) {
- /* "rule.pxi":113
+ /* "cdec/sa/rule.pxi":113
* for i from 0 <= i < min(self.n, otherp.n):
* if self.syms[i] < otherp.syms[i]:
* return -1 # <<<<<<<<<<<<<<
@@ -29979,7 +30017,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase_20__cmp__(struct __pyx_obj_4cdec_2sa_
goto __pyx_L0;
}
- /* "rule.pxi":114
+ /* "cdec/sa/rule.pxi":114
* if self.syms[i] < otherp.syms[i]:
* return -1
* elif self.syms[i] > otherp.syms[i]: # <<<<<<<<<<<<<<
@@ -29989,7 +30027,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase_20__cmp__(struct __pyx_obj_4cdec_2sa_
__pyx_t_5 = (((__pyx_v_self->syms[__pyx_v_i]) > (__pyx_v_otherp->syms[__pyx_v_i])) != 0);
if (__pyx_t_5) {
- /* "rule.pxi":115
+ /* "cdec/sa/rule.pxi":115
* return -1
* elif self.syms[i] > otherp.syms[i]:
* return 1 # <<<<<<<<<<<<<<
@@ -30001,7 +30039,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase_20__cmp__(struct __pyx_obj_4cdec_2sa_
}
}
- /* "rule.pxi":116
+ /* "cdec/sa/rule.pxi":116
* elif self.syms[i] > otherp.syms[i]:
* return 1
* if self.n < otherp.n: # <<<<<<<<<<<<<<
@@ -30011,7 +30049,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase_20__cmp__(struct __pyx_obj_4cdec_2sa_
__pyx_t_5 = ((__pyx_v_self->n < __pyx_v_otherp->n) != 0);
if (__pyx_t_5) {
- /* "rule.pxi":117
+ /* "cdec/sa/rule.pxi":117
* return 1
* if self.n < otherp.n:
* return -1 # <<<<<<<<<<<<<<
@@ -30022,7 +30060,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase_20__cmp__(struct __pyx_obj_4cdec_2sa_
goto __pyx_L0;
}
- /* "rule.pxi":118
+ /* "cdec/sa/rule.pxi":118
* if self.n < otherp.n:
* return -1
* elif self.n > otherp.n: # <<<<<<<<<<<<<<
@@ -30032,7 +30070,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase_20__cmp__(struct __pyx_obj_4cdec_2sa_
__pyx_t_5 = ((__pyx_v_self->n > __pyx_v_otherp->n) != 0);
if (__pyx_t_5) {
- /* "rule.pxi":119
+ /* "cdec/sa/rule.pxi":119
* return -1
* elif self.n > otherp.n:
* return 1 # <<<<<<<<<<<<<<
@@ -30044,7 +30082,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase_20__cmp__(struct __pyx_obj_4cdec_2sa_
}
/*else*/ {
- /* "rule.pxi":121
+ /* "cdec/sa/rule.pxi":121
* return 1
* else:
* return 0 # <<<<<<<<<<<<<<
@@ -30055,7 +30093,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase_20__cmp__(struct __pyx_obj_4cdec_2sa_
goto __pyx_L0;
}
- /* "rule.pxi":107
+ /* "cdec/sa/rule.pxi":107
* return chunk
*
* def __cmp__(self, other): # <<<<<<<<<<<<<<
@@ -30075,7 +30113,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Phrase_20__cmp__(struct __pyx_obj_4cdec_2sa_
}
#endif /*!(#if PY_MAJOR_VERSION < 3)*/
-/* "rule.pxi":123
+/* "cdec/sa/rule.pxi":123
* return 0
*
* def __hash__(self): # <<<<<<<<<<<<<<
@@ -30105,7 +30143,7 @@ static Py_hash_t __pyx_pf_4cdec_2sa_3_sa_6Phrase_22__hash__(struct __pyx_obj_4cd
int __pyx_t_2;
__Pyx_RefNannySetupContext("__hash__", 0);
- /* "rule.pxi":126
+ /* "cdec/sa/rule.pxi":126
* cdef int i
* cdef unsigned h
* h = 0 # <<<<<<<<<<<<<<
@@ -30114,7 +30152,7 @@ static Py_hash_t __pyx_pf_4cdec_2sa_3_sa_6Phrase_22__hash__(struct __pyx_obj_4cd
*/
__pyx_v_h = 0;
- /* "rule.pxi":127
+ /* "cdec/sa/rule.pxi":127
* cdef unsigned h
* h = 0
* for i from 0 <= i < self.n: # <<<<<<<<<<<<<<
@@ -30124,7 +30162,7 @@ static Py_hash_t __pyx_pf_4cdec_2sa_3_sa_6Phrase_22__hash__(struct __pyx_obj_4cd
__pyx_t_1 = __pyx_v_self->n;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {
- /* "rule.pxi":128
+ /* "cdec/sa/rule.pxi":128
* h = 0
* for i from 0 <= i < self.n:
* if self.syms[i] > 0: # <<<<<<<<<<<<<<
@@ -30134,7 +30172,7 @@ static Py_hash_t __pyx_pf_4cdec_2sa_3_sa_6Phrase_22__hash__(struct __pyx_obj_4cd
__pyx_t_2 = (((__pyx_v_self->syms[__pyx_v_i]) > 0) != 0);
if (__pyx_t_2) {
- /* "rule.pxi":129
+ /* "cdec/sa/rule.pxi":129
* for i from 0 <= i < self.n:
* if self.syms[i] > 0:
* h = (h << 1) + self.syms[i] # <<<<<<<<<<<<<<
@@ -30146,7 +30184,7 @@ static Py_hash_t __pyx_pf_4cdec_2sa_3_sa_6Phrase_22__hash__(struct __pyx_obj_4cd
}
/*else*/ {
- /* "rule.pxi":131
+ /* "cdec/sa/rule.pxi":131
* h = (h << 1) + self.syms[i]
* else:
* h = (h << 1) + -self.syms[i] # <<<<<<<<<<<<<<
@@ -30158,7 +30196,7 @@ static Py_hash_t __pyx_pf_4cdec_2sa_3_sa_6Phrase_22__hash__(struct __pyx_obj_4cd
__pyx_L5:;
}
- /* "rule.pxi":132
+ /* "cdec/sa/rule.pxi":132
* else:
* h = (h << 1) + -self.syms[i]
* return h # <<<<<<<<<<<<<<
@@ -30168,7 +30206,7 @@ static Py_hash_t __pyx_pf_4cdec_2sa_3_sa_6Phrase_22__hash__(struct __pyx_obj_4cd
__pyx_r = __pyx_v_h;
goto __pyx_L0;
- /* "rule.pxi":123
+ /* "cdec/sa/rule.pxi":123
* return 0
*
* def __hash__(self): # <<<<<<<<<<<<<<
@@ -30183,7 +30221,7 @@ static Py_hash_t __pyx_pf_4cdec_2sa_3_sa_6Phrase_22__hash__(struct __pyx_obj_4cd
return __pyx_r;
}
-/* "rule.pxi":134
+/* "cdec/sa/rule.pxi":134
* return h
*
* def __len__(self): # <<<<<<<<<<<<<<
@@ -30209,7 +30247,7 @@ static Py_ssize_t __pyx_pf_4cdec_2sa_3_sa_6Phrase_24__len__(struct __pyx_obj_4cd
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__len__", 0);
- /* "rule.pxi":135
+ /* "cdec/sa/rule.pxi":135
*
* def __len__(self):
* return self.n # <<<<<<<<<<<<<<
@@ -30219,7 +30257,7 @@ static Py_ssize_t __pyx_pf_4cdec_2sa_3_sa_6Phrase_24__len__(struct __pyx_obj_4cd
__pyx_r = __pyx_v_self->n;
goto __pyx_L0;
- /* "rule.pxi":134
+ /* "cdec/sa/rule.pxi":134
* return h
*
* def __len__(self): # <<<<<<<<<<<<<<
@@ -30233,7 +30271,7 @@ static Py_ssize_t __pyx_pf_4cdec_2sa_3_sa_6Phrase_24__len__(struct __pyx_obj_4cd
return __pyx_r;
}
-/* "rule.pxi":137
+/* "cdec/sa/rule.pxi":137
* return self.n
*
* def __getitem__(self, i): # <<<<<<<<<<<<<<
@@ -30264,7 +30302,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_26__getitem__(struct __pyx_obj_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__getitem__", 0);
- /* "rule.pxi":138
+ /* "cdec/sa/rule.pxi":138
*
* def __getitem__(self, i):
* return self.syms[i] # <<<<<<<<<<<<<<
@@ -30279,7 +30317,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_26__getitem__(struct __pyx_obj_
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "rule.pxi":137
+ /* "cdec/sa/rule.pxi":137
* return self.n
*
* def __getitem__(self, i): # <<<<<<<<<<<<<<
@@ -30299,7 +30337,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_26__getitem__(struct __pyx_obj_
}
static PyObject *__pyx_gb_4cdec_2sa_3_sa_6Phrase_30generator2(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-/* "rule.pxi":140
+/* "cdec/sa/rule.pxi":140
* return self.syms[i]
*
* def __iter__(self): # <<<<<<<<<<<<<<
@@ -30375,7 +30413,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_6Phrase_30generator2(__pyx_GeneratorObj
__pyx_L3_first_run:;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "rule.pxi":142
+ /* "cdec/sa/rule.pxi":142
* def __iter__(self):
* cdef int i
* for i from 0 <= i < self.n: # <<<<<<<<<<<<<<
@@ -30385,7 +30423,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_6Phrase_30generator2(__pyx_GeneratorObj
__pyx_t_1 = __pyx_cur_scope->__pyx_v_self->n;
for (__pyx_cur_scope->__pyx_v_i = 0; __pyx_cur_scope->__pyx_v_i < __pyx_t_1; __pyx_cur_scope->__pyx_v_i++) {
- /* "rule.pxi":143
+ /* "cdec/sa/rule.pxi":143
* cdef int i
* for i from 0 <= i < self.n:
* yield self.syms[i] # <<<<<<<<<<<<<<
@@ -30407,7 +30445,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_6Phrase_30generator2(__pyx_GeneratorObj
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- /* "rule.pxi":140
+ /* "cdec/sa/rule.pxi":140
* return self.syms[i]
*
* def __iter__(self): # <<<<<<<<<<<<<<
@@ -30429,7 +30467,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_6Phrase_30generator2(__pyx_GeneratorObj
return NULL;
}
-/* "rule.pxi":145
+/* "cdec/sa/rule.pxi":145
* yield self.syms[i]
*
* def subst(self, start, children): # <<<<<<<<<<<<<<
@@ -30513,7 +30551,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_31subst(struct __pyx_obj_4cdec_
__Pyx_RefNannySetupContext("subst", 0);
__Pyx_INCREF(__pyx_v_start);
- /* "rule.pxi":147
+ /* "cdec/sa/rule.pxi":147
* def subst(self, start, children):
* cdef int i
* for i from 0 <= i < self.n: # <<<<<<<<<<<<<<
@@ -30523,7 +30561,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_31subst(struct __pyx_obj_4cdec_
__pyx_t_1 = __pyx_v_self->n;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {
- /* "rule.pxi":148
+ /* "cdec/sa/rule.pxi":148
* cdef int i
* for i from 0 <= i < self.n:
* if sym_isvar(self.syms[i]): # <<<<<<<<<<<<<<
@@ -30533,7 +30571,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_31subst(struct __pyx_obj_4cdec_
__pyx_t_2 = (__pyx_f_4cdec_2sa_3_sa_sym_isvar((__pyx_v_self->syms[__pyx_v_i])) != 0);
if (__pyx_t_2) {
- /* "rule.pxi":149
+ /* "cdec/sa/rule.pxi":149
* for i from 0 <= i < self.n:
* if sym_isvar(self.syms[i]):
* start = start + children[sym_getindex(self.syms[i])-1] # <<<<<<<<<<<<<<
@@ -30552,7 +30590,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_31subst(struct __pyx_obj_4cdec_
}
/*else*/ {
- /* "rule.pxi":151
+ /* "cdec/sa/rule.pxi":151
* start = start + children[sym_getindex(self.syms[i])-1]
* else:
* start = start + (self.syms[i],) # <<<<<<<<<<<<<<
@@ -30575,7 +30613,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_31subst(struct __pyx_obj_4cdec_
__pyx_L5:;
}
- /* "rule.pxi":152
+ /* "cdec/sa/rule.pxi":152
* else:
* start = start + (self.syms[i],)
* return start # <<<<<<<<<<<<<<
@@ -30587,7 +30625,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_31subst(struct __pyx_obj_4cdec_
__pyx_r = __pyx_v_start;
goto __pyx_L0;
- /* "rule.pxi":145
+ /* "cdec/sa/rule.pxi":145
* yield self.syms[i]
*
* def subst(self, start, children): # <<<<<<<<<<<<<<
@@ -30608,7 +30646,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_31subst(struct __pyx_obj_4cdec_
return __pyx_r;
}
-/* "rule.pxi":155
+/* "cdec/sa/rule.pxi":155
*
* property words:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -30645,12 +30683,12 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_5words___get__(struct __pyx_obj
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "rule.pxi":156
+ /* "cdec/sa/rule.pxi":156
* property words:
* def __get__(self):
* return [sym_tostring(w) for w in self if not sym_isvar(w)] # <<<<<<<<<<<<<<
*
- * cdef class Rule:
+ * def iterspans(self, nt_flag = False, to_str = True):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
@@ -30711,7 +30749,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_5words___get__(struct __pyx_obj
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "rule.pxi":155
+ /* "cdec/sa/rule.pxi":155
*
* property words:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -30732,8 +30770,494 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_5words___get__(struct __pyx_obj
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
+static PyObject *__pyx_gb_4cdec_2sa_3_sa_6Phrase_35generator3(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+
+/* "cdec/sa/rule.pxi":158
+ * return [sym_tostring(w) for w in self if not sym_isvar(w)]
+ *
+ * def iterspans(self, nt_flag = False, to_str = True): # <<<<<<<<<<<<<<
+ * """iterate over (terminal and nonterminal) spans, it generates pairs of the kind (terminal span, !nt_flag) or (nonterminal, nt_flag)
+ * Example: iterspans(False, False) --> ([-1], False), ([2,3], True), ([-1], False), ([4], True), ([-1], False)
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_4cdec_2sa_3_sa_6Phrase_34iterspans(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4cdec_2sa_3_sa_6Phrase_33iterspans[] = "iterate over (terminal and nonterminal) spans, it generates pairs of the kind (terminal span, !nt_flag) or (nonterminal, nt_flag)\n Example: iterspans(False, False) --> ([-1], False), ([2,3], True), ([-1], False), ([4], True), ([-1], False)\n for the sequence -1 2 3 -1 4 -1";
+static PyObject *__pyx_pw_4cdec_2sa_3_sa_6Phrase_34iterspans(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_nt_flag = 0;
+ PyObject *__pyx_v_to_str = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("iterspans (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nt_flag,&__pyx_n_s_to_str,0};
+ PyObject* values[2] = {0,0};
+ values[0] = ((PyObject *)Py_False);
+ values[1] = ((PyObject *)Py_True);
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nt_flag);
+ if (value) { values[0] = value; kw_args--; }
+ }
+ case 1:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_to_str);
+ if (value) { values[1] = value; kw_args--; }
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "iterspans") < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else {
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ }
+ __pyx_v_nt_flag = values[0];
+ __pyx_v_to_str = values[1];
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("iterspans", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("cdec.sa._sa.Phrase.iterspans", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_4cdec_2sa_3_sa_6Phrase_33iterspans(((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_v_self), __pyx_v_nt_flag, __pyx_v_to_str);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "cdec/sa/rule.pxi":164
+ * span = []
+ * cdef int i, s
+ * get_sym = lambda sym : sym_tostring(sym) if to_str else lambda sym : sym # <<<<<<<<<<<<<<
+ * for i from 0 <= i < self.n:
+ * s = self.syms[i]
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_4cdec_2sa_3_sa_6Phrase_9iterspans_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_sym); /*proto*/
+static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_6Phrase_9iterspans_lambda1 = {"lambda1", (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_6Phrase_9iterspans_lambda1, METH_O, 0};
+static PyObject *__pyx_pw_4cdec_2sa_3_sa_6Phrase_9iterspans_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_sym) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("lambda1 (wrapper)", 0);
+ __pyx_r = __pyx_lambda_funcdef_lambda1(__pyx_self, ((PyObject *)__pyx_v_sym));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_4cdec_2sa_3_sa_6Phrase_9iterspans_7lambda1_lambda2(PyObject *__pyx_self, PyObject *__pyx_v_sym); /*proto*/
+static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_6Phrase_9iterspans_7lambda1_lambda2 = {"lambda2", (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_6Phrase_9iterspans_7lambda1_lambda2, METH_O, 0};
+static PyObject *__pyx_pw_4cdec_2sa_3_sa_6Phrase_9iterspans_7lambda1_lambda2(PyObject *__pyx_self, PyObject *__pyx_v_sym) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("lambda2 (wrapper)", 0);
+ __pyx_r = __pyx_lambda_funcdef_lambda2(__pyx_self, ((PyObject *)__pyx_v_sym));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_lambda_funcdef_lambda2(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sym) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("lambda2", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_sym);
+ __pyx_r = __pyx_v_sym;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_sym) {
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16_iterspans *__pyx_cur_scope;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16_iterspans *__pyx_outer_scope;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ PyObject *__pyx_t_4 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("lambda1", 0);
+ __pyx_outer_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16_iterspans *) __Pyx_CyFunction_GetClosure(__pyx_self);
+ __pyx_cur_scope = __pyx_outer_scope;
+ __Pyx_XDECREF(__pyx_r);
+ if (unlikely(!__pyx_cur_scope->__pyx_v_to_str)) { __Pyx_RaiseClosureNameError("to_str"); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_to_str); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_2) {
+ __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_sym); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_f_4cdec_2sa_3_sa_sym_tostring(__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_1 = __pyx_t_4;
+ __pyx_t_4 = 0;
+ } else {
+ __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_6Phrase_9iterspans_7lambda1_lambda2, 0, __pyx_n_s_iterspans_locals_lambda_locals_l, NULL, __pyx_n_s_cdec_sa__sa, __pyx_d, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_1 = __pyx_t_4;
+ __pyx_t_4 = 0;
+ }
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_AddTraceback("cdec.sa._sa.Phrase.iterspans.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "cdec/sa/rule.pxi":158
+ * return [sym_tostring(w) for w in self if not sym_isvar(w)]
+ *
+ * def iterspans(self, nt_flag = False, to_str = True): # <<<<<<<<<<<<<<
+ * """iterate over (terminal and nonterminal) spans, it generates pairs of the kind (terminal span, !nt_flag) or (nonterminal, nt_flag)
+ * Example: iterspans(False, False) --> ([-1], False), ([2,3], True), ([-1], False), ([4], True), ([-1], False)
+ */
+
+static PyObject *__pyx_pf_4cdec_2sa_3_sa_6Phrase_33iterspans(struct __pyx_obj_4cdec_2sa_3_sa_Phrase *__pyx_v_self, PyObject *__pyx_v_nt_flag, PyObject *__pyx_v_to_str) {
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16_iterspans *__pyx_cur_scope;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("iterspans", 0);
+ __pyx_cur_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16_iterspans *)__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_16_iterspans(__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_16_iterspans, __pyx_empty_tuple, NULL);
+ if (unlikely(!__pyx_cur_scope)) {
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ }
+ __Pyx_GOTREF(__pyx_cur_scope);
+ __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
+ __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
+ __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
+ __pyx_cur_scope->__pyx_v_nt_flag = __pyx_v_nt_flag;
+ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_nt_flag);
+ __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_nt_flag);
+ __pyx_cur_scope->__pyx_v_to_str = __pyx_v_to_str;
+ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_to_str);
+ __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_to_str);
+ {
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_6Phrase_35generator3, (PyObject *) __pyx_cur_scope, __pyx_n_s_iterspans, __pyx_n_s_Phrase_iterspans); if (unlikely(!gen)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_cur_scope);
+ __Pyx_RefNannyFinishContext();
+ return (PyObject *) gen;
+ }
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_AddTraceback("cdec.sa._sa.Phrase.iterspans", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_gb_4cdec_2sa_3_sa_6Phrase_35generator3(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+{
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16_iterspans *__pyx_cur_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16_iterspans *)__pyx_generator->closure);
+ PyObject *__pyx_r = NULL;
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ Py_ssize_t __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
+ int __pyx_t_6;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("None", 0);
+ switch (__pyx_generator->resume_label) {
+ case 0: goto __pyx_L3_first_run;
+ case 1: goto __pyx_L8_resume_from_yield;
+ case 2: goto __pyx_L9_resume_from_yield;
+ case 3: goto __pyx_L11_resume_from_yield;
+ default: /* CPython raises the right error here */
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ }
+ __pyx_L3_first_run:;
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "cdec/sa/rule.pxi":162
+ * Example: iterspans(False, False) --> ([-1], False), ([2,3], True), ([-1], False), ([4], True), ([-1], False)
+ * for the sequence -1 2 3 -1 4 -1"""
+ * span = [] # <<<<<<<<<<<<<<
+ * cdef int i, s
+ * get_sym = lambda sym : sym_tostring(sym) if to_str else lambda sym : sym
+ */
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_cur_scope->__pyx_v_span = ((PyObject*)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "cdec/sa/rule.pxi":164
+ * span = []
+ * cdef int i, s
+ * get_sym = lambda sym : sym_tostring(sym) if to_str else lambda sym : sym # <<<<<<<<<<<<<<
+ * for i from 0 <= i < self.n:
+ * s = self.syms[i]
+ */
+ __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_6Phrase_9iterspans_lambda1, 0, __pyx_n_s_iterspans_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cdec_sa__sa, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_cur_scope->__pyx_v_get_sym = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "cdec/sa/rule.pxi":165
+ * cdef int i, s
+ * get_sym = lambda sym : sym_tostring(sym) if to_str else lambda sym : sym
+ * for i from 0 <= i < self.n: # <<<<<<<<<<<<<<
+ * s = self.syms[i]
+ * if sym_isvar(s):
+ */
+ __pyx_t_2 = __pyx_cur_scope->__pyx_v_self->n;
+ for (__pyx_cur_scope->__pyx_v_i = 0; __pyx_cur_scope->__pyx_v_i < __pyx_t_2; __pyx_cur_scope->__pyx_v_i++) {
+
+ /* "cdec/sa/rule.pxi":166
+ * get_sym = lambda sym : sym_tostring(sym) if to_str else lambda sym : sym
+ * for i from 0 <= i < self.n:
+ * s = self.syms[i] # <<<<<<<<<<<<<<
+ * if sym_isvar(s):
+ * if len(span):
+ */
+ __pyx_cur_scope->__pyx_v_s = (__pyx_cur_scope->__pyx_v_self->syms[__pyx_cur_scope->__pyx_v_i]);
+
+ /* "cdec/sa/rule.pxi":167
+ * for i from 0 <= i < self.n:
+ * s = self.syms[i]
+ * if sym_isvar(s): # <<<<<<<<<<<<<<
+ * if len(span):
+ * yield (span, not nt_flag)
+ */
+ __pyx_t_3 = (__pyx_f_4cdec_2sa_3_sa_sym_isvar(__pyx_cur_scope->__pyx_v_s) != 0);
+ if (__pyx_t_3) {
+
+ /* "cdec/sa/rule.pxi":168
+ * s = self.syms[i]
+ * if sym_isvar(s):
+ * if len(span): # <<<<<<<<<<<<<<
+ * yield (span, not nt_flag)
+ * span = []
+ */
+ __pyx_t_4 = PyList_GET_SIZE(__pyx_cur_scope->__pyx_v_span); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = (__pyx_t_4 != 0);
+ if (__pyx_t_3) {
+
+ /* "cdec/sa/rule.pxi":169
+ * if sym_isvar(s):
+ * if len(span):
+ * yield (span, not nt_flag) # <<<<<<<<<<<<<<
+ * span = []
+ * yield ([get_sym(s)], nt_flag)
+ */
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_nt_flag); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBool_FromLong((!__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_span);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_cur_scope->__pyx_v_span);
+ __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_span);
+ PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_1 = 0;
+ __pyx_r = __pyx_t_5;
+ __pyx_t_5 = 0;
+ __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ /* return from generator, yielding value */
+ __pyx_generator->resume_label = 1;
+ return __pyx_r;
+ __pyx_L8_resume_from_yield:;
+ __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "cdec/sa/rule.pxi":170
+ * if len(span):
+ * yield (span, not nt_flag)
+ * span = [] # <<<<<<<<<<<<<<
+ * yield ([get_sym(s)], nt_flag)
+ * else:
+ */
+ __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_span);
+ __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_span, ((PyObject*)__pyx_t_5));
+ __Pyx_GIVEREF(__pyx_t_5);
+ __pyx_t_5 = 0;
+ goto __pyx_L7;
+ }
+ __pyx_L7:;
+
+ /* "cdec/sa/rule.pxi":171
+ * yield (span, not nt_flag)
+ * span = []
+ * yield ([get_sym(s)], nt_flag) # <<<<<<<<<<<<<<
+ * else:
+ * span.append(get_sym(s))
+ */
+ __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_s); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_1 = __pyx_lambda_funcdef_lambda1(__pyx_cur_scope->__pyx_v_get_sym, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_1 = 0;
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
+ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_nt_flag);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_cur_scope->__pyx_v_nt_flag);
+ __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_nt_flag);
+ __pyx_t_5 = 0;
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ /* return from generator, yielding value */
+ __pyx_generator->resume_label = 2;
+ return __pyx_r;
+ __pyx_L9_resume_from_yield:;
+ __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L6;
+ }
+ /*else*/ {
+
+ /* "cdec/sa/rule.pxi":173
+ * yield ([get_sym(s)], nt_flag)
+ * else:
+ * span.append(get_sym(s)) # <<<<<<<<<<<<<<
+ * if len(span):
+ * yield (span, not nt_flag)
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_s); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_5 = __pyx_lambda_funcdef_lambda1(__pyx_cur_scope->__pyx_v_get_sym, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_6 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_span, __pyx_t_5); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ }
+ __pyx_L6:;
+ }
+
+ /* "cdec/sa/rule.pxi":174
+ * else:
+ * span.append(get_sym(s))
+ * if len(span): # <<<<<<<<<<<<<<
+ * yield (span, not nt_flag)
+ *
+ */
+ __pyx_t_4 = PyList_GET_SIZE(__pyx_cur_scope->__pyx_v_span); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = (__pyx_t_4 != 0);
+ if (__pyx_t_3) {
+
+ /* "cdec/sa/rule.pxi":175
+ * span.append(get_sym(s))
+ * if len(span):
+ * yield (span, not nt_flag) # <<<<<<<<<<<<<<
+ *
+ * cdef class Rule:
+ */
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_nt_flag); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyBool_FromLong((!__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_span);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_span);
+ __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_span);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ /* return from generator, yielding value */
+ __pyx_generator->resume_label = 3;
+ return __pyx_r;
+ __pyx_L11_resume_from_yield:;
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L10;
+ }
+ __pyx_L10:;
+
+ /* "cdec/sa/rule.pxi":158
+ * return [sym_tostring(w) for w in self if not sym_isvar(w)]
+ *
+ * def iterspans(self, nt_flag = False, to_str = True): # <<<<<<<<<<<<<<
+ * """iterate over (terminal and nonterminal) spans, it generates pairs of the kind (terminal span, !nt_flag) or (nonterminal, nt_flag)
+ * Example: iterspans(False, False) --> ([-1], False), ([2,3], True), ([-1], False), ([4], True), ([-1], False)
+ */
+
+ /* function exit code */
+ PyErr_SetNone(PyExc_StopIteration);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("iterspans", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_generator->resume_label = -1;
+ __Pyx_Generator_clear((PyObject*)__pyx_generator);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+}
-/* "rule.pxi":160
+/* "cdec/sa/rule.pxi":179
* cdef class Rule:
*
* def __cinit__(self, int lhs, Phrase f, Phrase e, scores=None, word_alignments=None): # <<<<<<<<<<<<<<
@@ -30780,12 +31304,12 @@ static int __pyx_pw_4cdec_2sa_3_sa_4Rule_1__cinit__(PyObject *__pyx_v_self, PyOb
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_e)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 3:
if (kw_args > 0) {
@@ -30799,7 +31323,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_4Rule_1__cinit__(PyObject *__pyx_v_self, PyOb
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -30812,7 +31336,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_4Rule_1__cinit__(PyObject *__pyx_v_self, PyOb
default: goto __pyx_L5_argtuple_error;
}
}
- __pyx_v_lhs = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_lhs == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_lhs = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_lhs == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_v_f = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)values[1]);
__pyx_v_e = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)values[2]);
__pyx_v_scores = values[3];
@@ -30820,14 +31344,14 @@ static int __pyx_pw_4cdec_2sa_3_sa_4Rule_1__cinit__(PyObject *__pyx_v_self, PyOb
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("cdec.sa._sa.Rule.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_4cdec_2sa_3_sa_Phrase, 1, "f", 0))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_e), __pyx_ptype_4cdec_2sa_3_sa_Phrase, 1, "e", 0))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_4cdec_2sa_3_sa_Phrase, 1, "f", 0))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_e), __pyx_ptype_4cdec_2sa_3_sa_Phrase, 1, "e", 0))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_r = __pyx_pf_4cdec_2sa_3_sa_4Rule___cinit__(((struct __pyx_obj_4cdec_2sa_3_sa_Rule *)__pyx_v_self), __pyx_v_lhs, __pyx_v_f, __pyx_v_e, __pyx_v_scores, __pyx_v_word_alignments);
/* function exit code */
@@ -30850,7 +31374,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_4Rule___cinit__(struct __pyx_obj_4cdec_2sa_3_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "rule.pxi":161
+ /* "cdec/sa/rule.pxi":180
*
* def __cinit__(self, int lhs, Phrase f, Phrase e, scores=None, word_alignments=None):
* if not sym_isvar(lhs): raise Exception('Invalid LHS symbol: %d' % lhs) # <<<<<<<<<<<<<<
@@ -30859,25 +31383,25 @@ static int __pyx_pf_4cdec_2sa_3_sa_4Rule___cinit__(struct __pyx_obj_4cdec_2sa_3_
*/
__pyx_t_1 = ((!(__pyx_f_4cdec_2sa_3_sa_sym_isvar(__pyx_v_lhs) != 0)) != 0);
if (__pyx_t_1) {
- __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_lhs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_lhs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_LHS_symbol_d, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_LHS_symbol_d, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[7]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[7]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- /* "rule.pxi":162
+ /* "cdec/sa/rule.pxi":181
* def __cinit__(self, int lhs, Phrase f, Phrase e, scores=None, word_alignments=None):
* if not sym_isvar(lhs): raise Exception('Invalid LHS symbol: %d' % lhs)
* self.lhs = lhs # <<<<<<<<<<<<<<
@@ -30886,7 +31410,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_4Rule___cinit__(struct __pyx_obj_4cdec_2sa_3_
*/
__pyx_v_self->lhs = __pyx_v_lhs;
- /* "rule.pxi":163
+ /* "cdec/sa/rule.pxi":182
* if not sym_isvar(lhs): raise Exception('Invalid LHS symbol: %d' % lhs)
* self.lhs = lhs
* self.f = f # <<<<<<<<<<<<<<
@@ -30899,7 +31423,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_4Rule___cinit__(struct __pyx_obj_4cdec_2sa_3_
__Pyx_DECREF(((PyObject *)__pyx_v_self->f));
__pyx_v_self->f = __pyx_v_f;
- /* "rule.pxi":164
+ /* "cdec/sa/rule.pxi":183
* self.lhs = lhs
* self.f = f
* self.e = e # <<<<<<<<<<<<<<
@@ -30912,7 +31436,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_4Rule___cinit__(struct __pyx_obj_4cdec_2sa_3_
__Pyx_DECREF(((PyObject *)__pyx_v_self->e));
__pyx_v_self->e = __pyx_v_e;
- /* "rule.pxi":165
+ /* "cdec/sa/rule.pxi":184
* self.f = f
* self.e = e
* self.word_alignments = word_alignments # <<<<<<<<<<<<<<
@@ -30925,14 +31449,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_4Rule___cinit__(struct __pyx_obj_4cdec_2sa_3_
__Pyx_DECREF(__pyx_v_self->word_alignments);
__pyx_v_self->word_alignments = __pyx_v_word_alignments;
- /* "rule.pxi":166
+ /* "cdec/sa/rule.pxi":185
* self.e = e
* self.word_alignments = word_alignments
* self.scores = scores # <<<<<<<<<<<<<<
*
* def __hash__(self):
*/
- if (!(likely(((__pyx_v_scores) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_scores, __pyx_ptype_4cdec_2sa_3_sa_FeatureVector))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_v_scores) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_scores, __pyx_ptype_4cdec_2sa_3_sa_FeatureVector))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_3 = __pyx_v_scores;
__Pyx_INCREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
@@ -30941,7 +31465,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_4Rule___cinit__(struct __pyx_obj_4cdec_2sa_3_
__pyx_v_self->scores = ((struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *)__pyx_t_3);
__pyx_t_3 = 0;
- /* "rule.pxi":160
+ /* "cdec/sa/rule.pxi":179
* cdef class Rule:
*
* def __cinit__(self, int lhs, Phrase f, Phrase e, scores=None, word_alignments=None): # <<<<<<<<<<<<<<
@@ -30962,7 +31486,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_4Rule___cinit__(struct __pyx_obj_4cdec_2sa_3_
return __pyx_r;
}
-/* "rule.pxi":168
+/* "cdec/sa/rule.pxi":187
* self.scores = scores
*
* def __hash__(self): # <<<<<<<<<<<<<<
@@ -30994,16 +31518,16 @@ static Py_hash_t __pyx_pf_4cdec_2sa_3_sa_4Rule_2__hash__(struct __pyx_obj_4cdec_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__hash__", 0);
- /* "rule.pxi":169
+ /* "cdec/sa/rule.pxi":188
*
* def __hash__(self):
* return hash((self.lhs, self.f, self.e)) # <<<<<<<<<<<<<<
*
* def __cmp__(self, Rule other):
*/
- __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->lhs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->lhs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
@@ -31014,12 +31538,12 @@ static Py_hash_t __pyx_pf_4cdec_2sa_3_sa_4Rule_2__hash__(struct __pyx_obj_4cdec_
PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_self->e));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self->e));
__pyx_t_1 = 0;
- __pyx_t_3 = PyObject_Hash(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Hash(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_3;
goto __pyx_L0;
- /* "rule.pxi":168
+ /* "cdec/sa/rule.pxi":187
* self.scores = scores
*
* def __hash__(self): # <<<<<<<<<<<<<<
@@ -31039,7 +31563,7 @@ static Py_hash_t __pyx_pf_4cdec_2sa_3_sa_4Rule_2__hash__(struct __pyx_obj_4cdec_
return __pyx_r;
}
-/* "rule.pxi":171
+/* "cdec/sa/rule.pxi":190
* return hash((self.lhs, self.f, self.e))
*
* def __cmp__(self, Rule other): # <<<<<<<<<<<<<<
@@ -31057,7 +31581,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_4Rule_5__cmp__(PyObject *__pyx_v_self, PyObje
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cmp__ (wrapper)", 0);
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_4cdec_2sa_3_sa_Rule, 1, "other", 0))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_4cdec_2sa_3_sa_Rule, 1, "other", 0))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_r = __pyx_pf_4cdec_2sa_3_sa_4Rule_4__cmp__(((struct __pyx_obj_4cdec_2sa_3_sa_Rule *)__pyx_v_self), ((struct __pyx_obj_4cdec_2sa_3_sa_Rule *)__pyx_v_other));
/* function exit code */
@@ -31083,16 +31607,16 @@ static int __pyx_pf_4cdec_2sa_3_sa_4Rule_4__cmp__(struct __pyx_obj_4cdec_2sa_3_s
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cmp__", 0);
- /* "rule.pxi":172
+ /* "cdec/sa/rule.pxi":191
*
* def __cmp__(self, Rule other):
* return cmp((self.lhs, self.f, self.e, self.word_alignments), # <<<<<<<<<<<<<<
* (other.lhs, other.f, other.e, self.word_alignments))
*
*/
- __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->lhs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->lhs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
@@ -31107,16 +31631,16 @@ static int __pyx_pf_4cdec_2sa_3_sa_4Rule_4__cmp__(struct __pyx_obj_4cdec_2sa_3_s
__Pyx_GIVEREF(__pyx_v_self->word_alignments);
__pyx_t_1 = 0;
- /* "rule.pxi":173
+ /* "cdec/sa/rule.pxi":192
* def __cmp__(self, Rule other):
* return cmp((self.lhs, self.f, self.e, self.word_alignments),
* (other.lhs, other.f, other.e, self.word_alignments)) # <<<<<<<<<<<<<<
*
* def fmerge(self, Phrase f):
*/
- __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_other->lhs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_other->lhs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
@@ -31131,14 +31655,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_4Rule_4__cmp__(struct __pyx_obj_4cdec_2sa_3_s
__Pyx_GIVEREF(__pyx_v_self->word_alignments);
__pyx_t_1 = 0;
- /* "rule.pxi":172
+ /* "cdec/sa/rule.pxi":191
*
* def __cmp__(self, Rule other):
* return cmp((self.lhs, self.f, self.e, self.word_alignments), # <<<<<<<<<<<<<<
* (other.lhs, other.f, other.e, self.word_alignments))
*
*/
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
@@ -31146,15 +31670,15 @@ static int __pyx_pf_4cdec_2sa_3_sa_4Rule_4__cmp__(struct __pyx_obj_4cdec_2sa_3_s
__Pyx_GIVEREF(__pyx_t_3);
__pyx_t_2 = 0;
__pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_cmp, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_cmp, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_4;
goto __pyx_L0;
- /* "rule.pxi":171
+ /* "cdec/sa/rule.pxi":190
* return hash((self.lhs, self.f, self.e))
*
* def __cmp__(self, Rule other): # <<<<<<<<<<<<<<
@@ -31175,7 +31699,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_4Rule_4__cmp__(struct __pyx_obj_4cdec_2sa_3_s
}
#endif /*!(#if PY_MAJOR_VERSION < 3)*/
-/* "rule.pxi":175
+/* "cdec/sa/rule.pxi":194
* (other.lhs, other.f, other.e, self.word_alignments))
*
* def fmerge(self, Phrase f): # <<<<<<<<<<<<<<
@@ -31192,7 +31716,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_4Rule_7fmerge(PyObject *__pyx_v_self, P
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("fmerge (wrapper)", 0);
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_4cdec_2sa_3_sa_Phrase, 1, "f", 0))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_4cdec_2sa_3_sa_Phrase, 1, "f", 0))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_r = __pyx_pf_4cdec_2sa_3_sa_4Rule_6fmerge(((struct __pyx_obj_4cdec_2sa_3_sa_Rule *)__pyx_v_self), ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_v_f));
/* function exit code */
@@ -31214,19 +31738,19 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_4Rule_6fmerge(struct __pyx_obj_4cdec_2s
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("fmerge", 0);
- /* "rule.pxi":176
+ /* "cdec/sa/rule.pxi":195
*
* def fmerge(self, Phrase f):
* if self.f == f: # <<<<<<<<<<<<<<
* self.f = f
*
*/
- __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_self->f), ((PyObject *)__pyx_v_f), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_self->f), ((PyObject *)__pyx_v_f), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
- /* "rule.pxi":177
+ /* "cdec/sa/rule.pxi":196
* def fmerge(self, Phrase f):
* if self.f == f:
* self.f = f # <<<<<<<<<<<<<<
@@ -31242,7 +31766,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_4Rule_6fmerge(struct __pyx_obj_4cdec_2s
}
__pyx_L3:;
- /* "rule.pxi":175
+ /* "cdec/sa/rule.pxi":194
* (other.lhs, other.f, other.e, self.word_alignments))
*
* def fmerge(self, Phrase f): # <<<<<<<<<<<<<<
@@ -31263,7 +31787,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_4Rule_6fmerge(struct __pyx_obj_4cdec_2s
return __pyx_r;
}
-/* "rule.pxi":179
+/* "cdec/sa/rule.pxi":198
* self.f = f
*
* def arity(self): # <<<<<<<<<<<<<<
@@ -31295,7 +31819,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_4Rule_8arity(struct __pyx_obj_4cdec_2sa
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("arity", 0);
- /* "rule.pxi":180
+ /* "cdec/sa/rule.pxi":199
*
* def arity(self):
* return self.f.arity() # <<<<<<<<<<<<<<
@@ -31303,7 +31827,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_4Rule_8arity(struct __pyx_obj_4cdec_2sa
* def __str__(self):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->f), __pyx_n_s_arity); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->f), __pyx_n_s_arity); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
@@ -31316,10 +31840,10 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_4Rule_8arity(struct __pyx_obj_4cdec_2sa
}
}
if (__pyx_t_3) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else {
- __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -31327,7 +31851,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_4Rule_8arity(struct __pyx_obj_4cdec_2sa
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "rule.pxi":179
+ /* "cdec/sa/rule.pxi":198
* self.f = f
*
* def arity(self): # <<<<<<<<<<<<<<
@@ -31348,7 +31872,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_4Rule_8arity(struct __pyx_obj_4cdec_2sa
return __pyx_r;
}
-/* "rule.pxi":182
+/* "cdec/sa/rule.pxi":201
* return self.f.arity()
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -31368,9 +31892,9 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_4Rule_11__str__(PyObject *__pyx_v_self)
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_2sa_3_sa_4Rule_7__str___2generator13(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4cdec_2sa_3_sa_4Rule_7__str___2generator14(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-/* "rule.pxi":186
+/* "cdec/sa/rule.pxi":205
* fields = [sym_tostring(self.lhs), str(self.f), str(self.e), str(self.scores)]
* if self.word_alignments is not None:
* fields.append(' '.join('%d-%d' % a for a in self.alignments())) # <<<<<<<<<<<<<<
@@ -31379,24 +31903,24 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_4Rule_7__str___2generator13(__pyx_Gener
*/
static PyObject *__pyx_pf_4cdec_2sa_3_sa_4Rule_7__str___genexpr(PyObject *__pyx_self) {
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr *__pyx_cur_scope;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_genexpr *__pyx_cur_scope;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("genexpr", 0);
- __pyx_cur_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr *)__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr(__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr, __pyx_empty_tuple, NULL);
+ __pyx_cur_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_genexpr *)__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_18_genexpr(__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_18_genexpr, __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_cur_scope)) {
__Pyx_RefNannyFinishContext();
return NULL;
}
__Pyx_GOTREF(__pyx_cur_scope);
- __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ *) __pyx_self;
+ __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17___str__ *) __pyx_self;
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
{
- __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_4Rule_7__str___2generator13, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_str___locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_4Rule_7__str___2generator14, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_str___locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_cur_scope);
__Pyx_RefNannyFinishContext();
return (PyObject *) gen;
@@ -31412,9 +31936,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_4Rule_7__str___genexpr(PyObject *__pyx_
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_2sa_3_sa_4Rule_7__str___2generator13(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4cdec_2sa_3_sa_4Rule_7__str___2generator14(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr *)__pyx_generator->closure);
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_genexpr *)__pyx_generator->closure);
PyObject *__pyx_r = NULL;
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
@@ -31434,9 +31958,9 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_4Rule_7__str___2generator13(__pyx_Gener
return NULL;
}
__pyx_L3_first_run:;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self), __pyx_n_s_alignments); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self), __pyx_n_s_alignments); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
@@ -31449,10 +31973,10 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_4Rule_7__str___2generator13(__pyx_Gener
}
}
if (__pyx_t_3) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else {
- __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -31460,9 +31984,9 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_4Rule_7__str___2generator13(__pyx_Gener
__pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
__pyx_t_5 = NULL;
} else {
- __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
for (;;) {
@@ -31470,16 +31994,16 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_4Rule_7__str___2generator13(__pyx_Gener
if (likely(PyList_CheckExact(__pyx_t_2))) {
if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
}
} else {
@@ -31488,7 +32012,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_4Rule_7__str___2generator13(__pyx_Gener
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[7]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -31498,7 +32022,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_4Rule_7__str___2generator13(__pyx_Gener
__Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_a, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_d_d_2, __pyx_cur_scope->__pyx_v_a); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_d_d_2, __pyx_cur_scope->__pyx_v_a); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -31517,7 +32041,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_4Rule_7__str___2generator13(__pyx_Gener
__Pyx_XGOTREF(__pyx_t_2);
__pyx_t_4 = __pyx_cur_scope->__pyx_t_1;
__pyx_t_5 = __pyx_cur_scope->__pyx_t_2;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -31537,7 +32061,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_4Rule_7__str___2generator13(__pyx_Gener
return NULL;
}
-/* "rule.pxi":182
+/* "cdec/sa/rule.pxi":201
* return self.f.arity()
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -31546,7 +32070,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_4Rule_7__str___2generator13(__pyx_Gener
*/
static PyObject *__pyx_pf_4cdec_2sa_3_sa_4Rule_10__str__(struct __pyx_obj_4cdec_2sa_3_sa_Rule *__pyx_v_self) {
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ *__pyx_cur_scope;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17___str__ *__pyx_cur_scope;
PyObject *__pyx_v_fields = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
@@ -31562,7 +32086,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_4Rule_10__str__(struct __pyx_obj_4cdec_
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__str__", 0);
- __pyx_cur_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ *)__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_16___str__(__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_16___str__, __pyx_empty_tuple, NULL);
+ __pyx_cur_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17___str__ *)__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_17___str__(__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_17___str__, __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_cur_scope)) {
__Pyx_RefNannyFinishContext();
return NULL;
@@ -31572,40 +32096,40 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_4Rule_10__str__(struct __pyx_obj_4cdec_
__Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
__Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
- /* "rule.pxi":184
+ /* "cdec/sa/rule.pxi":203
* def __str__(self):
* cdef unsigned i
* fields = [sym_tostring(self.lhs), str(self.f), str(self.e), str(self.scores)] # <<<<<<<<<<<<<<
* if self.word_alignments is not None:
* fields.append(' '.join('%d-%d' % a for a in self.alignments()))
*/
- __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_f_4cdec_2sa_3_sa_sym_tostring(__pyx_cur_scope->__pyx_v_self->lhs)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_f_4cdec_2sa_3_sa_sym_tostring(__pyx_cur_scope->__pyx_v_self->lhs)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 203; __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[7]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->f));
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_self->f));
__Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->f));
- __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->e));
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_self->e));
__Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->e));
- __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->scores));
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_self->scores));
__Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->scores));
- __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyList_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyList_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
@@ -31622,7 +32146,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_4Rule_10__str__(struct __pyx_obj_4cdec_
__pyx_v_fields = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
- /* "rule.pxi":185
+ /* "cdec/sa/rule.pxi":204
* cdef unsigned i
* fields = [sym_tostring(self.lhs), str(self.f), str(self.e), str(self.scores)]
* if self.word_alignments is not None: # <<<<<<<<<<<<<<
@@ -31633,25 +32157,25 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_4Rule_10__str__(struct __pyx_obj_4cdec_
__pyx_t_7 = (__pyx_t_6 != 0);
if (__pyx_t_7) {
- /* "rule.pxi":186
+ /* "cdec/sa/rule.pxi":205
* fields = [sym_tostring(self.lhs), str(self.f), str(self.e), str(self.scores)]
* if self.word_alignments is not None:
* fields.append(' '.join('%d-%d' % a for a in self.alignments())) # <<<<<<<<<<<<<<
* return ' ||| '.join(fields)
*
*/
- __pyx_t_2 = __pyx_pf_4cdec_2sa_3_sa_4Rule_7__str___genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_pf_4cdec_2sa_3_sa_4Rule_7__str___genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = __Pyx_PyString_Join(__pyx_kp_s__46, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyString_Join(__pyx_kp_s__46, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_fields, __pyx_t_5); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_fields, __pyx_t_5); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
goto __pyx_L3;
}
__pyx_L3:;
- /* "rule.pxi":187
+ /* "cdec/sa/rule.pxi":206
* if self.word_alignments is not None:
* fields.append(' '.join('%d-%d' % a for a in self.alignments()))
* return ' ||| '.join(fields) # <<<<<<<<<<<<<<
@@ -31659,13 +32183,13 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_4Rule_10__str__(struct __pyx_obj_4cdec_
* def alignments(self):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_5 = __Pyx_PyString_Join(__pyx_kp_s__10, __pyx_v_fields); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyString_Join(__pyx_kp_s__10, __pyx_v_fields); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L0;
- /* "rule.pxi":182
+ /* "cdec/sa/rule.pxi":201
* return self.f.arity()
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -31689,9 +32213,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_4Rule_10__str__(struct __pyx_obj_4cdec_
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_2sa_3_sa_4Rule_14generator3(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4cdec_2sa_3_sa_4Rule_14generator4(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-/* "rule.pxi":189
+/* "cdec/sa/rule.pxi":208
* return ' ||| '.join(fields)
*
* def alignments(self): # <<<<<<<<<<<<<<
@@ -31713,14 +32237,14 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_4Rule_13alignments(PyObject *__pyx_v_se
}
static PyObject *__pyx_pf_4cdec_2sa_3_sa_4Rule_12alignments(struct __pyx_obj_4cdec_2sa_3_sa_Rule *__pyx_v_self) {
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments *__pyx_cur_scope;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_alignments *__pyx_cur_scope;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("alignments", 0);
- __pyx_cur_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments *)__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments(__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments, __pyx_empty_tuple, NULL);
+ __pyx_cur_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_alignments *)__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_19_alignments(__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_19_alignments, __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_cur_scope)) {
__Pyx_RefNannyFinishContext();
return NULL;
@@ -31730,7 +32254,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_4Rule_12alignments(struct __pyx_obj_4cd
__Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
__Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
{
- __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_4Rule_14generator3, (PyObject *) __pyx_cur_scope, __pyx_n_s_alignments, __pyx_n_s_Rule_alignments); if (unlikely(!gen)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_4Rule_14generator4, (PyObject *) __pyx_cur_scope, __pyx_n_s_alignments, __pyx_n_s_Rule_alignments); if (unlikely(!gen)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_cur_scope);
__Pyx_RefNannyFinishContext();
return (PyObject *) gen;
@@ -31746,9 +32270,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_4Rule_12alignments(struct __pyx_obj_4cd
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_2sa_3_sa_4Rule_14generator3(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4cdec_2sa_3_sa_4Rule_14generator4(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments *__pyx_cur_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments *)__pyx_generator->closure);
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_alignments *__pyx_cur_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_alignments *)__pyx_generator->closure);
PyObject *__pyx_r = NULL;
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
@@ -31769,9 +32293,9 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_4Rule_14generator3(__pyx_GeneratorObjec
return NULL;
}
__pyx_L3_first_run:;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "rule.pxi":190
+ /* "cdec/sa/rule.pxi":209
*
* def alignments(self):
* for point in self.word_alignments: # <<<<<<<<<<<<<<
@@ -31781,25 +32305,25 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_4Rule_14generator3(__pyx_GeneratorObjec
__pyx_t_1 = __pyx_cur_scope->__pyx_v_self->word_alignments; __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_v_self->word_alignments); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_self->word_alignments); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
for (;;) {
if (likely(!__pyx_t_3)) {
if (likely(PyList_CheckExact(__pyx_t_1))) {
if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 190; __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[7]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 190; __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[7]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 190; __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[7]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 190; __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[7]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
}
} else {
@@ -31808,7 +32332,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_4Rule_14generator3(__pyx_GeneratorObjec
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[7]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[7]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -31819,22 +32343,22 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_4Rule_14generator3(__pyx_GeneratorObjec
__Pyx_GIVEREF(__pyx_t_4);
__pyx_t_4 = 0;
- /* "rule.pxi":191
+ /* "cdec/sa/rule.pxi":210
* def alignments(self):
* for point in self.word_alignments:
* yield point / ALIGNMENT_CODE, point % ALIGNMENT_CODE # <<<<<<<<<<<<<<
*/
- __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_4cdec_2sa_3_sa_ALIGNMENT_CODE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_4cdec_2sa_3_sa_ALIGNMENT_CODE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_cur_scope->__pyx_v_point, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_cur_scope->__pyx_v_point, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 210; __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_PyInt_From_int(__pyx_v_4cdec_2sa_3_sa_ALIGNMENT_CODE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_4cdec_2sa_3_sa_ALIGNMENT_CODE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = PyNumber_Remainder(__pyx_cur_scope->__pyx_v_point, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyNumber_Remainder(__pyx_cur_scope->__pyx_v_point, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_5);
@@ -31859,9 +32383,9 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_4Rule_14generator3(__pyx_GeneratorObjec
__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[7]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "rule.pxi":190
+ /* "cdec/sa/rule.pxi":209
*
* def alignments(self):
* for point in self.word_alignments: # <<<<<<<<<<<<<<
@@ -31870,7 +32394,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_4Rule_14generator3(__pyx_GeneratorObjec
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "rule.pxi":189
+ /* "cdec/sa/rule.pxi":208
* return ' ||| '.join(fields)
*
* def alignments(self): # <<<<<<<<<<<<<<
@@ -31961,7 +32485,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_4Rule_1e___get__(struct __pyx_obj_4cdec
return __pyx_r;
}
-/* "precomputation.pxi":21
+/* "cdec/sa/precomputation.pxi":21
* int arr_len
*
* cdef _Trie_Node* new_trie_node(): # <<<<<<<<<<<<<<
@@ -31975,7 +32499,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_new_trie
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("new_trie_node", 0);
- /* "precomputation.pxi":23
+ /* "cdec/sa/precomputation.pxi":23
* cdef _Trie_Node* new_trie_node():
* cdef _Trie_Node* node
* node = <_Trie_Node*> malloc(sizeof(_Trie_Node)) # <<<<<<<<<<<<<<
@@ -31984,7 +32508,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_new_trie
*/
__pyx_v_node = ((struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *)malloc((sizeof(struct __pyx_t_4cdec_2sa_3_sa__Trie_Node))));
- /* "precomputation.pxi":24
+ /* "cdec/sa/precomputation.pxi":24
* cdef _Trie_Node* node
* node = <_Trie_Node*> malloc(sizeof(_Trie_Node))
* node.root = NULL # <<<<<<<<<<<<<<
@@ -31993,7 +32517,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_new_trie
*/
__pyx_v_node->root = NULL;
- /* "precomputation.pxi":25
+ /* "cdec/sa/precomputation.pxi":25
* node = <_Trie_Node*> malloc(sizeof(_Trie_Node))
* node.root = NULL
* node.arr_len = 0 # <<<<<<<<<<<<<<
@@ -32002,7 +32526,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_new_trie
*/
__pyx_v_node->arr_len = 0;
- /* "precomputation.pxi":26
+ /* "cdec/sa/precomputation.pxi":26
* node.root = NULL
* node.arr_len = 0
* node.arr = <int*> malloc(sizeof(0*sizeof(int))) # <<<<<<<<<<<<<<
@@ -32011,7 +32535,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_new_trie
*/
__pyx_v_node->arr = ((int *)malloc((sizeof((0 * (sizeof(int)))))));
- /* "precomputation.pxi":27
+ /* "cdec/sa/precomputation.pxi":27
* node.arr_len = 0
* node.arr = <int*> malloc(sizeof(0*sizeof(int)))
* return node # <<<<<<<<<<<<<<
@@ -32021,7 +32545,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_new_trie
__pyx_r = __pyx_v_node;
goto __pyx_L0;
- /* "precomputation.pxi":21
+ /* "cdec/sa/precomputation.pxi":21
* int arr_len
*
* cdef _Trie_Node* new_trie_node(): # <<<<<<<<<<<<<<
@@ -32035,7 +32559,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_new_trie
return __pyx_r;
}
-/* "precomputation.pxi":29
+/* "cdec/sa/precomputation.pxi":29
* return node
*
* cdef _Trie_Edge* new_trie_edge(int val): # <<<<<<<<<<<<<<
@@ -32049,7 +32573,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Edge *__pyx_f_4cdec_2sa_3_sa_new_trie
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("new_trie_edge", 0);
- /* "precomputation.pxi":31
+ /* "cdec/sa/precomputation.pxi":31
* cdef _Trie_Edge* new_trie_edge(int val):
* cdef _Trie_Edge* edge
* edge = <_Trie_Edge*> malloc(sizeof(_Trie_Edge)) # <<<<<<<<<<<<<<
@@ -32058,7 +32582,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Edge *__pyx_f_4cdec_2sa_3_sa_new_trie
*/
__pyx_v_edge = ((struct __pyx_t_4cdec_2sa_3_sa__Trie_Edge *)malloc((sizeof(struct __pyx_t_4cdec_2sa_3_sa__Trie_Edge))));
- /* "precomputation.pxi":32
+ /* "cdec/sa/precomputation.pxi":32
* cdef _Trie_Edge* edge
* edge = <_Trie_Edge*> malloc(sizeof(_Trie_Edge))
* edge.node = new_trie_node() # <<<<<<<<<<<<<<
@@ -32067,7 +32591,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Edge *__pyx_f_4cdec_2sa_3_sa_new_trie
*/
__pyx_v_edge->node = __pyx_f_4cdec_2sa_3_sa_new_trie_node();
- /* "precomputation.pxi":33
+ /* "cdec/sa/precomputation.pxi":33
* edge = <_Trie_Edge*> malloc(sizeof(_Trie_Edge))
* edge.node = new_trie_node()
* edge.bigger = NULL # <<<<<<<<<<<<<<
@@ -32076,7 +32600,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Edge *__pyx_f_4cdec_2sa_3_sa_new_trie
*/
__pyx_v_edge->bigger = NULL;
- /* "precomputation.pxi":34
+ /* "cdec/sa/precomputation.pxi":34
* edge.node = new_trie_node()
* edge.bigger = NULL
* edge.smaller = NULL # <<<<<<<<<<<<<<
@@ -32085,7 +32609,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Edge *__pyx_f_4cdec_2sa_3_sa_new_trie
*/
__pyx_v_edge->smaller = NULL;
- /* "precomputation.pxi":35
+ /* "cdec/sa/precomputation.pxi":35
* edge.bigger = NULL
* edge.smaller = NULL
* edge.val = val # <<<<<<<<<<<<<<
@@ -32094,7 +32618,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Edge *__pyx_f_4cdec_2sa_3_sa_new_trie
*/
__pyx_v_edge->val = __pyx_v_val;
- /* "precomputation.pxi":36
+ /* "cdec/sa/precomputation.pxi":36
* edge.smaller = NULL
* edge.val = val
* return edge # <<<<<<<<<<<<<<
@@ -32104,7 +32628,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Edge *__pyx_f_4cdec_2sa_3_sa_new_trie
__pyx_r = __pyx_v_edge;
goto __pyx_L0;
- /* "precomputation.pxi":29
+ /* "cdec/sa/precomputation.pxi":29
* return node
*
* cdef _Trie_Edge* new_trie_edge(int val): # <<<<<<<<<<<<<<
@@ -32118,7 +32642,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Edge *__pyx_f_4cdec_2sa_3_sa_new_trie
return __pyx_r;
}
-/* "precomputation.pxi":38
+/* "cdec/sa/precomputation.pxi":38
* return edge
*
* cdef free_trie_node(_Trie_Node* node): # <<<<<<<<<<<<<<
@@ -32136,7 +32660,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_free_trie_node(struct __pyx_t_4cdec_2sa_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("free_trie_node", 0);
- /* "precomputation.pxi":39
+ /* "cdec/sa/precomputation.pxi":39
*
* cdef free_trie_node(_Trie_Node* node):
* if node != NULL: # <<<<<<<<<<<<<<
@@ -32146,7 +32670,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_free_trie_node(struct __pyx_t_4cdec_2sa_
__pyx_t_1 = ((__pyx_v_node != NULL) != 0);
if (__pyx_t_1) {
- /* "precomputation.pxi":40
+ /* "cdec/sa/precomputation.pxi":40
* cdef free_trie_node(_Trie_Node* node):
* if node != NULL:
* free_trie_edge(node.root) # <<<<<<<<<<<<<<
@@ -32157,7 +32681,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_free_trie_node(struct __pyx_t_4cdec_2sa_
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "precomputation.pxi":41
+ /* "cdec/sa/precomputation.pxi":41
* if node != NULL:
* free_trie_edge(node.root)
* free(node.arr) # <<<<<<<<<<<<<<
@@ -32169,7 +32693,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_free_trie_node(struct __pyx_t_4cdec_2sa_
}
__pyx_L3:;
- /* "precomputation.pxi":38
+ /* "cdec/sa/precomputation.pxi":38
* return edge
*
* cdef free_trie_node(_Trie_Node* node): # <<<<<<<<<<<<<<
@@ -32190,7 +32714,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_free_trie_node(struct __pyx_t_4cdec_2sa_
return __pyx_r;
}
-/* "precomputation.pxi":43
+/* "cdec/sa/precomputation.pxi":43
* free(node.arr)
*
* cdef free_trie_edge(_Trie_Edge* edge): # <<<<<<<<<<<<<<
@@ -32208,7 +32732,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_free_trie_edge(struct __pyx_t_4cdec_2sa_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("free_trie_edge", 0);
- /* "precomputation.pxi":44
+ /* "cdec/sa/precomputation.pxi":44
*
* cdef free_trie_edge(_Trie_Edge* edge):
* if edge != NULL: # <<<<<<<<<<<<<<
@@ -32218,7 +32742,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_free_trie_edge(struct __pyx_t_4cdec_2sa_
__pyx_t_1 = ((__pyx_v_edge != NULL) != 0);
if (__pyx_t_1) {
- /* "precomputation.pxi":45
+ /* "cdec/sa/precomputation.pxi":45
* cdef free_trie_edge(_Trie_Edge* edge):
* if edge != NULL:
* free_trie_node(edge.node) # <<<<<<<<<<<<<<
@@ -32229,7 +32753,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_free_trie_edge(struct __pyx_t_4cdec_2sa_
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "precomputation.pxi":46
+ /* "cdec/sa/precomputation.pxi":46
* if edge != NULL:
* free_trie_node(edge.node)
* free_trie_edge(edge.bigger) # <<<<<<<<<<<<<<
@@ -32240,7 +32764,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_free_trie_edge(struct __pyx_t_4cdec_2sa_
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "precomputation.pxi":47
+ /* "cdec/sa/precomputation.pxi":47
* free_trie_node(edge.node)
* free_trie_edge(edge.bigger)
* free_trie_edge(edge.smaller) # <<<<<<<<<<<<<<
@@ -32254,7 +32778,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_free_trie_edge(struct __pyx_t_4cdec_2sa_
}
__pyx_L3:;
- /* "precomputation.pxi":43
+ /* "cdec/sa/precomputation.pxi":43
* free(node.arr)
*
* cdef free_trie_edge(_Trie_Edge* edge): # <<<<<<<<<<<<<<
@@ -32275,7 +32799,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_free_trie_edge(struct __pyx_t_4cdec_2sa_
return __pyx_r;
}
-/* "precomputation.pxi":49
+/* "cdec/sa/precomputation.pxi":49
* free_trie_edge(edge.smaller)
*
* cdef _Trie_Node* trie_find(_Trie_Node* node, int val): # <<<<<<<<<<<<<<
@@ -32292,7 +32816,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_trie_fin
int __pyx_t_3;
__Pyx_RefNannySetupContext("trie_find", 0);
- /* "precomputation.pxi":51
+ /* "cdec/sa/precomputation.pxi":51
* cdef _Trie_Node* trie_find(_Trie_Node* node, int val):
* cdef _Trie_Edge* cur
* cur = node.root # <<<<<<<<<<<<<<
@@ -32302,7 +32826,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_trie_fin
__pyx_t_1 = __pyx_v_node->root;
__pyx_v_cur = __pyx_t_1;
- /* "precomputation.pxi":52
+ /* "cdec/sa/precomputation.pxi":52
* cdef _Trie_Edge* cur
* cur = node.root
* while cur != NULL and cur.val != val: # <<<<<<<<<<<<<<
@@ -32323,7 +32847,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_trie_fin
__pyx_L5_bool_binop_done:;
if (!__pyx_t_2) break;
- /* "precomputation.pxi":53
+ /* "cdec/sa/precomputation.pxi":53
* cur = node.root
* while cur != NULL and cur.val != val:
* if val > cur.val: # <<<<<<<<<<<<<<
@@ -32333,7 +32857,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_trie_fin
__pyx_t_2 = ((__pyx_v_val > __pyx_v_cur->val) != 0);
if (__pyx_t_2) {
- /* "precomputation.pxi":54
+ /* "cdec/sa/precomputation.pxi":54
* while cur != NULL and cur.val != val:
* if val > cur.val:
* cur = cur.bigger # <<<<<<<<<<<<<<
@@ -32345,7 +32869,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_trie_fin
goto __pyx_L7;
}
- /* "precomputation.pxi":55
+ /* "cdec/sa/precomputation.pxi":55
* if val > cur.val:
* cur = cur.bigger
* elif val < cur.val: # <<<<<<<<<<<<<<
@@ -32355,7 +32879,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_trie_fin
__pyx_t_2 = ((__pyx_v_val < __pyx_v_cur->val) != 0);
if (__pyx_t_2) {
- /* "precomputation.pxi":56
+ /* "cdec/sa/precomputation.pxi":56
* cur = cur.bigger
* elif val < cur.val:
* cur = cur.smaller # <<<<<<<<<<<<<<
@@ -32369,7 +32893,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_trie_fin
__pyx_L7:;
}
- /* "precomputation.pxi":57
+ /* "cdec/sa/precomputation.pxi":57
* elif val < cur.val:
* cur = cur.smaller
* if cur == NULL: # <<<<<<<<<<<<<<
@@ -32379,7 +32903,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_trie_fin
__pyx_t_2 = ((__pyx_v_cur == NULL) != 0);
if (__pyx_t_2) {
- /* "precomputation.pxi":58
+ /* "cdec/sa/precomputation.pxi":58
* cur = cur.smaller
* if cur == NULL:
* return NULL # <<<<<<<<<<<<<<
@@ -32391,7 +32915,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_trie_fin
}
/*else*/ {
- /* "precomputation.pxi":60
+ /* "cdec/sa/precomputation.pxi":60
* return NULL
* else:
* return cur.node # <<<<<<<<<<<<<<
@@ -32402,7 +32926,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_trie_fin
goto __pyx_L0;
}
- /* "precomputation.pxi":49
+ /* "cdec/sa/precomputation.pxi":49
* free_trie_edge(edge.smaller)
*
* cdef _Trie_Node* trie_find(_Trie_Node* node, int val): # <<<<<<<<<<<<<<
@@ -32416,7 +32940,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_trie_fin
return __pyx_r;
}
-/* "precomputation.pxi":62
+/* "cdec/sa/precomputation.pxi":62
* return cur.node
*
* cdef trie_node_data_append(_Trie_Node* node, int val): # <<<<<<<<<<<<<<
@@ -32430,7 +32954,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_node_data_append(struct __pyx_t_4cd
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("trie_node_data_append", 0);
- /* "precomputation.pxi":64
+ /* "cdec/sa/precomputation.pxi":64
* cdef trie_node_data_append(_Trie_Node* node, int val):
* cdef int new_len
* new_len = node.arr_len + 1 # <<<<<<<<<<<<<<
@@ -32439,7 +32963,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_node_data_append(struct __pyx_t_4cd
*/
__pyx_v_new_len = (__pyx_v_node->arr_len + 1);
- /* "precomputation.pxi":65
+ /* "cdec/sa/precomputation.pxi":65
* cdef int new_len
* new_len = node.arr_len + 1
* node.arr = <int*> realloc(node.arr, new_len*sizeof(int)) # <<<<<<<<<<<<<<
@@ -32448,7 +32972,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_node_data_append(struct __pyx_t_4cd
*/
__pyx_v_node->arr = ((int *)realloc(__pyx_v_node->arr, (__pyx_v_new_len * (sizeof(int)))));
- /* "precomputation.pxi":66
+ /* "cdec/sa/precomputation.pxi":66
* new_len = node.arr_len + 1
* node.arr = <int*> realloc(node.arr, new_len*sizeof(int))
* node.arr[node.arr_len] = val # <<<<<<<<<<<<<<
@@ -32457,7 +32981,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_node_data_append(struct __pyx_t_4cd
*/
(__pyx_v_node->arr[__pyx_v_node->arr_len]) = __pyx_v_val;
- /* "precomputation.pxi":67
+ /* "cdec/sa/precomputation.pxi":67
* node.arr = <int*> realloc(node.arr, new_len*sizeof(int))
* node.arr[node.arr_len] = val
* node.arr_len = new_len # <<<<<<<<<<<<<<
@@ -32466,7 +32990,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_node_data_append(struct __pyx_t_4cd
*/
__pyx_v_node->arr_len = __pyx_v_new_len;
- /* "precomputation.pxi":62
+ /* "cdec/sa/precomputation.pxi":62
* return cur.node
*
* cdef trie_node_data_append(_Trie_Node* node, int val): # <<<<<<<<<<<<<<
@@ -32481,7 +33005,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_node_data_append(struct __pyx_t_4cd
return __pyx_r;
}
-/* "precomputation.pxi":69
+/* "cdec/sa/precomputation.pxi":69
* node.arr_len = new_len
*
* cdef trie_node_data_extend(_Trie_Node* node, int* vals, int num_vals): # <<<<<<<<<<<<<<
@@ -32495,7 +33019,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_node_data_extend(struct __pyx_t_4cd
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("trie_node_data_extend", 0);
- /* "precomputation.pxi":71
+ /* "cdec/sa/precomputation.pxi":71
* cdef trie_node_data_extend(_Trie_Node* node, int* vals, int num_vals):
* cdef int new_len
* new_len = node.arr_len + num_vals # <<<<<<<<<<<<<<
@@ -32504,7 +33028,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_node_data_extend(struct __pyx_t_4cd
*/
__pyx_v_new_len = (__pyx_v_node->arr_len + __pyx_v_num_vals);
- /* "precomputation.pxi":72
+ /* "cdec/sa/precomputation.pxi":72
* cdef int new_len
* new_len = node.arr_len + num_vals
* node.arr = <int*> realloc(node.arr, new_len*sizeof(int)) # <<<<<<<<<<<<<<
@@ -32513,7 +33037,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_node_data_extend(struct __pyx_t_4cd
*/
__pyx_v_node->arr = ((int *)realloc(__pyx_v_node->arr, (__pyx_v_new_len * (sizeof(int)))));
- /* "precomputation.pxi":73
+ /* "cdec/sa/precomputation.pxi":73
* new_len = node.arr_len + num_vals
* node.arr = <int*> realloc(node.arr, new_len*sizeof(int))
* memcpy(node.arr + node.arr_len, vals, num_vals*sizeof(int)) # <<<<<<<<<<<<<<
@@ -32522,7 +33046,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_node_data_extend(struct __pyx_t_4cd
*/
memcpy((__pyx_v_node->arr + __pyx_v_node->arr_len), __pyx_v_vals, (__pyx_v_num_vals * (sizeof(int))));
- /* "precomputation.pxi":74
+ /* "cdec/sa/precomputation.pxi":74
* node.arr = <int*> realloc(node.arr, new_len*sizeof(int))
* memcpy(node.arr + node.arr_len, vals, num_vals*sizeof(int))
* node.arr_len = new_len # <<<<<<<<<<<<<<
@@ -32531,7 +33055,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_node_data_extend(struct __pyx_t_4cd
*/
__pyx_v_node->arr_len = __pyx_v_new_len;
- /* "precomputation.pxi":69
+ /* "cdec/sa/precomputation.pxi":69
* node.arr_len = new_len
*
* cdef trie_node_data_extend(_Trie_Node* node, int* vals, int num_vals): # <<<<<<<<<<<<<<
@@ -32546,7 +33070,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_node_data_extend(struct __pyx_t_4cd
return __pyx_r;
}
-/* "precomputation.pxi":77
+/* "cdec/sa/precomputation.pxi":77
*
*
* cdef _Trie_Node* trie_insert(_Trie_Node* node, int val): # <<<<<<<<<<<<<<
@@ -32562,7 +33086,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_trie_ins
int __pyx_t_2;
__Pyx_RefNannySetupContext("trie_insert", 0);
- /* "precomputation.pxi":79
+ /* "cdec/sa/precomputation.pxi":79
* cdef _Trie_Node* trie_insert(_Trie_Node* node, int val):
* cdef _Trie_Edge** cur
* cur = &node.root # <<<<<<<<<<<<<<
@@ -32571,7 +33095,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_trie_ins
*/
__pyx_v_cur = (&__pyx_v_node->root);
- /* "precomputation.pxi":80
+ /* "cdec/sa/precomputation.pxi":80
* cdef _Trie_Edge** cur
* cur = &node.root
* while cur[0] != NULL and cur[0].val != val: # <<<<<<<<<<<<<<
@@ -32592,7 +33116,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_trie_ins
__pyx_L5_bool_binop_done:;
if (!__pyx_t_1) break;
- /* "precomputation.pxi":81
+ /* "cdec/sa/precomputation.pxi":81
* cur = &node.root
* while cur[0] != NULL and cur[0].val != val:
* if val > cur[0].val: # <<<<<<<<<<<<<<
@@ -32602,7 +33126,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_trie_ins
__pyx_t_1 = ((__pyx_v_val > (__pyx_v_cur[0])->val) != 0);
if (__pyx_t_1) {
- /* "precomputation.pxi":82
+ /* "cdec/sa/precomputation.pxi":82
* while cur[0] != NULL and cur[0].val != val:
* if val > cur[0].val:
* cur = &cur[0].bigger # <<<<<<<<<<<<<<
@@ -32613,7 +33137,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_trie_ins
goto __pyx_L7;
}
- /* "precomputation.pxi":83
+ /* "cdec/sa/precomputation.pxi":83
* if val > cur[0].val:
* cur = &cur[0].bigger
* elif val < cur[0].val: # <<<<<<<<<<<<<<
@@ -32623,7 +33147,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_trie_ins
__pyx_t_1 = ((__pyx_v_val < (__pyx_v_cur[0])->val) != 0);
if (__pyx_t_1) {
- /* "precomputation.pxi":84
+ /* "cdec/sa/precomputation.pxi":84
* cur = &cur[0].bigger
* elif val < cur[0].val:
* cur = &cur[0].smaller # <<<<<<<<<<<<<<
@@ -32636,7 +33160,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_trie_ins
__pyx_L7:;
}
- /* "precomputation.pxi":85
+ /* "cdec/sa/precomputation.pxi":85
* elif val < cur[0].val:
* cur = &cur[0].smaller
* if cur[0] == NULL: # <<<<<<<<<<<<<<
@@ -32646,7 +33170,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_trie_ins
__pyx_t_1 = (((__pyx_v_cur[0]) == NULL) != 0);
if (__pyx_t_1) {
- /* "precomputation.pxi":86
+ /* "cdec/sa/precomputation.pxi":86
* cur = &cur[0].smaller
* if cur[0] == NULL:
* cur[0] = new_trie_edge(val) # <<<<<<<<<<<<<<
@@ -32658,7 +33182,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_trie_ins
}
__pyx_L8:;
- /* "precomputation.pxi":87
+ /* "cdec/sa/precomputation.pxi":87
* if cur[0] == NULL:
* cur[0] = new_trie_edge(val)
* return cur[0].node # <<<<<<<<<<<<<<
@@ -32668,7 +33192,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_trie_ins
__pyx_r = (__pyx_v_cur[0])->node;
goto __pyx_L0;
- /* "precomputation.pxi":77
+ /* "cdec/sa/precomputation.pxi":77
*
*
* cdef _Trie_Node* trie_insert(_Trie_Node* node, int val): # <<<<<<<<<<<<<<
@@ -32682,7 +33206,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_trie_ins
return __pyx_r;
}
-/* "precomputation.pxi":89
+/* "cdec/sa/precomputation.pxi":89
* return cur[0].node
*
* cdef trie_node_to_map(_Trie_Node* node, result, prefix, int include_zeros): # <<<<<<<<<<<<<<
@@ -32703,7 +33227,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_node_to_map(struct __pyx_t_4cdec_2s
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("trie_node_to_map", 0);
- /* "precomputation.pxi":92
+ /* "cdec/sa/precomputation.pxi":92
* cdef IntList arr
*
* if include_zeros or node.arr_len > 0: # <<<<<<<<<<<<<<
@@ -32723,7 +33247,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_node_to_map(struct __pyx_t_4cdec_2s
__pyx_L4_bool_binop_done:;
if (__pyx_t_1) {
- /* "precomputation.pxi":93
+ /* "cdec/sa/precomputation.pxi":93
*
* if include_zeros or node.arr_len > 0:
* arr = IntList() # <<<<<<<<<<<<<<
@@ -32735,7 +33259,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_node_to_map(struct __pyx_t_4cdec_2s
__pyx_v_arr = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_3);
__pyx_t_3 = 0;
- /* "precomputation.pxi":94
+ /* "cdec/sa/precomputation.pxi":94
* if include_zeros or node.arr_len > 0:
* arr = IntList()
* free(arr.arr) # <<<<<<<<<<<<<<
@@ -32744,7 +33268,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_node_to_map(struct __pyx_t_4cdec_2s
*/
free(__pyx_v_arr->arr);
- /* "precomputation.pxi":95
+ /* "cdec/sa/precomputation.pxi":95
* arr = IntList()
* free(arr.arr)
* arr.arr = <int*> malloc(node.arr_len * sizeof(int)) # <<<<<<<<<<<<<<
@@ -32753,7 +33277,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_node_to_map(struct __pyx_t_4cdec_2s
*/
__pyx_v_arr->arr = ((int *)malloc((__pyx_v_node->arr_len * (sizeof(int)))));
- /* "precomputation.pxi":96
+ /* "cdec/sa/precomputation.pxi":96
* free(arr.arr)
* arr.arr = <int*> malloc(node.arr_len * sizeof(int))
* memcpy(arr.arr, node.arr, node.arr_len * sizeof(int)) # <<<<<<<<<<<<<<
@@ -32762,7 +33286,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_node_to_map(struct __pyx_t_4cdec_2s
*/
memcpy(__pyx_v_arr->arr, __pyx_v_node->arr, (__pyx_v_node->arr_len * (sizeof(int))));
- /* "precomputation.pxi":97
+ /* "cdec/sa/precomputation.pxi":97
* arr.arr = <int*> malloc(node.arr_len * sizeof(int))
* memcpy(arr.arr, node.arr, node.arr_len * sizeof(int))
* arr.len = node.arr_len # <<<<<<<<<<<<<<
@@ -32772,7 +33296,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_node_to_map(struct __pyx_t_4cdec_2s
__pyx_t_4 = __pyx_v_node->arr_len;
__pyx_v_arr->len = __pyx_t_4;
- /* "precomputation.pxi":98
+ /* "cdec/sa/precomputation.pxi":98
* memcpy(arr.arr, node.arr, node.arr_len * sizeof(int))
* arr.len = node.arr_len
* arr.size = node.arr_len # <<<<<<<<<<<<<<
@@ -32782,7 +33306,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_node_to_map(struct __pyx_t_4cdec_2s
__pyx_t_4 = __pyx_v_node->arr_len;
__pyx_v_arr->size = __pyx_t_4;
- /* "precomputation.pxi":99
+ /* "cdec/sa/precomputation.pxi":99
* arr.len = node.arr_len
* arr.size = node.arr_len
* result[prefix] = arr # <<<<<<<<<<<<<<
@@ -32794,7 +33318,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_node_to_map(struct __pyx_t_4cdec_2s
}
__pyx_L3:;
- /* "precomputation.pxi":100
+ /* "cdec/sa/precomputation.pxi":100
* arr.size = node.arr_len
* result[prefix] = arr
* trie_edge_to_map(node.root, result, prefix, include_zeros) # <<<<<<<<<<<<<<
@@ -32805,7 +33329,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_node_to_map(struct __pyx_t_4cdec_2s
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "precomputation.pxi":89
+ /* "cdec/sa/precomputation.pxi":89
* return cur[0].node
*
* cdef trie_node_to_map(_Trie_Node* node, result, prefix, int include_zeros): # <<<<<<<<<<<<<<
@@ -32827,7 +33351,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_node_to_map(struct __pyx_t_4cdec_2s
return __pyx_r;
}
-/* "precomputation.pxi":102
+/* "cdec/sa/precomputation.pxi":102
* trie_edge_to_map(node.root, result, prefix, include_zeros)
*
* cdef trie_edge_to_map(_Trie_Edge* edge, result, prefix, int include_zeros): # <<<<<<<<<<<<<<
@@ -32847,7 +33371,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_edge_to_map(struct __pyx_t_4cdec_2s
__Pyx_RefNannySetupContext("trie_edge_to_map", 0);
__Pyx_INCREF(__pyx_v_prefix);
- /* "precomputation.pxi":103
+ /* "cdec/sa/precomputation.pxi":103
*
* cdef trie_edge_to_map(_Trie_Edge* edge, result, prefix, int include_zeros):
* if edge != NULL: # <<<<<<<<<<<<<<
@@ -32857,7 +33381,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_edge_to_map(struct __pyx_t_4cdec_2s
__pyx_t_1 = ((__pyx_v_edge != NULL) != 0);
if (__pyx_t_1) {
- /* "precomputation.pxi":104
+ /* "cdec/sa/precomputation.pxi":104
* cdef trie_edge_to_map(_Trie_Edge* edge, result, prefix, int include_zeros):
* if edge != NULL:
* trie_edge_to_map(edge.smaller, result, prefix, include_zeros) # <<<<<<<<<<<<<<
@@ -32868,7 +33392,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_edge_to_map(struct __pyx_t_4cdec_2s
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "precomputation.pxi":105
+ /* "cdec/sa/precomputation.pxi":105
* if edge != NULL:
* trie_edge_to_map(edge.smaller, result, prefix, include_zeros)
* trie_edge_to_map(edge.bigger, result, prefix, include_zeros) # <<<<<<<<<<<<<<
@@ -32879,7 +33403,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_edge_to_map(struct __pyx_t_4cdec_2s
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "precomputation.pxi":106
+ /* "cdec/sa/precomputation.pxi":106
* trie_edge_to_map(edge.smaller, result, prefix, include_zeros)
* trie_edge_to_map(edge.bigger, result, prefix, include_zeros)
* prefix = prefix + (edge.val,) # <<<<<<<<<<<<<<
@@ -32899,7 +33423,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_edge_to_map(struct __pyx_t_4cdec_2s
__Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_2);
__pyx_t_2 = 0;
- /* "precomputation.pxi":107
+ /* "cdec/sa/precomputation.pxi":107
* trie_edge_to_map(edge.bigger, result, prefix, include_zeros)
* prefix = prefix + (edge.val,)
* trie_node_to_map(edge.node, result, prefix, include_zeros) # <<<<<<<<<<<<<<
@@ -32913,7 +33437,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_edge_to_map(struct __pyx_t_4cdec_2s
}
__pyx_L3:;
- /* "precomputation.pxi":102
+ /* "cdec/sa/precomputation.pxi":102
* trie_edge_to_map(node.root, result, prefix, include_zeros)
*
* cdef trie_edge_to_map(_Trie_Edge* edge, result, prefix, int include_zeros): # <<<<<<<<<<<<<<
@@ -32936,7 +33460,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_trie_edge_to_map(struct __pyx_t_4cdec_2s
return __pyx_r;
}
-/* "precomputation.pxi":114
+/* "cdec/sa/precomputation.pxi":114
* cdef int V
*
* def __cinit__(self, int alphabet_size): # <<<<<<<<<<<<<<
@@ -33001,7 +33525,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_7TrieMap___cinit__(struct __pyx_obj_4cdec_2sa
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "precomputation.pxi":115
+ /* "cdec/sa/precomputation.pxi":115
*
* def __cinit__(self, int alphabet_size):
* self.V = alphabet_size # <<<<<<<<<<<<<<
@@ -33010,7 +33534,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_7TrieMap___cinit__(struct __pyx_obj_4cdec_2sa
*/
__pyx_v_self->V = __pyx_v_alphabet_size;
- /* "precomputation.pxi":116
+ /* "cdec/sa/precomputation.pxi":116
* def __cinit__(self, int alphabet_size):
* self.V = alphabet_size
* self.root = <_Trie_Node**> malloc(self.V * sizeof(_Trie_Node*)) # <<<<<<<<<<<<<<
@@ -33019,7 +33543,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_7TrieMap___cinit__(struct __pyx_obj_4cdec_2sa
*/
__pyx_v_self->root = ((struct __pyx_t_4cdec_2sa_3_sa__Trie_Node **)malloc((__pyx_v_self->V * (sizeof(struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *)))));
- /* "precomputation.pxi":117
+ /* "cdec/sa/precomputation.pxi":117
* self.V = alphabet_size
* self.root = <_Trie_Node**> malloc(self.V * sizeof(_Trie_Node*))
* memset(self.root, 0, self.V * sizeof(_Trie_Node*)) # <<<<<<<<<<<<<<
@@ -33028,7 +33552,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_7TrieMap___cinit__(struct __pyx_obj_4cdec_2sa
*/
memset(__pyx_v_self->root, 0, (__pyx_v_self->V * (sizeof(struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *))));
- /* "precomputation.pxi":114
+ /* "cdec/sa/precomputation.pxi":114
* cdef int V
*
* def __cinit__(self, int alphabet_size): # <<<<<<<<<<<<<<
@@ -33042,7 +33566,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_7TrieMap___cinit__(struct __pyx_obj_4cdec_2sa
return __pyx_r;
}
-/* "precomputation.pxi":120
+/* "cdec/sa/precomputation.pxi":120
*
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -33072,7 +33596,7 @@ static void __pyx_pf_4cdec_2sa_3_sa_7TrieMap_2__dealloc__(struct __pyx_obj_4cdec
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "precomputation.pxi":122
+ /* "cdec/sa/precomputation.pxi":122
* def __dealloc__(self):
* cdef int i
* for i from 0 <= i < self.V: # <<<<<<<<<<<<<<
@@ -33082,7 +33606,7 @@ static void __pyx_pf_4cdec_2sa_3_sa_7TrieMap_2__dealloc__(struct __pyx_obj_4cdec
__pyx_t_1 = __pyx_v_self->V;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {
- /* "precomputation.pxi":123
+ /* "cdec/sa/precomputation.pxi":123
* cdef int i
* for i from 0 <= i < self.V:
* if self.root[i] != NULL: # <<<<<<<<<<<<<<
@@ -33092,7 +33616,7 @@ static void __pyx_pf_4cdec_2sa_3_sa_7TrieMap_2__dealloc__(struct __pyx_obj_4cdec
__pyx_t_2 = (((__pyx_v_self->root[__pyx_v_i]) != NULL) != 0);
if (__pyx_t_2) {
- /* "precomputation.pxi":124
+ /* "cdec/sa/precomputation.pxi":124
* for i from 0 <= i < self.V:
* if self.root[i] != NULL:
* free_trie_node(self.root[i]) # <<<<<<<<<<<<<<
@@ -33107,7 +33631,7 @@ static void __pyx_pf_4cdec_2sa_3_sa_7TrieMap_2__dealloc__(struct __pyx_obj_4cdec
__pyx_L5:;
}
- /* "precomputation.pxi":125
+ /* "cdec/sa/precomputation.pxi":125
* if self.root[i] != NULL:
* free_trie_node(self.root[i])
* free(self.root) # <<<<<<<<<<<<<<
@@ -33116,7 +33640,7 @@ static void __pyx_pf_4cdec_2sa_3_sa_7TrieMap_2__dealloc__(struct __pyx_obj_4cdec
*/
free(__pyx_v_self->root);
- /* "precomputation.pxi":120
+ /* "cdec/sa/precomputation.pxi":120
*
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -33133,7 +33657,7 @@ static void __pyx_pf_4cdec_2sa_3_sa_7TrieMap_2__dealloc__(struct __pyx_obj_4cdec
__Pyx_RefNannyFinishContext();
}
-/* "precomputation.pxi":128
+/* "cdec/sa/precomputation.pxi":128
*
*
* def insert(self, pattern): # <<<<<<<<<<<<<<
@@ -33169,7 +33693,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_4insert(struct __pyx_obj_4cdec
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("insert", 0);
- /* "precomputation.pxi":131
+ /* "cdec/sa/precomputation.pxi":131
* cdef int* p
* cdef int i, l
* l = len(pattern) # <<<<<<<<<<<<<<
@@ -33179,7 +33703,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_4insert(struct __pyx_obj_4cdec
__pyx_t_1 = PyObject_Length(__pyx_v_pattern); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_l = __pyx_t_1;
- /* "precomputation.pxi":132
+ /* "cdec/sa/precomputation.pxi":132
* cdef int i, l
* l = len(pattern)
* p = <int*> malloc(l*sizeof(int)) # <<<<<<<<<<<<<<
@@ -33188,7 +33712,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_4insert(struct __pyx_obj_4cdec
*/
__pyx_v_p = ((int *)malloc((__pyx_v_l * (sizeof(int)))));
- /* "precomputation.pxi":133
+ /* "cdec/sa/precomputation.pxi":133
* l = len(pattern)
* p = <int*> malloc(l*sizeof(int))
* for i from 0 <= i < l: # <<<<<<<<<<<<<<
@@ -33198,7 +33722,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_4insert(struct __pyx_obj_4cdec
__pyx_t_2 = __pyx_v_l;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {
- /* "precomputation.pxi":134
+ /* "cdec/sa/precomputation.pxi":134
* p = <int*> malloc(l*sizeof(int))
* for i from 0 <= i < l:
* p[i] = pattern[i] # <<<<<<<<<<<<<<
@@ -33212,7 +33736,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_4insert(struct __pyx_obj_4cdec
(__pyx_v_p[__pyx_v_i]) = __pyx_t_4;
}
- /* "precomputation.pxi":135
+ /* "cdec/sa/precomputation.pxi":135
* for i from 0 <= i < l:
* p[i] = pattern[i]
* self._insert(p,l) # <<<<<<<<<<<<<<
@@ -33221,7 +33745,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_4insert(struct __pyx_obj_4cdec
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_TrieMap *)__pyx_v_self->__pyx_vtab)->_insert(__pyx_v_self, __pyx_v_p, __pyx_v_l);
- /* "precomputation.pxi":136
+ /* "cdec/sa/precomputation.pxi":136
* p[i] = pattern[i]
* self._insert(p,l)
* free(p) # <<<<<<<<<<<<<<
@@ -33230,7 +33754,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_4insert(struct __pyx_obj_4cdec
*/
free(__pyx_v_p);
- /* "precomputation.pxi":128
+ /* "cdec/sa/precomputation.pxi":128
*
*
* def insert(self, pattern): # <<<<<<<<<<<<<<
@@ -33251,7 +33775,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_4insert(struct __pyx_obj_4cdec
return __pyx_r;
}
-/* "precomputation.pxi":139
+/* "cdec/sa/precomputation.pxi":139
*
*
* cdef _Trie_Node* _insert(self, int* pattern, int pattern_len): # <<<<<<<<<<<<<<
@@ -33268,7 +33792,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_7TrieMap
int __pyx_t_2;
__Pyx_RefNannySetupContext("_insert", 0);
- /* "precomputation.pxi":142
+ /* "cdec/sa/precomputation.pxi":142
* cdef int i
* cdef _Trie_Node* node
* if self.root[pattern[0]] == NULL: # <<<<<<<<<<<<<<
@@ -33278,7 +33802,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_7TrieMap
__pyx_t_1 = (((__pyx_v_self->root[(__pyx_v_pattern[0])]) == NULL) != 0);
if (__pyx_t_1) {
- /* "precomputation.pxi":143
+ /* "cdec/sa/precomputation.pxi":143
* cdef _Trie_Node* node
* if self.root[pattern[0]] == NULL:
* self.root[pattern[0]] = new_trie_node() # <<<<<<<<<<<<<<
@@ -33290,7 +33814,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_7TrieMap
}
__pyx_L3:;
- /* "precomputation.pxi":144
+ /* "cdec/sa/precomputation.pxi":144
* if self.root[pattern[0]] == NULL:
* self.root[pattern[0]] = new_trie_node()
* node = self.root[pattern[0]] # <<<<<<<<<<<<<<
@@ -33299,7 +33823,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_7TrieMap
*/
__pyx_v_node = (__pyx_v_self->root[(__pyx_v_pattern[0])]);
- /* "precomputation.pxi":145
+ /* "cdec/sa/precomputation.pxi":145
* self.root[pattern[0]] = new_trie_node()
* node = self.root[pattern[0]]
* for i from 1 <= i < pattern_len: # <<<<<<<<<<<<<<
@@ -33309,7 +33833,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_7TrieMap
__pyx_t_2 = __pyx_v_pattern_len;
for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {
- /* "precomputation.pxi":146
+ /* "cdec/sa/precomputation.pxi":146
* node = self.root[pattern[0]]
* for i from 1 <= i < pattern_len:
* node = trie_insert(node, pattern[i]) # <<<<<<<<<<<<<<
@@ -33319,7 +33843,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_7TrieMap
__pyx_v_node = __pyx_f_4cdec_2sa_3_sa_trie_insert(__pyx_v_node, (__pyx_v_pattern[__pyx_v_i]));
}
- /* "precomputation.pxi":147
+ /* "cdec/sa/precomputation.pxi":147
* for i from 1 <= i < pattern_len:
* node = trie_insert(node, pattern[i])
* return node # <<<<<<<<<<<<<<
@@ -33329,7 +33853,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_7TrieMap
__pyx_r = __pyx_v_node;
goto __pyx_L0;
- /* "precomputation.pxi":139
+ /* "cdec/sa/precomputation.pxi":139
*
*
* cdef _Trie_Node* _insert(self, int* pattern, int pattern_len): # <<<<<<<<<<<<<<
@@ -33343,7 +33867,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_7TrieMap
return __pyx_r;
}
-/* "precomputation.pxi":149
+/* "cdec/sa/precomputation.pxi":149
* return node
*
* def contains(self, pattern): # <<<<<<<<<<<<<<
@@ -33381,7 +33905,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_6contains(struct __pyx_obj_4cd
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("contains", 0);
- /* "precomputation.pxi":153
+ /* "cdec/sa/precomputation.pxi":153
* cdef int i, l
* cdef _Trie_Node* node
* l = len(pattern) # <<<<<<<<<<<<<<
@@ -33391,7 +33915,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_6contains(struct __pyx_obj_4cd
__pyx_t_1 = PyObject_Length(__pyx_v_pattern); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_l = __pyx_t_1;
- /* "precomputation.pxi":154
+ /* "cdec/sa/precomputation.pxi":154
* cdef _Trie_Node* node
* l = len(pattern)
* p = <int*> malloc(l*sizeof(int)) # <<<<<<<<<<<<<<
@@ -33400,7 +33924,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_6contains(struct __pyx_obj_4cd
*/
__pyx_v_p = ((int *)malloc((__pyx_v_l * (sizeof(int)))));
- /* "precomputation.pxi":155
+ /* "cdec/sa/precomputation.pxi":155
* l = len(pattern)
* p = <int*> malloc(l*sizeof(int))
* for i from 0 <= i < l: # <<<<<<<<<<<<<<
@@ -33410,7 +33934,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_6contains(struct __pyx_obj_4cd
__pyx_t_2 = __pyx_v_l;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {
- /* "precomputation.pxi":156
+ /* "cdec/sa/precomputation.pxi":156
* p = <int*> malloc(l*sizeof(int))
* for i from 0 <= i < l:
* p[i] = pattern[i] # <<<<<<<<<<<<<<
@@ -33424,7 +33948,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_6contains(struct __pyx_obj_4cd
(__pyx_v_p[__pyx_v_i]) = __pyx_t_4;
}
- /* "precomputation.pxi":157
+ /* "cdec/sa/precomputation.pxi":157
* for i from 0 <= i < l:
* p[i] = pattern[i]
* node = self._contains(p,l) # <<<<<<<<<<<<<<
@@ -33433,7 +33957,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_6contains(struct __pyx_obj_4cd
*/
__pyx_v_node = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_TrieMap *)__pyx_v_self->__pyx_vtab)->_contains(__pyx_v_self, __pyx_v_p, __pyx_v_l);
- /* "precomputation.pxi":158
+ /* "cdec/sa/precomputation.pxi":158
* p[i] = pattern[i]
* node = self._contains(p,l)
* free(p) # <<<<<<<<<<<<<<
@@ -33442,7 +33966,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_6contains(struct __pyx_obj_4cd
*/
free(__pyx_v_p);
- /* "precomputation.pxi":159
+ /* "cdec/sa/precomputation.pxi":159
* node = self._contains(p,l)
* free(p)
* if node == NULL: # <<<<<<<<<<<<<<
@@ -33452,7 +33976,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_6contains(struct __pyx_obj_4cd
__pyx_t_5 = ((__pyx_v_node == NULL) != 0);
if (__pyx_t_5) {
- /* "precomputation.pxi":160
+ /* "cdec/sa/precomputation.pxi":160
* free(p)
* if node == NULL:
* return False # <<<<<<<<<<<<<<
@@ -33466,7 +33990,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_6contains(struct __pyx_obj_4cd
}
/*else*/ {
- /* "precomputation.pxi":162
+ /* "cdec/sa/precomputation.pxi":162
* return False
* else:
* return True # <<<<<<<<<<<<<<
@@ -33479,7 +34003,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_6contains(struct __pyx_obj_4cd
goto __pyx_L0;
}
- /* "precomputation.pxi":149
+ /* "cdec/sa/precomputation.pxi":149
* return node
*
* def contains(self, pattern): # <<<<<<<<<<<<<<
@@ -33498,7 +34022,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_6contains(struct __pyx_obj_4cd
return __pyx_r;
}
-/* "precomputation.pxi":164
+/* "cdec/sa/precomputation.pxi":164
* return True
*
* cdef _Trie_Node* _contains(self, int* pattern, int pattern_len): # <<<<<<<<<<<<<<
@@ -33515,7 +34039,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_7TrieMap
int __pyx_t_2;
__Pyx_RefNannySetupContext("_contains", 0);
- /* "precomputation.pxi":167
+ /* "cdec/sa/precomputation.pxi":167
* cdef int i
* cdef _Trie_Node* node
* node = self.root[pattern[0]] # <<<<<<<<<<<<<<
@@ -33524,7 +34048,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_7TrieMap
*/
__pyx_v_node = (__pyx_v_self->root[(__pyx_v_pattern[0])]);
- /* "precomputation.pxi":168
+ /* "cdec/sa/precomputation.pxi":168
* cdef _Trie_Node* node
* node = self.root[pattern[0]]
* i = 1 # <<<<<<<<<<<<<<
@@ -33533,7 +34057,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_7TrieMap
*/
__pyx_v_i = 1;
- /* "precomputation.pxi":169
+ /* "cdec/sa/precomputation.pxi":169
* node = self.root[pattern[0]]
* i = 1
* while node != NULL and i < pattern_len: # <<<<<<<<<<<<<<
@@ -33554,7 +34078,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_7TrieMap
__pyx_L5_bool_binop_done:;
if (!__pyx_t_1) break;
- /* "precomputation.pxi":170
+ /* "cdec/sa/precomputation.pxi":170
* i = 1
* while node != NULL and i < pattern_len:
* node = trie_find(node, pattern[i]) # <<<<<<<<<<<<<<
@@ -33563,7 +34087,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_7TrieMap
*/
__pyx_v_node = __pyx_f_4cdec_2sa_3_sa_trie_find(__pyx_v_node, (__pyx_v_pattern[__pyx_v_i]));
- /* "precomputation.pxi":171
+ /* "cdec/sa/precomputation.pxi":171
* while node != NULL and i < pattern_len:
* node = trie_find(node, pattern[i])
* i = i+1 # <<<<<<<<<<<<<<
@@ -33573,7 +34097,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_7TrieMap
__pyx_v_i = (__pyx_v_i + 1);
}
- /* "precomputation.pxi":172
+ /* "cdec/sa/precomputation.pxi":172
* node = trie_find(node, pattern[i])
* i = i+1
* return node # <<<<<<<<<<<<<<
@@ -33583,7 +34107,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_7TrieMap
__pyx_r = __pyx_v_node;
goto __pyx_L0;
- /* "precomputation.pxi":164
+ /* "cdec/sa/precomputation.pxi":164
* return True
*
* cdef _Trie_Node* _contains(self, int* pattern, int pattern_len): # <<<<<<<<<<<<<<
@@ -33597,7 +34121,7 @@ static struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *__pyx_f_4cdec_2sa_3_sa_7TrieMap
return __pyx_r;
}
-/* "precomputation.pxi":174
+/* "cdec/sa/precomputation.pxi":174
* return node
*
* def toMap(self, flag): # <<<<<<<<<<<<<<
@@ -33633,7 +34157,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_8toMap(struct __pyx_obj_4cdec_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("toMap", 0);
- /* "precomputation.pxi":177
+ /* "cdec/sa/precomputation.pxi":177
* cdef int i, include_zeros
*
* if flag: # <<<<<<<<<<<<<<
@@ -33643,7 +34167,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_8toMap(struct __pyx_obj_4cdec_
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_flag); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_1) {
- /* "precomputation.pxi":178
+ /* "cdec/sa/precomputation.pxi":178
*
* if flag:
* include_zeros=1 # <<<<<<<<<<<<<<
@@ -33655,7 +34179,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_8toMap(struct __pyx_obj_4cdec_
}
/*else*/ {
- /* "precomputation.pxi":180
+ /* "cdec/sa/precomputation.pxi":180
* include_zeros=1
* else:
* include_zeros=0 # <<<<<<<<<<<<<<
@@ -33666,7 +34190,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_8toMap(struct __pyx_obj_4cdec_
}
__pyx_L3:;
- /* "precomputation.pxi":181
+ /* "cdec/sa/precomputation.pxi":181
* else:
* include_zeros=0
* result = {} # <<<<<<<<<<<<<<
@@ -33678,7 +34202,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_8toMap(struct __pyx_obj_4cdec_
__pyx_v_result = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
- /* "precomputation.pxi":182
+ /* "cdec/sa/precomputation.pxi":182
* include_zeros=0
* result = {}
* for i from 0 <= i < self.V: # <<<<<<<<<<<<<<
@@ -33688,7 +34212,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_8toMap(struct __pyx_obj_4cdec_
__pyx_t_3 = __pyx_v_self->V;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) {
- /* "precomputation.pxi":183
+ /* "cdec/sa/precomputation.pxi":183
* result = {}
* for i from 0 <= i < self.V:
* if self.root[i] != NULL: # <<<<<<<<<<<<<<
@@ -33698,7 +34222,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_8toMap(struct __pyx_obj_4cdec_
__pyx_t_1 = (((__pyx_v_self->root[__pyx_v_i]) != NULL) != 0);
if (__pyx_t_1) {
- /* "precomputation.pxi":184
+ /* "cdec/sa/precomputation.pxi":184
* for i from 0 <= i < self.V:
* if self.root[i] != NULL:
* trie_node_to_map(self.root[i], result, (i,), include_zeros) # <<<<<<<<<<<<<<
@@ -33721,7 +34245,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_8toMap(struct __pyx_obj_4cdec_
__pyx_L6:;
}
- /* "precomputation.pxi":185
+ /* "cdec/sa/precomputation.pxi":185
* if self.root[i] != NULL:
* trie_node_to_map(self.root[i], result, (i,), include_zeros)
* return result # <<<<<<<<<<<<<<
@@ -33733,7 +34257,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_8toMap(struct __pyx_obj_4cdec_
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "precomputation.pxi":174
+ /* "cdec/sa/precomputation.pxi":174
* return node
*
* def toMap(self, flag): # <<<<<<<<<<<<<<
@@ -33754,7 +34278,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7TrieMap_8toMap(struct __pyx_obj_4cdec_
return __pyx_r;
}
-/* "precomputation.pxi":200
+/* "cdec/sa/precomputation.pxi":200
* cdef write_map(self, m, FILE* f)
*
* def __cinit__(self, fsarray=None, from_stats=None, from_binary=None, # <<<<<<<<<<<<<<
@@ -33914,7 +34438,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_14Precomputation___cinit__(struct __pyx_obj_4
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "precomputation.pxi":204
+ /* "cdec/sa/precomputation.pxi":204
* max_length=5, max_nonterminals=2,
* train_max_initial_size=10, train_min_gap_size=2):
* self.precompute_rank = precompute_rank # <<<<<<<<<<<<<<
@@ -33924,7 +34448,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_14Precomputation___cinit__(struct __pyx_obj_4
__pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_precompute_rank); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_self->precompute_rank = __pyx_t_1;
- /* "precomputation.pxi":205
+ /* "cdec/sa/precomputation.pxi":205
* train_max_initial_size=10, train_min_gap_size=2):
* self.precompute_rank = precompute_rank
* self.precompute_secondary_rank = precompute_secondary_rank # <<<<<<<<<<<<<<
@@ -33934,7 +34458,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_14Precomputation___cinit__(struct __pyx_obj_4
__pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_precompute_secondary_rank); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_self->precompute_secondary_rank = __pyx_t_1;
- /* "precomputation.pxi":206
+ /* "cdec/sa/precomputation.pxi":206
* self.precompute_rank = precompute_rank
* self.precompute_secondary_rank = precompute_secondary_rank
* self.max_length = max_length # <<<<<<<<<<<<<<
@@ -33944,7 +34468,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_14Precomputation___cinit__(struct __pyx_obj_4
__pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_max_length); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_self->max_length = __pyx_t_1;
- /* "precomputation.pxi":207
+ /* "cdec/sa/precomputation.pxi":207
* self.precompute_secondary_rank = precompute_secondary_rank
* self.max_length = max_length
* self.max_nonterminals = max_nonterminals # <<<<<<<<<<<<<<
@@ -33954,7 +34478,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_14Precomputation___cinit__(struct __pyx_obj_4
__pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_max_nonterminals); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_self->max_nonterminals = __pyx_t_1;
- /* "precomputation.pxi":208
+ /* "cdec/sa/precomputation.pxi":208
* self.max_length = max_length
* self.max_nonterminals = max_nonterminals
* self.train_max_initial_size = train_max_initial_size # <<<<<<<<<<<<<<
@@ -33964,7 +34488,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_14Precomputation___cinit__(struct __pyx_obj_4
__pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_train_max_initial_size); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_self->train_max_initial_size = __pyx_t_1;
- /* "precomputation.pxi":209
+ /* "cdec/sa/precomputation.pxi":209
* self.max_nonterminals = max_nonterminals
* self.train_max_initial_size = train_max_initial_size
* self.train_min_gap_size = train_min_gap_size # <<<<<<<<<<<<<<
@@ -33974,7 +34498,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_14Precomputation___cinit__(struct __pyx_obj_4
__pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_train_min_gap_size); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_self->train_min_gap_size = __pyx_t_1;
- /* "precomputation.pxi":210
+ /* "cdec/sa/precomputation.pxi":210
* self.train_max_initial_size = train_max_initial_size
* self.train_min_gap_size = train_min_gap_size
* if from_binary: # <<<<<<<<<<<<<<
@@ -33984,7 +34508,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_14Precomputation___cinit__(struct __pyx_obj_4
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_from_binary); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_2) {
- /* "precomputation.pxi":211
+ /* "cdec/sa/precomputation.pxi":211
* self.train_min_gap_size = train_min_gap_size
* if from_binary:
* self.read_binary(from_binary) # <<<<<<<<<<<<<<
@@ -34022,7 +34546,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_14Precomputation___cinit__(struct __pyx_obj_4
goto __pyx_L3;
}
- /* "precomputation.pxi":212
+ /* "cdec/sa/precomputation.pxi":212
* if from_binary:
* self.read_binary(from_binary)
* elif from_stats: # <<<<<<<<<<<<<<
@@ -34032,7 +34556,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_14Precomputation___cinit__(struct __pyx_obj_4
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_from_stats); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_2) {
- /* "precomputation.pxi":213
+ /* "cdec/sa/precomputation.pxi":213
* self.read_binary(from_binary)
* elif from_stats:
* self.precompute(from_stats, fsarray) # <<<<<<<<<<<<<<
@@ -34073,7 +34597,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_14Precomputation___cinit__(struct __pyx_obj_4
}
__pyx_L3:;
- /* "precomputation.pxi":200
+ /* "cdec/sa/precomputation.pxi":200
* cdef write_map(self, m, FILE* f)
*
* def __cinit__(self, fsarray=None, from_stats=None, from_binary=None, # <<<<<<<<<<<<<<
@@ -34096,7 +34620,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_14Precomputation___cinit__(struct __pyx_obj_4
return __pyx_r;
}
-/* "precomputation.pxi":216
+/* "cdec/sa/precomputation.pxi":216
*
*
* def read_binary(self, char* filename): # <<<<<<<<<<<<<<
@@ -34140,7 +34664,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_2read_binary(struct __
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("read_binary", 0);
- /* "precomputation.pxi":218
+ /* "cdec/sa/precomputation.pxi":218
* def read_binary(self, char* filename):
* cdef FILE* f
* f = fopen(filename, "r") # <<<<<<<<<<<<<<
@@ -34149,7 +34673,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_2read_binary(struct __
*/
__pyx_v_f = fopen(__pyx_v_filename, __pyx_k_r);
- /* "precomputation.pxi":219
+ /* "cdec/sa/precomputation.pxi":219
* cdef FILE* f
* f = fopen(filename, "r")
* fread(&(self.precompute_rank), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -34158,7 +34682,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_2read_binary(struct __
*/
fread((&__pyx_v_self->precompute_rank), (sizeof(int)), 1, __pyx_v_f);
- /* "precomputation.pxi":220
+ /* "cdec/sa/precomputation.pxi":220
* f = fopen(filename, "r")
* fread(&(self.precompute_rank), sizeof(int), 1, f)
* fread(&(self.precompute_secondary_rank), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -34167,7 +34691,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_2read_binary(struct __
*/
fread((&__pyx_v_self->precompute_secondary_rank), (sizeof(int)), 1, __pyx_v_f);
- /* "precomputation.pxi":221
+ /* "cdec/sa/precomputation.pxi":221
* fread(&(self.precompute_rank), sizeof(int), 1, f)
* fread(&(self.precompute_secondary_rank), sizeof(int), 1, f)
* fread(&(self.max_length), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -34176,7 +34700,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_2read_binary(struct __
*/
fread((&__pyx_v_self->max_length), (sizeof(int)), 1, __pyx_v_f);
- /* "precomputation.pxi":222
+ /* "cdec/sa/precomputation.pxi":222
* fread(&(self.precompute_secondary_rank), sizeof(int), 1, f)
* fread(&(self.max_length), sizeof(int), 1, f)
* fread(&(self.max_nonterminals), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -34185,7 +34709,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_2read_binary(struct __
*/
fread((&__pyx_v_self->max_nonterminals), (sizeof(int)), 1, __pyx_v_f);
- /* "precomputation.pxi":223
+ /* "cdec/sa/precomputation.pxi":223
* fread(&(self.max_length), sizeof(int), 1, f)
* fread(&(self.max_nonterminals), sizeof(int), 1, f)
* fread(&(self.train_max_initial_size), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -34194,7 +34718,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_2read_binary(struct __
*/
fread((&__pyx_v_self->train_max_initial_size), (sizeof(int)), 1, __pyx_v_f);
- /* "precomputation.pxi":224
+ /* "cdec/sa/precomputation.pxi":224
* fread(&(self.max_nonterminals), sizeof(int), 1, f)
* fread(&(self.train_max_initial_size), sizeof(int), 1, f)
* fread(&(self.train_min_gap_size), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -34203,7 +34727,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_2read_binary(struct __
*/
fread((&__pyx_v_self->train_min_gap_size), (sizeof(int)), 1, __pyx_v_f);
- /* "precomputation.pxi":225
+ /* "cdec/sa/precomputation.pxi":225
* fread(&(self.train_max_initial_size), sizeof(int), 1, f)
* fread(&(self.train_min_gap_size), sizeof(int), 1, f)
* self.precomputed_index = self.read_map(f) # <<<<<<<<<<<<<<
@@ -34218,7 +34742,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_2read_binary(struct __
__pyx_v_self->precomputed_index = __pyx_t_1;
__pyx_t_1 = 0;
- /* "precomputation.pxi":226
+ /* "cdec/sa/precomputation.pxi":226
* fread(&(self.train_min_gap_size), sizeof(int), 1, f)
* self.precomputed_index = self.read_map(f)
* self.precomputed_collocations = self.read_map(f) # <<<<<<<<<<<<<<
@@ -34233,7 +34757,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_2read_binary(struct __
__pyx_v_self->precomputed_collocations = __pyx_t_1;
__pyx_t_1 = 0;
- /* "precomputation.pxi":227
+ /* "cdec/sa/precomputation.pxi":227
* self.precomputed_index = self.read_map(f)
* self.precomputed_collocations = self.read_map(f)
* fclose(f) # <<<<<<<<<<<<<<
@@ -34242,7 +34766,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_2read_binary(struct __
*/
fclose(__pyx_v_f);
- /* "precomputation.pxi":216
+ /* "cdec/sa/precomputation.pxi":216
*
*
* def read_binary(self, char* filename): # <<<<<<<<<<<<<<
@@ -34263,7 +34787,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_2read_binary(struct __
return __pyx_r;
}
-/* "precomputation.pxi":230
+/* "cdec/sa/precomputation.pxi":230
*
*
* def write_binary(self, char* filename): # <<<<<<<<<<<<<<
@@ -34308,7 +34832,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_4write_binary(struct _
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("write_binary", 0);
- /* "precomputation.pxi":232
+ /* "cdec/sa/precomputation.pxi":232
* def write_binary(self, char* filename):
* cdef FILE* f
* f = fopen(filename, "w") # <<<<<<<<<<<<<<
@@ -34317,7 +34841,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_4write_binary(struct _
*/
__pyx_v_f = fopen(__pyx_v_filename, __pyx_k_w);
- /* "precomputation.pxi":233
+ /* "cdec/sa/precomputation.pxi":233
* cdef FILE* f
* f = fopen(filename, "w")
* fwrite(&(self.precompute_rank), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -34326,7 +34850,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_4write_binary(struct _
*/
fwrite((&__pyx_v_self->precompute_rank), (sizeof(int)), 1, __pyx_v_f);
- /* "precomputation.pxi":234
+ /* "cdec/sa/precomputation.pxi":234
* f = fopen(filename, "w")
* fwrite(&(self.precompute_rank), sizeof(int), 1, f)
* fwrite(&(self.precompute_secondary_rank), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -34335,7 +34859,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_4write_binary(struct _
*/
fwrite((&__pyx_v_self->precompute_secondary_rank), (sizeof(int)), 1, __pyx_v_f);
- /* "precomputation.pxi":235
+ /* "cdec/sa/precomputation.pxi":235
* fwrite(&(self.precompute_rank), sizeof(int), 1, f)
* fwrite(&(self.precompute_secondary_rank), sizeof(int), 1, f)
* fwrite(&(self.max_length), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -34344,7 +34868,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_4write_binary(struct _
*/
fwrite((&__pyx_v_self->max_length), (sizeof(int)), 1, __pyx_v_f);
- /* "precomputation.pxi":236
+ /* "cdec/sa/precomputation.pxi":236
* fwrite(&(self.precompute_secondary_rank), sizeof(int), 1, f)
* fwrite(&(self.max_length), sizeof(int), 1, f)
* fwrite(&(self.max_nonterminals), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -34353,7 +34877,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_4write_binary(struct _
*/
fwrite((&__pyx_v_self->max_nonterminals), (sizeof(int)), 1, __pyx_v_f);
- /* "precomputation.pxi":237
+ /* "cdec/sa/precomputation.pxi":237
* fwrite(&(self.max_length), sizeof(int), 1, f)
* fwrite(&(self.max_nonterminals), sizeof(int), 1, f)
* fwrite(&(self.train_max_initial_size), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -34362,7 +34886,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_4write_binary(struct _
*/
fwrite((&__pyx_v_self->train_max_initial_size), (sizeof(int)), 1, __pyx_v_f);
- /* "precomputation.pxi":238
+ /* "cdec/sa/precomputation.pxi":238
* fwrite(&(self.max_nonterminals), sizeof(int), 1, f)
* fwrite(&(self.train_max_initial_size), sizeof(int), 1, f)
* fwrite(&(self.train_min_gap_size), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -34371,7 +34895,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_4write_binary(struct _
*/
fwrite((&__pyx_v_self->train_min_gap_size), (sizeof(int)), 1, __pyx_v_f);
- /* "precomputation.pxi":239
+ /* "cdec/sa/precomputation.pxi":239
* fwrite(&(self.train_max_initial_size), sizeof(int), 1, f)
* fwrite(&(self.train_min_gap_size), sizeof(int), 1, f)
* self.write_map(self.precomputed_index, f) # <<<<<<<<<<<<<<
@@ -34385,7 +34909,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_4write_binary(struct _
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "precomputation.pxi":240
+ /* "cdec/sa/precomputation.pxi":240
* fwrite(&(self.train_min_gap_size), sizeof(int), 1, f)
* self.write_map(self.precomputed_index, f)
* self.write_map(self.precomputed_collocations, f) # <<<<<<<<<<<<<<
@@ -34399,7 +34923,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_4write_binary(struct _
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "precomputation.pxi":241
+ /* "cdec/sa/precomputation.pxi":241
* self.write_map(self.precomputed_index, f)
* self.write_map(self.precomputed_collocations, f)
* fclose(f) # <<<<<<<<<<<<<<
@@ -34408,7 +34932,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_4write_binary(struct _
*/
fclose(__pyx_v_f);
- /* "precomputation.pxi":230
+ /* "cdec/sa/precomputation.pxi":230
*
*
* def write_binary(self, char* filename): # <<<<<<<<<<<<<<
@@ -34430,7 +34954,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_4write_binary(struct _
return __pyx_r;
}
-/* "precomputation.pxi":244
+/* "cdec/sa/precomputation.pxi":244
*
*
* cdef write_map(self, m, FILE* f): # <<<<<<<<<<<<<<
@@ -34461,7 +34985,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_write_map(CYTHON_UNUSED
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("write_map", 0);
- /* "precomputation.pxi":248
+ /* "cdec/sa/precomputation.pxi":248
* cdef IntList arr
*
* N = len(m) # <<<<<<<<<<<<<<
@@ -34471,7 +34995,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_write_map(CYTHON_UNUSED
__pyx_t_1 = PyObject_Length(__pyx_v_m); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_N = __pyx_t_1;
- /* "precomputation.pxi":249
+ /* "cdec/sa/precomputation.pxi":249
*
* N = len(m)
* fwrite(&(N), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -34480,7 +35004,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_write_map(CYTHON_UNUSED
*/
fwrite((&__pyx_v_N), (sizeof(int)), 1, __pyx_v_f);
- /* "precomputation.pxi":250
+ /* "cdec/sa/precomputation.pxi":250
* N = len(m)
* fwrite(&(N), sizeof(int), 1, f)
* for pattern, val in m.iteritems(): # <<<<<<<<<<<<<<
@@ -34508,7 +35032,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_write_map(CYTHON_UNUSED
__Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_6);
__pyx_t_6 = 0;
- /* "precomputation.pxi":251
+ /* "cdec/sa/precomputation.pxi":251
* fwrite(&(N), sizeof(int), 1, f)
* for pattern, val in m.iteritems():
* N = len(pattern) # <<<<<<<<<<<<<<
@@ -34518,7 +35042,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_write_map(CYTHON_UNUSED
__pyx_t_8 = PyObject_Length(__pyx_v_pattern); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_N = __pyx_t_8;
- /* "precomputation.pxi":252
+ /* "cdec/sa/precomputation.pxi":252
* for pattern, val in m.iteritems():
* N = len(pattern)
* fwrite(&(N), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -34527,7 +35051,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_write_map(CYTHON_UNUSED
*/
fwrite((&__pyx_v_N), (sizeof(int)), 1, __pyx_v_f);
- /* "precomputation.pxi":253
+ /* "cdec/sa/precomputation.pxi":253
* N = len(pattern)
* fwrite(&(N), sizeof(int), 1, f)
* for word_id in pattern: # <<<<<<<<<<<<<<
@@ -34574,7 +35098,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_write_map(CYTHON_UNUSED
__Pyx_XDECREF_SET(__pyx_v_word_id, __pyx_t_5);
__pyx_t_5 = 0;
- /* "precomputation.pxi":254
+ /* "cdec/sa/precomputation.pxi":254
* fwrite(&(N), sizeof(int), 1, f)
* for word_id in pattern:
* i = word_id # <<<<<<<<<<<<<<
@@ -34584,7 +35108,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_write_map(CYTHON_UNUSED
__pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_word_id); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_i = __pyx_t_7;
- /* "precomputation.pxi":255
+ /* "cdec/sa/precomputation.pxi":255
* for word_id in pattern:
* i = word_id
* fwrite(&(i), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -34593,7 +35117,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_write_map(CYTHON_UNUSED
*/
fwrite((&__pyx_v_i), (sizeof(int)), 1, __pyx_v_f);
- /* "precomputation.pxi":253
+ /* "cdec/sa/precomputation.pxi":253
* N = len(pattern)
* fwrite(&(N), sizeof(int), 1, f)
* for word_id in pattern: # <<<<<<<<<<<<<<
@@ -34603,7 +35127,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_write_map(CYTHON_UNUSED
}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "precomputation.pxi":256
+ /* "cdec/sa/precomputation.pxi":256
* i = word_id
* fwrite(&(i), sizeof(int), 1, f)
* arr = val # <<<<<<<<<<<<<<
@@ -34616,7 +35140,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_write_map(CYTHON_UNUSED
__Pyx_XDECREF_SET(__pyx_v_arr, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_6));
__pyx_t_6 = 0;
- /* "precomputation.pxi":257
+ /* "cdec/sa/precomputation.pxi":257
* fwrite(&(i), sizeof(int), 1, f)
* arr = val
* arr.write_handle(f) # <<<<<<<<<<<<<<
@@ -34627,7 +35151,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_write_map(CYTHON_UNUSED
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "precomputation.pxi":244
+ /* "cdec/sa/precomputation.pxi":244
*
*
* cdef write_map(self, m, FILE* f): # <<<<<<<<<<<<<<
@@ -34654,7 +35178,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_write_map(CYTHON_UNUSED
return __pyx_r;
}
-/* "precomputation.pxi":260
+/* "cdec/sa/precomputation.pxi":260
*
*
* cdef read_map(self, FILE* f): # <<<<<<<<<<<<<<
@@ -34682,7 +35206,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_read_map(CYTHON_UNUSED
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("read_map", 0);
- /* "precomputation.pxi":264
+ /* "cdec/sa/precomputation.pxi":264
* cdef IntList arr
*
* m = {} # <<<<<<<<<<<<<<
@@ -34694,7 +35218,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_read_map(CYTHON_UNUSED
__pyx_v_m = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "precomputation.pxi":265
+ /* "cdec/sa/precomputation.pxi":265
*
* m = {}
* fread(&(N), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -34703,7 +35227,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_read_map(CYTHON_UNUSED
*/
fread((&__pyx_v_N), (sizeof(int)), 1, __pyx_v_f);
- /* "precomputation.pxi":266
+ /* "cdec/sa/precomputation.pxi":266
* m = {}
* fread(&(N), sizeof(int), 1, f)
* for j from 0 <= j < N: # <<<<<<<<<<<<<<
@@ -34713,7 +35237,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_read_map(CYTHON_UNUSED
__pyx_t_2 = __pyx_v_N;
for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_2; __pyx_v_j++) {
- /* "precomputation.pxi":267
+ /* "cdec/sa/precomputation.pxi":267
* fread(&(N), sizeof(int), 1, f)
* for j from 0 <= j < N:
* fread(&(i), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -34722,7 +35246,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_read_map(CYTHON_UNUSED
*/
fread((&__pyx_v_i), (sizeof(int)), 1, __pyx_v_f);
- /* "precomputation.pxi":268
+ /* "cdec/sa/precomputation.pxi":268
* for j from 0 <= j < N:
* fread(&(i), sizeof(int), 1, f)
* key = () # <<<<<<<<<<<<<<
@@ -34732,7 +35256,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_read_map(CYTHON_UNUSED
__Pyx_INCREF(__pyx_empty_tuple);
__Pyx_XDECREF_SET(__pyx_v_key, __pyx_empty_tuple);
- /* "precomputation.pxi":269
+ /* "cdec/sa/precomputation.pxi":269
* fread(&(i), sizeof(int), 1, f)
* key = ()
* for k from 0 <= k < i: # <<<<<<<<<<<<<<
@@ -34742,7 +35266,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_read_map(CYTHON_UNUSED
__pyx_t_3 = __pyx_v_i;
for (__pyx_v_k = 0; __pyx_v_k < __pyx_t_3; __pyx_v_k++) {
- /* "precomputation.pxi":270
+ /* "cdec/sa/precomputation.pxi":270
* key = ()
* for k from 0 <= k < i:
* fread(&(word_id), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -34751,7 +35275,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_read_map(CYTHON_UNUSED
*/
fread((&__pyx_v_word_id), (sizeof(int)), 1, __pyx_v_f);
- /* "precomputation.pxi":271
+ /* "cdec/sa/precomputation.pxi":271
* for k from 0 <= k < i:
* fread(&(word_id), sizeof(int), 1, f)
* key = key + (word_id,) # <<<<<<<<<<<<<<
@@ -34772,7 +35296,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_read_map(CYTHON_UNUSED
__pyx_t_1 = 0;
}
- /* "precomputation.pxi":272
+ /* "cdec/sa/precomputation.pxi":272
* fread(&(word_id), sizeof(int), 1, f)
* key = key + (word_id,)
* arr = IntList() # <<<<<<<<<<<<<<
@@ -34784,7 +35308,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_read_map(CYTHON_UNUSED
__Pyx_XDECREF_SET(__pyx_v_arr, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1));
__pyx_t_1 = 0;
- /* "precomputation.pxi":273
+ /* "cdec/sa/precomputation.pxi":273
* key = key + (word_id,)
* arr = IntList()
* arr.read_handle(f) # <<<<<<<<<<<<<<
@@ -34793,7 +35317,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_read_map(CYTHON_UNUSED
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_arr->__pyx_vtab)->read_handle(__pyx_v_arr, __pyx_v_f);
- /* "precomputation.pxi":274
+ /* "cdec/sa/precomputation.pxi":274
* arr = IntList()
* arr.read_handle(f)
* m[key] = arr # <<<<<<<<<<<<<<
@@ -34803,7 +35327,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_read_map(CYTHON_UNUSED
if (unlikely(PyDict_SetItem(__pyx_v_m, __pyx_v_key, ((PyObject *)__pyx_v_arr)) < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- /* "precomputation.pxi":275
+ /* "cdec/sa/precomputation.pxi":275
* arr.read_handle(f)
* m[key] = arr
* return m # <<<<<<<<<<<<<<
@@ -34815,7 +35339,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_read_map(CYTHON_UNUSED
__pyx_r = __pyx_v_m;
goto __pyx_L0;
- /* "precomputation.pxi":260
+ /* "cdec/sa/precomputation.pxi":260
*
*
* cdef read_map(self, FILE* f): # <<<<<<<<<<<<<<
@@ -34838,7 +35362,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_14Precomputation_read_map(CYTHON_UNUSED
return __pyx_r;
}
-/* "precomputation.pxi":278
+/* "cdec/sa/precomputation.pxi":278
*
*
* def precompute(self, stats, SuffixArray sarray): # <<<<<<<<<<<<<<
@@ -34988,7 +35512,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("precompute", 0);
- /* "precomputation.pxi":280
+ /* "cdec/sa/precomputation.pxi":280
* def precompute(self, stats, SuffixArray sarray):
* cdef int i, l, N, max_pattern_len, i1, l1, i2, l2, i3, l3, ptr1, ptr2, ptr3, is_super, sent_count, max_rank
* cdef DataArray darray = sarray.darray # <<<<<<<<<<<<<<
@@ -35000,7 +35524,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_v_darray = ((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "precomputation.pxi":285
+ /* "cdec/sa/precomputation.pxi":285
* cdef _Trie_Node* node
*
* data = darray.data # <<<<<<<<<<<<<<
@@ -35012,7 +35536,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_v_data = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "precomputation.pxi":287
+ /* "cdec/sa/precomputation.pxi":287
* data = darray.data
*
* frequent_patterns = TrieMap(len(darray.id2word)) # <<<<<<<<<<<<<<
@@ -35036,7 +35560,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_v_frequent_patterns = ((struct __pyx_obj_4cdec_2sa_3_sa_TrieMap *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "precomputation.pxi":288
+ /* "cdec/sa/precomputation.pxi":288
*
* frequent_patterns = TrieMap(len(darray.id2word))
* super_frequent_patterns = TrieMap(len(darray.id2word)) # <<<<<<<<<<<<<<
@@ -35060,7 +35584,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_v_super_frequent_patterns = ((struct __pyx_obj_4cdec_2sa_3_sa_TrieMap *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "precomputation.pxi":289
+ /* "cdec/sa/precomputation.pxi":289
* frequent_patterns = TrieMap(len(darray.id2word))
* super_frequent_patterns = TrieMap(len(darray.id2word))
* collocations = TrieMap(len(darray.id2word)) # <<<<<<<<<<<<<<
@@ -35084,7 +35608,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_v_collocations = ((struct __pyx_obj_4cdec_2sa_3_sa_TrieMap *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "precomputation.pxi":291
+ /* "cdec/sa/precomputation.pxi":291
* collocations = TrieMap(len(darray.id2word))
*
* I_set = set() # <<<<<<<<<<<<<<
@@ -35096,7 +35620,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_v_I_set = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "precomputation.pxi":292
+ /* "cdec/sa/precomputation.pxi":292
*
* I_set = set()
* J_set = set() # <<<<<<<<<<<<<<
@@ -35108,7 +35632,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_v_J_set = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "precomputation.pxi":293
+ /* "cdec/sa/precomputation.pxi":293
* I_set = set()
* J_set = set()
* J2_set = set() # <<<<<<<<<<<<<<
@@ -35120,7 +35644,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_v_J2_set = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "precomputation.pxi":294
+ /* "cdec/sa/precomputation.pxi":294
* J_set = set()
* J2_set = set()
* IJ_set = set() # <<<<<<<<<<<<<<
@@ -35132,7 +35656,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_v_IJ_set = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "precomputation.pxi":295
+ /* "cdec/sa/precomputation.pxi":295
* J2_set = set()
* IJ_set = set()
* pattern_rank = {} # <<<<<<<<<<<<<<
@@ -35144,7 +35668,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_v_pattern_rank = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "precomputation.pxi":297
+ /* "cdec/sa/precomputation.pxi":297
* pattern_rank = {}
*
* logger.info("Precomputing frequent intersections") # <<<<<<<<<<<<<<
@@ -35161,7 +35685,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "precomputation.pxi":298
+ /* "cdec/sa/precomputation.pxi":298
*
* logger.info("Precomputing frequent intersections")
* cdef float start_time = monitor_cpu() # <<<<<<<<<<<<<<
@@ -35192,7 +35716,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_start_time = __pyx_t_5;
- /* "precomputation.pxi":300
+ /* "cdec/sa/precomputation.pxi":300
* cdef float start_time = monitor_cpu()
*
* max_pattern_len = 0 # <<<<<<<<<<<<<<
@@ -35201,7 +35725,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
*/
__pyx_v_max_pattern_len = 0;
- /* "precomputation.pxi":301
+ /* "cdec/sa/precomputation.pxi":301
*
* max_pattern_len = 0
* for rank, (_, _, phrase) in enumerate(stats): # <<<<<<<<<<<<<<
@@ -35318,7 +35842,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_t_1 = __pyx_t_4;
__pyx_t_4 = 0;
- /* "precomputation.pxi":302
+ /* "cdec/sa/precomputation.pxi":302
* max_pattern_len = 0
* for rank, (_, _, phrase) in enumerate(stats):
* if rank >= self.precompute_rank: # <<<<<<<<<<<<<<
@@ -35333,7 +35857,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
if (__pyx_t_12) {
- /* "precomputation.pxi":303
+ /* "cdec/sa/precomputation.pxi":303
* for rank, (_, _, phrase) in enumerate(stats):
* if rank >= self.precompute_rank:
* break # <<<<<<<<<<<<<<
@@ -35343,7 +35867,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
goto __pyx_L4_break;
}
- /* "precomputation.pxi":304
+ /* "cdec/sa/precomputation.pxi":304
* if rank >= self.precompute_rank:
* break
* max_pattern_len = max(max_pattern_len, len(phrase)) # <<<<<<<<<<<<<<
@@ -35359,7 +35883,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
}
__pyx_v_max_pattern_len = __pyx_t_15;
- /* "precomputation.pxi":305
+ /* "cdec/sa/precomputation.pxi":305
* break
* max_pattern_len = max(max_pattern_len, len(phrase))
* frequent_patterns.insert(phrase) # <<<<<<<<<<<<<<
@@ -35395,7 +35919,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- /* "precomputation.pxi":306
+ /* "cdec/sa/precomputation.pxi":306
* max_pattern_len = max(max_pattern_len, len(phrase))
* frequent_patterns.insert(phrase)
* I_set.add(phrase) # <<<<<<<<<<<<<<
@@ -35404,7 +35928,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
*/
__pyx_t_16 = PySet_Add(__pyx_v_I_set, __pyx_v_phrase); if (unlikely(__pyx_t_16 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "precomputation.pxi":307
+ /* "cdec/sa/precomputation.pxi":307
* frequent_patterns.insert(phrase)
* I_set.add(phrase)
* pattern_rank[phrase] = rank # <<<<<<<<<<<<<<
@@ -35413,7 +35937,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
*/
if (unlikely(PyDict_SetItem(__pyx_v_pattern_rank, __pyx_v_phrase, __pyx_v_rank) < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "precomputation.pxi":308
+ /* "cdec/sa/precomputation.pxi":308
* I_set.add(phrase)
* pattern_rank[phrase] = rank
* if rank < self.precompute_secondary_rank: # <<<<<<<<<<<<<<
@@ -35428,7 +35952,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_12) {
- /* "precomputation.pxi":309
+ /* "cdec/sa/precomputation.pxi":309
* pattern_rank[phrase] = rank
* if rank < self.precompute_secondary_rank:
* super_frequent_patterns.insert(phrase) # <<<<<<<<<<<<<<
@@ -35464,7 +35988,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "precomputation.pxi":310
+ /* "cdec/sa/precomputation.pxi":310
* if rank < self.precompute_secondary_rank:
* super_frequent_patterns.insert(phrase)
* J_set.add(phrase) # <<<<<<<<<<<<<<
@@ -35476,7 +36000,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
}
__pyx_L8:;
- /* "precomputation.pxi":301
+ /* "cdec/sa/precomputation.pxi":301
*
* max_pattern_len = 0
* for rank, (_, _, phrase) in enumerate(stats): # <<<<<<<<<<<<<<
@@ -35488,7 +36012,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "precomputation.pxi":312
+ /* "cdec/sa/precomputation.pxi":312
* J_set.add(phrase)
*
* queue = IntList(increment=1000) # <<<<<<<<<<<<<<
@@ -35504,7 +36028,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_v_queue = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_3);
__pyx_t_3 = 0;
- /* "precomputation.pxi":314
+ /* "cdec/sa/precomputation.pxi":314
* queue = IntList(increment=1000)
*
* logger.info(" Computing inverted indexes...") # <<<<<<<<<<<<<<
@@ -35521,7 +36045,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "precomputation.pxi":315
+ /* "cdec/sa/precomputation.pxi":315
*
* logger.info(" Computing inverted indexes...")
* N = len(data) # <<<<<<<<<<<<<<
@@ -35531,7 +36055,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_data)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_N = __pyx_t_2;
- /* "precomputation.pxi":316
+ /* "cdec/sa/precomputation.pxi":316
* logger.info(" Computing inverted indexes...")
* N = len(data)
* for i from 0 <= i < N: # <<<<<<<<<<<<<<
@@ -35541,7 +36065,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_t_14 = __pyx_v_N;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_14; __pyx_v_i++) {
- /* "precomputation.pxi":317
+ /* "cdec/sa/precomputation.pxi":317
* N = len(data)
* for i from 0 <= i < N:
* sa_word_id = data.arr[i] # <<<<<<<<<<<<<<
@@ -35550,7 +36074,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
*/
__pyx_v_sa_word_id = (__pyx_v_data->arr[__pyx_v_i]);
- /* "precomputation.pxi":318
+ /* "cdec/sa/precomputation.pxi":318
* for i from 0 <= i < N:
* sa_word_id = data.arr[i]
* if sa_word_id == 1: # <<<<<<<<<<<<<<
@@ -35560,7 +36084,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_t_12 = ((__pyx_v_sa_word_id == 1) != 0);
if (__pyx_t_12) {
- /* "precomputation.pxi":319
+ /* "cdec/sa/precomputation.pxi":319
* sa_word_id = data.arr[i]
* if sa_word_id == 1:
* queue._append(-1) # <<<<<<<<<<<<<<
@@ -35572,7 +36096,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
}
/*else*/ {
- /* "precomputation.pxi":321
+ /* "cdec/sa/precomputation.pxi":321
* queue._append(-1)
* else:
* for l from 1 <= l <= max_pattern_len: # <<<<<<<<<<<<<<
@@ -35582,7 +36106,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_t_17 = __pyx_v_max_pattern_len;
for (__pyx_v_l = 1; __pyx_v_l <= __pyx_t_17; __pyx_v_l++) {
- /* "precomputation.pxi":322
+ /* "cdec/sa/precomputation.pxi":322
* else:
* for l from 1 <= l <= max_pattern_len:
* node = frequent_patterns._contains(data.arr+i, l) # <<<<<<<<<<<<<<
@@ -35591,7 +36115,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
*/
__pyx_v_node = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_TrieMap *)__pyx_v_frequent_patterns->__pyx_vtab)->_contains(__pyx_v_frequent_patterns, (__pyx_v_data->arr + __pyx_v_i), __pyx_v_l);
- /* "precomputation.pxi":323
+ /* "cdec/sa/precomputation.pxi":323
* for l from 1 <= l <= max_pattern_len:
* node = frequent_patterns._contains(data.arr+i, l)
* if node == NULL: # <<<<<<<<<<<<<<
@@ -35601,7 +36125,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_t_12 = ((__pyx_v_node == NULL) != 0);
if (__pyx_t_12) {
- /* "precomputation.pxi":324
+ /* "cdec/sa/precomputation.pxi":324
* node = frequent_patterns._contains(data.arr+i, l)
* if node == NULL:
* break # <<<<<<<<<<<<<<
@@ -35611,7 +36135,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
goto __pyx_L13_break;
}
- /* "precomputation.pxi":325
+ /* "cdec/sa/precomputation.pxi":325
* if node == NULL:
* break
* queue._append(i) # <<<<<<<<<<<<<<
@@ -35620,7 +36144,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_queue->__pyx_vtab)->_append(__pyx_v_queue, __pyx_v_i);
- /* "precomputation.pxi":326
+ /* "cdec/sa/precomputation.pxi":326
* break
* queue._append(i)
* queue._append(l) # <<<<<<<<<<<<<<
@@ -35629,7 +36153,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_queue->__pyx_vtab)->_append(__pyx_v_queue, __pyx_v_l);
- /* "precomputation.pxi":327
+ /* "cdec/sa/precomputation.pxi":327
* queue._append(i)
* queue._append(l)
* trie_node_data_append(node, i) # <<<<<<<<<<<<<<
@@ -35645,7 +36169,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_L11:;
}
- /* "precomputation.pxi":329
+ /* "cdec/sa/precomputation.pxi":329
* trie_node_data_append(node, i)
*
* logger.info(" Computing collocations...") # <<<<<<<<<<<<<<
@@ -35662,7 +36186,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "precomputation.pxi":330
+ /* "cdec/sa/precomputation.pxi":330
*
* logger.info(" Computing collocations...")
* N = len(queue) # <<<<<<<<<<<<<<
@@ -35672,7 +36196,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_queue)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_N = __pyx_t_2;
- /* "precomputation.pxi":331
+ /* "cdec/sa/precomputation.pxi":331
* logger.info(" Computing collocations...")
* N = len(queue)
* ptr1 = 0 # <<<<<<<<<<<<<<
@@ -35681,7 +36205,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
*/
__pyx_v_ptr1 = 0;
- /* "precomputation.pxi":332
+ /* "cdec/sa/precomputation.pxi":332
* N = len(queue)
* ptr1 = 0
* sent_count = 0 # <<<<<<<<<<<<<<
@@ -35690,7 +36214,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
*/
__pyx_v_sent_count = 0;
- /* "precomputation.pxi":333
+ /* "cdec/sa/precomputation.pxi":333
* ptr1 = 0
* sent_count = 0
* while ptr1 < N: # main loop # <<<<<<<<<<<<<<
@@ -35701,7 +36225,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_t_12 = ((__pyx_v_ptr1 < __pyx_v_N) != 0);
if (!__pyx_t_12) break;
- /* "precomputation.pxi":334
+ /* "cdec/sa/precomputation.pxi":334
* sent_count = 0
* while ptr1 < N: # main loop
* i1 = queue.arr[ptr1] # <<<<<<<<<<<<<<
@@ -35710,7 +36234,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
*/
__pyx_v_i1 = (__pyx_v_queue->arr[__pyx_v_ptr1]);
- /* "precomputation.pxi":335
+ /* "cdec/sa/precomputation.pxi":335
* while ptr1 < N: # main loop
* i1 = queue.arr[ptr1]
* if i1 > -1: # <<<<<<<<<<<<<<
@@ -35720,7 +36244,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_t_12 = ((__pyx_v_i1 > -1) != 0);
if (__pyx_t_12) {
- /* "precomputation.pxi":336
+ /* "cdec/sa/precomputation.pxi":336
* i1 = queue.arr[ptr1]
* if i1 > -1:
* l1 = queue.arr[ptr1+1] # <<<<<<<<<<<<<<
@@ -35729,7 +36253,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
*/
__pyx_v_l1 = (__pyx_v_queue->arr[(__pyx_v_ptr1 + 1)]);
- /* "precomputation.pxi":337
+ /* "cdec/sa/precomputation.pxi":337
* if i1 > -1:
* l1 = queue.arr[ptr1+1]
* ptr2 = ptr1 + 2 # <<<<<<<<<<<<<<
@@ -35738,7 +36262,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
*/
__pyx_v_ptr2 = (__pyx_v_ptr1 + 2);
- /* "precomputation.pxi":338
+ /* "cdec/sa/precomputation.pxi":338
* l1 = queue.arr[ptr1+1]
* ptr2 = ptr1 + 2
* while ptr2 < N: # <<<<<<<<<<<<<<
@@ -35749,7 +36273,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_t_12 = ((__pyx_v_ptr2 < __pyx_v_N) != 0);
if (!__pyx_t_12) break;
- /* "precomputation.pxi":339
+ /* "cdec/sa/precomputation.pxi":339
* ptr2 = ptr1 + 2
* while ptr2 < N:
* i2 = queue.arr[ptr2] # <<<<<<<<<<<<<<
@@ -35758,7 +36282,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
*/
__pyx_v_i2 = (__pyx_v_queue->arr[__pyx_v_ptr2]);
- /* "precomputation.pxi":340
+ /* "cdec/sa/precomputation.pxi":340
* while ptr2 < N:
* i2 = queue.arr[ptr2]
* if i2 == -1 or i2 - i1 >= self.train_max_initial_size: # <<<<<<<<<<<<<<
@@ -35778,7 +36302,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_L21_bool_binop_done:;
if (__pyx_t_12) {
- /* "precomputation.pxi":341
+ /* "cdec/sa/precomputation.pxi":341
* i2 = queue.arr[ptr2]
* if i2 == -1 or i2 - i1 >= self.train_max_initial_size:
* break # <<<<<<<<<<<<<<
@@ -35788,7 +36312,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
goto __pyx_L19_break;
}
- /* "precomputation.pxi":342
+ /* "cdec/sa/precomputation.pxi":342
* if i2 == -1 or i2 - i1 >= self.train_max_initial_size:
* break
* l2 = queue.arr[ptr2+1] # <<<<<<<<<<<<<<
@@ -35797,7 +36321,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
*/
__pyx_v_l2 = (__pyx_v_queue->arr[(__pyx_v_ptr2 + 1)]);
- /* "precomputation.pxi":343
+ /* "cdec/sa/precomputation.pxi":343
* break
* l2 = queue.arr[ptr2+1]
* if (i2 - i1 - l1 >= self.train_min_gap_size and # <<<<<<<<<<<<<<
@@ -35813,7 +36337,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
}
__pyx_L25_next_and:;
- /* "precomputation.pxi":344
+ /* "cdec/sa/precomputation.pxi":344
* l2 = queue.arr[ptr2+1]
* if (i2 - i1 - l1 >= self.train_min_gap_size and
* i2 + l2 - i1 <= self.train_max_initial_size and # <<<<<<<<<<<<<<
@@ -35829,7 +36353,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
}
__pyx_L26_next_and:;
- /* "precomputation.pxi":345
+ /* "cdec/sa/precomputation.pxi":345
* if (i2 - i1 - l1 >= self.train_min_gap_size and
* i2 + l2 - i1 <= self.train_max_initial_size and
* l1+l2+1 <= self.max_length): # <<<<<<<<<<<<<<
@@ -35841,7 +36365,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_L24_bool_binop_done:;
if (__pyx_t_12) {
- /* "precomputation.pxi":346
+ /* "cdec/sa/precomputation.pxi":346
* i2 + l2 - i1 <= self.train_max_initial_size and
* l1+l2+1 <= self.max_length):
* node = collocations._insert(data.arr+i1, l1) # <<<<<<<<<<<<<<
@@ -35850,7 +36374,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
*/
__pyx_v_node = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_TrieMap *)__pyx_v_collocations->__pyx_vtab)->_insert(__pyx_v_collocations, (__pyx_v_data->arr + __pyx_v_i1), __pyx_v_l1);
- /* "precomputation.pxi":347
+ /* "cdec/sa/precomputation.pxi":347
* l1+l2+1 <= self.max_length):
* node = collocations._insert(data.arr+i1, l1)
* node = trie_insert(node, -1) # <<<<<<<<<<<<<<
@@ -35859,7 +36383,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
*/
__pyx_v_node = __pyx_f_4cdec_2sa_3_sa_trie_insert(__pyx_v_node, -1);
- /* "precomputation.pxi":348
+ /* "cdec/sa/precomputation.pxi":348
* node = collocations._insert(data.arr+i1, l1)
* node = trie_insert(node, -1)
* for i from i2 <= i < i2+l2: # <<<<<<<<<<<<<<
@@ -35869,7 +36393,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_t_14 = (__pyx_v_i2 + __pyx_v_l2);
for (__pyx_v_i = __pyx_v_i2; __pyx_v_i < __pyx_t_14; __pyx_v_i++) {
- /* "precomputation.pxi":349
+ /* "cdec/sa/precomputation.pxi":349
* node = trie_insert(node, -1)
* for i from i2 <= i < i2+l2:
* node = trie_insert(node, data.arr[i]) # <<<<<<<<<<<<<<
@@ -35879,7 +36403,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_v_node = __pyx_f_4cdec_2sa_3_sa_trie_insert(__pyx_v_node, (__pyx_v_data->arr[__pyx_v_i]));
}
- /* "precomputation.pxi":350
+ /* "cdec/sa/precomputation.pxi":350
* for i from i2 <= i < i2+l2:
* node = trie_insert(node, data.arr[i])
* trie_node_data_append(node, i1) # <<<<<<<<<<<<<<
@@ -35890,7 +36414,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "precomputation.pxi":351
+ /* "cdec/sa/precomputation.pxi":351
* node = trie_insert(node, data.arr[i])
* trie_node_data_append(node, i1)
* trie_node_data_append(node, i2) # <<<<<<<<<<<<<<
@@ -35901,7 +36425,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "precomputation.pxi":352
+ /* "cdec/sa/precomputation.pxi":352
* trie_node_data_append(node, i1)
* trie_node_data_append(node, i2)
* if super_frequent_patterns._contains(data.arr+i2, l2) != NULL: # <<<<<<<<<<<<<<
@@ -35911,7 +36435,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_t_12 = ((((struct __pyx_vtabstruct_4cdec_2sa_3_sa_TrieMap *)__pyx_v_super_frequent_patterns->__pyx_vtab)->_contains(__pyx_v_super_frequent_patterns, (__pyx_v_data->arr + __pyx_v_i2), __pyx_v_l2) != NULL) != 0);
if (__pyx_t_12) {
- /* "precomputation.pxi":353
+ /* "cdec/sa/precomputation.pxi":353
* trie_node_data_append(node, i2)
* if super_frequent_patterns._contains(data.arr+i2, l2) != NULL:
* if super_frequent_patterns._contains(data.arr+i1, l1) != NULL: # <<<<<<<<<<<<<<
@@ -35921,7 +36445,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_t_12 = ((((struct __pyx_vtabstruct_4cdec_2sa_3_sa_TrieMap *)__pyx_v_super_frequent_patterns->__pyx_vtab)->_contains(__pyx_v_super_frequent_patterns, (__pyx_v_data->arr + __pyx_v_i1), __pyx_v_l1) != NULL) != 0);
if (__pyx_t_12) {
- /* "precomputation.pxi":354
+ /* "cdec/sa/precomputation.pxi":354
* if super_frequent_patterns._contains(data.arr+i2, l2) != NULL:
* if super_frequent_patterns._contains(data.arr+i1, l1) != NULL:
* is_super = 1 # <<<<<<<<<<<<<<
@@ -35933,7 +36457,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
}
/*else*/ {
- /* "precomputation.pxi":356
+ /* "cdec/sa/precomputation.pxi":356
* is_super = 1
* else:
* is_super = 0 # <<<<<<<<<<<<<<
@@ -35944,7 +36468,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
}
__pyx_L30:;
- /* "precomputation.pxi":357
+ /* "cdec/sa/precomputation.pxi":357
* else:
* is_super = 0
* ptr3 = ptr2 + 2 # <<<<<<<<<<<<<<
@@ -35953,7 +36477,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
*/
__pyx_v_ptr3 = (__pyx_v_ptr2 + 2);
- /* "precomputation.pxi":358
+ /* "cdec/sa/precomputation.pxi":358
* is_super = 0
* ptr3 = ptr2 + 2
* while ptr3 < N: # <<<<<<<<<<<<<<
@@ -35964,7 +36488,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_t_12 = ((__pyx_v_ptr3 < __pyx_v_N) != 0);
if (!__pyx_t_12) break;
- /* "precomputation.pxi":359
+ /* "cdec/sa/precomputation.pxi":359
* ptr3 = ptr2 + 2
* while ptr3 < N:
* i3 = queue.arr[ptr3] # <<<<<<<<<<<<<<
@@ -35973,7 +36497,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
*/
__pyx_v_i3 = (__pyx_v_queue->arr[__pyx_v_ptr3]);
- /* "precomputation.pxi":360
+ /* "cdec/sa/precomputation.pxi":360
* while ptr3 < N:
* i3 = queue.arr[ptr3]
* if i3 == -1 or i3 - i1 >= self.train_max_initial_size: # <<<<<<<<<<<<<<
@@ -35993,7 +36517,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_L34_bool_binop_done:;
if (__pyx_t_12) {
- /* "precomputation.pxi":361
+ /* "cdec/sa/precomputation.pxi":361
* i3 = queue.arr[ptr3]
* if i3 == -1 or i3 - i1 >= self.train_max_initial_size:
* break # <<<<<<<<<<<<<<
@@ -36003,7 +36527,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
goto __pyx_L32_break;
}
- /* "precomputation.pxi":362
+ /* "cdec/sa/precomputation.pxi":362
* if i3 == -1 or i3 - i1 >= self.train_max_initial_size:
* break
* l3 = queue.arr[ptr3+1] # <<<<<<<<<<<<<<
@@ -36012,7 +36536,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
*/
__pyx_v_l3 = (__pyx_v_queue->arr[(__pyx_v_ptr3 + 1)]);
- /* "precomputation.pxi":363
+ /* "cdec/sa/precomputation.pxi":363
* break
* l3 = queue.arr[ptr3+1]
* if (i3 - i2 - l2 >= self.train_min_gap_size and # <<<<<<<<<<<<<<
@@ -36028,7 +36552,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
}
__pyx_L38_next_and:;
- /* "precomputation.pxi":364
+ /* "cdec/sa/precomputation.pxi":364
* l3 = queue.arr[ptr3+1]
* if (i3 - i2 - l2 >= self.train_min_gap_size and
* i3 + l3 - i1 <= self.train_max_initial_size and # <<<<<<<<<<<<<<
@@ -36044,7 +36568,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
}
__pyx_L39_next_and:;
- /* "precomputation.pxi":365
+ /* "cdec/sa/precomputation.pxi":365
* if (i3 - i2 - l2 >= self.train_min_gap_size and
* i3 + l3 - i1 <= self.train_max_initial_size and
* l1+l2+l3+2 <= self.max_length): # <<<<<<<<<<<<<<
@@ -36056,7 +36580,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_L37_bool_binop_done:;
if (__pyx_t_12) {
- /* "precomputation.pxi":366
+ /* "cdec/sa/precomputation.pxi":366
* i3 + l3 - i1 <= self.train_max_initial_size and
* l1+l2+l3+2 <= self.max_length):
* if is_super or super_frequent_patterns._contains(data.arr+i3, l3) != NULL: # <<<<<<<<<<<<<<
@@ -36076,7 +36600,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_L41_bool_binop_done:;
if (__pyx_t_12) {
- /* "precomputation.pxi":367
+ /* "cdec/sa/precomputation.pxi":367
* l1+l2+l3+2 <= self.max_length):
* if is_super or super_frequent_patterns._contains(data.arr+i3, l3) != NULL:
* node = collocations._insert(data.arr+i1, l1) # <<<<<<<<<<<<<<
@@ -36085,7 +36609,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
*/
__pyx_v_node = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_TrieMap *)__pyx_v_collocations->__pyx_vtab)->_insert(__pyx_v_collocations, (__pyx_v_data->arr + __pyx_v_i1), __pyx_v_l1);
- /* "precomputation.pxi":368
+ /* "cdec/sa/precomputation.pxi":368
* if is_super or super_frequent_patterns._contains(data.arr+i3, l3) != NULL:
* node = collocations._insert(data.arr+i1, l1)
* node = trie_insert(node, -1) # <<<<<<<<<<<<<<
@@ -36094,7 +36618,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
*/
__pyx_v_node = __pyx_f_4cdec_2sa_3_sa_trie_insert(__pyx_v_node, -1);
- /* "precomputation.pxi":369
+ /* "cdec/sa/precomputation.pxi":369
* node = collocations._insert(data.arr+i1, l1)
* node = trie_insert(node, -1)
* for i from i2 <= i < i2+l2: # <<<<<<<<<<<<<<
@@ -36104,7 +36628,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_t_14 = (__pyx_v_i2 + __pyx_v_l2);
for (__pyx_v_i = __pyx_v_i2; __pyx_v_i < __pyx_t_14; __pyx_v_i++) {
- /* "precomputation.pxi":370
+ /* "cdec/sa/precomputation.pxi":370
* node = trie_insert(node, -1)
* for i from i2 <= i < i2+l2:
* node = trie_insert(node, data.arr[i]) # <<<<<<<<<<<<<<
@@ -36114,7 +36638,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_v_node = __pyx_f_4cdec_2sa_3_sa_trie_insert(__pyx_v_node, (__pyx_v_data->arr[__pyx_v_i]));
}
- /* "precomputation.pxi":371
+ /* "cdec/sa/precomputation.pxi":371
* for i from i2 <= i < i2+l2:
* node = trie_insert(node, data.arr[i])
* node = trie_insert(node, -1) # <<<<<<<<<<<<<<
@@ -36123,7 +36647,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
*/
__pyx_v_node = __pyx_f_4cdec_2sa_3_sa_trie_insert(__pyx_v_node, -1);
- /* "precomputation.pxi":372
+ /* "cdec/sa/precomputation.pxi":372
* node = trie_insert(node, data.arr[i])
* node = trie_insert(node, -1)
* for i from i3 <= i < i3+l3: # <<<<<<<<<<<<<<
@@ -36133,7 +36657,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_t_14 = (__pyx_v_i3 + __pyx_v_l3);
for (__pyx_v_i = __pyx_v_i3; __pyx_v_i < __pyx_t_14; __pyx_v_i++) {
- /* "precomputation.pxi":373
+ /* "cdec/sa/precomputation.pxi":373
* node = trie_insert(node, -1)
* for i from i3 <= i < i3+l3:
* node = trie_insert(node, data.arr[i]) # <<<<<<<<<<<<<<
@@ -36143,7 +36667,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_v_node = __pyx_f_4cdec_2sa_3_sa_trie_insert(__pyx_v_node, (__pyx_v_data->arr[__pyx_v_i]));
}
- /* "precomputation.pxi":374
+ /* "cdec/sa/precomputation.pxi":374
* for i from i3 <= i < i3+l3:
* node = trie_insert(node, data.arr[i])
* trie_node_data_append(node, i1) # <<<<<<<<<<<<<<
@@ -36154,7 +36678,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "precomputation.pxi":375
+ /* "cdec/sa/precomputation.pxi":375
* node = trie_insert(node, data.arr[i])
* trie_node_data_append(node, i1)
* trie_node_data_append(node, i2) # <<<<<<<<<<<<<<
@@ -36165,7 +36689,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "precomputation.pxi":376
+ /* "cdec/sa/precomputation.pxi":376
* trie_node_data_append(node, i1)
* trie_node_data_append(node, i2)
* trie_node_data_append(node, i3) # <<<<<<<<<<<<<<
@@ -36182,7 +36706,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
}
__pyx_L36:;
- /* "precomputation.pxi":377
+ /* "cdec/sa/precomputation.pxi":377
* trie_node_data_append(node, i2)
* trie_node_data_append(node, i3)
* ptr3 = ptr3 + 2 # <<<<<<<<<<<<<<
@@ -36199,7 +36723,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
}
__pyx_L23:;
- /* "precomputation.pxi":378
+ /* "cdec/sa/precomputation.pxi":378
* trie_node_data_append(node, i3)
* ptr3 = ptr3 + 2
* ptr2 = ptr2 + 2 # <<<<<<<<<<<<<<
@@ -36210,7 +36734,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
}
__pyx_L19_break:;
- /* "precomputation.pxi":379
+ /* "cdec/sa/precomputation.pxi":379
* ptr3 = ptr3 + 2
* ptr2 = ptr2 + 2
* ptr1 = ptr1 + 2 # <<<<<<<<<<<<<<
@@ -36222,7 +36746,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
}
/*else*/ {
- /* "precomputation.pxi":381
+ /* "cdec/sa/precomputation.pxi":381
* ptr1 = ptr1 + 2
* else:
* sent_count = sent_count + 1 # <<<<<<<<<<<<<<
@@ -36231,7 +36755,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
*/
__pyx_v_sent_count = (__pyx_v_sent_count + 1);
- /* "precomputation.pxi":382
+ /* "cdec/sa/precomputation.pxi":382
* else:
* sent_count = sent_count + 1
* if sent_count % 10000 == 0: # <<<<<<<<<<<<<<
@@ -36241,7 +36765,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_t_12 = ((__Pyx_mod_long(__pyx_v_sent_count, 10000) == 0) != 0);
if (__pyx_t_12) {
- /* "precomputation.pxi":383
+ /* "cdec/sa/precomputation.pxi":383
* sent_count = sent_count + 1
* if sent_count % 10000 == 0:
* logger.debug(" %d sentences", sent_count) # <<<<<<<<<<<<<<
@@ -36287,7 +36811,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
}
__pyx_L47:;
- /* "precomputation.pxi":384
+ /* "cdec/sa/precomputation.pxi":384
* if sent_count % 10000 == 0:
* logger.debug(" %d sentences", sent_count)
* ptr1 = ptr1 + 1 # <<<<<<<<<<<<<<
@@ -36299,7 +36823,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_L17:;
}
- /* "precomputation.pxi":386
+ /* "cdec/sa/precomputation.pxi":386
* ptr1 = ptr1 + 1
*
* self.precomputed_collocations = collocations.toMap(False) # <<<<<<<<<<<<<<
@@ -36317,7 +36841,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_v_self->precomputed_collocations = __pyx_t_4;
__pyx_t_4 = 0;
- /* "precomputation.pxi":387
+ /* "cdec/sa/precomputation.pxi":387
*
* self.precomputed_collocations = collocations.toMap(False)
* self.precomputed_index = frequent_patterns.toMap(True) # <<<<<<<<<<<<<<
@@ -36335,7 +36859,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_v_self->precomputed_index = __pyx_t_3;
__pyx_t_3 = 0;
- /* "precomputation.pxi":389
+ /* "cdec/sa/precomputation.pxi":389
* self.precomputed_index = frequent_patterns.toMap(True)
*
* x = 0 # <<<<<<<<<<<<<<
@@ -36345,7 +36869,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__Pyx_INCREF(__pyx_int_0);
__pyx_v_x = __pyx_int_0;
- /* "precomputation.pxi":390
+ /* "cdec/sa/precomputation.pxi":390
*
* x = 0
* for pattern1 in J_set: # <<<<<<<<<<<<<<
@@ -36371,7 +36895,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__Pyx_XDECREF_SET(__pyx_v_pattern1, __pyx_t_4);
__pyx_t_4 = 0;
- /* "precomputation.pxi":391
+ /* "cdec/sa/precomputation.pxi":391
* x = 0
* for pattern1 in J_set:
* for pattern2 in J_set: # <<<<<<<<<<<<<<
@@ -36397,7 +36921,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__Pyx_XDECREF_SET(__pyx_v_pattern2, __pyx_t_8);
__pyx_t_8 = 0;
- /* "precomputation.pxi":392
+ /* "cdec/sa/precomputation.pxi":392
* for pattern1 in J_set:
* for pattern2 in J_set:
* if len(pattern1) + len(pattern2) + 1 < self.max_length: # <<<<<<<<<<<<<<
@@ -36409,7 +36933,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_t_12 = ((((__pyx_t_2 + __pyx_t_15) + 1) < __pyx_v_self->max_length) != 0);
if (__pyx_t_12) {
- /* "precomputation.pxi":393
+ /* "cdec/sa/precomputation.pxi":393
* for pattern2 in J_set:
* if len(pattern1) + len(pattern2) + 1 < self.max_length:
* combined_pattern = pattern1 + (-1,) + pattern2 # <<<<<<<<<<<<<<
@@ -36424,7 +36948,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__Pyx_XDECREF_SET(__pyx_v_combined_pattern, __pyx_t_1);
__pyx_t_1 = 0;
- /* "precomputation.pxi":394
+ /* "cdec/sa/precomputation.pxi":394
* if len(pattern1) + len(pattern2) + 1 < self.max_length:
* combined_pattern = pattern1 + (-1,) + pattern2
* J2_set.add(combined_pattern) # <<<<<<<<<<<<<<
@@ -36436,7 +36960,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
}
__pyx_L52:;
- /* "precomputation.pxi":391
+ /* "cdec/sa/precomputation.pxi":391
* x = 0
* for pattern1 in J_set:
* for pattern2 in J_set: # <<<<<<<<<<<<<<
@@ -36446,7 +36970,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "precomputation.pxi":390
+ /* "cdec/sa/precomputation.pxi":390
*
* x = 0
* for pattern1 in J_set: # <<<<<<<<<<<<<<
@@ -36456,7 +36980,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "precomputation.pxi":396
+ /* "cdec/sa/precomputation.pxi":396
* J2_set.add(combined_pattern)
*
* for pattern1 in I_set: # <<<<<<<<<<<<<<
@@ -36482,7 +37006,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__Pyx_XDECREF_SET(__pyx_v_pattern1, __pyx_t_4);
__pyx_t_4 = 0;
- /* "precomputation.pxi":397
+ /* "cdec/sa/precomputation.pxi":397
*
* for pattern1 in I_set:
* for pattern2 in I_set: # <<<<<<<<<<<<<<
@@ -36508,7 +37032,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__Pyx_XDECREF_SET(__pyx_v_pattern2, __pyx_t_1);
__pyx_t_1 = 0;
- /* "precomputation.pxi":398
+ /* "cdec/sa/precomputation.pxi":398
* for pattern1 in I_set:
* for pattern2 in I_set:
* x = x+1 # <<<<<<<<<<<<<<
@@ -36520,7 +37044,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__Pyx_DECREF_SET(__pyx_v_x, __pyx_t_1);
__pyx_t_1 = 0;
- /* "precomputation.pxi":399
+ /* "cdec/sa/precomputation.pxi":399
* for pattern2 in I_set:
* x = x+1
* if len(pattern1) + len(pattern2) + 1 <= self.max_length: # <<<<<<<<<<<<<<
@@ -36532,7 +37056,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_t_12 = ((((__pyx_t_15 + __pyx_t_2) + 1) <= __pyx_v_self->max_length) != 0);
if (__pyx_t_12) {
- /* "precomputation.pxi":400
+ /* "cdec/sa/precomputation.pxi":400
* x = x+1
* if len(pattern1) + len(pattern2) + 1 <= self.max_length:
* combined_pattern = pattern1 + (-1,) + pattern2 # <<<<<<<<<<<<<<
@@ -36547,7 +37071,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__Pyx_XDECREF_SET(__pyx_v_combined_pattern, __pyx_t_8);
__pyx_t_8 = 0;
- /* "precomputation.pxi":401
+ /* "cdec/sa/precomputation.pxi":401
* if len(pattern1) + len(pattern2) + 1 <= self.max_length:
* combined_pattern = pattern1 + (-1,) + pattern2
* IJ_set.add(combined_pattern) # <<<<<<<<<<<<<<
@@ -36559,7 +37083,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
}
__pyx_L57:;
- /* "precomputation.pxi":397
+ /* "cdec/sa/precomputation.pxi":397
*
* for pattern1 in I_set:
* for pattern2 in I_set: # <<<<<<<<<<<<<<
@@ -36569,7 +37093,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "precomputation.pxi":396
+ /* "cdec/sa/precomputation.pxi":396
* J2_set.add(combined_pattern)
*
* for pattern1 in I_set: # <<<<<<<<<<<<<<
@@ -36579,7 +37103,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "precomputation.pxi":403
+ /* "cdec/sa/precomputation.pxi":403
* IJ_set.add(combined_pattern)
*
* for pattern1 in I_set: # <<<<<<<<<<<<<<
@@ -36605,7 +37129,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__Pyx_XDECREF_SET(__pyx_v_pattern1, __pyx_t_4);
__pyx_t_4 = 0;
- /* "precomputation.pxi":404
+ /* "cdec/sa/precomputation.pxi":404
*
* for pattern1 in I_set:
* for pattern2 in J2_set: # <<<<<<<<<<<<<<
@@ -36631,7 +37155,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__Pyx_XDECREF_SET(__pyx_v_pattern2, __pyx_t_8);
__pyx_t_8 = 0;
- /* "precomputation.pxi":405
+ /* "cdec/sa/precomputation.pxi":405
* for pattern1 in I_set:
* for pattern2 in J2_set:
* x = x+2 # <<<<<<<<<<<<<<
@@ -36643,7 +37167,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__Pyx_DECREF_SET(__pyx_v_x, __pyx_t_8);
__pyx_t_8 = 0;
- /* "precomputation.pxi":406
+ /* "cdec/sa/precomputation.pxi":406
* for pattern2 in J2_set:
* x = x+2
* if len(pattern1) + len(pattern2) + 1<= self.max_length: # <<<<<<<<<<<<<<
@@ -36655,7 +37179,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_t_12 = ((((__pyx_t_2 + __pyx_t_15) + 1) <= __pyx_v_self->max_length) != 0);
if (__pyx_t_12) {
- /* "precomputation.pxi":407
+ /* "cdec/sa/precomputation.pxi":407
* x = x+2
* if len(pattern1) + len(pattern2) + 1<= self.max_length:
* combined_pattern = pattern1 + (-1,) + pattern2 # <<<<<<<<<<<<<<
@@ -36670,7 +37194,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__Pyx_XDECREF_SET(__pyx_v_combined_pattern, __pyx_t_1);
__pyx_t_1 = 0;
- /* "precomputation.pxi":408
+ /* "cdec/sa/precomputation.pxi":408
* if len(pattern1) + len(pattern2) + 1<= self.max_length:
* combined_pattern = pattern1 + (-1,) + pattern2
* IJ_set.add(combined_pattern) # <<<<<<<<<<<<<<
@@ -36679,7 +37203,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
*/
__pyx_t_16 = PySet_Add(__pyx_v_IJ_set, __pyx_v_combined_pattern); if (unlikely(__pyx_t_16 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "precomputation.pxi":409
+ /* "cdec/sa/precomputation.pxi":409
* combined_pattern = pattern1 + (-1,) + pattern2
* IJ_set.add(combined_pattern)
* combined_pattern = pattern2 + (-1,) + pattern1 # <<<<<<<<<<<<<<
@@ -36694,7 +37218,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__Pyx_DECREF_SET(__pyx_v_combined_pattern, __pyx_t_8);
__pyx_t_8 = 0;
- /* "precomputation.pxi":410
+ /* "cdec/sa/precomputation.pxi":410
* IJ_set.add(combined_pattern)
* combined_pattern = pattern2 + (-1,) + pattern1
* IJ_set.add(combined_pattern) # <<<<<<<<<<<<<<
@@ -36706,7 +37230,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
}
__pyx_L62:;
- /* "precomputation.pxi":404
+ /* "cdec/sa/precomputation.pxi":404
*
* for pattern1 in I_set:
* for pattern2 in J2_set: # <<<<<<<<<<<<<<
@@ -36716,7 +37240,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "precomputation.pxi":403
+ /* "cdec/sa/precomputation.pxi":403
* IJ_set.add(combined_pattern)
*
* for pattern1 in I_set: # <<<<<<<<<<<<<<
@@ -36726,7 +37250,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "precomputation.pxi":412
+ /* "cdec/sa/precomputation.pxi":412
* IJ_set.add(combined_pattern)
*
* N = len(pattern_rank) # <<<<<<<<<<<<<<
@@ -36736,7 +37260,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_t_15 = PyDict_Size(__pyx_v_pattern_rank); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_N = __pyx_t_15;
- /* "precomputation.pxi":413
+ /* "cdec/sa/precomputation.pxi":413
*
* N = len(pattern_rank)
* cost_by_rank = IntList(initial_len=N) # <<<<<<<<<<<<<<
@@ -36755,7 +37279,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_v_cost_by_rank = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_4);
__pyx_t_4 = 0;
- /* "precomputation.pxi":414
+ /* "cdec/sa/precomputation.pxi":414
* N = len(pattern_rank)
* cost_by_rank = IntList(initial_len=N)
* count_by_rank = IntList(initial_len=N) # <<<<<<<<<<<<<<
@@ -36774,7 +37298,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_v_count_by_rank = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_3);
__pyx_t_3 = 0;
- /* "precomputation.pxi":415
+ /* "cdec/sa/precomputation.pxi":415
* cost_by_rank = IntList(initial_len=N)
* count_by_rank = IntList(initial_len=N)
* for pattern, arr in self.precomputed_collocations.iteritems(): # <<<<<<<<<<<<<<
@@ -36802,7 +37326,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__Pyx_XDECREF_SET(__pyx_v_arr, __pyx_t_8);
__pyx_t_8 = 0;
- /* "precomputation.pxi":416
+ /* "cdec/sa/precomputation.pxi":416
* count_by_rank = IntList(initial_len=N)
* for pattern, arr in self.precomputed_collocations.iteritems():
* if pattern not in IJ_set: # <<<<<<<<<<<<<<
@@ -36813,7 +37337,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_t_18 = (__pyx_t_12 != 0);
if (__pyx_t_18) {
- /* "precomputation.pxi":417
+ /* "cdec/sa/precomputation.pxi":417
* for pattern, arr in self.precomputed_collocations.iteritems():
* if pattern not in IJ_set:
* s = "" # <<<<<<<<<<<<<<
@@ -36823,7 +37347,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__Pyx_INCREF(__pyx_kp_s__32);
__Pyx_XDECREF_SET(__pyx_v_s, __pyx_kp_s__32);
- /* "precomputation.pxi":418
+ /* "cdec/sa/precomputation.pxi":418
* if pattern not in IJ_set:
* s = ""
* for word_id in pattern: # <<<<<<<<<<<<<<
@@ -36870,7 +37394,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__Pyx_XDECREF_SET(__pyx_v_word_id, __pyx_t_4);
__pyx_t_4 = 0;
- /* "precomputation.pxi":419
+ /* "cdec/sa/precomputation.pxi":419
* s = ""
* for word_id in pattern:
* if word_id == -1: # <<<<<<<<<<<<<<
@@ -36882,7 +37406,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_18) {
- /* "precomputation.pxi":420
+ /* "cdec/sa/precomputation.pxi":420
* for word_id in pattern:
* if word_id == -1:
* s = s + "X " # <<<<<<<<<<<<<<
@@ -36897,7 +37421,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
}
/*else*/ {
- /* "precomputation.pxi":422
+ /* "cdec/sa/precomputation.pxi":422
* s = s + "X "
* else:
* s = s + darray.id2word[word_id] + " " # <<<<<<<<<<<<<<
@@ -36917,7 +37441,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
}
__pyx_L68:;
- /* "precomputation.pxi":418
+ /* "cdec/sa/precomputation.pxi":418
* if pattern not in IJ_set:
* s = ""
* for word_id in pattern: # <<<<<<<<<<<<<<
@@ -36927,7 +37451,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- /* "precomputation.pxi":423
+ /* "cdec/sa/precomputation.pxi":423
* else:
* s = s + darray.id2word[word_id] + " "
* logger.warn("ERROR: unexpected pattern %s in set of precomputed collocations", s) # <<<<<<<<<<<<<<
@@ -36971,7 +37495,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
}
/*else*/ {
- /* "precomputation.pxi":425
+ /* "cdec/sa/precomputation.pxi":425
* logger.warn("ERROR: unexpected pattern %s in set of precomputed collocations", s)
* else:
* chunk = () # <<<<<<<<<<<<<<
@@ -36981,7 +37505,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__Pyx_INCREF(__pyx_empty_tuple);
__Pyx_XDECREF_SET(__pyx_v_chunk, __pyx_empty_tuple);
- /* "precomputation.pxi":426
+ /* "cdec/sa/precomputation.pxi":426
* else:
* chunk = ()
* max_rank = 0 # <<<<<<<<<<<<<<
@@ -36990,7 +37514,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
*/
__pyx_v_max_rank = 0;
- /* "precomputation.pxi":427
+ /* "cdec/sa/precomputation.pxi":427
* chunk = ()
* max_rank = 0
* arity = 0 # <<<<<<<<<<<<<<
@@ -37000,7 +37524,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__Pyx_INCREF(__pyx_int_0);
__Pyx_XDECREF_SET(__pyx_v_arity, __pyx_int_0);
- /* "precomputation.pxi":428
+ /* "cdec/sa/precomputation.pxi":428
* max_rank = 0
* arity = 0
* for word_id in pattern: # <<<<<<<<<<<<<<
@@ -37047,7 +37571,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__Pyx_XDECREF_SET(__pyx_v_word_id, __pyx_t_1);
__pyx_t_1 = 0;
- /* "precomputation.pxi":429
+ /* "cdec/sa/precomputation.pxi":429
* arity = 0
* for word_id in pattern:
* if word_id == -1: # <<<<<<<<<<<<<<
@@ -37059,7 +37583,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_18) {
- /* "precomputation.pxi":430
+ /* "cdec/sa/precomputation.pxi":430
* for word_id in pattern:
* if word_id == -1:
* max_rank = max(max_rank, pattern_rank[chunk]) # <<<<<<<<<<<<<<
@@ -37089,7 +37613,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_v_max_rank = __pyx_t_17;
- /* "precomputation.pxi":431
+ /* "cdec/sa/precomputation.pxi":431
* if word_id == -1:
* max_rank = max(max_rank, pattern_rank[chunk])
* arity = arity + 1 # <<<<<<<<<<<<<<
@@ -37101,7 +37625,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__Pyx_DECREF_SET(__pyx_v_arity, __pyx_t_9);
__pyx_t_9 = 0;
- /* "precomputation.pxi":432
+ /* "cdec/sa/precomputation.pxi":432
* max_rank = max(max_rank, pattern_rank[chunk])
* arity = arity + 1
* chunk = () # <<<<<<<<<<<<<<
@@ -37114,7 +37638,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
}
/*else*/ {
- /* "precomputation.pxi":434
+ /* "cdec/sa/precomputation.pxi":434
* chunk = ()
* else:
* chunk = chunk + (word_id,) # <<<<<<<<<<<<<<
@@ -37134,7 +37658,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
}
__pyx_L71:;
- /* "precomputation.pxi":428
+ /* "cdec/sa/precomputation.pxi":428
* max_rank = 0
* arity = 0
* for word_id in pattern: # <<<<<<<<<<<<<<
@@ -37144,7 +37668,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- /* "precomputation.pxi":435
+ /* "cdec/sa/precomputation.pxi":435
* else:
* chunk = chunk + (word_id,)
* max_rank = max(max_rank, pattern_rank[chunk]) # <<<<<<<<<<<<<<
@@ -37174,7 +37698,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_max_rank = __pyx_t_17;
- /* "precomputation.pxi":436
+ /* "cdec/sa/precomputation.pxi":436
* chunk = chunk + (word_id,)
* max_rank = max(max_rank, pattern_rank[chunk])
* cost_by_rank.arr[max_rank] = cost_by_rank.arr[max_rank] + (4*len(arr)) # <<<<<<<<<<<<<<
@@ -37184,7 +37708,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_t_13 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
(__pyx_v_cost_by_rank->arr[__pyx_v_max_rank]) = ((__pyx_v_cost_by_rank->arr[__pyx_v_max_rank]) + (4 * __pyx_t_13));
- /* "precomputation.pxi":437
+ /* "cdec/sa/precomputation.pxi":437
* max_rank = max(max_rank, pattern_rank[chunk])
* cost_by_rank.arr[max_rank] = cost_by_rank.arr[max_rank] + (4*len(arr))
* count_by_rank.arr[max_rank] = count_by_rank.arr[max_rank] + (len(arr)/(arity+1)) # <<<<<<<<<<<<<<
@@ -37214,7 +37738,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "precomputation.pxi":439
+ /* "cdec/sa/precomputation.pxi":439
* count_by_rank.arr[max_rank] = count_by_rank.arr[max_rank] + (len(arr)/(arity+1))
*
* cumul_cost = 0 # <<<<<<<<<<<<<<
@@ -37224,7 +37748,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__Pyx_INCREF(__pyx_int_0);
__pyx_v_cumul_cost = __pyx_int_0;
- /* "precomputation.pxi":440
+ /* "cdec/sa/precomputation.pxi":440
*
* cumul_cost = 0
* cumul_count = 0 # <<<<<<<<<<<<<<
@@ -37234,7 +37758,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__Pyx_INCREF(__pyx_int_0);
__pyx_v_cumul_count = __pyx_int_0;
- /* "precomputation.pxi":441
+ /* "cdec/sa/precomputation.pxi":441
* cumul_cost = 0
* cumul_count = 0
* for i from 0 <= i < N: # <<<<<<<<<<<<<<
@@ -37244,7 +37768,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_t_14 = __pyx_v_N;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_14; __pyx_v_i++) {
- /* "precomputation.pxi":442
+ /* "cdec/sa/precomputation.pxi":442
* cumul_count = 0
* for i from 0 <= i < N:
* cumul_cost = cumul_cost + cost_by_rank.arr[i] # <<<<<<<<<<<<<<
@@ -37259,7 +37783,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__Pyx_DECREF_SET(__pyx_v_cumul_cost, __pyx_t_7);
__pyx_t_7 = 0;
- /* "precomputation.pxi":443
+ /* "cdec/sa/precomputation.pxi":443
* for i from 0 <= i < N:
* cumul_cost = cumul_cost + cost_by_rank.arr[i]
* cumul_count = cumul_count + count_by_rank.arr[i] # <<<<<<<<<<<<<<
@@ -37274,7 +37798,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__Pyx_DECREF_SET(__pyx_v_cumul_count, __pyx_t_3);
__pyx_t_3 = 0;
- /* "precomputation.pxi":444
+ /* "cdec/sa/precomputation.pxi":444
* cumul_cost = cumul_cost + cost_by_rank.arr[i]
* cumul_count = cumul_count + count_by_rank.arr[i]
* logger.debug("RANK %d\tCOUNT, COST: %d %d\tCUMUL: %d, %d", i, count_by_rank.arr[i], cost_by_rank.arr[i], cumul_count, cumul_cost) # <<<<<<<<<<<<<<
@@ -37334,7 +37858,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
- /* "precomputation.pxi":446
+ /* "cdec/sa/precomputation.pxi":446
* logger.debug("RANK %d\tCOUNT, COST: %d %d\tCUMUL: %d, %d", i, count_by_rank.arr[i], cost_by_rank.arr[i], cumul_count, cumul_cost)
*
* num_found_patterns = len(self.precomputed_collocations) # <<<<<<<<<<<<<<
@@ -37347,7 +37871,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_num_found_patterns = __pyx_t_2;
- /* "precomputation.pxi":447
+ /* "cdec/sa/precomputation.pxi":447
*
* num_found_patterns = len(self.precomputed_collocations)
* for pattern in IJ_set: # <<<<<<<<<<<<<<
@@ -37373,7 +37897,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__Pyx_XDECREF_SET(__pyx_v_pattern, __pyx_t_9);
__pyx_t_9 = 0;
- /* "precomputation.pxi":448
+ /* "cdec/sa/precomputation.pxi":448
* num_found_patterns = len(self.precomputed_collocations)
* for pattern in IJ_set:
* if pattern not in self.precomputed_collocations: # <<<<<<<<<<<<<<
@@ -37384,7 +37908,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__pyx_t_12 = (__pyx_t_18 != 0);
if (__pyx_t_12) {
- /* "precomputation.pxi":449
+ /* "cdec/sa/precomputation.pxi":449
* for pattern in IJ_set:
* if pattern not in self.precomputed_collocations:
* self.precomputed_collocations[pattern] = IntList() # <<<<<<<<<<<<<<
@@ -37399,7 +37923,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
}
__pyx_L76:;
- /* "precomputation.pxi":447
+ /* "cdec/sa/precomputation.pxi":447
*
* num_found_patterns = len(self.precomputed_collocations)
* for pattern in IJ_set: # <<<<<<<<<<<<<<
@@ -37409,7 +37933,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "precomputation.pxi":451
+ /* "cdec/sa/precomputation.pxi":451
* self.precomputed_collocations[pattern] = IntList()
*
* cdef float stop_time = monitor_cpu() # <<<<<<<<<<<<<<
@@ -37440,7 +37964,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_stop_time = __pyx_t_5;
- /* "precomputation.pxi":452
+ /* "cdec/sa/precomputation.pxi":452
*
* cdef float stop_time = monitor_cpu()
* logger.info("Precomputed collocations for %d patterns out of %d possible (upper bound %d)", num_found_patterns, len(self.precomputed_collocations), x) # <<<<<<<<<<<<<<
@@ -37495,7 +38019,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "precomputation.pxi":453
+ /* "cdec/sa/precomputation.pxi":453
* cdef float stop_time = monitor_cpu()
* logger.info("Precomputed collocations for %d patterns out of %d possible (upper bound %d)", num_found_patterns, len(self.precomputed_collocations), x)
* logger.info("Precomputed inverted index for %d patterns ", len(self.precomputed_index)) # <<<<<<<<<<<<<<
@@ -37541,7 +38065,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "precomputation.pxi":454
+ /* "cdec/sa/precomputation.pxi":454
* logger.info("Precomputed collocations for %d patterns out of %d possible (upper bound %d)", num_found_patterns, len(self.precomputed_collocations), x)
* logger.info("Precomputed inverted index for %d patterns ", len(self.precomputed_index))
* logger.info("Precomputation took %f seconds", (stop_time - start_time)) # <<<<<<<<<<<<<<
@@ -37582,7 +38106,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "precomputation.pxi":278
+ /* "cdec/sa/precomputation.pxi":278
*
*
* def precompute(self, stats, SuffixArray sarray): # <<<<<<<<<<<<<<
@@ -37637,7 +38161,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_14Precomputation_6precompute(struct __p
return __pyx_r;
}
-/* "suffix_array.pxi":11
+/* "cdec/sa/suffix_array.pxi":11
* cdef IntList ha
*
* def __cinit__(self, from_binary=None, from_text=None, side=None): # <<<<<<<<<<<<<<
@@ -37736,7 +38260,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_11SuffixArray___cinit__(struct __pyx_obj_4cde
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "suffix_array.pxi":12
+ /* "cdec/sa/suffix_array.pxi":12
*
* def __cinit__(self, from_binary=None, from_text=None, side=None):
* self.darray = DataArray() # <<<<<<<<<<<<<<
@@ -37751,7 +38275,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_11SuffixArray___cinit__(struct __pyx_obj_4cde
__pyx_v_self->darray = ((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "suffix_array.pxi":13
+ /* "cdec/sa/suffix_array.pxi":13
* def __cinit__(self, from_binary=None, from_text=None, side=None):
* self.darray = DataArray()
* self.sa = IntList() # <<<<<<<<<<<<<<
@@ -37766,7 +38290,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_11SuffixArray___cinit__(struct __pyx_obj_4cde
__pyx_v_self->sa = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "suffix_array.pxi":14
+ /* "cdec/sa/suffix_array.pxi":14
* self.darray = DataArray()
* self.sa = IntList()
* self.ha = IntList() # <<<<<<<<<<<<<<
@@ -37781,7 +38305,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_11SuffixArray___cinit__(struct __pyx_obj_4cde
__pyx_v_self->ha = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "suffix_array.pxi":15
+ /* "cdec/sa/suffix_array.pxi":15
* self.sa = IntList()
* self.ha = IntList()
* if from_binary: # <<<<<<<<<<<<<<
@@ -37791,7 +38315,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_11SuffixArray___cinit__(struct __pyx_obj_4cde
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_from_binary); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_2) {
- /* "suffix_array.pxi":16
+ /* "cdec/sa/suffix_array.pxi":16
* self.ha = IntList()
* if from_binary:
* self.read_binary(from_binary) # <<<<<<<<<<<<<<
@@ -37829,7 +38353,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_11SuffixArray___cinit__(struct __pyx_obj_4cde
goto __pyx_L3;
}
- /* "suffix_array.pxi":17
+ /* "cdec/sa/suffix_array.pxi":17
* if from_binary:
* self.read_binary(from_binary)
* elif from_text: # <<<<<<<<<<<<<<
@@ -37839,7 +38363,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_11SuffixArray___cinit__(struct __pyx_obj_4cde
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_from_text); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_2) {
- /* "suffix_array.pxi":18
+ /* "cdec/sa/suffix_array.pxi":18
* self.read_binary(from_binary)
* elif from_text:
* self.read_text(from_text, side) # <<<<<<<<<<<<<<
@@ -37880,7 +38404,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_11SuffixArray___cinit__(struct __pyx_obj_4cde
}
__pyx_L3:;
- /* "suffix_array.pxi":11
+ /* "cdec/sa/suffix_array.pxi":11
* cdef IntList ha
*
* def __cinit__(self, from_binary=None, from_text=None, side=None): # <<<<<<<<<<<<<<
@@ -37903,7 +38427,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_11SuffixArray___cinit__(struct __pyx_obj_4cde
return __pyx_r;
}
-/* "suffix_array.pxi":20
+/* "cdec/sa/suffix_array.pxi":20
* self.read_text(from_text, side)
*
* def __getitem__(self, i): # <<<<<<<<<<<<<<
@@ -37934,7 +38458,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_2__getitem__(struct __pyx
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__getitem__", 0);
- /* "suffix_array.pxi":21
+ /* "cdec/sa/suffix_array.pxi":21
*
* def __getitem__(self, i):
* return self.sa.arr[i] # <<<<<<<<<<<<<<
@@ -37949,7 +38473,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_2__getitem__(struct __pyx
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "suffix_array.pxi":20
+ /* "cdec/sa/suffix_array.pxi":20
* self.read_text(from_text, side)
*
* def __getitem__(self, i): # <<<<<<<<<<<<<<
@@ -37968,7 +38492,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_2__getitem__(struct __pyx
return __pyx_r;
}
-/* "suffix_array.pxi":23
+/* "cdec/sa/suffix_array.pxi":23
* return self.sa.arr[i]
*
* def read_text(self, filename, side): # <<<<<<<<<<<<<<
@@ -38072,7 +38596,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("read_text", 0);
- /* "suffix_array.pxi":29
+ /* "cdec/sa/suffix_array.pxi":29
* cdef IntList isa, word_count
*
* self.darray = DataArray(from_text=filename, side=side, use_sent_id=True) # <<<<<<<<<<<<<<
@@ -38093,7 +38617,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
__pyx_v_self->darray = ((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "suffix_array.pxi":30
+ /* "cdec/sa/suffix_array.pxi":30
*
* self.darray = DataArray(from_text=filename, side=side, use_sent_id=True)
* N = len(self.darray) # <<<<<<<<<<<<<<
@@ -38106,7 +38630,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_N = __pyx_t_3;
- /* "suffix_array.pxi":31
+ /* "cdec/sa/suffix_array.pxi":31
* self.darray = DataArray(from_text=filename, side=side, use_sent_id=True)
* N = len(self.darray)
* V = len(self.darray.id2word) # <<<<<<<<<<<<<<
@@ -38119,7 +38643,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_V = __pyx_t_3;
- /* "suffix_array.pxi":33
+ /* "cdec/sa/suffix_array.pxi":33
* V = len(self.darray.id2word)
*
* self.sa = IntList(initial_len=N) # <<<<<<<<<<<<<<
@@ -38141,7 +38665,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
__pyx_v_self->sa = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "suffix_array.pxi":34
+ /* "cdec/sa/suffix_array.pxi":34
*
* self.sa = IntList(initial_len=N)
* self.ha = IntList(initial_len=V+1) # <<<<<<<<<<<<<<
@@ -38163,7 +38687,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
__pyx_v_self->ha = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "suffix_array.pxi":36
+ /* "cdec/sa/suffix_array.pxi":36
* self.ha = IntList(initial_len=V+1)
*
* isa = IntList(initial_len=N) # <<<<<<<<<<<<<<
@@ -38182,7 +38706,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
__pyx_v_isa = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "suffix_array.pxi":37
+ /* "cdec/sa/suffix_array.pxi":37
*
* isa = IntList(initial_len=N)
* word_count = IntList(initial_len=V+1) # <<<<<<<<<<<<<<
@@ -38201,7 +38725,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
__pyx_v_word_count = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "suffix_array.pxi":40
+ /* "cdec/sa/suffix_array.pxi":40
*
* '''Step 1: bucket sort data'''
* cdef float sort_start_time = monitor_cpu() # <<<<<<<<<<<<<<
@@ -38232,7 +38756,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_sort_start_time = __pyx_t_5;
- /* "suffix_array.pxi":41
+ /* "cdec/sa/suffix_array.pxi":41
* '''Step 1: bucket sort data'''
* cdef float sort_start_time = monitor_cpu()
* cdef float start_time = sort_start_time # <<<<<<<<<<<<<<
@@ -38241,7 +38765,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
*/
__pyx_v_start_time = __pyx_v_sort_start_time;
- /* "suffix_array.pxi":42
+ /* "cdec/sa/suffix_array.pxi":42
* cdef float sort_start_time = monitor_cpu()
* cdef float start_time = sort_start_time
* for i from 0 <= i < N: # <<<<<<<<<<<<<<
@@ -38251,7 +38775,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
__pyx_t_6 = __pyx_v_N;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) {
- /* "suffix_array.pxi":43
+ /* "cdec/sa/suffix_array.pxi":43
* cdef float start_time = sort_start_time
* for i from 0 <= i < N:
* a_i = self.darray.data.arr[i] # <<<<<<<<<<<<<<
@@ -38260,7 +38784,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
*/
__pyx_v_a_i = (__pyx_v_self->darray->data->arr[__pyx_v_i]);
- /* "suffix_array.pxi":44
+ /* "cdec/sa/suffix_array.pxi":44
* for i from 0 <= i < N:
* a_i = self.darray.data.arr[i]
* word_count.arr[a_i] = word_count.arr[a_i] + 1 # <<<<<<<<<<<<<<
@@ -38270,7 +38794,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
(__pyx_v_word_count->arr[__pyx_v_a_i]) = ((__pyx_v_word_count->arr[__pyx_v_a_i]) + 1);
}
- /* "suffix_array.pxi":46
+ /* "cdec/sa/suffix_array.pxi":46
* word_count.arr[a_i] = word_count.arr[a_i] + 1
*
* n = 0 # <<<<<<<<<<<<<<
@@ -38279,7 +38803,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
*/
__pyx_v_n = 0;
- /* "suffix_array.pxi":47
+ /* "cdec/sa/suffix_array.pxi":47
*
* n = 0
* for i from 0 <= i < V+1: # <<<<<<<<<<<<<<
@@ -38289,7 +38813,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
__pyx_t_7 = (__pyx_v_V + 1);
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {
- /* "suffix_array.pxi":48
+ /* "cdec/sa/suffix_array.pxi":48
* n = 0
* for i from 0 <= i < V+1:
* self.ha.arr[i] = n # <<<<<<<<<<<<<<
@@ -38298,7 +38822,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
*/
(__pyx_v_self->ha->arr[__pyx_v_i]) = __pyx_v_n;
- /* "suffix_array.pxi":49
+ /* "cdec/sa/suffix_array.pxi":49
* for i from 0 <= i < V+1:
* self.ha.arr[i] = n
* n = n + word_count.arr[i] # <<<<<<<<<<<<<<
@@ -38307,7 +38831,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
*/
__pyx_v_n = (__pyx_v_n + (__pyx_v_word_count->arr[__pyx_v_i]));
- /* "suffix_array.pxi":50
+ /* "cdec/sa/suffix_array.pxi":50
* self.ha.arr[i] = n
* n = n + word_count.arr[i]
* word_count.arr[i] = 0 # <<<<<<<<<<<<<<
@@ -38317,7 +38841,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
(__pyx_v_word_count->arr[__pyx_v_i]) = 0;
}
- /* "suffix_array.pxi":52
+ /* "cdec/sa/suffix_array.pxi":52
* word_count.arr[i] = 0
*
* for i from 0 <= i < N: # <<<<<<<<<<<<<<
@@ -38327,7 +38851,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
__pyx_t_6 = __pyx_v_N;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) {
- /* "suffix_array.pxi":53
+ /* "cdec/sa/suffix_array.pxi":53
*
* for i from 0 <= i < N:
* a_i = self.darray.data.arr[i] # <<<<<<<<<<<<<<
@@ -38336,7 +38860,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
*/
__pyx_v_a_i = (__pyx_v_self->darray->data->arr[__pyx_v_i]);
- /* "suffix_array.pxi":54
+ /* "cdec/sa/suffix_array.pxi":54
* for i from 0 <= i < N:
* a_i = self.darray.data.arr[i]
* self.sa.arr[self.ha.arr[a_i] + word_count.arr[a_i]] = i # <<<<<<<<<<<<<<
@@ -38345,7 +38869,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
*/
(__pyx_v_self->sa->arr[((__pyx_v_self->ha->arr[__pyx_v_a_i]) + (__pyx_v_word_count->arr[__pyx_v_a_i]))]) = __pyx_v_i;
- /* "suffix_array.pxi":55
+ /* "cdec/sa/suffix_array.pxi":55
* a_i = self.darray.data.arr[i]
* self.sa.arr[self.ha.arr[a_i] + word_count.arr[a_i]] = i
* isa.arr[i] = self.ha.arr[a_i + 1] - 1 # bucket pointer is last index in bucket # <<<<<<<<<<<<<<
@@ -38354,7 +38878,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
*/
(__pyx_v_isa->arr[__pyx_v_i]) = ((__pyx_v_self->ha->arr[(__pyx_v_a_i + 1)]) - 1);
- /* "suffix_array.pxi":56
+ /* "cdec/sa/suffix_array.pxi":56
* self.sa.arr[self.ha.arr[a_i] + word_count.arr[a_i]] = i
* isa.arr[i] = self.ha.arr[a_i + 1] - 1 # bucket pointer is last index in bucket
* word_count.arr[a_i] = word_count.arr[a_i] + 1 # <<<<<<<<<<<<<<
@@ -38364,7 +38888,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
(__pyx_v_word_count->arr[__pyx_v_a_i]) = ((__pyx_v_word_count->arr[__pyx_v_a_i]) + 1);
}
- /* "suffix_array.pxi":59
+ /* "cdec/sa/suffix_array.pxi":59
*
* '''Determine size of initial runs'''
* current_run = 0 # <<<<<<<<<<<<<<
@@ -38373,7 +38897,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
*/
__pyx_v_current_run = 0;
- /* "suffix_array.pxi":60
+ /* "cdec/sa/suffix_array.pxi":60
* '''Determine size of initial runs'''
* current_run = 0
* for i from 0 <= i < V+1: # <<<<<<<<<<<<<<
@@ -38383,7 +38907,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
__pyx_t_7 = (__pyx_v_V + 1);
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {
- /* "suffix_array.pxi":61
+ /* "cdec/sa/suffix_array.pxi":61
* current_run = 0
* for i from 0 <= i < V+1:
* if i < V and self.ha.arr[i+1] - self.ha.arr[i] == 1: # <<<<<<<<<<<<<<
@@ -38403,7 +38927,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
__pyx_L12_bool_binop_done:;
if (__pyx_t_8) {
- /* "suffix_array.pxi":62
+ /* "cdec/sa/suffix_array.pxi":62
* for i from 0 <= i < V+1:
* if i < V and self.ha.arr[i+1] - self.ha.arr[i] == 1:
* current_run = current_run + 1 # <<<<<<<<<<<<<<
@@ -38415,7 +38939,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
}
/*else*/ {
- /* "suffix_array.pxi":64
+ /* "cdec/sa/suffix_array.pxi":64
* current_run = current_run + 1
* else:
* if current_run > 0: # <<<<<<<<<<<<<<
@@ -38425,7 +38949,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
__pyx_t_8 = ((__pyx_v_current_run > 0) != 0);
if (__pyx_t_8) {
- /* "suffix_array.pxi":65
+ /* "cdec/sa/suffix_array.pxi":65
* else:
* if current_run > 0:
* self.sa.arr[self.ha.arr[i] - current_run] = -current_run # <<<<<<<<<<<<<<
@@ -38434,7 +38958,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
*/
(__pyx_v_self->sa->arr[((__pyx_v_self->ha->arr[__pyx_v_i]) - __pyx_v_current_run)]) = (-__pyx_v_current_run);
- /* "suffix_array.pxi":66
+ /* "cdec/sa/suffix_array.pxi":66
* if current_run > 0:
* self.sa.arr[self.ha.arr[i] - current_run] = -current_run
* current_run = 0 # <<<<<<<<<<<<<<
@@ -38449,7 +38973,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
__pyx_L11:;
}
- /* "suffix_array.pxi":68
+ /* "cdec/sa/suffix_array.pxi":68
* current_run = 0
*
* logger.info(" Bucket sort took %f seconds", (monitor_cpu() - sort_start_time)) # <<<<<<<<<<<<<<
@@ -38516,7 +39040,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "suffix_array.pxi":71
+ /* "cdec/sa/suffix_array.pxi":71
*
* '''Step 2: prefix-doubling sort'''
* h = 1 # <<<<<<<<<<<<<<
@@ -38525,7 +39049,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
*/
__pyx_v_h = 1;
- /* "suffix_array.pxi":72
+ /* "cdec/sa/suffix_array.pxi":72
* '''Step 2: prefix-doubling sort'''
* h = 1
* while self.sa.arr[0] != -N: # <<<<<<<<<<<<<<
@@ -38536,7 +39060,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
__pyx_t_8 = (((__pyx_v_self->sa->arr[0]) != (-__pyx_v_N)) != 0);
if (!__pyx_t_8) break;
- /* "suffix_array.pxi":73
+ /* "cdec/sa/suffix_array.pxi":73
* h = 1
* while self.sa.arr[0] != -N:
* sort_start_time = monitor_cpu() # <<<<<<<<<<<<<<
@@ -38567,7 +39091,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_sort_start_time = __pyx_t_5;
- /* "suffix_array.pxi":74
+ /* "cdec/sa/suffix_array.pxi":74
* while self.sa.arr[0] != -N:
* sort_start_time = monitor_cpu()
* logger.debug(" Refining, sort depth = %d", h) # <<<<<<<<<<<<<<
@@ -38610,7 +39134,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "suffix_array.pxi":75
+ /* "cdec/sa/suffix_array.pxi":75
* sort_start_time = monitor_cpu()
* logger.debug(" Refining, sort depth = %d", h)
* i = 0 # <<<<<<<<<<<<<<
@@ -38619,7 +39143,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
*/
__pyx_v_i = 0;
- /* "suffix_array.pxi":76
+ /* "cdec/sa/suffix_array.pxi":76
* logger.debug(" Refining, sort depth = %d", h)
* i = 0
* skip = 0 # <<<<<<<<<<<<<<
@@ -38628,7 +39152,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
*/
__pyx_v_skip = 0;
- /* "suffix_array.pxi":77
+ /* "cdec/sa/suffix_array.pxi":77
* i = 0
* skip = 0
* while i < N: # <<<<<<<<<<<<<<
@@ -38639,7 +39163,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
__pyx_t_8 = ((__pyx_v_i < __pyx_v_N) != 0);
if (!__pyx_t_8) break;
- /* "suffix_array.pxi":78
+ /* "cdec/sa/suffix_array.pxi":78
* skip = 0
* while i < N:
* if self.sa.arr[i] < 0: # <<<<<<<<<<<<<<
@@ -38649,7 +39173,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
__pyx_t_8 = (((__pyx_v_self->sa->arr[__pyx_v_i]) < 0) != 0);
if (__pyx_t_8) {
- /* "suffix_array.pxi":79
+ /* "cdec/sa/suffix_array.pxi":79
* while i < N:
* if self.sa.arr[i] < 0:
* skip = skip + self.sa.arr[i] # <<<<<<<<<<<<<<
@@ -38658,7 +39182,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
*/
__pyx_v_skip = (__pyx_v_skip + (__pyx_v_self->sa->arr[__pyx_v_i]));
- /* "suffix_array.pxi":80
+ /* "cdec/sa/suffix_array.pxi":80
* if self.sa.arr[i] < 0:
* skip = skip + self.sa.arr[i]
* i = i - self.sa.arr[i] # <<<<<<<<<<<<<<
@@ -38670,7 +39194,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
}
/*else*/ {
- /* "suffix_array.pxi":82
+ /* "cdec/sa/suffix_array.pxi":82
* i = i - self.sa.arr[i]
* else:
* if skip < 0: # <<<<<<<<<<<<<<
@@ -38680,7 +39204,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
__pyx_t_8 = ((__pyx_v_skip < 0) != 0);
if (__pyx_t_8) {
- /* "suffix_array.pxi":83
+ /* "cdec/sa/suffix_array.pxi":83
* else:
* if skip < 0:
* self.sa.arr[i+skip] = skip # <<<<<<<<<<<<<<
@@ -38689,7 +39213,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
*/
(__pyx_v_self->sa->arr[(__pyx_v_i + __pyx_v_skip)]) = __pyx_v_skip;
- /* "suffix_array.pxi":84
+ /* "cdec/sa/suffix_array.pxi":84
* if skip < 0:
* self.sa.arr[i+skip] = skip
* skip = 0 # <<<<<<<<<<<<<<
@@ -38701,7 +39225,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
}
__pyx_L20:;
- /* "suffix_array.pxi":85
+ /* "cdec/sa/suffix_array.pxi":85
* self.sa.arr[i+skip] = skip
* skip = 0
* j = isa.arr[self.sa.arr[i]] # <<<<<<<<<<<<<<
@@ -38710,7 +39234,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
*/
__pyx_v_j = (__pyx_v_isa->arr[(__pyx_v_self->sa->arr[__pyx_v_i])]);
- /* "suffix_array.pxi":86
+ /* "cdec/sa/suffix_array.pxi":86
* skip = 0
* j = isa.arr[self.sa.arr[i]]
* self.q3sort(i, j, h, isa) # <<<<<<<<<<<<<<
@@ -38760,7 +39284,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "suffix_array.pxi":87
+ /* "cdec/sa/suffix_array.pxi":87
* j = isa.arr[self.sa.arr[i]]
* self.q3sort(i, j, h, isa)
* i = j+1 # <<<<<<<<<<<<<<
@@ -38772,7 +39296,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
__pyx_L19:;
}
- /* "suffix_array.pxi":88
+ /* "cdec/sa/suffix_array.pxi":88
* self.q3sort(i, j, h, isa)
* i = j+1
* if skip < 0: # <<<<<<<<<<<<<<
@@ -38782,7 +39306,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
__pyx_t_8 = ((__pyx_v_skip < 0) != 0);
if (__pyx_t_8) {
- /* "suffix_array.pxi":89
+ /* "cdec/sa/suffix_array.pxi":89
* i = j+1
* if skip < 0:
* self.sa.arr[i+skip] = skip # <<<<<<<<<<<<<<
@@ -38794,7 +39318,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
}
__pyx_L21:;
- /* "suffix_array.pxi":90
+ /* "cdec/sa/suffix_array.pxi":90
* if skip < 0:
* self.sa.arr[i+skip] = skip
* h = h * 2 # <<<<<<<<<<<<<<
@@ -38803,7 +39327,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
*/
__pyx_v_h = (__pyx_v_h * 2);
- /* "suffix_array.pxi":91
+ /* "cdec/sa/suffix_array.pxi":91
* self.sa.arr[i+skip] = skip
* h = h * 2
* logger.debug(" Refinement took %f seconds", (monitor_cpu() - sort_start_time)) # <<<<<<<<<<<<<<
@@ -38871,7 +39395,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
}
- /* "suffix_array.pxi":94
+ /* "cdec/sa/suffix_array.pxi":94
*
* '''Step 3: read off suffix array from inverse suffix array'''
* logger.info(" Finalizing sort...") # <<<<<<<<<<<<<<
@@ -38888,7 +39412,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "suffix_array.pxi":95
+ /* "cdec/sa/suffix_array.pxi":95
* '''Step 3: read off suffix array from inverse suffix array'''
* logger.info(" Finalizing sort...")
* for i from 0 <= i < N: # <<<<<<<<<<<<<<
@@ -38898,7 +39422,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
__pyx_t_6 = __pyx_v_N;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) {
- /* "suffix_array.pxi":96
+ /* "cdec/sa/suffix_array.pxi":96
* logger.info(" Finalizing sort...")
* for i from 0 <= i < N:
* j = isa.arr[i] # <<<<<<<<<<<<<<
@@ -38907,7 +39431,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
*/
__pyx_v_j = (__pyx_v_isa->arr[__pyx_v_i]);
- /* "suffix_array.pxi":97
+ /* "cdec/sa/suffix_array.pxi":97
* for i from 0 <= i < N:
* j = isa.arr[i]
* self.sa.arr[j] = i # <<<<<<<<<<<<<<
@@ -38917,7 +39441,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
(__pyx_v_self->sa->arr[__pyx_v_j]) = __pyx_v_i;
}
- /* "suffix_array.pxi":98
+ /* "cdec/sa/suffix_array.pxi":98
* j = isa.arr[i]
* self.sa.arr[j] = i
* logger.info("Suffix array construction took %f seconds", (monitor_cpu() - start_time)) # <<<<<<<<<<<<<<
@@ -38984,7 +39508,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "suffix_array.pxi":23
+ /* "cdec/sa/suffix_array.pxi":23
* return self.sa.arr[i]
*
* def read_text(self, filename, side): # <<<<<<<<<<<<<<
@@ -39013,7 +39537,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_4read_text(struct __pyx_o
return __pyx_r;
}
-/* "suffix_array.pxi":100
+/* "cdec/sa/suffix_array.pxi":100
* logger.info("Suffix array construction took %f seconds", (monitor_cpu() - start_time))
*
* def q3sort(self, int i, int j, int h, IntList isa, pad=""): # <<<<<<<<<<<<<<
@@ -39143,7 +39667,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("q3sort", 0);
- /* "suffix_array.pxi":107
+ /* "cdec/sa/suffix_array.pxi":107
* cdef int k, midpoint, pval, phead, ptail, tmp
*
* if j-i < -1: # <<<<<<<<<<<<<<
@@ -39153,7 +39677,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_
__pyx_t_1 = (((__pyx_v_j - __pyx_v_i) < -1) != 0);
if (__pyx_t_1) {
- /* "suffix_array.pxi":108
+ /* "cdec/sa/suffix_array.pxi":108
*
* if j-i < -1:
* raise Exception("Unexpected condition found in q3sort: sort from %d to %d" % (i,j)) # <<<<<<<<<<<<<<
@@ -39188,7 +39712,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_
{__pyx_filename = __pyx_f[12]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- /* "suffix_array.pxi":109
+ /* "cdec/sa/suffix_array.pxi":109
* if j-i < -1:
* raise Exception("Unexpected condition found in q3sort: sort from %d to %d" % (i,j))
* if j-i == -1: # recursive base case -- empty interval # <<<<<<<<<<<<<<
@@ -39198,7 +39722,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_
__pyx_t_1 = (((__pyx_v_j - __pyx_v_i) == -1) != 0);
if (__pyx_t_1) {
- /* "suffix_array.pxi":110
+ /* "cdec/sa/suffix_array.pxi":110
* raise Exception("Unexpected condition found in q3sort: sort from %d to %d" % (i,j))
* if j-i == -1: # recursive base case -- empty interval
* return # <<<<<<<<<<<<<<
@@ -39210,7 +39734,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_
goto __pyx_L0;
}
- /* "suffix_array.pxi":111
+ /* "cdec/sa/suffix_array.pxi":111
* if j-i == -1: # recursive base case -- empty interval
* return
* if (j-i == 0): # recursive base case -- singleton interval # <<<<<<<<<<<<<<
@@ -39220,7 +39744,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_
__pyx_t_1 = (((__pyx_v_j - __pyx_v_i) == 0) != 0);
if (__pyx_t_1) {
- /* "suffix_array.pxi":112
+ /* "cdec/sa/suffix_array.pxi":112
* return
* if (j-i == 0): # recursive base case -- singleton interval
* isa.arr[self.sa.arr[i]] = i # <<<<<<<<<<<<<<
@@ -39229,7 +39753,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_
*/
(__pyx_v_isa->arr[(__pyx_v_self->sa->arr[__pyx_v_i])]) = __pyx_v_i;
- /* "suffix_array.pxi":113
+ /* "cdec/sa/suffix_array.pxi":113
* if (j-i == 0): # recursive base case -- singleton interval
* isa.arr[self.sa.arr[i]] = i
* self.sa.arr[i] = -1 # <<<<<<<<<<<<<<
@@ -39238,7 +39762,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_
*/
(__pyx_v_self->sa->arr[__pyx_v_i]) = -1;
- /* "suffix_array.pxi":114
+ /* "cdec/sa/suffix_array.pxi":114
* isa.arr[self.sa.arr[i]] = i
* self.sa.arr[i] = -1
* return # <<<<<<<<<<<<<<
@@ -39250,7 +39774,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_
goto __pyx_L0;
}
- /* "suffix_array.pxi":123
+ /* "cdec/sa/suffix_array.pxi":123
* # If the method of assigning word_id's is changed, this method
* # may need to be reconsidered as well.
* midpoint = (i+j)/2 # <<<<<<<<<<<<<<
@@ -39259,7 +39783,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_
*/
__pyx_v_midpoint = __Pyx_div_long((__pyx_v_i + __pyx_v_j), 2);
- /* "suffix_array.pxi":124
+ /* "cdec/sa/suffix_array.pxi":124
* # may need to be reconsidered as well.
* midpoint = (i+j)/2
* pval = isa.arr[self.sa.arr[midpoint] + h] # <<<<<<<<<<<<<<
@@ -39268,7 +39792,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_
*/
__pyx_v_pval = (__pyx_v_isa->arr[((__pyx_v_self->sa->arr[__pyx_v_midpoint]) + __pyx_v_h)]);
- /* "suffix_array.pxi":125
+ /* "cdec/sa/suffix_array.pxi":125
* midpoint = (i+j)/2
* pval = isa.arr[self.sa.arr[midpoint] + h]
* if i != midpoint: # <<<<<<<<<<<<<<
@@ -39278,7 +39802,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_
__pyx_t_1 = ((__pyx_v_i != __pyx_v_midpoint) != 0);
if (__pyx_t_1) {
- /* "suffix_array.pxi":126
+ /* "cdec/sa/suffix_array.pxi":126
* pval = isa.arr[self.sa.arr[midpoint] + h]
* if i != midpoint:
* tmp = self.sa.arr[midpoint] # <<<<<<<<<<<<<<
@@ -39287,7 +39811,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_
*/
__pyx_v_tmp = (__pyx_v_self->sa->arr[__pyx_v_midpoint]);
- /* "suffix_array.pxi":127
+ /* "cdec/sa/suffix_array.pxi":127
* if i != midpoint:
* tmp = self.sa.arr[midpoint]
* self.sa.arr[midpoint] = self.sa.arr[i] # <<<<<<<<<<<<<<
@@ -39296,7 +39820,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_
*/
(__pyx_v_self->sa->arr[__pyx_v_midpoint]) = (__pyx_v_self->sa->arr[__pyx_v_i]);
- /* "suffix_array.pxi":128
+ /* "cdec/sa/suffix_array.pxi":128
* tmp = self.sa.arr[midpoint]
* self.sa.arr[midpoint] = self.sa.arr[i]
* self.sa.arr[i] = tmp # <<<<<<<<<<<<<<
@@ -39308,7 +39832,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_
}
__pyx_L6:;
- /* "suffix_array.pxi":129
+ /* "cdec/sa/suffix_array.pxi":129
* self.sa.arr[midpoint] = self.sa.arr[i]
* self.sa.arr[i] = tmp
* phead = i # <<<<<<<<<<<<<<
@@ -39317,7 +39841,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_
*/
__pyx_v_phead = __pyx_v_i;
- /* "suffix_array.pxi":130
+ /* "cdec/sa/suffix_array.pxi":130
* self.sa.arr[i] = tmp
* phead = i
* ptail = i # <<<<<<<<<<<<<<
@@ -39326,7 +39850,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_
*/
__pyx_v_ptail = __pyx_v_i;
- /* "suffix_array.pxi":134
+ /* "cdec/sa/suffix_array.pxi":134
* # find the three partitions. phead marks the first element
* # of the middle partition, and ptail marks the last element
* for k from i+1 <= k < j+1: # <<<<<<<<<<<<<<
@@ -39336,7 +39860,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_
__pyx_t_5 = (__pyx_v_j + 1);
for (__pyx_v_k = (__pyx_v_i + 1); __pyx_v_k < __pyx_t_5; __pyx_v_k++) {
- /* "suffix_array.pxi":135
+ /* "cdec/sa/suffix_array.pxi":135
* # of the middle partition, and ptail marks the last element
* for k from i+1 <= k < j+1:
* if isa.arr[self.sa.arr[k] + h] < pval: # <<<<<<<<<<<<<<
@@ -39346,7 +39870,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_
__pyx_t_1 = (((__pyx_v_isa->arr[((__pyx_v_self->sa->arr[__pyx_v_k]) + __pyx_v_h)]) < __pyx_v_pval) != 0);
if (__pyx_t_1) {
- /* "suffix_array.pxi":136
+ /* "cdec/sa/suffix_array.pxi":136
* for k from i+1 <= k < j+1:
* if isa.arr[self.sa.arr[k] + h] < pval:
* if k > ptail+1: # <<<<<<<<<<<<<<
@@ -39356,7 +39880,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_
__pyx_t_1 = ((__pyx_v_k > (__pyx_v_ptail + 1)) != 0);
if (__pyx_t_1) {
- /* "suffix_array.pxi":137
+ /* "cdec/sa/suffix_array.pxi":137
* if isa.arr[self.sa.arr[k] + h] < pval:
* if k > ptail+1:
* tmp = self.sa.arr[phead] # <<<<<<<<<<<<<<
@@ -39365,7 +39889,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_
*/
__pyx_v_tmp = (__pyx_v_self->sa->arr[__pyx_v_phead]);
- /* "suffix_array.pxi":138
+ /* "cdec/sa/suffix_array.pxi":138
* if k > ptail+1:
* tmp = self.sa.arr[phead]
* self.sa.arr[phead] = self.sa.arr[k] # <<<<<<<<<<<<<<
@@ -39374,7 +39898,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_
*/
(__pyx_v_self->sa->arr[__pyx_v_phead]) = (__pyx_v_self->sa->arr[__pyx_v_k]);
- /* "suffix_array.pxi":139
+ /* "cdec/sa/suffix_array.pxi":139
* tmp = self.sa.arr[phead]
* self.sa.arr[phead] = self.sa.arr[k]
* self.sa.arr[k] = self.sa.arr[ptail+1] # <<<<<<<<<<<<<<
@@ -39383,7 +39907,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_
*/
(__pyx_v_self->sa->arr[__pyx_v_k]) = (__pyx_v_self->sa->arr[(__pyx_v_ptail + 1)]);
- /* "suffix_array.pxi":140
+ /* "cdec/sa/suffix_array.pxi":140
* self.sa.arr[phead] = self.sa.arr[k]
* self.sa.arr[k] = self.sa.arr[ptail+1]
* self.sa.arr[ptail+1] = tmp # <<<<<<<<<<<<<<
@@ -39395,7 +39919,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_
}
/*else*/ {
- /* "suffix_array.pxi":142
+ /* "cdec/sa/suffix_array.pxi":142
* self.sa.arr[ptail+1] = tmp
* else: # k == ptail+1
* tmp = self.sa.arr[phead] # <<<<<<<<<<<<<<
@@ -39404,7 +39928,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_
*/
__pyx_v_tmp = (__pyx_v_self->sa->arr[__pyx_v_phead]);
- /* "suffix_array.pxi":143
+ /* "cdec/sa/suffix_array.pxi":143
* else: # k == ptail+1
* tmp = self.sa.arr[phead]
* self.sa.arr[phead] = self.sa.arr[k] # <<<<<<<<<<<<<<
@@ -39413,7 +39937,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_
*/
(__pyx_v_self->sa->arr[__pyx_v_phead]) = (__pyx_v_self->sa->arr[__pyx_v_k]);
- /* "suffix_array.pxi":144
+ /* "cdec/sa/suffix_array.pxi":144
* tmp = self.sa.arr[phead]
* self.sa.arr[phead] = self.sa.arr[k]
* self.sa.arr[k] = tmp # <<<<<<<<<<<<<<
@@ -39424,7 +39948,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_
}
__pyx_L10:;
- /* "suffix_array.pxi":145
+ /* "cdec/sa/suffix_array.pxi":145
* self.sa.arr[phead] = self.sa.arr[k]
* self.sa.arr[k] = tmp
* phead = phead + 1 # <<<<<<<<<<<<<<
@@ -39433,7 +39957,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_
*/
__pyx_v_phead = (__pyx_v_phead + 1);
- /* "suffix_array.pxi":146
+ /* "cdec/sa/suffix_array.pxi":146
* self.sa.arr[k] = tmp
* phead = phead + 1
* ptail = ptail + 1 # <<<<<<<<<<<<<<
@@ -39445,7 +39969,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_
}
/*else*/ {
- /* "suffix_array.pxi":148
+ /* "cdec/sa/suffix_array.pxi":148
* ptail = ptail + 1
* else:
* if isa.arr[self.sa.arr[k] + h] == pval: # <<<<<<<<<<<<<<
@@ -39455,7 +39979,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_
__pyx_t_1 = (((__pyx_v_isa->arr[((__pyx_v_self->sa->arr[__pyx_v_k]) + __pyx_v_h)]) == __pyx_v_pval) != 0);
if (__pyx_t_1) {
- /* "suffix_array.pxi":149
+ /* "cdec/sa/suffix_array.pxi":149
* else:
* if isa.arr[self.sa.arr[k] + h] == pval:
* if k > ptail+1: # <<<<<<<<<<<<<<
@@ -39465,7 +39989,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_
__pyx_t_1 = ((__pyx_v_k > (__pyx_v_ptail + 1)) != 0);
if (__pyx_t_1) {
- /* "suffix_array.pxi":150
+ /* "cdec/sa/suffix_array.pxi":150
* if isa.arr[self.sa.arr[k] + h] == pval:
* if k > ptail+1:
* tmp = self.sa.arr[ptail+1] # <<<<<<<<<<<<<<
@@ -39474,7 +39998,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_
*/
__pyx_v_tmp = (__pyx_v_self->sa->arr[(__pyx_v_ptail + 1)]);
- /* "suffix_array.pxi":151
+ /* "cdec/sa/suffix_array.pxi":151
* if k > ptail+1:
* tmp = self.sa.arr[ptail+1]
* self.sa.arr[ptail+1] = self.sa.arr[k] # <<<<<<<<<<<<<<
@@ -39483,7 +40007,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_
*/
(__pyx_v_self->sa->arr[(__pyx_v_ptail + 1)]) = (__pyx_v_self->sa->arr[__pyx_v_k]);
- /* "suffix_array.pxi":152
+ /* "cdec/sa/suffix_array.pxi":152
* tmp = self.sa.arr[ptail+1]
* self.sa.arr[ptail+1] = self.sa.arr[k]
* self.sa.arr[k] = tmp # <<<<<<<<<<<<<<
@@ -39495,7 +40019,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_
}
__pyx_L12:;
- /* "suffix_array.pxi":153
+ /* "cdec/sa/suffix_array.pxi":153
* self.sa.arr[ptail+1] = self.sa.arr[k]
* self.sa.arr[k] = tmp
* ptail = ptail + 1 # <<<<<<<<<<<<<<
@@ -39510,7 +40034,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_
__pyx_L9:;
}
- /* "suffix_array.pxi":156
+ /* "cdec/sa/suffix_array.pxi":156
*
* # recursively sort smaller suffixes
* self.q3sort(i, phead-1, h, isa, pad+" ") # <<<<<<<<<<<<<<
@@ -39565,7 +40089,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "suffix_array.pxi":160
+ /* "cdec/sa/suffix_array.pxi":160
* # update suffixes with pivot value
* # corresponds to update_group function in Larsson & Sadakane
* for k from phead <= k < ptail+1: # <<<<<<<<<<<<<<
@@ -39575,7 +40099,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_
__pyx_t_5 = (__pyx_v_ptail + 1);
for (__pyx_v_k = __pyx_v_phead; __pyx_v_k < __pyx_t_5; __pyx_v_k++) {
- /* "suffix_array.pxi":161
+ /* "cdec/sa/suffix_array.pxi":161
* # corresponds to update_group function in Larsson & Sadakane
* for k from phead <= k < ptail+1:
* isa.arr[self.sa.arr[k]] = ptail # <<<<<<<<<<<<<<
@@ -39585,7 +40109,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_
(__pyx_v_isa->arr[(__pyx_v_self->sa->arr[__pyx_v_k])]) = __pyx_v_ptail;
}
- /* "suffix_array.pxi":162
+ /* "cdec/sa/suffix_array.pxi":162
* for k from phead <= k < ptail+1:
* isa.arr[self.sa.arr[k]] = ptail
* if phead == ptail: # <<<<<<<<<<<<<<
@@ -39595,7 +40119,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_
__pyx_t_1 = ((__pyx_v_phead == __pyx_v_ptail) != 0);
if (__pyx_t_1) {
- /* "suffix_array.pxi":163
+ /* "cdec/sa/suffix_array.pxi":163
* isa.arr[self.sa.arr[k]] = ptail
* if phead == ptail:
* self.sa.arr[phead] = -1 # <<<<<<<<<<<<<<
@@ -39607,7 +40131,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_
}
__pyx_L15:;
- /* "suffix_array.pxi":166
+ /* "cdec/sa/suffix_array.pxi":166
*
* # recursively sort larger suffixes
* self.q3sort(ptail+1, j, h, isa, pad+" ") # <<<<<<<<<<<<<<
@@ -39662,7 +40186,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "suffix_array.pxi":100
+ /* "cdec/sa/suffix_array.pxi":100
* logger.info("Suffix array construction took %f seconds", (monitor_cpu() - start_time))
*
* def q3sort(self, int i, int j, int h, IntList isa, pad=""): # <<<<<<<<<<<<<<
@@ -39690,7 +40214,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_
return __pyx_r;
}
-/* "suffix_array.pxi":169
+/* "cdec/sa/suffix_array.pxi":169
*
*
* def write_text(self, char* filename): # <<<<<<<<<<<<<<
@@ -39737,7 +40261,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_8write_text(struct __pyx_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("write_text", 0);
- /* "suffix_array.pxi":170
+ /* "cdec/sa/suffix_array.pxi":170
*
* def write_text(self, char* filename):
* self.darray.write_text(filename) # <<<<<<<<<<<<<<
@@ -39776,7 +40300,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_8write_text(struct __pyx_
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "suffix_array.pxi":169
+ /* "cdec/sa/suffix_array.pxi":169
*
*
* def write_text(self, char* filename): # <<<<<<<<<<<<<<
@@ -39801,7 +40325,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_8write_text(struct __pyx_
return __pyx_r;
}
-/* "suffix_array.pxi":172
+/* "cdec/sa/suffix_array.pxi":172
* self.darray.write_text(filename)
*
* def read_binary(self, char* filename): # <<<<<<<<<<<<<<
@@ -39841,7 +40365,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_10read_binary(struct __py
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("read_binary", 0);
- /* "suffix_array.pxi":174
+ /* "cdec/sa/suffix_array.pxi":174
* def read_binary(self, char* filename):
* cdef FILE *f
* f = fopen(filename, "r") # <<<<<<<<<<<<<<
@@ -39850,7 +40374,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_10read_binary(struct __py
*/
__pyx_v_f = fopen(__pyx_v_filename, __pyx_k_r);
- /* "suffix_array.pxi":175
+ /* "cdec/sa/suffix_array.pxi":175
* cdef FILE *f
* f = fopen(filename, "r")
* self.darray.read_handle(f) # <<<<<<<<<<<<<<
@@ -39859,7 +40383,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_10read_binary(struct __py
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_DataArray *)__pyx_v_self->darray->__pyx_vtab)->read_handle(__pyx_v_self->darray, __pyx_v_f);
- /* "suffix_array.pxi":176
+ /* "cdec/sa/suffix_array.pxi":176
* f = fopen(filename, "r")
* self.darray.read_handle(f)
* self.sa.read_handle(f) # <<<<<<<<<<<<<<
@@ -39868,7 +40392,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_10read_binary(struct __py
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->sa->__pyx_vtab)->read_handle(__pyx_v_self->sa, __pyx_v_f);
- /* "suffix_array.pxi":177
+ /* "cdec/sa/suffix_array.pxi":177
* self.darray.read_handle(f)
* self.sa.read_handle(f)
* self.ha.read_handle(f) # <<<<<<<<<<<<<<
@@ -39877,7 +40401,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_10read_binary(struct __py
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->ha->__pyx_vtab)->read_handle(__pyx_v_self->ha, __pyx_v_f);
- /* "suffix_array.pxi":178
+ /* "cdec/sa/suffix_array.pxi":178
* self.sa.read_handle(f)
* self.ha.read_handle(f)
* fclose(f) # <<<<<<<<<<<<<<
@@ -39886,7 +40410,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_10read_binary(struct __py
*/
fclose(__pyx_v_f);
- /* "suffix_array.pxi":172
+ /* "cdec/sa/suffix_array.pxi":172
* self.darray.write_text(filename)
*
* def read_binary(self, char* filename): # <<<<<<<<<<<<<<
@@ -39901,7 +40425,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_10read_binary(struct __py
return __pyx_r;
}
-/* "suffix_array.pxi":180
+/* "cdec/sa/suffix_array.pxi":180
* fclose(f)
*
* def write_binary(self, char* filename): # <<<<<<<<<<<<<<
@@ -39941,7 +40465,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_12write_binary(struct __p
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("write_binary", 0);
- /* "suffix_array.pxi":182
+ /* "cdec/sa/suffix_array.pxi":182
* def write_binary(self, char* filename):
* cdef FILE* f
* f = fopen(filename, "w") # <<<<<<<<<<<<<<
@@ -39950,7 +40474,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_12write_binary(struct __p
*/
__pyx_v_f = fopen(__pyx_v_filename, __pyx_k_w);
- /* "suffix_array.pxi":183
+ /* "cdec/sa/suffix_array.pxi":183
* cdef FILE* f
* f = fopen(filename, "w")
* self.darray.write_handle(f) # <<<<<<<<<<<<<<
@@ -39959,7 +40483,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_12write_binary(struct __p
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_DataArray *)__pyx_v_self->darray->__pyx_vtab)->write_handle(__pyx_v_self->darray, __pyx_v_f);
- /* "suffix_array.pxi":184
+ /* "cdec/sa/suffix_array.pxi":184
* f = fopen(filename, "w")
* self.darray.write_handle(f)
* self.sa.write_handle(f) # <<<<<<<<<<<<<<
@@ -39968,7 +40492,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_12write_binary(struct __p
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->sa->__pyx_vtab)->write_handle(__pyx_v_self->sa, __pyx_v_f);
- /* "suffix_array.pxi":185
+ /* "cdec/sa/suffix_array.pxi":185
* self.darray.write_handle(f)
* self.sa.write_handle(f)
* self.ha.write_handle(f) # <<<<<<<<<<<<<<
@@ -39977,7 +40501,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_12write_binary(struct __p
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_self->ha->__pyx_vtab)->write_handle(__pyx_v_self->ha, __pyx_v_f);
- /* "suffix_array.pxi":186
+ /* "cdec/sa/suffix_array.pxi":186
* self.sa.write_handle(f)
* self.ha.write_handle(f)
* fclose(f) # <<<<<<<<<<<<<<
@@ -39986,7 +40510,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_12write_binary(struct __p
*/
fclose(__pyx_v_f);
- /* "suffix_array.pxi":180
+ /* "cdec/sa/suffix_array.pxi":180
* fclose(f)
*
* def write_binary(self, char* filename): # <<<<<<<<<<<<<<
@@ -40001,7 +40525,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_12write_binary(struct __p
return __pyx_r;
}
-/* "suffix_array.pxi":188
+/* "cdec/sa/suffix_array.pxi":188
* fclose(f)
*
* def write_enhanced(self, char* filename): # <<<<<<<<<<<<<<
@@ -40061,7 +40585,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_14write_enhanced(struct _
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("write_enhanced", 0);
- /* "suffix_array.pxi":189
+ /* "cdec/sa/suffix_array.pxi":189
*
* def write_enhanced(self, char* filename):
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -40117,7 +40641,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_14write_enhanced(struct _
__pyx_v_f = __pyx_t_4;
__pyx_t_4 = 0;
- /* "suffix_array.pxi":190
+ /* "cdec/sa/suffix_array.pxi":190
* def write_enhanced(self, char* filename):
* with open(filename, "w") as f:
* self.darray.write_enhanced_handle(f) # <<<<<<<<<<<<<<
@@ -40153,7 +40677,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_14write_enhanced(struct _
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "suffix_array.pxi":191
+ /* "cdec/sa/suffix_array.pxi":191
* with open(filename, "w") as f:
* self.darray.write_enhanced_handle(f)
* for a_i in self.sa: # <<<<<<<<<<<<<<
@@ -40200,7 +40724,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_14write_enhanced(struct _
__Pyx_XDECREF_SET(__pyx_v_a_i, __pyx_t_1);
__pyx_t_1 = 0;
- /* "suffix_array.pxi":192
+ /* "cdec/sa/suffix_array.pxi":192
* self.darray.write_enhanced_handle(f)
* for a_i in self.sa:
* f.write("%d " % a_i) # <<<<<<<<<<<<<<
@@ -40239,7 +40763,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_14write_enhanced(struct _
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "suffix_array.pxi":191
+ /* "cdec/sa/suffix_array.pxi":191
* with open(filename, "w") as f:
* self.darray.write_enhanced_handle(f)
* for a_i in self.sa: # <<<<<<<<<<<<<<
@@ -40249,7 +40773,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_14write_enhanced(struct _
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "suffix_array.pxi":193
+ /* "cdec/sa/suffix_array.pxi":193
* for a_i in self.sa:
* f.write("%d " % a_i)
* f.write("\n") # <<<<<<<<<<<<<<
@@ -40263,7 +40787,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_14write_enhanced(struct _
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "suffix_array.pxi":194
+ /* "cdec/sa/suffix_array.pxi":194
* f.write("%d " % a_i)
* f.write("\n")
* for w_i in self.ha: # <<<<<<<<<<<<<<
@@ -40310,7 +40834,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_14write_enhanced(struct _
__Pyx_XDECREF_SET(__pyx_v_w_i, __pyx_t_4);
__pyx_t_4 = 0;
- /* "suffix_array.pxi":195
+ /* "cdec/sa/suffix_array.pxi":195
* f.write("\n")
* for w_i in self.ha:
* f.write("%d " % w_i) # <<<<<<<<<<<<<<
@@ -40349,7 +40873,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_14write_enhanced(struct _
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "suffix_array.pxi":194
+ /* "cdec/sa/suffix_array.pxi":194
* f.write("%d " % a_i)
* f.write("\n")
* for w_i in self.ha: # <<<<<<<<<<<<<<
@@ -40359,7 +40883,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_14write_enhanced(struct _
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "suffix_array.pxi":196
+ /* "cdec/sa/suffix_array.pxi":196
* for w_i in self.ha:
* f.write("%d " % w_i)
* f.write("\n") # <<<<<<<<<<<<<<
@@ -40385,7 +40909,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_14write_enhanced(struct _
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "suffix_array.pxi":189
+ /* "cdec/sa/suffix_array.pxi":189
*
* def write_enhanced(self, char* filename):
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -40456,7 +40980,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_14write_enhanced(struct _
__pyx_L22:;
}
- /* "suffix_array.pxi":188
+ /* "cdec/sa/suffix_array.pxi":188
* fclose(f)
*
* def write_enhanced(self, char* filename): # <<<<<<<<<<<<<<
@@ -40485,7 +41009,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_14write_enhanced(struct _
return __pyx_r;
}
-/* "suffix_array.pxi":198
+/* "cdec/sa/suffix_array.pxi":198
* f.write("\n")
*
* cdef int __search_high(self, int word_id, int offset, int low, int high): # <<<<<<<<<<<<<<
@@ -40500,7 +41024,7 @@ static int __pyx_f_4cdec_2sa_3_sa_11SuffixArray___search_high(struct __pyx_obj_4
int __pyx_t_1;
__Pyx_RefNannySetupContext("__search_high", 0);
- /* "suffix_array.pxi":201
+ /* "cdec/sa/suffix_array.pxi":201
* cdef int midpoint
*
* if low >= high: # <<<<<<<<<<<<<<
@@ -40510,7 +41034,7 @@ static int __pyx_f_4cdec_2sa_3_sa_11SuffixArray___search_high(struct __pyx_obj_4
__pyx_t_1 = ((__pyx_v_low >= __pyx_v_high) != 0);
if (__pyx_t_1) {
- /* "suffix_array.pxi":202
+ /* "cdec/sa/suffix_array.pxi":202
*
* if low >= high:
* return high # <<<<<<<<<<<<<<
@@ -40521,7 +41045,7 @@ static int __pyx_f_4cdec_2sa_3_sa_11SuffixArray___search_high(struct __pyx_obj_4
goto __pyx_L0;
}
- /* "suffix_array.pxi":203
+ /* "cdec/sa/suffix_array.pxi":203
* if low >= high:
* return high
* midpoint = (high + low) / 2 # <<<<<<<<<<<<<<
@@ -40530,7 +41054,7 @@ static int __pyx_f_4cdec_2sa_3_sa_11SuffixArray___search_high(struct __pyx_obj_4
*/
__pyx_v_midpoint = __Pyx_div_long((__pyx_v_high + __pyx_v_low), 2);
- /* "suffix_array.pxi":204
+ /* "cdec/sa/suffix_array.pxi":204
* return high
* midpoint = (high + low) / 2
* if self.darray.data.arr[self.sa.arr[midpoint] + offset] == word_id: # <<<<<<<<<<<<<<
@@ -40540,7 +41064,7 @@ static int __pyx_f_4cdec_2sa_3_sa_11SuffixArray___search_high(struct __pyx_obj_4
__pyx_t_1 = (((__pyx_v_self->darray->data->arr[((__pyx_v_self->sa->arr[__pyx_v_midpoint]) + __pyx_v_offset)]) == __pyx_v_word_id) != 0);
if (__pyx_t_1) {
- /* "suffix_array.pxi":205
+ /* "cdec/sa/suffix_array.pxi":205
* midpoint = (high + low) / 2
* if self.darray.data.arr[self.sa.arr[midpoint] + offset] == word_id:
* return self.__search_high(word_id, offset, midpoint+1, high) # <<<<<<<<<<<<<<
@@ -40552,7 +41076,7 @@ static int __pyx_f_4cdec_2sa_3_sa_11SuffixArray___search_high(struct __pyx_obj_4
}
/*else*/ {
- /* "suffix_array.pxi":207
+ /* "cdec/sa/suffix_array.pxi":207
* return self.__search_high(word_id, offset, midpoint+1, high)
* else:
* return self.__search_high(word_id, offset, low, midpoint) # <<<<<<<<<<<<<<
@@ -40563,7 +41087,7 @@ static int __pyx_f_4cdec_2sa_3_sa_11SuffixArray___search_high(struct __pyx_obj_4
goto __pyx_L0;
}
- /* "suffix_array.pxi":198
+ /* "cdec/sa/suffix_array.pxi":198
* f.write("\n")
*
* cdef int __search_high(self, int word_id, int offset, int low, int high): # <<<<<<<<<<<<<<
@@ -40577,7 +41101,7 @@ static int __pyx_f_4cdec_2sa_3_sa_11SuffixArray___search_high(struct __pyx_obj_4
return __pyx_r;
}
-/* "suffix_array.pxi":209
+/* "cdec/sa/suffix_array.pxi":209
* return self.__search_high(word_id, offset, low, midpoint)
*
* cdef int __search_low(self, int word_id, int offset, int low, int high): # <<<<<<<<<<<<<<
@@ -40592,7 +41116,7 @@ static int __pyx_f_4cdec_2sa_3_sa_11SuffixArray___search_low(struct __pyx_obj_4c
int __pyx_t_1;
__Pyx_RefNannySetupContext("__search_low", 0);
- /* "suffix_array.pxi":212
+ /* "cdec/sa/suffix_array.pxi":212
* cdef int midpoint
*
* if low >= high: # <<<<<<<<<<<<<<
@@ -40602,7 +41126,7 @@ static int __pyx_f_4cdec_2sa_3_sa_11SuffixArray___search_low(struct __pyx_obj_4c
__pyx_t_1 = ((__pyx_v_low >= __pyx_v_high) != 0);
if (__pyx_t_1) {
- /* "suffix_array.pxi":213
+ /* "cdec/sa/suffix_array.pxi":213
*
* if low >= high:
* return high # <<<<<<<<<<<<<<
@@ -40613,7 +41137,7 @@ static int __pyx_f_4cdec_2sa_3_sa_11SuffixArray___search_low(struct __pyx_obj_4c
goto __pyx_L0;
}
- /* "suffix_array.pxi":214
+ /* "cdec/sa/suffix_array.pxi":214
* if low >= high:
* return high
* midpoint = (high + low) / 2 # <<<<<<<<<<<<<<
@@ -40622,7 +41146,7 @@ static int __pyx_f_4cdec_2sa_3_sa_11SuffixArray___search_low(struct __pyx_obj_4c
*/
__pyx_v_midpoint = __Pyx_div_long((__pyx_v_high + __pyx_v_low), 2);
- /* "suffix_array.pxi":215
+ /* "cdec/sa/suffix_array.pxi":215
* return high
* midpoint = (high + low) / 2
* if self.darray.data.arr[self.sa.arr[midpoint] + offset] == word_id: # <<<<<<<<<<<<<<
@@ -40632,7 +41156,7 @@ static int __pyx_f_4cdec_2sa_3_sa_11SuffixArray___search_low(struct __pyx_obj_4c
__pyx_t_1 = (((__pyx_v_self->darray->data->arr[((__pyx_v_self->sa->arr[__pyx_v_midpoint]) + __pyx_v_offset)]) == __pyx_v_word_id) != 0);
if (__pyx_t_1) {
- /* "suffix_array.pxi":216
+ /* "cdec/sa/suffix_array.pxi":216
* midpoint = (high + low) / 2
* if self.darray.data.arr[self.sa.arr[midpoint] + offset] == word_id:
* return self.__search_low(word_id, offset, low, midpoint) # <<<<<<<<<<<<<<
@@ -40644,7 +41168,7 @@ static int __pyx_f_4cdec_2sa_3_sa_11SuffixArray___search_low(struct __pyx_obj_4c
}
/*else*/ {
- /* "suffix_array.pxi":218
+ /* "cdec/sa/suffix_array.pxi":218
* return self.__search_low(word_id, offset, low, midpoint)
* else:
* return self.__search_low(word_id, offset, midpoint+1, high) # <<<<<<<<<<<<<<
@@ -40655,7 +41179,7 @@ static int __pyx_f_4cdec_2sa_3_sa_11SuffixArray___search_low(struct __pyx_obj_4c
goto __pyx_L0;
}
- /* "suffix_array.pxi":209
+ /* "cdec/sa/suffix_array.pxi":209
* return self.__search_high(word_id, offset, low, midpoint)
*
* cdef int __search_low(self, int word_id, int offset, int low, int high): # <<<<<<<<<<<<<<
@@ -40669,7 +41193,7 @@ static int __pyx_f_4cdec_2sa_3_sa_11SuffixArray___search_low(struct __pyx_obj_4c
return __pyx_r;
}
-/* "suffix_array.pxi":220
+/* "cdec/sa/suffix_array.pxi":220
* return self.__search_low(word_id, offset, midpoint+1, high)
*
* cdef __get_range(self, int word_id, int offset, int low, int high, int midpoint): # <<<<<<<<<<<<<<
@@ -40688,7 +41212,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_11SuffixArray___get_range(struct __pyx_o
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get_range", 0);
- /* "suffix_array.pxi":221
+ /* "cdec/sa/suffix_array.pxi":221
*
* cdef __get_range(self, int word_id, int offset, int low, int high, int midpoint):
* return (self.__search_low(word_id, offset, low, midpoint), # <<<<<<<<<<<<<<
@@ -40699,7 +41223,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_11SuffixArray___get_range(struct __pyx_o
__pyx_t_1 = __Pyx_PyInt_From_int(((struct __pyx_vtabstruct_4cdec_2sa_3_sa_SuffixArray *)__pyx_v_self->__pyx_vtab)->__pyx___search_low(__pyx_v_self, __pyx_v_word_id, __pyx_v_offset, __pyx_v_low, __pyx_v_midpoint)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- /* "suffix_array.pxi":222
+ /* "cdec/sa/suffix_array.pxi":222
* cdef __get_range(self, int word_id, int offset, int low, int high, int midpoint):
* return (self.__search_low(word_id, offset, low, midpoint),
* self.__search_high(word_id, offset, midpoint, high)) # <<<<<<<<<<<<<<
@@ -40709,7 +41233,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_11SuffixArray___get_range(struct __pyx_o
__pyx_t_2 = __Pyx_PyInt_From_int(((struct __pyx_vtabstruct_4cdec_2sa_3_sa_SuffixArray *)__pyx_v_self->__pyx_vtab)->__pyx___search_high(__pyx_v_self, __pyx_v_word_id, __pyx_v_offset, __pyx_v_midpoint, __pyx_v_high)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- /* "suffix_array.pxi":221
+ /* "cdec/sa/suffix_array.pxi":221
*
* cdef __get_range(self, int word_id, int offset, int low, int high, int midpoint):
* return (self.__search_low(word_id, offset, low, midpoint), # <<<<<<<<<<<<<<
@@ -40728,7 +41252,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_11SuffixArray___get_range(struct __pyx_o
__pyx_t_3 = 0;
goto __pyx_L0;
- /* "suffix_array.pxi":220
+ /* "cdec/sa/suffix_array.pxi":220
* return self.__search_low(word_id, offset, midpoint+1, high)
*
* cdef __get_range(self, int word_id, int offset, int low, int high, int midpoint): # <<<<<<<<<<<<<<
@@ -40749,7 +41273,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_11SuffixArray___get_range(struct __pyx_o
return __pyx_r;
}
-/* "suffix_array.pxi":224
+/* "cdec/sa/suffix_array.pxi":224
* self.__search_high(word_id, offset, midpoint, high))
*
* cdef __lookup_helper(self, int word_id, int offset, int low, int high): # <<<<<<<<<<<<<<
@@ -40770,7 +41294,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_11SuffixArray___lookup_helper(struct __p
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__lookup_helper", 0);
- /* "suffix_array.pxi":227
+ /* "cdec/sa/suffix_array.pxi":227
* cdef int midpoint
*
* if offset == 0: # <<<<<<<<<<<<<<
@@ -40780,7 +41304,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_11SuffixArray___lookup_helper(struct __p
__pyx_t_1 = ((__pyx_v_offset == 0) != 0);
if (__pyx_t_1) {
- /* "suffix_array.pxi":228
+ /* "cdec/sa/suffix_array.pxi":228
*
* if offset == 0:
* return (self.ha.arr[word_id], self.ha.arr[word_id+1]) # <<<<<<<<<<<<<<
@@ -40805,7 +41329,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_11SuffixArray___lookup_helper(struct __p
goto __pyx_L0;
}
- /* "suffix_array.pxi":229
+ /* "cdec/sa/suffix_array.pxi":229
* if offset == 0:
* return (self.ha.arr[word_id], self.ha.arr[word_id+1])
* if low >= high: # <<<<<<<<<<<<<<
@@ -40815,7 +41339,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_11SuffixArray___lookup_helper(struct __p
__pyx_t_1 = ((__pyx_v_low >= __pyx_v_high) != 0);
if (__pyx_t_1) {
- /* "suffix_array.pxi":230
+ /* "cdec/sa/suffix_array.pxi":230
* return (self.ha.arr[word_id], self.ha.arr[word_id+1])
* if low >= high:
* return None # <<<<<<<<<<<<<<
@@ -40828,7 +41352,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_11SuffixArray___lookup_helper(struct __p
goto __pyx_L0;
}
- /* "suffix_array.pxi":232
+ /* "cdec/sa/suffix_array.pxi":232
* return None
*
* midpoint = (high + low) / 2 # <<<<<<<<<<<<<<
@@ -40837,7 +41361,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_11SuffixArray___lookup_helper(struct __p
*/
__pyx_v_midpoint = __Pyx_div_long((__pyx_v_high + __pyx_v_low), 2);
- /* "suffix_array.pxi":233
+ /* "cdec/sa/suffix_array.pxi":233
*
* midpoint = (high + low) / 2
* if self.darray.data.arr[self.sa.arr[midpoint] + offset] == word_id: # <<<<<<<<<<<<<<
@@ -40847,7 +41371,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_11SuffixArray___lookup_helper(struct __p
__pyx_t_1 = (((__pyx_v_self->darray->data->arr[((__pyx_v_self->sa->arr[__pyx_v_midpoint]) + __pyx_v_offset)]) == __pyx_v_word_id) != 0);
if (__pyx_t_1) {
- /* "suffix_array.pxi":234
+ /* "cdec/sa/suffix_array.pxi":234
* midpoint = (high + low) / 2
* if self.darray.data.arr[self.sa.arr[midpoint] + offset] == word_id:
* return self.__get_range(word_id, offset, low, high, midpoint) # <<<<<<<<<<<<<<
@@ -40862,7 +41386,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_11SuffixArray___lookup_helper(struct __p
goto __pyx_L0;
}
- /* "suffix_array.pxi":235
+ /* "cdec/sa/suffix_array.pxi":235
* if self.darray.data.arr[self.sa.arr[midpoint] + offset] == word_id:
* return self.__get_range(word_id, offset, low, high, midpoint)
* if self.darray.data.arr[self.sa.arr[midpoint] + offset] > word_id: # <<<<<<<<<<<<<<
@@ -40872,7 +41396,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_11SuffixArray___lookup_helper(struct __p
__pyx_t_1 = (((__pyx_v_self->darray->data->arr[((__pyx_v_self->sa->arr[__pyx_v_midpoint]) + __pyx_v_offset)]) > __pyx_v_word_id) != 0);
if (__pyx_t_1) {
- /* "suffix_array.pxi":236
+ /* "cdec/sa/suffix_array.pxi":236
* return self.__get_range(word_id, offset, low, high, midpoint)
* if self.darray.data.arr[self.sa.arr[midpoint] + offset] > word_id:
* return self.__lookup_helper(word_id, offset, low, midpoint) # <<<<<<<<<<<<<<
@@ -40888,7 +41412,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_11SuffixArray___lookup_helper(struct __p
}
/*else*/ {
- /* "suffix_array.pxi":238
+ /* "cdec/sa/suffix_array.pxi":238
* return self.__lookup_helper(word_id, offset, low, midpoint)
* else:
* return self.__lookup_helper(word_id, offset, midpoint+1, high) # <<<<<<<<<<<<<<
@@ -40903,7 +41427,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_11SuffixArray___lookup_helper(struct __p
goto __pyx_L0;
}
- /* "suffix_array.pxi":224
+ /* "cdec/sa/suffix_array.pxi":224
* self.__search_high(word_id, offset, midpoint, high))
*
* cdef __lookup_helper(self, int word_id, int offset, int low, int high): # <<<<<<<<<<<<<<
@@ -40924,7 +41448,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_11SuffixArray___lookup_helper(struct __p
return __pyx_r;
}
-/* "suffix_array.pxi":240
+/* "cdec/sa/suffix_array.pxi":240
* return self.__lookup_helper(word_id, offset, midpoint+1, high)
*
* def lookup(self, word, int offset, int low, int high): # <<<<<<<<<<<<<<
@@ -41025,7 +41549,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_16lookup(struct __pyx_obj
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("lookup", 0);
- /* "suffix_array.pxi":242
+ /* "cdec/sa/suffix_array.pxi":242
* def lookup(self, word, int offset, int low, int high):
* cdef int wordid
* if low == -1: # <<<<<<<<<<<<<<
@@ -41035,7 +41559,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_16lookup(struct __pyx_obj
__pyx_t_1 = ((__pyx_v_low == -1) != 0);
if (__pyx_t_1) {
- /* "suffix_array.pxi":243
+ /* "cdec/sa/suffix_array.pxi":243
* cdef int wordid
* if low == -1:
* low = 0 # <<<<<<<<<<<<<<
@@ -41047,7 +41571,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_16lookup(struct __pyx_obj
}
__pyx_L3:;
- /* "suffix_array.pxi":244
+ /* "cdec/sa/suffix_array.pxi":244
* if low == -1:
* low = 0
* if high == -1: # <<<<<<<<<<<<<<
@@ -41057,7 +41581,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_16lookup(struct __pyx_obj
__pyx_t_1 = ((__pyx_v_high == -1) != 0);
if (__pyx_t_1) {
- /* "suffix_array.pxi":245
+ /* "cdec/sa/suffix_array.pxi":245
* low = 0
* if high == -1:
* high = len(self.sa) # <<<<<<<<<<<<<<
@@ -41073,7 +41597,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_16lookup(struct __pyx_obj
}
__pyx_L4:;
- /* "suffix_array.pxi":246
+ /* "cdec/sa/suffix_array.pxi":246
* if high == -1:
* high = len(self.sa)
* if word in self.darray.word2id: # <<<<<<<<<<<<<<
@@ -41084,7 +41608,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_16lookup(struct __pyx_obj
__pyx_t_4 = (__pyx_t_1 != 0);
if (__pyx_t_4) {
- /* "suffix_array.pxi":247
+ /* "cdec/sa/suffix_array.pxi":247
* high = len(self.sa)
* if word in self.darray.word2id:
* word_id = self.darray.word2id[word] # <<<<<<<<<<<<<<
@@ -41096,7 +41620,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_16lookup(struct __pyx_obj
__pyx_v_word_id = __pyx_t_2;
__pyx_t_2 = 0;
- /* "suffix_array.pxi":248
+ /* "cdec/sa/suffix_array.pxi":248
* if word in self.darray.word2id:
* word_id = self.darray.word2id[word]
* return self.__lookup_helper(word_id, offset, low, high) # <<<<<<<<<<<<<<
@@ -41113,7 +41637,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_16lookup(struct __pyx_obj
}
/*else*/ {
- /* "suffix_array.pxi":250
+ /* "cdec/sa/suffix_array.pxi":250
* return self.__lookup_helper(word_id, offset, low, high)
* else:
* return None # <<<<<<<<<<<<<<
@@ -41124,7 +41648,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_16lookup(struct __pyx_obj
goto __pyx_L0;
}
- /* "suffix_array.pxi":240
+ /* "cdec/sa/suffix_array.pxi":240
* return self.__lookup_helper(word_id, offset, midpoint+1, high)
*
* def lookup(self, word, int offset, int low, int high): # <<<<<<<<<<<<<<
@@ -41144,7 +41668,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_16lookup(struct __pyx_obj
return __pyx_r;
}
-/* "rulefactory.pxi":47
+/* "cdec/sa/rulefactory.pxi":47
* cdef public bilex
*
* def __cinit__(self): # <<<<<<<<<<<<<<
@@ -41168,7 +41692,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_1__cinit__(PyObject *__pyx_v_se
return __pyx_r;
}
-/* "rulefactory.pxi":54
+/* "cdec/sa/rulefactory.pxi":54
* self.phrases_f = defaultdict(int)
* self.phrases_e = defaultdict(int)
* self.phrases_fe = defaultdict(lambda: defaultdict(int)) # <<<<<<<<<<<<<<
@@ -41177,20 +41701,20 @@ static int __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_1__cinit__(PyObject *__pyx_v_se
*/
/* Python wrapper */
-static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9__cinit___lambda1(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_11OnlineStats_9__cinit___lambda1 = {"lambda1", (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9__cinit___lambda1, METH_NOARGS, 0};
-static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9__cinit___lambda1(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9__cinit___lambda3(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_11OnlineStats_9__cinit___lambda3 = {"lambda3", (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9__cinit___lambda3, METH_NOARGS, 0};
+static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9__cinit___lambda3(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("lambda1 (wrapper)", 0);
- __pyx_r = __pyx_lambda_funcdef_lambda1(__pyx_self);
+ __Pyx_RefNannySetupContext("lambda3 (wrapper)", 0);
+ __pyx_r = __pyx_lambda_funcdef_lambda3(__pyx_self);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_lambda_funcdef_lambda1(CYTHON_UNUSED PyObject *__pyx_self) {
+static PyObject *__pyx_lambda_funcdef_lambda3(CYTHON_UNUSED PyObject *__pyx_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
@@ -41200,7 +41724,7 @@ static PyObject *__pyx_lambda_funcdef_lambda1(CYTHON_UNUSED PyObject *__pyx_self
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("lambda1", 0);
+ __Pyx_RefNannySetupContext("lambda3", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_defaultdict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
@@ -41239,7 +41763,7 @@ static PyObject *__pyx_lambda_funcdef_lambda1(CYTHON_UNUSED PyObject *__pyx_self
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("cdec.sa._sa.OnlineStats.__cinit__.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("cdec.sa._sa.OnlineStats.__cinit__.lambda3", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -41247,7 +41771,7 @@ static PyObject *__pyx_lambda_funcdef_lambda1(CYTHON_UNUSED PyObject *__pyx_self
return __pyx_r;
}
-/* "rulefactory.pxi":55
+/* "cdec/sa/rulefactory.pxi":55
* self.phrases_e = defaultdict(int)
* self.phrases_fe = defaultdict(lambda: defaultdict(int))
* self.phrases_al = defaultdict(lambda: defaultdict(tuple)) # <<<<<<<<<<<<<<
@@ -41256,20 +41780,20 @@ static PyObject *__pyx_lambda_funcdef_lambda1(CYTHON_UNUSED PyObject *__pyx_self
*/
/* Python wrapper */
-static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9__cinit___1lambda2(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_11OnlineStats_9__cinit___1lambda2 = {"lambda2", (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9__cinit___1lambda2, METH_NOARGS, 0};
-static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9__cinit___1lambda2(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9__cinit___1lambda4(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_11OnlineStats_9__cinit___1lambda4 = {"lambda4", (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9__cinit___1lambda4, METH_NOARGS, 0};
+static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9__cinit___1lambda4(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("lambda2 (wrapper)", 0);
- __pyx_r = __pyx_lambda_funcdef_lambda2(__pyx_self);
+ __Pyx_RefNannySetupContext("lambda4 (wrapper)", 0);
+ __pyx_r = __pyx_lambda_funcdef_lambda4(__pyx_self);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_lambda_funcdef_lambda2(CYTHON_UNUSED PyObject *__pyx_self) {
+static PyObject *__pyx_lambda_funcdef_lambda4(CYTHON_UNUSED PyObject *__pyx_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
@@ -41279,7 +41803,7 @@ static PyObject *__pyx_lambda_funcdef_lambda2(CYTHON_UNUSED PyObject *__pyx_self
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("lambda2", 0);
+ __Pyx_RefNannySetupContext("lambda4", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_defaultdict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
@@ -41318,7 +41842,7 @@ static PyObject *__pyx_lambda_funcdef_lambda2(CYTHON_UNUSED PyObject *__pyx_self
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("cdec.sa._sa.OnlineStats.__cinit__.lambda2", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("cdec.sa._sa.OnlineStats.__cinit__.lambda4", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -41326,7 +41850,7 @@ static PyObject *__pyx_lambda_funcdef_lambda2(CYTHON_UNUSED PyObject *__pyx_self
return __pyx_r;
}
-/* "rulefactory.pxi":47
+/* "cdec/sa/rulefactory.pxi":47
* cdef public bilex
*
* def __cinit__(self): # <<<<<<<<<<<<<<
@@ -41347,7 +41871,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats___cinit__(struct __pyx_obj_4cde
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "rulefactory.pxi":49
+ /* "cdec/sa/rulefactory.pxi":49
* def __cinit__(self):
* # Keep track of everything that can be sampled:
* self.samples_f = defaultdict(int) # <<<<<<<<<<<<<<
@@ -41387,7 +41911,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats___cinit__(struct __pyx_obj_4cde
__pyx_v_self->samples_f = __pyx_t_1;
__pyx_t_1 = 0;
- /* "rulefactory.pxi":52
+ /* "cdec/sa/rulefactory.pxi":52
*
* # Phrase counts
* self.phrases_f = defaultdict(int) # <<<<<<<<<<<<<<
@@ -41427,7 +41951,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats___cinit__(struct __pyx_obj_4cde
__pyx_v_self->phrases_f = __pyx_t_1;
__pyx_t_1 = 0;
- /* "rulefactory.pxi":53
+ /* "cdec/sa/rulefactory.pxi":53
* # Phrase counts
* self.phrases_f = defaultdict(int)
* self.phrases_e = defaultdict(int) # <<<<<<<<<<<<<<
@@ -41467,7 +41991,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats___cinit__(struct __pyx_obj_4cde
__pyx_v_self->phrases_e = __pyx_t_1;
__pyx_t_1 = 0;
- /* "rulefactory.pxi":54
+ /* "cdec/sa/rulefactory.pxi":54
* self.phrases_f = defaultdict(int)
* self.phrases_e = defaultdict(int)
* self.phrases_fe = defaultdict(lambda: defaultdict(int)) # <<<<<<<<<<<<<<
@@ -41476,7 +42000,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats___cinit__(struct __pyx_obj_4cde
*/
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_defaultdict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_11OnlineStats_9__cinit___lambda1, 0, __pyx_n_s_cinit___locals_lambda, NULL, __pyx_n_s_cdec_sa__sa, __pyx_d, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_11OnlineStats_9__cinit___lambda3, 0, __pyx_n_s_cinit___locals_lambda, NULL, __pyx_n_s_cdec_sa__sa, __pyx_d, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = NULL;
if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
@@ -41510,7 +42034,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats___cinit__(struct __pyx_obj_4cde
__pyx_v_self->phrases_fe = __pyx_t_1;
__pyx_t_1 = 0;
- /* "rulefactory.pxi":55
+ /* "cdec/sa/rulefactory.pxi":55
* self.phrases_e = defaultdict(int)
* self.phrases_fe = defaultdict(lambda: defaultdict(int))
* self.phrases_al = defaultdict(lambda: defaultdict(tuple)) # <<<<<<<<<<<<<<
@@ -41519,7 +42043,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats___cinit__(struct __pyx_obj_4cde
*/
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_defaultdict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_11OnlineStats_9__cinit___1lambda2, 0, __pyx_n_s_cinit___locals_lambda, NULL, __pyx_n_s_cdec_sa__sa, __pyx_d, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_11OnlineStats_9__cinit___1lambda4, 0, __pyx_n_s_cinit___locals_lambda, NULL, __pyx_n_s_cdec_sa__sa, __pyx_d, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_4 = NULL;
if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
@@ -41553,7 +42077,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats___cinit__(struct __pyx_obj_4cde
__pyx_v_self->phrases_al = __pyx_t_1;
__pyx_t_1 = 0;
- /* "rulefactory.pxi":58
+ /* "cdec/sa/rulefactory.pxi":58
*
* # Instance-specific bilex
* self.bilex = Bilex() # <<<<<<<<<<<<<<
@@ -41586,7 +42110,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats___cinit__(struct __pyx_obj_4cde
__pyx_v_self->bilex = __pyx_t_1;
__pyx_t_1 = 0;
- /* "rulefactory.pxi":47
+ /* "cdec/sa/rulefactory.pxi":47
* cdef public bilex
*
* def __cinit__(self): # <<<<<<<<<<<<<<
@@ -41610,7 +42134,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats___cinit__(struct __pyx_obj_4cde
return __pyx_r;
}
-/* "rulefactory.pxi":40
+/* "cdec/sa/rulefactory.pxi":40
*
* cdef class OnlineStats:
* cdef public samples_f # <<<<<<<<<<<<<<
@@ -41705,7 +42229,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_9samples_f_4__del__(struct __py
return __pyx_r;
}
-/* "rulefactory.pxi":41
+/* "cdec/sa/rulefactory.pxi":41
* cdef class OnlineStats:
* cdef public samples_f
* cdef public phrases_f # <<<<<<<<<<<<<<
@@ -41800,7 +42324,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_9phrases_f_4__del__(struct __py
return __pyx_r;
}
-/* "rulefactory.pxi":42
+/* "cdec/sa/rulefactory.pxi":42
* cdef public samples_f
* cdef public phrases_f
* cdef public phrases_e # <<<<<<<<<<<<<<
@@ -41895,7 +42419,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_9phrases_e_4__del__(struct __py
return __pyx_r;
}
-/* "rulefactory.pxi":43
+/* "cdec/sa/rulefactory.pxi":43
* cdef public phrases_f
* cdef public phrases_e
* cdef public phrases_fe # <<<<<<<<<<<<<<
@@ -41990,7 +42514,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_10phrases_fe_4__del__(struct __
return __pyx_r;
}
-/* "rulefactory.pxi":44
+/* "cdec/sa/rulefactory.pxi":44
* cdef public phrases_e
* cdef public phrases_fe
* cdef public phrases_al # <<<<<<<<<<<<<<
@@ -42085,7 +42609,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_10phrases_al_4__del__(struct __
return __pyx_r;
}
-/* "rulefactory.pxi":45
+/* "cdec/sa/rulefactory.pxi":45
* cdef public phrases_fe
* cdef public phrases_al
* cdef public bilex # <<<<<<<<<<<<<<
@@ -42180,7 +42704,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_5bilex_4__del__(struct __pyx_ob
return __pyx_r;
}
-/* "rulefactory.pxi":70
+/* "cdec/sa/rulefactory.pxi":70
* cdef public children
*
* def __cinit__(self): # <<<<<<<<<<<<<<
@@ -42213,7 +42737,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_8TrieNode___cinit__(struct __pyx_obj_4cdec_2s
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "rulefactory.pxi":71
+ /* "cdec/sa/rulefactory.pxi":71
*
* def __cinit__(self):
* self.children = {} # <<<<<<<<<<<<<<
@@ -42228,7 +42752,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_8TrieNode___cinit__(struct __pyx_obj_4cdec_2s
__pyx_v_self->children = __pyx_t_1;
__pyx_t_1 = 0;
- /* "rulefactory.pxi":70
+ /* "cdec/sa/rulefactory.pxi":70
* cdef public children
*
* def __cinit__(self): # <<<<<<<<<<<<<<
@@ -42248,7 +42772,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_8TrieNode___cinit__(struct __pyx_obj_4cdec_2s
return __pyx_r;
}
-/* "rulefactory.pxi":68
+/* "cdec/sa/rulefactory.pxi":68
*
* cdef class TrieNode:
* cdef public children # <<<<<<<<<<<<<<
@@ -42343,7 +42867,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_8TrieNode_8children_4__del__(struct __pyx_obj
return __pyx_r;
}
-/* "rulefactory.pxi":78
+/* "cdec/sa/rulefactory.pxi":78
* cdef public suffix_link
*
* def __cinit__(self, phrase=None, phrase_location=None, suffix_link=None): # <<<<<<<<<<<<<<
@@ -42433,7 +42957,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_16ExtendedTrieNode___cinit__(struct __pyx_obj
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "rulefactory.pxi":79
+ /* "cdec/sa/rulefactory.pxi":79
*
* def __cinit__(self, phrase=None, phrase_location=None, suffix_link=None):
* self.phrase = phrase # <<<<<<<<<<<<<<
@@ -42446,7 +42970,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_16ExtendedTrieNode___cinit__(struct __pyx_obj
__Pyx_DECREF(__pyx_v_self->phrase);
__pyx_v_self->phrase = __pyx_v_phrase;
- /* "rulefactory.pxi":80
+ /* "cdec/sa/rulefactory.pxi":80
* def __cinit__(self, phrase=None, phrase_location=None, suffix_link=None):
* self.phrase = phrase
* self.phrase_location = phrase_location # <<<<<<<<<<<<<<
@@ -42459,7 +42983,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_16ExtendedTrieNode___cinit__(struct __pyx_obj
__Pyx_DECREF(__pyx_v_self->phrase_location);
__pyx_v_self->phrase_location = __pyx_v_phrase_location;
- /* "rulefactory.pxi":81
+ /* "cdec/sa/rulefactory.pxi":81
* self.phrase = phrase
* self.phrase_location = phrase_location
* self.suffix_link = suffix_link # <<<<<<<<<<<<<<
@@ -42472,7 +42996,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_16ExtendedTrieNode___cinit__(struct __pyx_obj
__Pyx_DECREF(__pyx_v_self->suffix_link);
__pyx_v_self->suffix_link = __pyx_v_suffix_link;
- /* "rulefactory.pxi":78
+ /* "cdec/sa/rulefactory.pxi":78
* cdef public suffix_link
*
* def __cinit__(self, phrase=None, phrase_location=None, suffix_link=None): # <<<<<<<<<<<<<<
@@ -42486,7 +43010,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_16ExtendedTrieNode___cinit__(struct __pyx_obj
return __pyx_r;
}
-/* "rulefactory.pxi":74
+/* "cdec/sa/rulefactory.pxi":74
*
* cdef class ExtendedTrieNode(TrieNode):
* cdef public phrase # <<<<<<<<<<<<<<
@@ -42581,7 +43105,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_16ExtendedTrieNode_6phrase_4__del__(struct __
return __pyx_r;
}
-/* "rulefactory.pxi":75
+/* "cdec/sa/rulefactory.pxi":75
* cdef class ExtendedTrieNode(TrieNode):
* cdef public phrase
* cdef public phrase_location # <<<<<<<<<<<<<<
@@ -42676,7 +43200,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_16ExtendedTrieNode_15phrase_location_4__del__
return __pyx_r;
}
-/* "rulefactory.pxi":76
+/* "cdec/sa/rulefactory.pxi":76
* cdef public phrase
* cdef public phrase_location
* cdef public suffix_link # <<<<<<<<<<<<<<
@@ -42771,7 +43295,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_16ExtendedTrieNode_11suffix_link_4__del__(str
return __pyx_r;
}
-/* "rulefactory.pxi":88
+/* "cdec/sa/rulefactory.pxi":88
* cdef public int count
* cdef public root
* def __cinit__(self, extended=False): # <<<<<<<<<<<<<<
@@ -42847,7 +43371,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9TrieTable___cinit__(struct __pyx_obj_4cdec_2
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "rulefactory.pxi":89
+ /* "cdec/sa/rulefactory.pxi":89
* cdef public root
* def __cinit__(self, extended=False):
* self.count = 0 # <<<<<<<<<<<<<<
@@ -42856,7 +43380,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9TrieTable___cinit__(struct __pyx_obj_4cdec_2
*/
__pyx_v_self->count = 0;
- /* "rulefactory.pxi":90
+ /* "cdec/sa/rulefactory.pxi":90
* def __cinit__(self, extended=False):
* self.count = 0
* self.extended = extended # <<<<<<<<<<<<<<
@@ -42866,7 +43390,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9TrieTable___cinit__(struct __pyx_obj_4cdec_2
__pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_extended); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_self->extended = __pyx_t_1;
- /* "rulefactory.pxi":91
+ /* "cdec/sa/rulefactory.pxi":91
* self.count = 0
* self.extended = extended
* if extended: # <<<<<<<<<<<<<<
@@ -42876,7 +43400,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9TrieTable___cinit__(struct __pyx_obj_4cdec_2
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_extended); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_2) {
- /* "rulefactory.pxi":92
+ /* "cdec/sa/rulefactory.pxi":92
* self.extended = extended
* if extended:
* self.root = ExtendedTrieNode() # <<<<<<<<<<<<<<
@@ -42894,7 +43418,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9TrieTable___cinit__(struct __pyx_obj_4cdec_2
}
/*else*/ {
- /* "rulefactory.pxi":94
+ /* "cdec/sa/rulefactory.pxi":94
* self.root = ExtendedTrieNode()
* else:
* self.root = TrieNode() # <<<<<<<<<<<<<<
@@ -42911,7 +43435,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9TrieTable___cinit__(struct __pyx_obj_4cdec_2
}
__pyx_L3:;
- /* "rulefactory.pxi":88
+ /* "cdec/sa/rulefactory.pxi":88
* cdef public int count
* cdef public root
* def __cinit__(self, extended=False): # <<<<<<<<<<<<<<
@@ -42931,7 +43455,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9TrieTable___cinit__(struct __pyx_obj_4cdec_2
return __pyx_r;
}
-/* "rulefactory.pxi":85
+/* "cdec/sa/rulefactory.pxi":85
*
* cdef class TrieTable:
* cdef public int extended # <<<<<<<<<<<<<<
@@ -43013,7 +43537,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9TrieTable_8extended_2__set__(struct __pyx_ob
return __pyx_r;
}
-/* "rulefactory.pxi":86
+/* "cdec/sa/rulefactory.pxi":86
* cdef class TrieTable:
* cdef public int extended
* cdef public int count # <<<<<<<<<<<<<<
@@ -43095,7 +43619,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9TrieTable_5count_2__set__(struct __pyx_obj_4
return __pyx_r;
}
-/* "rulefactory.pxi":87
+/* "cdec/sa/rulefactory.pxi":87
* cdef public int extended
* cdef public int count
* cdef public root # <<<<<<<<<<<<<<
@@ -43190,7 +43714,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9TrieTable_4root_4__del__(struct __pyx_obj_4c
return __pyx_r;
}
-/* "rulefactory.pxi":114
+/* "cdec/sa/rulefactory.pxi":114
*
* # returns true if sent_id is contained
* cdef int contains(self, int sent_id): # <<<<<<<<<<<<<<
@@ -43203,7 +43727,7 @@ static int __pyx_f_4cdec_2sa_3_sa_14PhraseLocation_contains(CYTHON_UNUSED struct
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("contains", 0);
- /* "rulefactory.pxi":115
+ /* "cdec/sa/rulefactory.pxi":115
* # returns true if sent_id is contained
* cdef int contains(self, int sent_id):
* return 1 # <<<<<<<<<<<<<<
@@ -43213,7 +43737,7 @@ static int __pyx_f_4cdec_2sa_3_sa_14PhraseLocation_contains(CYTHON_UNUSED struct
__pyx_r = 1;
goto __pyx_L0;
- /* "rulefactory.pxi":114
+ /* "cdec/sa/rulefactory.pxi":114
*
* # returns true if sent_id is contained
* cdef int contains(self, int sent_id): # <<<<<<<<<<<<<<
@@ -43227,7 +43751,7 @@ static int __pyx_f_4cdec_2sa_3_sa_14PhraseLocation_contains(CYTHON_UNUSED struct
return __pyx_r;
}
-/* "rulefactory.pxi":117
+/* "cdec/sa/rulefactory.pxi":117
* return 1
*
* def __cinit__(self, int sa_low=-1, int sa_high=-1, int arr_low=-1, int arr_high=-1, # <<<<<<<<<<<<<<
@@ -43254,7 +43778,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_14PhraseLocation_1__cinit__(PyObject *__pyx_v
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sa_low,&__pyx_n_s_sa_high,&__pyx_n_s_arr_low,&__pyx_n_s_arr_high,&__pyx_n_s_arr,&__pyx_n_s_num_subpatterns,0};
PyObject* values[6] = {0,0,0,0,0,0};
- /* "rulefactory.pxi":118
+ /* "cdec/sa/rulefactory.pxi":118
*
* def __cinit__(self, int sa_low=-1, int sa_high=-1, int arr_low=-1, int arr_high=-1,
* arr=None, int num_subpatterns=1): # <<<<<<<<<<<<<<
@@ -43360,7 +43884,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_14PhraseLocation_1__cinit__(PyObject *__pyx_v
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_4cdec_2sa_3_sa_14PhraseLocation___cinit__(((struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *)__pyx_v_self), __pyx_v_sa_low, __pyx_v_sa_high, __pyx_v_arr_low, __pyx_v_arr_high, __pyx_v_arr, __pyx_v_num_subpatterns);
- /* "rulefactory.pxi":117
+ /* "cdec/sa/rulefactory.pxi":117
* return 1
*
* def __cinit__(self, int sa_low=-1, int sa_high=-1, int arr_low=-1, int arr_high=-1, # <<<<<<<<<<<<<<
@@ -43382,7 +43906,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_4
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "rulefactory.pxi":119
+ /* "cdec/sa/rulefactory.pxi":119
* def __cinit__(self, int sa_low=-1, int sa_high=-1, int arr_low=-1, int arr_high=-1,
* arr=None, int num_subpatterns=1):
* self.sa_low = sa_low # <<<<<<<<<<<<<<
@@ -43391,7 +43915,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_4
*/
__pyx_v_self->sa_low = __pyx_v_sa_low;
- /* "rulefactory.pxi":120
+ /* "cdec/sa/rulefactory.pxi":120
* arr=None, int num_subpatterns=1):
* self.sa_low = sa_low
* self.sa_high = sa_high # <<<<<<<<<<<<<<
@@ -43400,7 +43924,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_4
*/
__pyx_v_self->sa_high = __pyx_v_sa_high;
- /* "rulefactory.pxi":121
+ /* "cdec/sa/rulefactory.pxi":121
* self.sa_low = sa_low
* self.sa_high = sa_high
* self.arr_low = arr_low # <<<<<<<<<<<<<<
@@ -43409,7 +43933,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_4
*/
__pyx_v_self->arr_low = __pyx_v_arr_low;
- /* "rulefactory.pxi":122
+ /* "cdec/sa/rulefactory.pxi":122
* self.sa_high = sa_high
* self.arr_low = arr_low
* self.arr_high = arr_high # <<<<<<<<<<<<<<
@@ -43418,7 +43942,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_4
*/
__pyx_v_self->arr_high = __pyx_v_arr_high;
- /* "rulefactory.pxi":123
+ /* "cdec/sa/rulefactory.pxi":123
* self.arr_low = arr_low
* self.arr_high = arr_high
* self.arr = arr # <<<<<<<<<<<<<<
@@ -43434,7 +43958,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_4
__pyx_v_self->arr = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "rulefactory.pxi":124
+ /* "cdec/sa/rulefactory.pxi":124
* self.arr_high = arr_high
* self.arr = arr
* self.num_subpatterns = num_subpatterns # <<<<<<<<<<<<<<
@@ -43443,7 +43967,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_4
*/
__pyx_v_self->num_subpatterns = __pyx_v_num_subpatterns;
- /* "rulefactory.pxi":117
+ /* "cdec/sa/rulefactory.pxi":117
* return 1
*
* def __cinit__(self, int sa_low=-1, int sa_high=-1, int arr_low=-1, int arr_high=-1, # <<<<<<<<<<<<<<
@@ -43463,7 +43987,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_4
return __pyx_r;
}
-/* "rulefactory.pxi":134
+/* "cdec/sa/rulefactory.pxi":134
* cdef IntList sa
*
* def __cinit__(self, int sample_size, SuffixArray fsarray): # <<<<<<<<<<<<<<
@@ -43552,7 +44076,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_7Sampler___cinit__(struct __pyx_obj_4cdec_2sa
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "rulefactory.pxi":135
+ /* "cdec/sa/rulefactory.pxi":135
*
* def __cinit__(self, int sample_size, SuffixArray fsarray):
* self.sample_size = sample_size # <<<<<<<<<<<<<<
@@ -43561,7 +44085,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_7Sampler___cinit__(struct __pyx_obj_4cdec_2sa
*/
__pyx_v_self->sample_size = __pyx_v_sample_size;
- /* "rulefactory.pxi":136
+ /* "cdec/sa/rulefactory.pxi":136
* def __cinit__(self, int sample_size, SuffixArray fsarray):
* self.sample_size = sample_size
* self.sa = fsarray.sa # <<<<<<<<<<<<<<
@@ -43576,7 +44100,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_7Sampler___cinit__(struct __pyx_obj_4cdec_2sa
__pyx_v_self->sa = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "rulefactory.pxi":137
+ /* "cdec/sa/rulefactory.pxi":137
* self.sample_size = sample_size
* self.sa = fsarray.sa
* if sample_size > 0: # <<<<<<<<<<<<<<
@@ -43586,7 +44110,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_7Sampler___cinit__(struct __pyx_obj_4cdec_2sa
__pyx_t_2 = ((__pyx_v_sample_size > 0) != 0);
if (__pyx_t_2) {
- /* "rulefactory.pxi":138
+ /* "cdec/sa/rulefactory.pxi":138
* self.sa = fsarray.sa
* if sample_size > 0:
* logger.info("Sampling strategy: uniform, max sample size = %d", sample_size) # <<<<<<<<<<<<<<
@@ -43632,7 +44156,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_7Sampler___cinit__(struct __pyx_obj_4cdec_2sa
}
/*else*/ {
- /* "rulefactory.pxi":140
+ /* "cdec/sa/rulefactory.pxi":140
* logger.info("Sampling strategy: uniform, max sample size = %d", sample_size)
* else:
* logger.info("Sampling strategy: no sampling") # <<<<<<<<<<<<<<
@@ -43651,7 +44175,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_7Sampler___cinit__(struct __pyx_obj_4cdec_2sa
}
__pyx_L3:;
- /* "rulefactory.pxi":134
+ /* "cdec/sa/rulefactory.pxi":134
* cdef IntList sa
*
* def __cinit__(self, int sample_size, SuffixArray fsarray): # <<<<<<<<<<<<<<
@@ -43675,7 +44199,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_7Sampler___cinit__(struct __pyx_obj_4cdec_2sa
return __pyx_r;
}
-/* "rulefactory.pxi":142
+/* "cdec/sa/rulefactory.pxi":142
* logger.info("Sampling strategy: no sampling")
*
* def sample(self, PhraseLocation phrase_location): # <<<<<<<<<<<<<<
@@ -43723,7 +44247,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("sample", 0);
- /* "rulefactory.pxi":155
+ /* "cdec/sa/rulefactory.pxi":155
* cdef int num_locations, val, j
*
* sample = IntList() # <<<<<<<<<<<<<<
@@ -43735,7 +44259,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
__pyx_v_sample = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "rulefactory.pxi":156
+ /* "cdec/sa/rulefactory.pxi":156
*
* sample = IntList()
* if phrase_location.arr is None: # <<<<<<<<<<<<<<
@@ -43746,7 +44270,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
- /* "rulefactory.pxi":157
+ /* "cdec/sa/rulefactory.pxi":157
* sample = IntList()
* if phrase_location.arr is None:
* num_locations = phrase_location.sa_high - phrase_location.sa_low # <<<<<<<<<<<<<<
@@ -43755,7 +44279,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
*/
__pyx_v_num_locations = (__pyx_v_phrase_location->sa_high - __pyx_v_phrase_location->sa_low);
- /* "rulefactory.pxi":158
+ /* "cdec/sa/rulefactory.pxi":158
* if phrase_location.arr is None:
* num_locations = phrase_location.sa_high - phrase_location.sa_low
* if self.sample_size == -1 or num_locations <= self.sample_size: # <<<<<<<<<<<<<<
@@ -43775,7 +44299,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
__pyx_L5_bool_binop_done:;
if (__pyx_t_3) {
- /* "rulefactory.pxi":159
+ /* "cdec/sa/rulefactory.pxi":159
* num_locations = phrase_location.sa_high - phrase_location.sa_low
* if self.sample_size == -1 or num_locations <= self.sample_size:
* sample._extend_arr(self.sa.arr + phrase_location.sa_low, num_locations) # <<<<<<<<<<<<<<
@@ -43787,7 +44311,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
}
/*else*/ {
- /* "rulefactory.pxi":161
+ /* "cdec/sa/rulefactory.pxi":161
* sample._extend_arr(self.sa.arr + phrase_location.sa_low, num_locations)
* else:
* stepsize = float(num_locations)/float(self.sample_size) # <<<<<<<<<<<<<<
@@ -43806,7 +44330,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
}
__pyx_v_stepsize = (((double)__pyx_v_num_locations) / ((double)__pyx_v_self->sample_size));
- /* "rulefactory.pxi":162
+ /* "cdec/sa/rulefactory.pxi":162
* else:
* stepsize = float(num_locations)/float(self.sample_size)
* i = phrase_location.sa_low # <<<<<<<<<<<<<<
@@ -43816,7 +44340,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
__pyx_t_4 = __pyx_v_phrase_location->sa_low;
__pyx_v_i = __pyx_t_4;
- /* "rulefactory.pxi":163
+ /* "cdec/sa/rulefactory.pxi":163
* stepsize = float(num_locations)/float(self.sample_size)
* i = phrase_location.sa_low
* while i < phrase_location.sa_high and sample.len < self.sample_size: # <<<<<<<<<<<<<<
@@ -43837,7 +44361,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
__pyx_L9_bool_binop_done:;
if (!__pyx_t_3) break;
- /* "rulefactory.pxi":166
+ /* "cdec/sa/rulefactory.pxi":166
* '''Note: int(i) not guaranteed to have the desired
* effect, according to the python documentation'''
* if fmod(i,1.0) > 0.5: # <<<<<<<<<<<<<<
@@ -43847,7 +44371,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
__pyx_t_3 = ((fmod(__pyx_v_i, 1.0) > 0.5) != 0);
if (__pyx_t_3) {
- /* "rulefactory.pxi":167
+ /* "cdec/sa/rulefactory.pxi":167
* effect, according to the python documentation'''
* if fmod(i,1.0) > 0.5:
* val = int(ceil(i)) # <<<<<<<<<<<<<<
@@ -43859,7 +44383,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
}
/*else*/ {
- /* "rulefactory.pxi":169
+ /* "cdec/sa/rulefactory.pxi":169
* val = int(ceil(i))
* else:
* val = int(floor(i)) # <<<<<<<<<<<<<<
@@ -43870,7 +44394,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
}
__pyx_L11:;
- /* "rulefactory.pxi":170
+ /* "cdec/sa/rulefactory.pxi":170
* else:
* val = int(floor(i))
* sample._append(self.sa.arr[val]) # <<<<<<<<<<<<<<
@@ -43879,7 +44403,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_sample->__pyx_vtab)->_append(__pyx_v_sample, (__pyx_v_self->sa->arr[__pyx_v_val]));
- /* "rulefactory.pxi":171
+ /* "cdec/sa/rulefactory.pxi":171
* val = int(floor(i))
* sample._append(self.sa.arr[val])
* i = i + stepsize # <<<<<<<<<<<<<<
@@ -43894,7 +44418,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
}
/*else*/ {
- /* "rulefactory.pxi":173
+ /* "cdec/sa/rulefactory.pxi":173
* i = i + stepsize
* else:
* num_locations = (phrase_location.arr_high - phrase_location.arr_low) / phrase_location.num_subpatterns # <<<<<<<<<<<<<<
@@ -43924,7 +44448,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
}
__pyx_v_num_locations = __Pyx_div_int(__pyx_t_4, __pyx_v_phrase_location->num_subpatterns);
- /* "rulefactory.pxi":174
+ /* "cdec/sa/rulefactory.pxi":174
* else:
* num_locations = (phrase_location.arr_high - phrase_location.arr_low) / phrase_location.num_subpatterns
* if self.sample_size == -1 or num_locations <= self.sample_size: # <<<<<<<<<<<<<<
@@ -43944,7 +44468,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
__pyx_L13_bool_binop_done:;
if (__pyx_t_3) {
- /* "rulefactory.pxi":175
+ /* "cdec/sa/rulefactory.pxi":175
* num_locations = (phrase_location.arr_high - phrase_location.arr_low) / phrase_location.num_subpatterns
* if self.sample_size == -1 or num_locations <= self.sample_size:
* sample = phrase_location.arr # <<<<<<<<<<<<<<
@@ -43959,7 +44483,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
}
/*else*/ {
- /* "rulefactory.pxi":177
+ /* "cdec/sa/rulefactory.pxi":177
* sample = phrase_location.arr
* else:
* stepsize = float(num_locations)/float(self.sample_size) # <<<<<<<<<<<<<<
@@ -43978,7 +44502,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
}
__pyx_v_stepsize = (((double)__pyx_v_num_locations) / ((double)__pyx_v_self->sample_size));
- /* "rulefactory.pxi":178
+ /* "cdec/sa/rulefactory.pxi":178
* else:
* stepsize = float(num_locations)/float(self.sample_size)
* i = phrase_location.arr_low # <<<<<<<<<<<<<<
@@ -43988,7 +44512,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
__pyx_t_4 = __pyx_v_phrase_location->arr_low;
__pyx_v_i = __pyx_t_4;
- /* "rulefactory.pxi":179
+ /* "cdec/sa/rulefactory.pxi":179
* stepsize = float(num_locations)/float(self.sample_size)
* i = phrase_location.arr_low
* while i < num_locations and sample.len < self.sample_size * phrase_location.num_subpatterns: # <<<<<<<<<<<<<<
@@ -44009,7 +44533,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
__pyx_L17_bool_binop_done:;
if (!__pyx_t_3) break;
- /* "rulefactory.pxi":182
+ /* "cdec/sa/rulefactory.pxi":182
* '''Note: int(i) not guaranteed to have the desired
* effect, according to the python documentation'''
* if fmod(i,1.0) > 0.5: # <<<<<<<<<<<<<<
@@ -44019,7 +44543,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
__pyx_t_3 = ((fmod(__pyx_v_i, 1.0) > 0.5) != 0);
if (__pyx_t_3) {
- /* "rulefactory.pxi":183
+ /* "cdec/sa/rulefactory.pxi":183
* effect, according to the python documentation'''
* if fmod(i,1.0) > 0.5:
* val = int(ceil(i)) # <<<<<<<<<<<<<<
@@ -44031,7 +44555,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
}
/*else*/ {
- /* "rulefactory.pxi":185
+ /* "cdec/sa/rulefactory.pxi":185
* val = int(ceil(i))
* else:
* val = int(floor(i)) # <<<<<<<<<<<<<<
@@ -44042,7 +44566,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
}
__pyx_L19:;
- /* "rulefactory.pxi":186
+ /* "cdec/sa/rulefactory.pxi":186
* else:
* val = int(floor(i))
* j = phrase_location.arr_low + (val*phrase_location.num_subpatterns) # <<<<<<<<<<<<<<
@@ -44051,7 +44575,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
*/
__pyx_v_j = (__pyx_v_phrase_location->arr_low + (__pyx_v_val * __pyx_v_phrase_location->num_subpatterns));
- /* "rulefactory.pxi":187
+ /* "cdec/sa/rulefactory.pxi":187
* val = int(floor(i))
* j = phrase_location.arr_low + (val*phrase_location.num_subpatterns)
* sample._extend_arr(phrase_location.arr.arr + j, phrase_location.num_subpatterns) # <<<<<<<<<<<<<<
@@ -44060,7 +44584,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_sample->__pyx_vtab)->_extend_arr(__pyx_v_sample, (__pyx_v_phrase_location->arr->arr + __pyx_v_j), __pyx_v_phrase_location->num_subpatterns);
- /* "rulefactory.pxi":188
+ /* "cdec/sa/rulefactory.pxi":188
* j = phrase_location.arr_low + (val*phrase_location.num_subpatterns)
* sample._extend_arr(phrase_location.arr.arr + j, phrase_location.num_subpatterns)
* i = i + stepsize # <<<<<<<<<<<<<<
@@ -44074,7 +44598,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
}
__pyx_L3:;
- /* "rulefactory.pxi":189
+ /* "cdec/sa/rulefactory.pxi":189
* sample._extend_arr(phrase_location.arr.arr + j, phrase_location.num_subpatterns)
* i = i + stepsize
* return sample # <<<<<<<<<<<<<<
@@ -44086,7 +44610,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
__pyx_r = ((PyObject *)__pyx_v_sample);
goto __pyx_L0;
- /* "rulefactory.pxi":142
+ /* "cdec/sa/rulefactory.pxi":142
* logger.info("Sampling strategy: no sampling")
*
* def sample(self, PhraseLocation phrase_location): # <<<<<<<<<<<<<<
@@ -44106,7 +44630,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
return __pyx_r;
}
-/* "rulefactory.pxi":201
+/* "cdec/sa/rulefactory.pxi":201
*
*
* cdef void assign_matching(Matching* m, int* arr, int start, int step, int* sent_id_arr): # <<<<<<<<<<<<<<
@@ -44118,7 +44642,7 @@ static void __pyx_f_4cdec_2sa_3_sa_assign_matching(struct __pyx_t_4cdec_2sa_3_sa
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("assign_matching", 0);
- /* "rulefactory.pxi":202
+ /* "cdec/sa/rulefactory.pxi":202
*
* cdef void assign_matching(Matching* m, int* arr, int start, int step, int* sent_id_arr):
* m.arr = arr # <<<<<<<<<<<<<<
@@ -44127,7 +44651,7 @@ static void __pyx_f_4cdec_2sa_3_sa_assign_matching(struct __pyx_t_4cdec_2sa_3_sa
*/
__pyx_v_m->arr = __pyx_v_arr;
- /* "rulefactory.pxi":203
+ /* "cdec/sa/rulefactory.pxi":203
* cdef void assign_matching(Matching* m, int* arr, int start, int step, int* sent_id_arr):
* m.arr = arr
* m.start = start # <<<<<<<<<<<<<<
@@ -44136,7 +44660,7 @@ static void __pyx_f_4cdec_2sa_3_sa_assign_matching(struct __pyx_t_4cdec_2sa_3_sa
*/
__pyx_v_m->start = __pyx_v_start;
- /* "rulefactory.pxi":204
+ /* "cdec/sa/rulefactory.pxi":204
* m.arr = arr
* m.start = start
* m.end = start + step # <<<<<<<<<<<<<<
@@ -44145,7 +44669,7 @@ static void __pyx_f_4cdec_2sa_3_sa_assign_matching(struct __pyx_t_4cdec_2sa_3_sa
*/
__pyx_v_m->end = (__pyx_v_start + __pyx_v_step);
- /* "rulefactory.pxi":205
+ /* "cdec/sa/rulefactory.pxi":205
* m.start = start
* m.end = start + step
* m.sent_id = sent_id_arr[arr[start]] # <<<<<<<<<<<<<<
@@ -44154,7 +44678,7 @@ static void __pyx_f_4cdec_2sa_3_sa_assign_matching(struct __pyx_t_4cdec_2sa_3_sa
*/
__pyx_v_m->sent_id = (__pyx_v_sent_id_arr[(__pyx_v_arr[__pyx_v_start])]);
- /* "rulefactory.pxi":206
+ /* "cdec/sa/rulefactory.pxi":206
* m.end = start + step
* m.sent_id = sent_id_arr[arr[start]]
* m.size = step # <<<<<<<<<<<<<<
@@ -44163,7 +44687,7 @@ static void __pyx_f_4cdec_2sa_3_sa_assign_matching(struct __pyx_t_4cdec_2sa_3_sa
*/
__pyx_v_m->size = __pyx_v_step;
- /* "rulefactory.pxi":201
+ /* "cdec/sa/rulefactory.pxi":201
*
*
* cdef void assign_matching(Matching* m, int* arr, int start, int step, int* sent_id_arr): # <<<<<<<<<<<<<<
@@ -44175,7 +44699,7 @@ static void __pyx_f_4cdec_2sa_3_sa_assign_matching(struct __pyx_t_4cdec_2sa_3_sa
__Pyx_RefNannyFinishContext();
}
-/* "rulefactory.pxi":209
+/* "cdec/sa/rulefactory.pxi":209
*
*
* cdef int* append_combined_matching(int* arr, Matching* loc1, Matching* loc2, # <<<<<<<<<<<<<<
@@ -44192,7 +44716,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_append_combined_matching(int *__pyx_v_arr, st
int __pyx_t_2;
__Pyx_RefNannySetupContext("append_combined_matching", 0);
- /* "rulefactory.pxi":213
+ /* "cdec/sa/rulefactory.pxi":213
* cdef int i, new_len
*
* new_len = result_len[0] + num_subpatterns # <<<<<<<<<<<<<<
@@ -44201,7 +44725,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_append_combined_matching(int *__pyx_v_arr, st
*/
__pyx_v_new_len = ((__pyx_v_result_len[0]) + __pyx_v_num_subpatterns);
- /* "rulefactory.pxi":214
+ /* "cdec/sa/rulefactory.pxi":214
*
* new_len = result_len[0] + num_subpatterns
* arr = <int*> realloc(arr, new_len*sizeof(int)) # <<<<<<<<<<<<<<
@@ -44210,7 +44734,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_append_combined_matching(int *__pyx_v_arr, st
*/
__pyx_v_arr = ((int *)realloc(__pyx_v_arr, (__pyx_v_new_len * (sizeof(int)))));
- /* "rulefactory.pxi":216
+ /* "cdec/sa/rulefactory.pxi":216
* arr = <int*> realloc(arr, new_len*sizeof(int))
*
* for i from 0 <= i < loc1.size: # <<<<<<<<<<<<<<
@@ -44220,7 +44744,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_append_combined_matching(int *__pyx_v_arr, st
__pyx_t_1 = __pyx_v_loc1->size;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {
- /* "rulefactory.pxi":217
+ /* "cdec/sa/rulefactory.pxi":217
*
* for i from 0 <= i < loc1.size:
* arr[result_len[0]+i] = loc1.arr[loc1.start+i] # <<<<<<<<<<<<<<
@@ -44230,7 +44754,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_append_combined_matching(int *__pyx_v_arr, st
(__pyx_v_arr[((__pyx_v_result_len[0]) + __pyx_v_i)]) = (__pyx_v_loc1->arr[(__pyx_v_loc1->start + __pyx_v_i)]);
}
- /* "rulefactory.pxi":218
+ /* "cdec/sa/rulefactory.pxi":218
* for i from 0 <= i < loc1.size:
* arr[result_len[0]+i] = loc1.arr[loc1.start+i]
* if num_subpatterns > loc1.size: # <<<<<<<<<<<<<<
@@ -44240,7 +44764,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_append_combined_matching(int *__pyx_v_arr, st
__pyx_t_2 = ((__pyx_v_num_subpatterns > __pyx_v_loc1->size) != 0);
if (__pyx_t_2) {
- /* "rulefactory.pxi":219
+ /* "cdec/sa/rulefactory.pxi":219
* arr[result_len[0]+i] = loc1.arr[loc1.start+i]
* if num_subpatterns > loc1.size:
* arr[new_len-1] = loc2.arr[loc2.end-1] # <<<<<<<<<<<<<<
@@ -44252,7 +44776,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_append_combined_matching(int *__pyx_v_arr, st
}
__pyx_L5:;
- /* "rulefactory.pxi":220
+ /* "cdec/sa/rulefactory.pxi":220
* if num_subpatterns > loc1.size:
* arr[new_len-1] = loc2.arr[loc2.end-1]
* result_len[0] = new_len # <<<<<<<<<<<<<<
@@ -44261,7 +44785,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_append_combined_matching(int *__pyx_v_arr, st
*/
(__pyx_v_result_len[0]) = __pyx_v_new_len;
- /* "rulefactory.pxi":221
+ /* "cdec/sa/rulefactory.pxi":221
* arr[new_len-1] = loc2.arr[loc2.end-1]
* result_len[0] = new_len
* return arr # <<<<<<<<<<<<<<
@@ -44271,7 +44795,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_append_combined_matching(int *__pyx_v_arr, st
__pyx_r = __pyx_v_arr;
goto __pyx_L0;
- /* "rulefactory.pxi":209
+ /* "cdec/sa/rulefactory.pxi":209
*
*
* cdef int* append_combined_matching(int* arr, Matching* loc1, Matching* loc2, # <<<<<<<<<<<<<<
@@ -44285,7 +44809,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_append_combined_matching(int *__pyx_v_arr, st
return __pyx_r;
}
-/* "rulefactory.pxi":224
+/* "cdec/sa/rulefactory.pxi":224
*
*
* cdef int* extend_arr(int* arr, int* arr_len, int* appendix, int appendix_len): # <<<<<<<<<<<<<<
@@ -44299,7 +44823,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("extend_arr", 0);
- /* "rulefactory.pxi":227
+ /* "cdec/sa/rulefactory.pxi":227
* cdef int new_len
*
* new_len = arr_len[0] + appendix_len # <<<<<<<<<<<<<<
@@ -44308,7 +44832,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr
*/
__pyx_v_new_len = ((__pyx_v_arr_len[0]) + __pyx_v_appendix_len);
- /* "rulefactory.pxi":228
+ /* "cdec/sa/rulefactory.pxi":228
*
* new_len = arr_len[0] + appendix_len
* arr = <int*> realloc(arr, new_len*sizeof(int)) # <<<<<<<<<<<<<<
@@ -44317,7 +44841,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr
*/
__pyx_v_arr = ((int *)realloc(__pyx_v_arr, (__pyx_v_new_len * (sizeof(int)))));
- /* "rulefactory.pxi":229
+ /* "cdec/sa/rulefactory.pxi":229
* new_len = arr_len[0] + appendix_len
* arr = <int*> realloc(arr, new_len*sizeof(int))
* memcpy(arr+arr_len[0], appendix, appendix_len*sizeof(int)) # <<<<<<<<<<<<<<
@@ -44326,7 +44850,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr
*/
memcpy((__pyx_v_arr + (__pyx_v_arr_len[0])), __pyx_v_appendix, (__pyx_v_appendix_len * (sizeof(int))));
- /* "rulefactory.pxi":230
+ /* "cdec/sa/rulefactory.pxi":230
* arr = <int*> realloc(arr, new_len*sizeof(int))
* memcpy(arr+arr_len[0], appendix, appendix_len*sizeof(int))
* arr_len[0] = new_len # <<<<<<<<<<<<<<
@@ -44335,7 +44859,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr
*/
(__pyx_v_arr_len[0]) = __pyx_v_new_len;
- /* "rulefactory.pxi":231
+ /* "cdec/sa/rulefactory.pxi":231
* memcpy(arr+arr_len[0], appendix, appendix_len*sizeof(int))
* arr_len[0] = new_len
* return arr # <<<<<<<<<<<<<<
@@ -44345,7 +44869,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr
__pyx_r = __pyx_v_arr;
goto __pyx_L0;
- /* "rulefactory.pxi":224
+ /* "cdec/sa/rulefactory.pxi":224
*
*
* cdef int* extend_arr(int* arr, int* arr_len, int* appendix, int appendix_len): # <<<<<<<<<<<<<<
@@ -44359,7 +44883,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr
return __pyx_r;
}
-/* "rulefactory.pxi":233
+/* "cdec/sa/rulefactory.pxi":233
* return arr
*
* cdef int median(int low, int high, int step): # <<<<<<<<<<<<<<
@@ -44376,7 +44900,7 @@ static int __pyx_f_4cdec_2sa_3_sa_median(int __pyx_v_low, int __pyx_v_high, int
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("median", 0);
- /* "rulefactory.pxi":234
+ /* "cdec/sa/rulefactory.pxi":234
*
* cdef int median(int low, int high, int step):
* return low + (((high - low)/step)/2)*step # <<<<<<<<<<<<<<
@@ -44407,7 +44931,7 @@ static int __pyx_f_4cdec_2sa_3_sa_median(int __pyx_v_low, int __pyx_v_high, int
__pyx_r = (__pyx_v_low + (__Pyx_div_long(__Pyx_div_int(__pyx_t_1, __pyx_v_step), 2) * __pyx_v_step));
goto __pyx_L0;
- /* "rulefactory.pxi":233
+ /* "cdec/sa/rulefactory.pxi":233
* return arr
*
* cdef int median(int low, int high, int step): # <<<<<<<<<<<<<<
@@ -44424,7 +44948,7 @@ static int __pyx_f_4cdec_2sa_3_sa_median(int __pyx_v_low, int __pyx_v_high, int
return __pyx_r;
}
-/* "rulefactory.pxi":237
+/* "cdec/sa/rulefactory.pxi":237
*
*
* cdef void find_comparable_matchings(int low, int high, int* arr, int step, int loc, int* loc_minus, int* loc_plus): # <<<<<<<<<<<<<<
@@ -44438,7 +44962,7 @@ static void __pyx_f_4cdec_2sa_3_sa_find_comparable_matchings(int __pyx_v_low, in
int __pyx_t_2;
__Pyx_RefNannySetupContext("find_comparable_matchings", 0);
- /* "rulefactory.pxi":241
+ /* "cdec/sa/rulefactory.pxi":241
* # in which all matchings have the same first index as the one
* # starting at loc
* loc_plus[0] = loc + step # <<<<<<<<<<<<<<
@@ -44447,7 +44971,7 @@ static void __pyx_f_4cdec_2sa_3_sa_find_comparable_matchings(int __pyx_v_low, in
*/
(__pyx_v_loc_plus[0]) = (__pyx_v_loc + __pyx_v_step);
- /* "rulefactory.pxi":242
+ /* "cdec/sa/rulefactory.pxi":242
* # starting at loc
* loc_plus[0] = loc + step
* while loc_plus[0] < high and arr[loc_plus[0]] == arr[loc]: # <<<<<<<<<<<<<<
@@ -44468,7 +44992,7 @@ static void __pyx_f_4cdec_2sa_3_sa_find_comparable_matchings(int __pyx_v_low, in
__pyx_L5_bool_binop_done:;
if (!__pyx_t_1) break;
- /* "rulefactory.pxi":243
+ /* "cdec/sa/rulefactory.pxi":243
* loc_plus[0] = loc + step
* while loc_plus[0] < high and arr[loc_plus[0]] == arr[loc]:
* loc_plus[0] = loc_plus[0] + step # <<<<<<<<<<<<<<
@@ -44478,7 +45002,7 @@ static void __pyx_f_4cdec_2sa_3_sa_find_comparable_matchings(int __pyx_v_low, in
(__pyx_v_loc_plus[0]) = ((__pyx_v_loc_plus[0]) + __pyx_v_step);
}
- /* "rulefactory.pxi":244
+ /* "cdec/sa/rulefactory.pxi":244
* while loc_plus[0] < high and arr[loc_plus[0]] == arr[loc]:
* loc_plus[0] = loc_plus[0] + step
* loc_minus[0] = loc # <<<<<<<<<<<<<<
@@ -44487,7 +45011,7 @@ static void __pyx_f_4cdec_2sa_3_sa_find_comparable_matchings(int __pyx_v_low, in
*/
(__pyx_v_loc_minus[0]) = __pyx_v_loc;
- /* "rulefactory.pxi":245
+ /* "cdec/sa/rulefactory.pxi":245
* loc_plus[0] = loc_plus[0] + step
* loc_minus[0] = loc
* while loc_minus[0]-step >= low and arr[loc_minus[0]-step] == arr[loc]: # <<<<<<<<<<<<<<
@@ -44508,7 +45032,7 @@ static void __pyx_f_4cdec_2sa_3_sa_find_comparable_matchings(int __pyx_v_low, in
__pyx_L9_bool_binop_done:;
if (!__pyx_t_1) break;
- /* "rulefactory.pxi":246
+ /* "cdec/sa/rulefactory.pxi":246
* loc_minus[0] = loc
* while loc_minus[0]-step >= low and arr[loc_minus[0]-step] == arr[loc]:
* loc_minus[0] = loc_minus[0] - step # <<<<<<<<<<<<<<
@@ -44518,7 +45042,7 @@ static void __pyx_f_4cdec_2sa_3_sa_find_comparable_matchings(int __pyx_v_low, in
(__pyx_v_loc_minus[0]) = ((__pyx_v_loc_minus[0]) - __pyx_v_step);
}
- /* "rulefactory.pxi":237
+ /* "cdec/sa/rulefactory.pxi":237
*
*
* cdef void find_comparable_matchings(int low, int high, int* arr, int step, int loc, int* loc_minus, int* loc_plus): # <<<<<<<<<<<<<<
@@ -44530,7 +45054,7 @@ static void __pyx_f_4cdec_2sa_3_sa_find_comparable_matchings(int __pyx_v_low, in
__Pyx_RefNannyFinishContext();
}
-/* "rulefactory.pxi":303
+/* "cdec/sa/rulefactory.pxi":303
* cdef bilex
*
* def __cinit__(self, # <<<<<<<<<<<<<<
@@ -44573,7 +45097,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_alignment,&__pyx_n_s_bilex,&__pyx_n_s_by_slack_factor,&__pyx_n_s_category,&__pyx_n_s_max_chunks,&__pyx_n_s_max_initial_size,&__pyx_n_s_max_length,&__pyx_n_s_max_nonterminals,&__pyx_n_s_max_target_chunks,&__pyx_n_s_max_target_length,&__pyx_n_s_min_gap_size,&__pyx_n_s_precompute_file,&__pyx_n_s_precompute_secondary_rank,&__pyx_n_s_precompute_rank,&__pyx_n_s_require_aligned_terminal,&__pyx_n_s_require_aligned_chunks,&__pyx_n_s_train_max_initial_size,&__pyx_n_s_train_min_gap_size,&__pyx_n_s_tight_phrases,&__pyx_n_s_use_baeza_yates,&__pyx_n_s_use_collocations,&__pyx_n_s_use_index,0};
PyObject* values[22] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
- /* "rulefactory.pxi":307
+ /* "cdec/sa/rulefactory.pxi":307
* Alignment alignment,
* # bilexical dictionary if online
* bilex=None, # <<<<<<<<<<<<<<
@@ -44582,7 +45106,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject
*/
values[1] = ((PyObject *)Py_None);
- /* "rulefactory.pxi":313
+ /* "cdec/sa/rulefactory.pxi":313
* char* category="[X]",
* # maximum number of contiguous chunks of terminal symbols in RHS of a rule. If None, defaults to max_nonterminals+1
* max_chunks=None, # <<<<<<<<<<<<<<
@@ -44591,7 +45115,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject
*/
values[4] = ((PyObject *)Py_None);
- /* "rulefactory.pxi":321
+ /* "cdec/sa/rulefactory.pxi":321
* unsigned max_nonterminals=2,
* # maximum number of contiguous chunks of terminal symbols in target-side RHS of a rule. If None, defaults to max_nonterminals+1
* max_target_chunks=None, # <<<<<<<<<<<<<<
@@ -44600,7 +45124,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject
*/
values[8] = ((PyObject *)Py_None);
- /* "rulefactory.pxi":323
+ /* "cdec/sa/rulefactory.pxi":323
* max_target_chunks=None,
* # maximum number of target side symbols (both T and NT) allowed in a rule. If None, defaults to max_initial_size
* max_target_length=None, # <<<<<<<<<<<<<<
@@ -44609,7 +45133,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject
*/
values[9] = ((PyObject *)Py_None);
- /* "rulefactory.pxi":327
+ /* "cdec/sa/rulefactory.pxi":327
* unsigned min_gap_size=2,
* # filename of file containing precomputed collocations
* precompute_file=None, # <<<<<<<<<<<<<<
@@ -44838,7 +45362,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject
__pyx_v_require_aligned_terminal = __Pyx_PyObject_IsTrue(values[14]); if (unlikely((__pyx_v_require_aligned_terminal == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
- /* "rulefactory.pxi":333
+ /* "cdec/sa/rulefactory.pxi":333
* unsigned precompute_rank=100,
* # require extracted rules to have at least one aligned word
* bint require_aligned_terminal=True, # <<<<<<<<<<<<<<
@@ -44851,7 +45375,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject
__pyx_v_require_aligned_chunks = __Pyx_PyObject_IsTrue(values[15]); if (unlikely((__pyx_v_require_aligned_chunks == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
- /* "rulefactory.pxi":335
+ /* "cdec/sa/rulefactory.pxi":335
* bint require_aligned_terminal=True,
* # require each contiguous chunk of extracted rules to have at least one aligned word
* bint require_aligned_chunks=False, # <<<<<<<<<<<<<<
@@ -44874,7 +45398,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject
__pyx_v_tight_phrases = __Pyx_PyObject_IsTrue(values[18]); if (unlikely((__pyx_v_tight_phrases == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
- /* "rulefactory.pxi":341
+ /* "cdec/sa/rulefactory.pxi":341
* unsigned train_min_gap_size=2,
* # False if phrases should be loose (better but slower), True otherwise
* bint tight_phrases=True, # <<<<<<<<<<<<<<
@@ -44887,7 +45411,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject
__pyx_v_use_baeza_yates = __Pyx_PyObject_IsTrue(values[19]); if (unlikely((__pyx_v_use_baeza_yates == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
- /* "rulefactory.pxi":343
+ /* "cdec/sa/rulefactory.pxi":343
* bint tight_phrases=True,
* # True to require use of double-binary alg, false otherwise
* bint use_baeza_yates=True, # <<<<<<<<<<<<<<
@@ -44900,7 +45424,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject
__pyx_v_use_collocations = __Pyx_PyObject_IsTrue(values[20]); if (unlikely((__pyx_v_use_collocations == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
- /* "rulefactory.pxi":345
+ /* "cdec/sa/rulefactory.pxi":345
* bint use_baeza_yates=True,
* # True to enable used of precomputed collocations
* bint use_collocations=True, # <<<<<<<<<<<<<<
@@ -44913,7 +45437,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject
__pyx_v_use_index = __Pyx_PyObject_IsTrue(values[21]); if (unlikely((__pyx_v_use_index == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
- /* "rulefactory.pxi":347
+ /* "cdec/sa/rulefactory.pxi":347
* bint use_collocations=True,
* # True to enable use of precomputed inverted indices
* bint use_index=True): # <<<<<<<<<<<<<<
@@ -44934,7 +45458,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_alignment), __pyx_ptype_4cdec_2sa_3_sa_Alignment, 1, "alignment", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_r = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(((struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self), __pyx_v_alignment, __pyx_v_bilex, __pyx_v_by_slack_factor, __pyx_v_category, __pyx_v_max_chunks, __pyx_v_max_initial_size, __pyx_v_max_length, __pyx_v_max_nonterminals, __pyx_v_max_target_chunks, __pyx_v_max_target_length, __pyx_v_min_gap_size, __pyx_v_precompute_file, __pyx_v_precompute_secondary_rank, __pyx_v_precompute_rank, __pyx_v_require_aligned_terminal, __pyx_v_require_aligned_chunks, __pyx_v_train_max_initial_size, __pyx_v_train_min_gap_size, __pyx_v_tight_phrases, __pyx_v_use_baeza_yates, __pyx_v_use_collocations, __pyx_v_use_index);
- /* "rulefactory.pxi":303
+ /* "cdec/sa/rulefactory.pxi":303
* cdef bilex
*
* def __cinit__(self, # <<<<<<<<<<<<<<
@@ -44966,7 +45490,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "rulefactory.pxi":353
+ /* "cdec/sa/rulefactory.pxi":353
* respectively. This is because Chiang's model does not require
* them to be the same, therefore we don't either.'''
* self.rules = TrieTable(True) # cache # <<<<<<<<<<<<<<
@@ -44981,7 +45505,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
__pyx_v_self->rules = ((struct __pyx_obj_4cdec_2sa_3_sa_TrieTable *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "rulefactory.pxi":354
+ /* "cdec/sa/rulefactory.pxi":354
* them to be the same, therefore we don't either.'''
* self.rules = TrieTable(True) # cache
* self.rules.root = ExtendedTrieNode(phrase_location=PhraseLocation()) # <<<<<<<<<<<<<<
@@ -45003,7 +45527,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
__pyx_v_self->rules->root = __pyx_t_2;
__pyx_t_2 = 0;
- /* "rulefactory.pxi":355
+ /* "cdec/sa/rulefactory.pxi":355
* self.rules = TrieTable(True) # cache
* self.rules.root = ExtendedTrieNode(phrase_location=PhraseLocation())
* if alignment is None: # <<<<<<<<<<<<<<
@@ -45014,7 +45538,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
- /* "rulefactory.pxi":356
+ /* "cdec/sa/rulefactory.pxi":356
* self.rules.root = ExtendedTrieNode(phrase_location=PhraseLocation())
* if alignment is None:
* raise Exception("Must specify an alignment object") # <<<<<<<<<<<<<<
@@ -45028,7 +45552,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
{__pyx_filename = __pyx_f[8]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- /* "rulefactory.pxi":357
+ /* "cdec/sa/rulefactory.pxi":357
* if alignment is None:
* raise Exception("Must specify an alignment object")
* self.alignment = alignment # <<<<<<<<<<<<<<
@@ -45041,7 +45565,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
__Pyx_DECREF(((PyObject *)__pyx_v_self->alignment));
__pyx_v_self->alignment = __pyx_v_alignment;
- /* "rulefactory.pxi":361
+ /* "cdec/sa/rulefactory.pxi":361
* # grammar parameters and settings
* # NOTE: setting max_nonterminals > 2 is not currently supported in Hiero
* self.max_length = max_length # <<<<<<<<<<<<<<
@@ -45050,7 +45574,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
*/
__pyx_v_self->max_length = __pyx_v_max_length;
- /* "rulefactory.pxi":362
+ /* "cdec/sa/rulefactory.pxi":362
* # NOTE: setting max_nonterminals > 2 is not currently supported in Hiero
* self.max_length = max_length
* self.max_nonterminals = max_nonterminals # <<<<<<<<<<<<<<
@@ -45059,7 +45583,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
*/
__pyx_v_self->max_nonterminals = __pyx_v_max_nonterminals;
- /* "rulefactory.pxi":363
+ /* "cdec/sa/rulefactory.pxi":363
* self.max_length = max_length
* self.max_nonterminals = max_nonterminals
* self.max_initial_size = max_initial_size # <<<<<<<<<<<<<<
@@ -45068,7 +45592,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
*/
__pyx_v_self->max_initial_size = __pyx_v_max_initial_size;
- /* "rulefactory.pxi":364
+ /* "cdec/sa/rulefactory.pxi":364
* self.max_nonterminals = max_nonterminals
* self.max_initial_size = max_initial_size
* self.train_max_initial_size = train_max_initial_size # <<<<<<<<<<<<<<
@@ -45077,7 +45601,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
*/
__pyx_v_self->train_max_initial_size = __pyx_v_train_max_initial_size;
- /* "rulefactory.pxi":365
+ /* "cdec/sa/rulefactory.pxi":365
* self.max_initial_size = max_initial_size
* self.train_max_initial_size = train_max_initial_size
* self.min_gap_size = min_gap_size # <<<<<<<<<<<<<<
@@ -45086,7 +45610,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
*/
__pyx_v_self->min_gap_size = __pyx_v_min_gap_size;
- /* "rulefactory.pxi":366
+ /* "cdec/sa/rulefactory.pxi":366
* self.train_max_initial_size = train_max_initial_size
* self.min_gap_size = min_gap_size
* self.train_min_gap_size = train_min_gap_size # <<<<<<<<<<<<<<
@@ -45095,7 +45619,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
*/
__pyx_v_self->train_min_gap_size = __pyx_v_train_min_gap_size;
- /* "rulefactory.pxi":367
+ /* "cdec/sa/rulefactory.pxi":367
* self.min_gap_size = min_gap_size
* self.train_min_gap_size = train_min_gap_size
* self.category = sym_fromstring(category, False) # <<<<<<<<<<<<<<
@@ -45104,7 +45628,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
*/
__pyx_v_self->category = __pyx_f_4cdec_2sa_3_sa_sym_fromstring(__pyx_v_category, 0);
- /* "rulefactory.pxi":369
+ /* "cdec/sa/rulefactory.pxi":369
* self.category = sym_fromstring(category, False)
*
* if max_chunks is None: # <<<<<<<<<<<<<<
@@ -45115,7 +45639,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
__pyx_t_3 = (__pyx_t_4 != 0);
if (__pyx_t_3) {
- /* "rulefactory.pxi":370
+ /* "cdec/sa/rulefactory.pxi":370
*
* if max_chunks is None:
* self.max_chunks = self.max_nonterminals + 1 # <<<<<<<<<<<<<<
@@ -45127,7 +45651,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
}
/*else*/ {
- /* "rulefactory.pxi":372
+ /* "cdec/sa/rulefactory.pxi":372
* self.max_chunks = self.max_nonterminals + 1
* else:
* self.max_chunks = max_chunks # <<<<<<<<<<<<<<
@@ -45139,7 +45663,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
}
__pyx_L4:;
- /* "rulefactory.pxi":374
+ /* "cdec/sa/rulefactory.pxi":374
* self.max_chunks = max_chunks
*
* if max_target_chunks is None: # <<<<<<<<<<<<<<
@@ -45150,7 +45674,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
- /* "rulefactory.pxi":375
+ /* "cdec/sa/rulefactory.pxi":375
*
* if max_target_chunks is None:
* self.max_target_chunks = self.max_nonterminals + 1 # <<<<<<<<<<<<<<
@@ -45162,7 +45686,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
}
/*else*/ {
- /* "rulefactory.pxi":377
+ /* "cdec/sa/rulefactory.pxi":377
* self.max_target_chunks = self.max_nonterminals + 1
* else:
* self.max_target_chunks = max_target_chunks # <<<<<<<<<<<<<<
@@ -45174,7 +45698,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
}
__pyx_L5:;
- /* "rulefactory.pxi":379
+ /* "cdec/sa/rulefactory.pxi":379
* self.max_target_chunks = max_target_chunks
*
* if max_target_length is None: # <<<<<<<<<<<<<<
@@ -45185,7 +45709,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
__pyx_t_3 = (__pyx_t_4 != 0);
if (__pyx_t_3) {
- /* "rulefactory.pxi":380
+ /* "cdec/sa/rulefactory.pxi":380
*
* if max_target_length is None:
* self.max_target_length = max_initial_size # <<<<<<<<<<<<<<
@@ -45197,7 +45721,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
}
/*else*/ {
- /* "rulefactory.pxi":382
+ /* "cdec/sa/rulefactory.pxi":382
* self.max_target_length = max_initial_size
* else:
* self.max_target_length = max_target_length # <<<<<<<<<<<<<<
@@ -45209,7 +45733,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
}
__pyx_L6:;
- /* "rulefactory.pxi":385
+ /* "cdec/sa/rulefactory.pxi":385
*
* # algorithmic parameters and settings
* self.precomputed_collocations = {} # <<<<<<<<<<<<<<
@@ -45224,7 +45748,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
__pyx_v_self->precomputed_collocations = __pyx_t_2;
__pyx_t_2 = 0;
- /* "rulefactory.pxi":386
+ /* "cdec/sa/rulefactory.pxi":386
* # algorithmic parameters and settings
* self.precomputed_collocations = {}
* self.precomputed_index = {} # <<<<<<<<<<<<<<
@@ -45239,7 +45763,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
__pyx_v_self->precomputed_index = __pyx_t_2;
__pyx_t_2 = 0;
- /* "rulefactory.pxi":387
+ /* "cdec/sa/rulefactory.pxi":387
* self.precomputed_collocations = {}
* self.precomputed_index = {}
* self.use_index = use_index # <<<<<<<<<<<<<<
@@ -45248,7 +45772,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
*/
__pyx_v_self->use_index = __pyx_v_use_index;
- /* "rulefactory.pxi":388
+ /* "cdec/sa/rulefactory.pxi":388
* self.precomputed_index = {}
* self.use_index = use_index
* self.use_collocations = use_collocations # <<<<<<<<<<<<<<
@@ -45257,7 +45781,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
*/
__pyx_v_self->use_collocations = __pyx_v_use_collocations;
- /* "rulefactory.pxi":389
+ /* "cdec/sa/rulefactory.pxi":389
* self.use_index = use_index
* self.use_collocations = use_collocations
* self.max_rank = {} # <<<<<<<<<<<<<<
@@ -45272,7 +45796,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
__pyx_v_self->max_rank = __pyx_t_2;
__pyx_t_2 = 0;
- /* "rulefactory.pxi":390
+ /* "cdec/sa/rulefactory.pxi":390
* self.use_collocations = use_collocations
* self.max_rank = {}
* self.precompute_file = precompute_file # <<<<<<<<<<<<<<
@@ -45285,7 +45809,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
__Pyx_DECREF(__pyx_v_self->precompute_file);
__pyx_v_self->precompute_file = __pyx_v_precompute_file;
- /* "rulefactory.pxi":391
+ /* "cdec/sa/rulefactory.pxi":391
* self.max_rank = {}
* self.precompute_file = precompute_file
* self.precompute_rank = precompute_rank # <<<<<<<<<<<<<<
@@ -45294,7 +45818,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
*/
__pyx_v_self->precompute_rank = __pyx_v_precompute_rank;
- /* "rulefactory.pxi":392
+ /* "cdec/sa/rulefactory.pxi":392
* self.precompute_file = precompute_file
* self.precompute_rank = precompute_rank
* self.precompute_secondary_rank = precompute_secondary_rank # <<<<<<<<<<<<<<
@@ -45303,7 +45827,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
*/
__pyx_v_self->precompute_secondary_rank = __pyx_v_precompute_secondary_rank;
- /* "rulefactory.pxi":393
+ /* "cdec/sa/rulefactory.pxi":393
* self.precompute_rank = precompute_rank
* self.precompute_secondary_rank = precompute_secondary_rank
* self.use_baeza_yates = use_baeza_yates # <<<<<<<<<<<<<<
@@ -45312,7 +45836,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
*/
__pyx_v_self->use_baeza_yates = __pyx_v_use_baeza_yates;
- /* "rulefactory.pxi":394
+ /* "cdec/sa/rulefactory.pxi":394
* self.precompute_secondary_rank = precompute_secondary_rank
* self.use_baeza_yates = use_baeza_yates
* self.by_slack_factor = by_slack_factor # <<<<<<<<<<<<<<
@@ -45321,7 +45845,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
*/
__pyx_v_self->by_slack_factor = __pyx_v_by_slack_factor;
- /* "rulefactory.pxi":395
+ /* "cdec/sa/rulefactory.pxi":395
* self.use_baeza_yates = use_baeza_yates
* self.by_slack_factor = by_slack_factor
* self.tight_phrases = tight_phrases # <<<<<<<<<<<<<<
@@ -45330,7 +45854,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
*/
__pyx_v_self->tight_phrases = __pyx_v_tight_phrases;
- /* "rulefactory.pxi":397
+ /* "cdec/sa/rulefactory.pxi":397
* self.tight_phrases = tight_phrases
*
* if require_aligned_chunks: # <<<<<<<<<<<<<<
@@ -45340,7 +45864,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
__pyx_t_3 = (__pyx_v_require_aligned_chunks != 0);
if (__pyx_t_3) {
- /* "rulefactory.pxi":399
+ /* "cdec/sa/rulefactory.pxi":399
* if require_aligned_chunks:
* # one condition is a stronger version of the other.
* self.require_aligned_chunks = self.require_aligned_terminal = True # <<<<<<<<<<<<<<
@@ -45352,7 +45876,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
goto __pyx_L7;
}
- /* "rulefactory.pxi":400
+ /* "cdec/sa/rulefactory.pxi":400
* # one condition is a stronger version of the other.
* self.require_aligned_chunks = self.require_aligned_terminal = True
* elif require_aligned_terminal: # <<<<<<<<<<<<<<
@@ -45362,7 +45886,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
__pyx_t_3 = (__pyx_v_require_aligned_terminal != 0);
if (__pyx_t_3) {
- /* "rulefactory.pxi":401
+ /* "cdec/sa/rulefactory.pxi":401
* self.require_aligned_chunks = self.require_aligned_terminal = True
* elif require_aligned_terminal:
* self.require_aligned_chunks = False # <<<<<<<<<<<<<<
@@ -45371,7 +45895,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
*/
__pyx_v_self->require_aligned_chunks = 0;
- /* "rulefactory.pxi":402
+ /* "cdec/sa/rulefactory.pxi":402
* elif require_aligned_terminal:
* self.require_aligned_chunks = False
* self.require_aligned_terminal = True # <<<<<<<<<<<<<<
@@ -45383,7 +45907,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
}
/*else*/ {
- /* "rulefactory.pxi":404
+ /* "cdec/sa/rulefactory.pxi":404
* self.require_aligned_terminal = True
* else:
* self.require_aligned_chunks = self.require_aligned_terminal = False # <<<<<<<<<<<<<<
@@ -45395,7 +45919,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
}
__pyx_L7:;
- /* "rulefactory.pxi":407
+ /* "cdec/sa/rulefactory.pxi":407
*
* # diagnostics
* self.prev_norm_prefix = () # <<<<<<<<<<<<<<
@@ -45408,7 +45932,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
__Pyx_DECREF(__pyx_v_self->prev_norm_prefix);
__pyx_v_self->prev_norm_prefix = __pyx_empty_tuple;
- /* "rulefactory.pxi":409
+ /* "cdec/sa/rulefactory.pxi":409
* self.prev_norm_prefix = ()
*
* self.findexes = IntList(initial_len=10) # <<<<<<<<<<<<<<
@@ -45427,7 +45951,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
__pyx_v_self->findexes = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "rulefactory.pxi":410
+ /* "cdec/sa/rulefactory.pxi":410
*
* self.findexes = IntList(initial_len=10)
* self.findexes1 = IntList(initial_len=10) # <<<<<<<<<<<<<<
@@ -45446,7 +45970,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
__pyx_v_self->findexes1 = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "rulefactory.pxi":416
+ /* "cdec/sa/rulefactory.pxi":416
* # None if not online
* # Base bilex, also need one per instance
* self.bilex = bilex # <<<<<<<<<<<<<<
@@ -45459,7 +45983,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
__Pyx_DECREF(__pyx_v_self->bilex);
__pyx_v_self->bilex = __pyx_v_bilex;
- /* "rulefactory.pxi":419
+ /* "cdec/sa/rulefactory.pxi":419
*
* # True after data is added
* self.online = False # <<<<<<<<<<<<<<
@@ -45468,7 +45992,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
*/
__pyx_v_self->online = 0;
- /* "rulefactory.pxi":420
+ /* "cdec/sa/rulefactory.pxi":420
* # True after data is added
* self.online = False
* self.online_stats = defaultdict(OnlineStats) # <<<<<<<<<<<<<<
@@ -45508,7 +46032,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
__pyx_v_self->online_stats = __pyx_t_2;
__pyx_t_2 = 0;
- /* "rulefactory.pxi":303
+ /* "cdec/sa/rulefactory.pxi":303
* cdef bilex
*
* def __cinit__(self, # <<<<<<<<<<<<<<
@@ -45531,7 +46055,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
return __pyx_r;
}
-/* "rulefactory.pxi":422
+/* "cdec/sa/rulefactory.pxi":422
* self.online_stats = defaultdict(OnlineStats)
*
* def configure(self, SuffixArray fsarray, DataArray edarray, # <<<<<<<<<<<<<<
@@ -45638,7 +46162,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_2configure(st
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("configure", 0);
- /* "rulefactory.pxi":427
+ /* "cdec/sa/rulefactory.pxi":427
* Here we also use it to precompute the most expensive intersections
* in the corpus quickly.'''
* self.fsa = fsarray # <<<<<<<<<<<<<<
@@ -45651,7 +46175,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_2configure(st
__Pyx_DECREF(((PyObject *)__pyx_v_self->fsa));
__pyx_v_self->fsa = __pyx_v_fsarray;
- /* "rulefactory.pxi":428
+ /* "cdec/sa/rulefactory.pxi":428
* in the corpus quickly.'''
* self.fsa = fsarray
* self.fda = fsarray.darray # <<<<<<<<<<<<<<
@@ -45666,7 +46190,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_2configure(st
__pyx_v_self->fda = ((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "rulefactory.pxi":429
+ /* "cdec/sa/rulefactory.pxi":429
* self.fsa = fsarray
* self.fda = fsarray.darray
* self.eda = edarray # <<<<<<<<<<<<<<
@@ -45679,7 +46203,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_2configure(st
__Pyx_DECREF(((PyObject *)__pyx_v_self->eda));
__pyx_v_self->eda = __pyx_v_edarray;
- /* "rulefactory.pxi":430
+ /* "cdec/sa/rulefactory.pxi":430
* self.fda = fsarray.darray
* self.eda = edarray
* self.fid2symid = self.set_idmap(self.fda) # <<<<<<<<<<<<<<
@@ -45698,7 +46222,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_2configure(st
__pyx_v_self->fid2symid = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "rulefactory.pxi":431
+ /* "cdec/sa/rulefactory.pxi":431
* self.eda = edarray
* self.fid2symid = self.set_idmap(self.fda)
* self.eid2symid = self.set_idmap(self.eda) # <<<<<<<<<<<<<<
@@ -45717,7 +46241,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_2configure(st
__pyx_v_self->eid2symid = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "rulefactory.pxi":432
+ /* "cdec/sa/rulefactory.pxi":432
* self.fid2symid = self.set_idmap(self.fda)
* self.eid2symid = self.set_idmap(self.eda)
* self.precompute() # <<<<<<<<<<<<<<
@@ -45746,7 +46270,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_2configure(st
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "rulefactory.pxi":433
+ /* "cdec/sa/rulefactory.pxi":433
* self.eid2symid = self.set_idmap(self.eda)
* self.precompute()
* self.sampler = sampler # <<<<<<<<<<<<<<
@@ -45759,7 +46283,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_2configure(st
__Pyx_DECREF(((PyObject *)__pyx_v_self->sampler));
__pyx_v_self->sampler = __pyx_v_sampler;
- /* "rulefactory.pxi":434
+ /* "cdec/sa/rulefactory.pxi":434
* self.precompute()
* self.sampler = sampler
* self.scorer = scorer # <<<<<<<<<<<<<<
@@ -45772,7 +46296,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_2configure(st
__Pyx_DECREF(((PyObject *)__pyx_v_self->scorer));
__pyx_v_self->scorer = __pyx_v_scorer;
- /* "rulefactory.pxi":422
+ /* "cdec/sa/rulefactory.pxi":422
* self.online_stats = defaultdict(OnlineStats)
*
* def configure(self, SuffixArray fsarray, DataArray edarray, # <<<<<<<<<<<<<<
@@ -45795,7 +46319,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_2configure(st
return __pyx_r;
}
-/* "rulefactory.pxi":436
+/* "cdec/sa/rulefactory.pxi":436
* self.scorer = scorer
*
* cdef set_idmap(self, DataArray darray): # <<<<<<<<<<<<<<
@@ -45820,7 +46344,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_set_idmap(CYTH
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("set_idmap", 0);
- /* "rulefactory.pxi":440
+ /* "cdec/sa/rulefactory.pxi":440
* cdef IntList idmap
*
* N = len(darray.id2word) # <<<<<<<<<<<<<<
@@ -45833,7 +46357,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_set_idmap(CYTH
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_N = __pyx_t_2;
- /* "rulefactory.pxi":441
+ /* "cdec/sa/rulefactory.pxi":441
*
* N = len(darray.id2word)
* idmap = IntList(initial_len=N) # <<<<<<<<<<<<<<
@@ -45852,7 +46376,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_set_idmap(CYTH
__pyx_v_idmap = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_3);
__pyx_t_3 = 0;
- /* "rulefactory.pxi":442
+ /* "cdec/sa/rulefactory.pxi":442
* N = len(darray.id2word)
* idmap = IntList(initial_len=N)
* for word_id from 0 <= word_id < N: # <<<<<<<<<<<<<<
@@ -45862,7 +46386,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_set_idmap(CYTH
__pyx_t_4 = __pyx_v_N;
for (__pyx_v_word_id = 0; __pyx_v_word_id < __pyx_t_4; __pyx_v_word_id++) {
- /* "rulefactory.pxi":443
+ /* "cdec/sa/rulefactory.pxi":443
* idmap = IntList(initial_len=N)
* for word_id from 0 <= word_id < N:
* new_word_id = sym_fromstring(darray.id2word[word_id], True) # <<<<<<<<<<<<<<
@@ -45875,7 +46399,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_set_idmap(CYTH
__pyx_v_new_word_id = __pyx_f_4cdec_2sa_3_sa_sym_fromstring(__pyx_t_5, 1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "rulefactory.pxi":444
+ /* "cdec/sa/rulefactory.pxi":444
* for word_id from 0 <= word_id < N:
* new_word_id = sym_fromstring(darray.id2word[word_id], True)
* idmap.arr[word_id] = new_word_id # <<<<<<<<<<<<<<
@@ -45885,7 +46409,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_set_idmap(CYTH
(__pyx_v_idmap->arr[__pyx_v_word_id]) = __pyx_v_new_word_id;
}
- /* "rulefactory.pxi":445
+ /* "cdec/sa/rulefactory.pxi":445
* new_word_id = sym_fromstring(darray.id2word[word_id], True)
* idmap.arr[word_id] = new_word_id
* return idmap # <<<<<<<<<<<<<<
@@ -45897,7 +46421,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_set_idmap(CYTH
__pyx_r = ((PyObject *)__pyx_v_idmap);
goto __pyx_L0;
- /* "rulefactory.pxi":436
+ /* "cdec/sa/rulefactory.pxi":436
* self.scorer = scorer
*
* cdef set_idmap(self, DataArray darray): # <<<<<<<<<<<<<<
@@ -45918,7 +46442,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_set_idmap(CYTH
return __pyx_r;
}
-/* "rulefactory.pxi":448
+/* "cdec/sa/rulefactory.pxi":448
*
*
* def pattern2phrase(self, pattern): # <<<<<<<<<<<<<<
@@ -45959,7 +46483,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_4pattern2phra
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("pattern2phrase", 0);
- /* "rulefactory.pxi":450
+ /* "cdec/sa/rulefactory.pxi":450
* def pattern2phrase(self, pattern):
* # pattern is a tuple, which we must convert to a hiero Phrase
* result = () # <<<<<<<<<<<<<<
@@ -45969,7 +46493,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_4pattern2phra
__Pyx_INCREF(__pyx_empty_tuple);
__pyx_v_result = __pyx_empty_tuple;
- /* "rulefactory.pxi":451
+ /* "cdec/sa/rulefactory.pxi":451
* # pattern is a tuple, which we must convert to a hiero Phrase
* result = ()
* arity = 0 # <<<<<<<<<<<<<<
@@ -45979,7 +46503,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_4pattern2phra
__Pyx_INCREF(__pyx_int_0);
__pyx_v_arity = __pyx_int_0;
- /* "rulefactory.pxi":452
+ /* "cdec/sa/rulefactory.pxi":452
* result = ()
* arity = 0
* for word_id in pattern: # <<<<<<<<<<<<<<
@@ -46026,7 +46550,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_4pattern2phra
__Pyx_XDECREF_SET(__pyx_v_word_id, __pyx_t_4);
__pyx_t_4 = 0;
- /* "rulefactory.pxi":453
+ /* "cdec/sa/rulefactory.pxi":453
* arity = 0
* for word_id in pattern:
* if word_id == -1: # <<<<<<<<<<<<<<
@@ -46038,7 +46562,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_4pattern2phra
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_5) {
- /* "rulefactory.pxi":454
+ /* "cdec/sa/rulefactory.pxi":454
* for word_id in pattern:
* if word_id == -1:
* arity = arity + 1 # <<<<<<<<<<<<<<
@@ -46050,7 +46574,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_4pattern2phra
__Pyx_DECREF_SET(__pyx_v_arity, __pyx_t_4);
__pyx_t_4 = 0;
- /* "rulefactory.pxi":455
+ /* "cdec/sa/rulefactory.pxi":455
* if word_id == -1:
* arity = arity + 1
* new_id = sym_setindex(self.category, arity) # <<<<<<<<<<<<<<
@@ -46063,7 +46587,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_4pattern2phra
}
/*else*/ {
- /* "rulefactory.pxi":457
+ /* "cdec/sa/rulefactory.pxi":457
* new_id = sym_setindex(self.category, arity)
* else:
* new_id = sym_fromstring(self.fda.id2word[word_id], True) # <<<<<<<<<<<<<<
@@ -46078,7 +46602,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_4pattern2phra
}
__pyx_L5:;
- /* "rulefactory.pxi":458
+ /* "cdec/sa/rulefactory.pxi":458
* else:
* new_id = sym_fromstring(self.fda.id2word[word_id], True)
* result = result + (new_id,) # <<<<<<<<<<<<<<
@@ -46098,7 +46622,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_4pattern2phra
__Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_4));
__pyx_t_4 = 0;
- /* "rulefactory.pxi":452
+ /* "cdec/sa/rulefactory.pxi":452
* result = ()
* arity = 0
* for word_id in pattern: # <<<<<<<<<<<<<<
@@ -46108,7 +46632,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_4pattern2phra
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "rulefactory.pxi":459
+ /* "cdec/sa/rulefactory.pxi":459
* new_id = sym_fromstring(self.fda.id2word[word_id], True)
* result = result + (new_id,)
* return Phrase(result) # <<<<<<<<<<<<<<
@@ -46128,7 +46652,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_4pattern2phra
__pyx_t_4 = 0;
goto __pyx_L0;
- /* "rulefactory.pxi":448
+ /* "cdec/sa/rulefactory.pxi":448
*
*
* def pattern2phrase(self, pattern): # <<<<<<<<<<<<<<
@@ -46152,7 +46676,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_4pattern2phra
return __pyx_r;
}
-/* "rulefactory.pxi":461
+/* "cdec/sa/rulefactory.pxi":461
* return Phrase(result)
*
* def pattern2phrase_plus(self, pattern): # <<<<<<<<<<<<<<
@@ -46195,7 +46719,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_6pattern2phra
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("pattern2phrase_plus", 0);
- /* "rulefactory.pxi":464
+ /* "cdec/sa/rulefactory.pxi":464
* # returns a list containing both the pattern, and pattern
* # suffixed/prefixed with the NT category.
* patterns = [] # <<<<<<<<<<<<<<
@@ -46207,7 +46731,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_6pattern2phra
__pyx_v_patterns = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "rulefactory.pxi":465
+ /* "cdec/sa/rulefactory.pxi":465
* # suffixed/prefixed with the NT category.
* patterns = []
* result = () # <<<<<<<<<<<<<<
@@ -46217,7 +46741,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_6pattern2phra
__Pyx_INCREF(__pyx_empty_tuple);
__pyx_v_result = __pyx_empty_tuple;
- /* "rulefactory.pxi":466
+ /* "cdec/sa/rulefactory.pxi":466
* patterns = []
* result = ()
* arity = 0 # <<<<<<<<<<<<<<
@@ -46227,7 +46751,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_6pattern2phra
__Pyx_INCREF(__pyx_int_0);
__pyx_v_arity = __pyx_int_0;
- /* "rulefactory.pxi":467
+ /* "cdec/sa/rulefactory.pxi":467
* result = ()
* arity = 0
* for word_id in pattern: # <<<<<<<<<<<<<<
@@ -46274,7 +46798,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_6pattern2phra
__Pyx_XDECREF_SET(__pyx_v_word_id, __pyx_t_4);
__pyx_t_4 = 0;
- /* "rulefactory.pxi":468
+ /* "cdec/sa/rulefactory.pxi":468
* arity = 0
* for word_id in pattern:
* if word_id == -1: # <<<<<<<<<<<<<<
@@ -46286,7 +46810,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_6pattern2phra
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_5) {
- /* "rulefactory.pxi":469
+ /* "cdec/sa/rulefactory.pxi":469
* for word_id in pattern:
* if word_id == -1:
* arity = arity + 1 # <<<<<<<<<<<<<<
@@ -46298,7 +46822,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_6pattern2phra
__Pyx_DECREF_SET(__pyx_v_arity, __pyx_t_4);
__pyx_t_4 = 0;
- /* "rulefactory.pxi":470
+ /* "cdec/sa/rulefactory.pxi":470
* if word_id == -1:
* arity = arity + 1
* new_id = sym_setindex(self.category, arity) # <<<<<<<<<<<<<<
@@ -46311,7 +46835,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_6pattern2phra
}
/*else*/ {
- /* "rulefactory.pxi":472
+ /* "cdec/sa/rulefactory.pxi":472
* new_id = sym_setindex(self.category, arity)
* else:
* new_id = sym_fromstring(self.fda.id2word[word_id], True) # <<<<<<<<<<<<<<
@@ -46326,7 +46850,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_6pattern2phra
}
__pyx_L5:;
- /* "rulefactory.pxi":473
+ /* "cdec/sa/rulefactory.pxi":473
* else:
* new_id = sym_fromstring(self.fda.id2word[word_id], True)
* result = result + (new_id,) # <<<<<<<<<<<<<<
@@ -46346,7 +46870,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_6pattern2phra
__Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_4));
__pyx_t_4 = 0;
- /* "rulefactory.pxi":467
+ /* "cdec/sa/rulefactory.pxi":467
* result = ()
* arity = 0
* for word_id in pattern: # <<<<<<<<<<<<<<
@@ -46356,7 +46880,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_6pattern2phra
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "rulefactory.pxi":474
+ /* "cdec/sa/rulefactory.pxi":474
* new_id = sym_fromstring(self.fda.id2word[word_id], True)
* result = result + (new_id,)
* patterns.append(Phrase(result)) # <<<<<<<<<<<<<<
@@ -46374,7 +46898,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_6pattern2phra
__pyx_t_9 = __Pyx_PyList_Append(__pyx_v_patterns, __pyx_t_4); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "rulefactory.pxi":475
+ /* "cdec/sa/rulefactory.pxi":475
* result = result + (new_id,)
* patterns.append(Phrase(result))
* patterns.append(Phrase(result + (sym_setindex(self.category, 1),))) # <<<<<<<<<<<<<<
@@ -46402,7 +46926,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_6pattern2phra
__pyx_t_9 = __Pyx_PyList_Append(__pyx_v_patterns, __pyx_t_4); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "rulefactory.pxi":476
+ /* "cdec/sa/rulefactory.pxi":476
* patterns.append(Phrase(result))
* patterns.append(Phrase(result + (sym_setindex(self.category, 1),)))
* patterns.append(Phrase((sym_setindex(self.category, 1),) + result)) # <<<<<<<<<<<<<<
@@ -46430,7 +46954,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_6pattern2phra
__pyx_t_9 = __Pyx_PyList_Append(__pyx_v_patterns, __pyx_t_4); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "rulefactory.pxi":477
+ /* "cdec/sa/rulefactory.pxi":477
* patterns.append(Phrase(result + (sym_setindex(self.category, 1),)))
* patterns.append(Phrase((sym_setindex(self.category, 1),) + result))
* return patterns # <<<<<<<<<<<<<<
@@ -46442,7 +46966,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_6pattern2phra
__pyx_r = __pyx_v_patterns;
goto __pyx_L0;
- /* "rulefactory.pxi":461
+ /* "cdec/sa/rulefactory.pxi":461
* return Phrase(result)
*
* def pattern2phrase_plus(self, pattern): # <<<<<<<<<<<<<<
@@ -46467,7 +46991,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_6pattern2phra
return __pyx_r;
}
-/* "rulefactory.pxi":479
+/* "cdec/sa/rulefactory.pxi":479
* return patterns
*
* def precompute(self): # <<<<<<<<<<<<<<
@@ -46517,7 +47041,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("precompute", 0);
- /* "rulefactory.pxi":482
+ /* "cdec/sa/rulefactory.pxi":482
* cdef Precomputation pre
*
* if self.precompute_file is not None: # <<<<<<<<<<<<<<
@@ -46528,7 +47052,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "rulefactory.pxi":483
+ /* "cdec/sa/rulefactory.pxi":483
*
* if self.precompute_file is not None:
* start_time = monitor_cpu() # <<<<<<<<<<<<<<
@@ -46558,7 +47082,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
__pyx_v_start_time = __pyx_t_3;
__pyx_t_3 = 0;
- /* "rulefactory.pxi":484
+ /* "cdec/sa/rulefactory.pxi":484
* if self.precompute_file is not None:
* start_time = monitor_cpu()
* logger.info("Reading precomputed data from file %s... ", self.precompute_file) # <<<<<<<<<<<<<<
@@ -46599,7 +47123,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "rulefactory.pxi":485
+ /* "cdec/sa/rulefactory.pxi":485
* start_time = monitor_cpu()
* logger.info("Reading precomputed data from file %s... ", self.precompute_file)
* pre = Precomputation(from_binary=self.precompute_file) # <<<<<<<<<<<<<<
@@ -46615,7 +47139,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
__pyx_v_pre = ((struct __pyx_obj_4cdec_2sa_3_sa_Precomputation *)__pyx_t_5);
__pyx_t_5 = 0;
- /* "rulefactory.pxi":487
+ /* "cdec/sa/rulefactory.pxi":487
* pre = Precomputation(from_binary=self.precompute_file)
* # check parameters of precomputation -- some are critical and some are not
* if pre.max_nonterminals != self.max_nonterminals: # <<<<<<<<<<<<<<
@@ -46625,7 +47149,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
__pyx_t_2 = ((__pyx_v_pre->max_nonterminals != __pyx_v_self->max_nonterminals) != 0);
if (__pyx_t_2) {
- /* "rulefactory.pxi":488
+ /* "cdec/sa/rulefactory.pxi":488
* # check parameters of precomputation -- some are critical and some are not
* if pre.max_nonterminals != self.max_nonterminals:
* logger.warn("Precomputation done with max nonterminals %d, decoder uses %d", pre.max_nonterminals, self.max_nonterminals) # <<<<<<<<<<<<<<
@@ -46676,7 +47200,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
}
__pyx_L4:;
- /* "rulefactory.pxi":489
+ /* "cdec/sa/rulefactory.pxi":489
* if pre.max_nonterminals != self.max_nonterminals:
* logger.warn("Precomputation done with max nonterminals %d, decoder uses %d", pre.max_nonterminals, self.max_nonterminals)
* if pre.max_length != self.max_length: # <<<<<<<<<<<<<<
@@ -46686,7 +47210,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
__pyx_t_2 = ((__pyx_v_pre->max_length != __pyx_v_self->max_length) != 0);
if (__pyx_t_2) {
- /* "rulefactory.pxi":490
+ /* "cdec/sa/rulefactory.pxi":490
* logger.warn("Precomputation done with max nonterminals %d, decoder uses %d", pre.max_nonterminals, self.max_nonterminals)
* if pre.max_length != self.max_length:
* logger.warn("Precomputation done with max terminals %d, decoder uses %d", pre.max_length, self.max_length) # <<<<<<<<<<<<<<
@@ -46737,7 +47261,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
}
__pyx_L5:;
- /* "rulefactory.pxi":491
+ /* "cdec/sa/rulefactory.pxi":491
* if pre.max_length != self.max_length:
* logger.warn("Precomputation done with max terminals %d, decoder uses %d", pre.max_length, self.max_length)
* if pre.train_max_initial_size != self.train_max_initial_size: # <<<<<<<<<<<<<<
@@ -46747,7 +47271,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
__pyx_t_2 = ((__pyx_v_pre->train_max_initial_size != __pyx_v_self->train_max_initial_size) != 0);
if (__pyx_t_2) {
- /* "rulefactory.pxi":492
+ /* "cdec/sa/rulefactory.pxi":492
* logger.warn("Precomputation done with max terminals %d, decoder uses %d", pre.max_length, self.max_length)
* if pre.train_max_initial_size != self.train_max_initial_size:
* raise Exception("Precomputation done with max initial size %d, decoder uses %d" % (pre.train_max_initial_size, self.train_max_initial_size)) # <<<<<<<<<<<<<<
@@ -46782,7 +47306,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
{__pyx_filename = __pyx_f[8]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- /* "rulefactory.pxi":493
+ /* "cdec/sa/rulefactory.pxi":493
* if pre.train_max_initial_size != self.train_max_initial_size:
* raise Exception("Precomputation done with max initial size %d, decoder uses %d" % (pre.train_max_initial_size, self.train_max_initial_size))
* if pre.train_min_gap_size != self.train_min_gap_size: # <<<<<<<<<<<<<<
@@ -46792,7 +47316,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
__pyx_t_2 = ((__pyx_v_pre->train_min_gap_size != __pyx_v_self->train_min_gap_size) != 0);
if (__pyx_t_2) {
- /* "rulefactory.pxi":494
+ /* "cdec/sa/rulefactory.pxi":494
* raise Exception("Precomputation done with max initial size %d, decoder uses %d" % (pre.train_max_initial_size, self.train_max_initial_size))
* if pre.train_min_gap_size != self.train_min_gap_size:
* raise Exception("Precomputation done with min gap size %d, decoder uses %d" % (pre.train_min_gap_size, self.train_min_gap_size)) # <<<<<<<<<<<<<<
@@ -46827,7 +47351,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
{__pyx_filename = __pyx_f[8]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- /* "rulefactory.pxi":495
+ /* "cdec/sa/rulefactory.pxi":495
* if pre.train_min_gap_size != self.train_min_gap_size:
* raise Exception("Precomputation done with min gap size %d, decoder uses %d" % (pre.train_min_gap_size, self.train_min_gap_size))
* if self.use_index: # <<<<<<<<<<<<<<
@@ -46837,7 +47361,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
__pyx_t_2 = (__pyx_v_self->use_index != 0);
if (__pyx_t_2) {
- /* "rulefactory.pxi":496
+ /* "cdec/sa/rulefactory.pxi":496
* raise Exception("Precomputation done with min gap size %d, decoder uses %d" % (pre.train_min_gap_size, self.train_min_gap_size))
* if self.use_index:
* logger.info("Converting %d hash keys on precomputed inverted index... ", len(pre.precomputed_index)) # <<<<<<<<<<<<<<
@@ -46884,7 +47408,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- /* "rulefactory.pxi":497
+ /* "cdec/sa/rulefactory.pxi":497
* if self.use_index:
* logger.info("Converting %d hash keys on precomputed inverted index... ", len(pre.precomputed_index))
* for pattern, arr in pre.precomputed_index.iteritems(): # <<<<<<<<<<<<<<
@@ -46912,7 +47436,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
__Pyx_XDECREF_SET(__pyx_v_arr, __pyx_t_7);
__pyx_t_7 = 0;
- /* "rulefactory.pxi":498
+ /* "cdec/sa/rulefactory.pxi":498
* logger.info("Converting %d hash keys on precomputed inverted index... ", len(pre.precomputed_index))
* for pattern, arr in pre.precomputed_index.iteritems():
* phrases = self.pattern2phrase_plus(pattern) # <<<<<<<<<<<<<<
@@ -46949,7 +47473,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
__Pyx_XDECREF_SET(__pyx_v_phrases, __pyx_t_7);
__pyx_t_7 = 0;
- /* "rulefactory.pxi":499
+ /* "cdec/sa/rulefactory.pxi":499
* for pattern, arr in pre.precomputed_index.iteritems():
* phrases = self.pattern2phrase_plus(pattern)
* for phrase in phrases: # <<<<<<<<<<<<<<
@@ -46996,7 +47520,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
__Pyx_XDECREF_SET(__pyx_v_phrase, __pyx_t_9);
__pyx_t_9 = 0;
- /* "rulefactory.pxi":500
+ /* "cdec/sa/rulefactory.pxi":500
* phrases = self.pattern2phrase_plus(pattern)
* for phrase in phrases:
* self.precomputed_index[phrase] = arr # <<<<<<<<<<<<<<
@@ -47005,7 +47529,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
*/
if (unlikely(PyObject_SetItem(__pyx_v_self->precomputed_index, __pyx_v_phrase, __pyx_v_arr) < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "rulefactory.pxi":499
+ /* "cdec/sa/rulefactory.pxi":499
* for pattern, arr in pre.precomputed_index.iteritems():
* phrases = self.pattern2phrase_plus(pattern)
* for phrase in phrases: # <<<<<<<<<<<<<<
@@ -47020,7 +47544,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
}
__pyx_L8:;
- /* "rulefactory.pxi":501
+ /* "cdec/sa/rulefactory.pxi":501
* for phrase in phrases:
* self.precomputed_index[phrase] = arr
* if self.use_collocations: # <<<<<<<<<<<<<<
@@ -47030,7 +47554,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
__pyx_t_2 = (__pyx_v_self->use_collocations != 0);
if (__pyx_t_2) {
- /* "rulefactory.pxi":502
+ /* "cdec/sa/rulefactory.pxi":502
* self.precomputed_index[phrase] = arr
* if self.use_collocations:
* logger.info("Converting %d hash keys on precomputed collocations... ", len(pre.precomputed_collocations)) # <<<<<<<<<<<<<<
@@ -47077,7 +47601,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- /* "rulefactory.pxi":503
+ /* "cdec/sa/rulefactory.pxi":503
* if self.use_collocations:
* logger.info("Converting %d hash keys on precomputed collocations... ", len(pre.precomputed_collocations))
* for pattern, arr in pre.precomputed_collocations.iteritems(): # <<<<<<<<<<<<<<
@@ -47105,7 +47629,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
__Pyx_XDECREF_SET(__pyx_v_arr, __pyx_t_5);
__pyx_t_5 = 0;
- /* "rulefactory.pxi":504
+ /* "cdec/sa/rulefactory.pxi":504
* logger.info("Converting %d hash keys on precomputed collocations... ", len(pre.precomputed_collocations))
* for pattern, arr in pre.precomputed_collocations.iteritems():
* phrase = self.pattern2phrase(pattern) # <<<<<<<<<<<<<<
@@ -47142,7 +47666,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
__Pyx_XDECREF_SET(__pyx_v_phrase, __pyx_t_5);
__pyx_t_5 = 0;
- /* "rulefactory.pxi":505
+ /* "cdec/sa/rulefactory.pxi":505
* for pattern, arr in pre.precomputed_collocations.iteritems():
* phrase = self.pattern2phrase(pattern)
* self.precomputed_collocations[phrase] = arr # <<<<<<<<<<<<<<
@@ -47156,7 +47680,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
}
__pyx_L13:;
- /* "rulefactory.pxi":506
+ /* "cdec/sa/rulefactory.pxi":506
* phrase = self.pattern2phrase(pattern)
* self.precomputed_collocations[phrase] = arr
* stop_time = monitor_cpu() # <<<<<<<<<<<<<<
@@ -47186,7 +47710,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
__pyx_v_stop_time = __pyx_t_8;
__pyx_t_8 = 0;
- /* "rulefactory.pxi":507
+ /* "cdec/sa/rulefactory.pxi":507
* self.precomputed_collocations[phrase] = arr
* stop_time = monitor_cpu()
* logger.info("Processing precomputations took %f seconds", stop_time - start_time) # <<<<<<<<<<<<<<
@@ -47232,7 +47756,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
}
__pyx_L3:;
- /* "rulefactory.pxi":479
+ /* "cdec/sa/rulefactory.pxi":479
* return patterns
*
* def precompute(self): # <<<<<<<<<<<<<<
@@ -47265,7 +47789,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
return __pyx_r;
}
-/* "rulefactory.pxi":510
+/* "cdec/sa/rulefactory.pxi":510
*
*
* def get_precomputed_collocation(self, phrase): # <<<<<<<<<<<<<<
@@ -47302,7 +47826,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_10get_precomp
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("get_precomputed_collocation", 0);
- /* "rulefactory.pxi":511
+ /* "cdec/sa/rulefactory.pxi":511
*
* def get_precomputed_collocation(self, phrase):
* if phrase in self.precomputed_collocations: # <<<<<<<<<<<<<<
@@ -47313,7 +47837,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_10get_precomp
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "rulefactory.pxi":512
+ /* "cdec/sa/rulefactory.pxi":512
* def get_precomputed_collocation(self, phrase):
* if phrase in self.precomputed_collocations:
* arr = self.precomputed_collocations[phrase] # <<<<<<<<<<<<<<
@@ -47325,7 +47849,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_10get_precomp
__pyx_v_arr = __pyx_t_3;
__pyx_t_3 = 0;
- /* "rulefactory.pxi":513
+ /* "cdec/sa/rulefactory.pxi":513
* if phrase in self.precomputed_collocations:
* arr = self.precomputed_collocations[phrase]
* return PhraseLocation(arr=arr, arr_low=0, arr_high=len(arr), num_subpatterns=phrase.arity()+1) # <<<<<<<<<<<<<<
@@ -47375,7 +47899,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_10get_precomp
goto __pyx_L0;
}
- /* "rulefactory.pxi":514
+ /* "cdec/sa/rulefactory.pxi":514
* arr = self.precomputed_collocations[phrase]
* return PhraseLocation(arr=arr, arr_low=0, arr_high=len(arr), num_subpatterns=phrase.arity()+1)
* return None # <<<<<<<<<<<<<<
@@ -47387,7 +47911,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_10get_precomp
__pyx_r = Py_None;
goto __pyx_L0;
- /* "rulefactory.pxi":510
+ /* "cdec/sa/rulefactory.pxi":510
*
*
* def get_precomputed_collocation(self, phrase): # <<<<<<<<<<<<<<
@@ -47410,7 +47934,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_10get_precomp
return __pyx_r;
}
-/* "rulefactory.pxi":517
+/* "cdec/sa/rulefactory.pxi":517
*
*
* cdef int* baeza_yates_helper(self, int low1, int high1, int* arr1, int step1, # <<<<<<<<<<<<<<
@@ -47455,7 +47979,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("baeza_yates_helper", 0);
- /* "rulefactory.pxi":530
+ /* "cdec/sa/rulefactory.pxi":530
* cdef Matching loc1, loc2
*
* result = <int*> malloc(0*sizeof(int*)) # <<<<<<<<<<<<<<
@@ -47464,7 +47988,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_result = ((int *)malloc((0 * (sizeof(int *)))));
- /* "rulefactory.pxi":532
+ /* "cdec/sa/rulefactory.pxi":532
* result = <int*> malloc(0*sizeof(int*))
*
* d_first = 0 # <<<<<<<<<<<<<<
@@ -47473,7 +47997,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_d_first = 0;
- /* "rulefactory.pxi":533
+ /* "cdec/sa/rulefactory.pxi":533
*
* d_first = 0
* if high1 - low1 > high2 - low2: # <<<<<<<<<<<<<<
@@ -47483,7 +48007,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
__pyx_t_1 = (((__pyx_v_high1 - __pyx_v_low1) > (__pyx_v_high2 - __pyx_v_low2)) != 0);
if (__pyx_t_1) {
- /* "rulefactory.pxi":534
+ /* "cdec/sa/rulefactory.pxi":534
* d_first = 0
* if high1 - low1 > high2 - low2:
* d_first = 1 # <<<<<<<<<<<<<<
@@ -47495,7 +48019,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
}
__pyx_L3:;
- /* "rulefactory.pxi":538
+ /* "cdec/sa/rulefactory.pxi":538
* # First, check to see if we are at any of the recursive base cases
* # Case 1: one of the sets is empty
* if low1 >= high1 or low2 >= high2: # <<<<<<<<<<<<<<
@@ -47515,7 +48039,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
__pyx_L5_bool_binop_done:;
if (__pyx_t_1) {
- /* "rulefactory.pxi":539
+ /* "cdec/sa/rulefactory.pxi":539
* # Case 1: one of the sets is empty
* if low1 >= high1 or low2 >= high2:
* return result # <<<<<<<<<<<<<<
@@ -47526,7 +48050,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
goto __pyx_L0;
}
- /* "rulefactory.pxi":542
+ /* "cdec/sa/rulefactory.pxi":542
*
* # Case 2: sets are non-overlapping
* assign_matching(&loc1, arr1, high1-step1, step1, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -47535,7 +48059,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_f_4cdec_2sa_3_sa_assign_matching((&__pyx_v_loc1), __pyx_v_arr1, (__pyx_v_high1 - __pyx_v_step1), __pyx_v_step1, __pyx_v_self->fda->sent_id->arr);
- /* "rulefactory.pxi":543
+ /* "cdec/sa/rulefactory.pxi":543
* # Case 2: sets are non-overlapping
* assign_matching(&loc1, arr1, high1-step1, step1, self.fda.sent_id.arr)
* assign_matching(&loc2, arr2, low2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -47544,7 +48068,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_f_4cdec_2sa_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_low2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr);
- /* "rulefactory.pxi":544
+ /* "cdec/sa/rulefactory.pxi":544
* assign_matching(&loc1, arr1, high1-step1, step1, self.fda.sent_id.arr)
* assign_matching(&loc2, arr2, low2, step2, self.fda.sent_id.arr)
* if self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) == -1: # <<<<<<<<<<<<<<
@@ -47554,7 +48078,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
__pyx_t_1 = ((((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last) == -1) != 0);
if (__pyx_t_1) {
- /* "rulefactory.pxi":545
+ /* "cdec/sa/rulefactory.pxi":545
* assign_matching(&loc2, arr2, low2, step2, self.fda.sent_id.arr)
* if self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) == -1:
* return result # <<<<<<<<<<<<<<
@@ -47565,7 +48089,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
goto __pyx_L0;
}
- /* "rulefactory.pxi":547
+ /* "cdec/sa/rulefactory.pxi":547
* return result
*
* assign_matching(&loc1, arr1, low1, step1, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -47574,7 +48098,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_f_4cdec_2sa_3_sa_assign_matching((&__pyx_v_loc1), __pyx_v_arr1, __pyx_v_low1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr);
- /* "rulefactory.pxi":548
+ /* "cdec/sa/rulefactory.pxi":548
*
* assign_matching(&loc1, arr1, low1, step1, self.fda.sent_id.arr)
* assign_matching(&loc2, arr2, high2-step2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -47583,7 +48107,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_f_4cdec_2sa_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, (__pyx_v_high2 - __pyx_v_step2), __pyx_v_step2, __pyx_v_self->fda->sent_id->arr);
- /* "rulefactory.pxi":549
+ /* "cdec/sa/rulefactory.pxi":549
* assign_matching(&loc1, arr1, low1, step1, self.fda.sent_id.arr)
* assign_matching(&loc2, arr2, high2-step2, step2, self.fda.sent_id.arr)
* if self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) == 1: # <<<<<<<<<<<<<<
@@ -47593,7 +48117,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
__pyx_t_1 = ((((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last) == 1) != 0);
if (__pyx_t_1) {
- /* "rulefactory.pxi":550
+ /* "cdec/sa/rulefactory.pxi":550
* assign_matching(&loc2, arr2, high2-step2, step2, self.fda.sent_id.arr)
* if self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) == 1:
* return result # <<<<<<<<<<<<<<
@@ -47604,7 +48128,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
goto __pyx_L0;
}
- /* "rulefactory.pxi":554
+ /* "cdec/sa/rulefactory.pxi":554
* # Case 3: query set and data set do not meet size mismatch constraints;
* # We use mergesort instead in this case
* qsetsize = (high1-low1) / step1 # <<<<<<<<<<<<<<
@@ -47634,7 +48158,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
}
__pyx_v_qsetsize = __Pyx_div_int(__pyx_t_3, __pyx_v_step1);
- /* "rulefactory.pxi":555
+ /* "cdec/sa/rulefactory.pxi":555
* # We use mergesort instead in this case
* qsetsize = (high1-low1) / step1
* dsetsize = (high2-low2) / step2 # <<<<<<<<<<<<<<
@@ -47664,7 +48188,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
}
__pyx_v_dsetsize = __Pyx_div_int(__pyx_t_3, __pyx_v_step2);
- /* "rulefactory.pxi":556
+ /* "cdec/sa/rulefactory.pxi":556
* qsetsize = (high1-low1) / step1
* dsetsize = (high2-low2) / step2
* if d_first: # <<<<<<<<<<<<<<
@@ -47674,7 +48198,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
__pyx_t_1 = (__pyx_v_d_first != 0);
if (__pyx_t_1) {
- /* "rulefactory.pxi":557
+ /* "cdec/sa/rulefactory.pxi":557
* dsetsize = (high2-low2) / step2
* if d_first:
* tmp = qsetsize # <<<<<<<<<<<<<<
@@ -47683,7 +48207,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_tmp = __pyx_v_qsetsize;
- /* "rulefactory.pxi":558
+ /* "cdec/sa/rulefactory.pxi":558
* if d_first:
* tmp = qsetsize
* qsetsize = dsetsize # <<<<<<<<<<<<<<
@@ -47692,7 +48216,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_qsetsize = __pyx_v_dsetsize;
- /* "rulefactory.pxi":559
+ /* "cdec/sa/rulefactory.pxi":559
* tmp = qsetsize
* qsetsize = dsetsize
* dsetsize = tmp # <<<<<<<<<<<<<<
@@ -47704,7 +48228,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
}
__pyx_L9:;
- /* "rulefactory.pxi":561
+ /* "cdec/sa/rulefactory.pxi":561
* dsetsize = tmp
*
* if self.by_slack_factor * qsetsize * log(dsetsize) / log(2) > dsetsize: # <<<<<<<<<<<<<<
@@ -47726,7 +48250,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
__pyx_t_1 = (((__pyx_t_4 / __pyx_t_5) > __pyx_v_dsetsize) != 0);
if (__pyx_t_1) {
- /* "rulefactory.pxi":562
+ /* "cdec/sa/rulefactory.pxi":562
*
* if self.by_slack_factor * qsetsize * log(dsetsize) / log(2) > dsetsize:
* free(result) # <<<<<<<<<<<<<<
@@ -47735,7 +48259,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
free(__pyx_v_result);
- /* "rulefactory.pxi":563
+ /* "cdec/sa/rulefactory.pxi":563
* if self.by_slack_factor * qsetsize * log(dsetsize) / log(2) > dsetsize:
* free(result)
* return self.merge_helper(low1, high1, arr1, step1, low2, high2, arr2, step2, offset_by_one, len_last, num_subpatterns, result_len) # <<<<<<<<<<<<<<
@@ -47746,7 +48270,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
goto __pyx_L0;
}
- /* "rulefactory.pxi":567
+ /* "cdec/sa/rulefactory.pxi":567
* # binary search. There are two flavors, depending on
* # whether the queryset or dataset is first
* if d_first: # <<<<<<<<<<<<<<
@@ -47756,7 +48280,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
__pyx_t_1 = (__pyx_v_d_first != 0);
if (__pyx_t_1) {
- /* "rulefactory.pxi":568
+ /* "cdec/sa/rulefactory.pxi":568
* # whether the queryset or dataset is first
* if d_first:
* med2 = median(low2, high2, step2) # <<<<<<<<<<<<<<
@@ -47765,7 +48289,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_med2 = __pyx_f_4cdec_2sa_3_sa_median(__pyx_v_low2, __pyx_v_high2, __pyx_v_step2);
- /* "rulefactory.pxi":569
+ /* "cdec/sa/rulefactory.pxi":569
* if d_first:
* med2 = median(low2, high2, step2)
* assign_matching(&loc2, arr2, med2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -47774,7 +48298,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_f_4cdec_2sa_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_med2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr);
- /* "rulefactory.pxi":571
+ /* "cdec/sa/rulefactory.pxi":571
* assign_matching(&loc2, arr2, med2, step2, self.fda.sent_id.arr)
*
* search_low = low1 # <<<<<<<<<<<<<<
@@ -47783,7 +48307,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_search_low = __pyx_v_low1;
- /* "rulefactory.pxi":572
+ /* "cdec/sa/rulefactory.pxi":572
*
* search_low = low1
* search_high = high1 # <<<<<<<<<<<<<<
@@ -47792,7 +48316,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_search_high = __pyx_v_high1;
- /* "rulefactory.pxi":573
+ /* "cdec/sa/rulefactory.pxi":573
* search_low = low1
* search_high = high1
* while search_low < search_high: # <<<<<<<<<<<<<<
@@ -47803,7 +48327,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
__pyx_t_1 = ((__pyx_v_search_low < __pyx_v_search_high) != 0);
if (!__pyx_t_1) break;
- /* "rulefactory.pxi":574
+ /* "cdec/sa/rulefactory.pxi":574
* search_high = high1
* while search_low < search_high:
* med1 = median(search_low, search_high, step1) # <<<<<<<<<<<<<<
@@ -47812,7 +48336,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_med1 = __pyx_f_4cdec_2sa_3_sa_median(__pyx_v_search_low, __pyx_v_search_high, __pyx_v_step1);
- /* "rulefactory.pxi":575
+ /* "cdec/sa/rulefactory.pxi":575
* while search_low < search_high:
* med1 = median(search_low, search_high, step1)
* find_comparable_matchings(low1, high1, arr1, step1, med1, &med1_minus, &med1_plus) # <<<<<<<<<<<<<<
@@ -47821,7 +48345,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_f_4cdec_2sa_3_sa_find_comparable_matchings(__pyx_v_low1, __pyx_v_high1, __pyx_v_arr1, __pyx_v_step1, __pyx_v_med1, (&__pyx_v_med1_minus), (&__pyx_v_med1_plus));
- /* "rulefactory.pxi":576
+ /* "cdec/sa/rulefactory.pxi":576
* med1 = median(search_low, search_high, step1)
* find_comparable_matchings(low1, high1, arr1, step1, med1, &med1_minus, &med1_plus)
* comparison = self.compare_matchings_set(med1_minus, med1_plus, arr1, step1, &loc2, offset_by_one, len_last) # <<<<<<<<<<<<<<
@@ -47830,7 +48354,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_comparison = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings_set(__pyx_v_self, __pyx_v_med1_minus, __pyx_v_med1_plus, __pyx_v_arr1, __pyx_v_step1, (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last);
- /* "rulefactory.pxi":579
+ /* "cdec/sa/rulefactory.pxi":579
* if comparison == -1:
* search_low = med1_plus
* elif comparison == 1: # <<<<<<<<<<<<<<
@@ -47839,7 +48363,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
switch (__pyx_v_comparison) {
- /* "rulefactory.pxi":577
+ /* "cdec/sa/rulefactory.pxi":577
* find_comparable_matchings(low1, high1, arr1, step1, med1, &med1_minus, &med1_plus)
* comparison = self.compare_matchings_set(med1_minus, med1_plus, arr1, step1, &loc2, offset_by_one, len_last)
* if comparison == -1: # <<<<<<<<<<<<<<
@@ -47848,7 +48372,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
case -1:
- /* "rulefactory.pxi":578
+ /* "cdec/sa/rulefactory.pxi":578
* comparison = self.compare_matchings_set(med1_minus, med1_plus, arr1, step1, &loc2, offset_by_one, len_last)
* if comparison == -1:
* search_low = med1_plus # <<<<<<<<<<<<<<
@@ -47858,7 +48382,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
__pyx_v_search_low = __pyx_v_med1_plus;
break;
- /* "rulefactory.pxi":579
+ /* "cdec/sa/rulefactory.pxi":579
* if comparison == -1:
* search_low = med1_plus
* elif comparison == 1: # <<<<<<<<<<<<<<
@@ -47867,7 +48391,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
case 1:
- /* "rulefactory.pxi":580
+ /* "cdec/sa/rulefactory.pxi":580
* search_low = med1_plus
* elif comparison == 1:
* search_high = med1_minus # <<<<<<<<<<<<<<
@@ -47878,7 +48402,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
break;
default:
- /* "rulefactory.pxi":582
+ /* "cdec/sa/rulefactory.pxi":582
* search_high = med1_minus
* else:
* break # <<<<<<<<<<<<<<
@@ -47894,7 +48418,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
}
/*else*/ {
- /* "rulefactory.pxi":584
+ /* "cdec/sa/rulefactory.pxi":584
* break
* else:
* med1 = median(low1, high1, step1) # <<<<<<<<<<<<<<
@@ -47903,7 +48427,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_med1 = __pyx_f_4cdec_2sa_3_sa_median(__pyx_v_low1, __pyx_v_high1, __pyx_v_step1);
- /* "rulefactory.pxi":585
+ /* "cdec/sa/rulefactory.pxi":585
* else:
* med1 = median(low1, high1, step1)
* find_comparable_matchings(low1, high1, arr1, step1, med1, &med1_minus, &med1_plus) # <<<<<<<<<<<<<<
@@ -47912,7 +48436,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_f_4cdec_2sa_3_sa_find_comparable_matchings(__pyx_v_low1, __pyx_v_high1, __pyx_v_arr1, __pyx_v_step1, __pyx_v_med1, (&__pyx_v_med1_minus), (&__pyx_v_med1_plus));
- /* "rulefactory.pxi":587
+ /* "cdec/sa/rulefactory.pxi":587
* find_comparable_matchings(low1, high1, arr1, step1, med1, &med1_minus, &med1_plus)
*
* search_low = low2 # <<<<<<<<<<<<<<
@@ -47921,7 +48445,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_search_low = __pyx_v_low2;
- /* "rulefactory.pxi":588
+ /* "cdec/sa/rulefactory.pxi":588
*
* search_low = low2
* search_high = high2 # <<<<<<<<<<<<<<
@@ -47930,7 +48454,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_search_high = __pyx_v_high2;
- /* "rulefactory.pxi":589
+ /* "cdec/sa/rulefactory.pxi":589
* search_low = low2
* search_high = high2
* while search_low < search_high: # <<<<<<<<<<<<<<
@@ -47941,7 +48465,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
__pyx_t_1 = ((__pyx_v_search_low < __pyx_v_search_high) != 0);
if (!__pyx_t_1) break;
- /* "rulefactory.pxi":590
+ /* "cdec/sa/rulefactory.pxi":590
* search_high = high2
* while search_low < search_high:
* med2 = median(search_low, search_high, step2) # <<<<<<<<<<<<<<
@@ -47950,7 +48474,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_med2 = __pyx_f_4cdec_2sa_3_sa_median(__pyx_v_search_low, __pyx_v_search_high, __pyx_v_step2);
- /* "rulefactory.pxi":591
+ /* "cdec/sa/rulefactory.pxi":591
* while search_low < search_high:
* med2 = median(search_low, search_high, step2)
* assign_matching(&loc2, arr2, med2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -47959,7 +48483,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_f_4cdec_2sa_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_med2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr);
- /* "rulefactory.pxi":592
+ /* "cdec/sa/rulefactory.pxi":592
* med2 = median(search_low, search_high, step2)
* assign_matching(&loc2, arr2, med2, step2, self.fda.sent_id.arr)
* comparison = self.compare_matchings_set(med1_minus, med1_plus, arr1, step1, &loc2, offset_by_one, len_last) # <<<<<<<<<<<<<<
@@ -47968,7 +48492,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_comparison = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings_set(__pyx_v_self, __pyx_v_med1_minus, __pyx_v_med1_plus, __pyx_v_arr1, __pyx_v_step1, (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last);
- /* "rulefactory.pxi":595
+ /* "cdec/sa/rulefactory.pxi":595
* if comparison == -1:
* search_high = med2
* elif comparison == 1: # <<<<<<<<<<<<<<
@@ -47977,7 +48501,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
switch (__pyx_v_comparison) {
- /* "rulefactory.pxi":593
+ /* "cdec/sa/rulefactory.pxi":593
* assign_matching(&loc2, arr2, med2, step2, self.fda.sent_id.arr)
* comparison = self.compare_matchings_set(med1_minus, med1_plus, arr1, step1, &loc2, offset_by_one, len_last)
* if comparison == -1: # <<<<<<<<<<<<<<
@@ -47986,7 +48510,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
case -1:
- /* "rulefactory.pxi":594
+ /* "cdec/sa/rulefactory.pxi":594
* comparison = self.compare_matchings_set(med1_minus, med1_plus, arr1, step1, &loc2, offset_by_one, len_last)
* if comparison == -1:
* search_high = med2 # <<<<<<<<<<<<<<
@@ -47996,7 +48520,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
__pyx_v_search_high = __pyx_v_med2;
break;
- /* "rulefactory.pxi":595
+ /* "cdec/sa/rulefactory.pxi":595
* if comparison == -1:
* search_high = med2
* elif comparison == 1: # <<<<<<<<<<<<<<
@@ -48005,7 +48529,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
case 1:
- /* "rulefactory.pxi":596
+ /* "cdec/sa/rulefactory.pxi":596
* search_high = med2
* elif comparison == 1:
* search_low = med2 + step2 # <<<<<<<<<<<<<<
@@ -48016,7 +48540,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
break;
default:
- /* "rulefactory.pxi":598
+ /* "cdec/sa/rulefactory.pxi":598
* search_low = med2 + step2
* else:
* break # <<<<<<<<<<<<<<
@@ -48031,7 +48555,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
}
__pyx_L11:;
- /* "rulefactory.pxi":600
+ /* "cdec/sa/rulefactory.pxi":600
* break
*
* med_result_len = 0 # <<<<<<<<<<<<<<
@@ -48040,7 +48564,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_med_result_len = 0;
- /* "rulefactory.pxi":601
+ /* "cdec/sa/rulefactory.pxi":601
*
* med_result_len = 0
* med_result = <int*> malloc(0*sizeof(int*)) # <<<<<<<<<<<<<<
@@ -48049,7 +48573,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_med_result = ((int *)malloc((0 * (sizeof(int *)))));
- /* "rulefactory.pxi":602
+ /* "cdec/sa/rulefactory.pxi":602
* med_result_len = 0
* med_result = <int*> malloc(0*sizeof(int*))
* if search_high > search_low: # <<<<<<<<<<<<<<
@@ -48059,7 +48583,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
__pyx_t_1 = ((__pyx_v_search_high > __pyx_v_search_low) != 0);
if (__pyx_t_1) {
- /* "rulefactory.pxi":608
+ /* "cdec/sa/rulefactory.pxi":608
* # want to store the bindings for all of those elements. We can
* # subsequently throw all of them away.
* med2_minus = med2 # <<<<<<<<<<<<<<
@@ -48068,7 +48592,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_med2_minus = __pyx_v_med2;
- /* "rulefactory.pxi":609
+ /* "cdec/sa/rulefactory.pxi":609
* # subsequently throw all of them away.
* med2_minus = med2
* med2_plus = med2 + step2 # <<<<<<<<<<<<<<
@@ -48077,7 +48601,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_med2_plus = (__pyx_v_med2 + __pyx_v_step2);
- /* "rulefactory.pxi":610
+ /* "cdec/sa/rulefactory.pxi":610
* med2_minus = med2
* med2_plus = med2 + step2
* i1 = med1_minus # <<<<<<<<<<<<<<
@@ -48086,7 +48610,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_i1 = __pyx_v_med1_minus;
- /* "rulefactory.pxi":611
+ /* "cdec/sa/rulefactory.pxi":611
* med2_plus = med2 + step2
* i1 = med1_minus
* while i1 < med1_plus: # <<<<<<<<<<<<<<
@@ -48097,7 +48621,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
__pyx_t_1 = ((__pyx_v_i1 < __pyx_v_med1_plus) != 0);
if (!__pyx_t_1) break;
- /* "rulefactory.pxi":612
+ /* "cdec/sa/rulefactory.pxi":612
* i1 = med1_minus
* while i1 < med1_plus:
* assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -48106,7 +48630,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_f_4cdec_2sa_3_sa_assign_matching((&__pyx_v_loc1), __pyx_v_arr1, __pyx_v_i1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr);
- /* "rulefactory.pxi":613
+ /* "cdec/sa/rulefactory.pxi":613
* while i1 < med1_plus:
* assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr)
* while med2_minus-step2 >= low2: # <<<<<<<<<<<<<<
@@ -48117,7 +48641,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
__pyx_t_1 = (((__pyx_v_med2_minus - __pyx_v_step2) >= __pyx_v_low2) != 0);
if (!__pyx_t_1) break;
- /* "rulefactory.pxi":614
+ /* "cdec/sa/rulefactory.pxi":614
* assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr)
* while med2_minus-step2 >= low2:
* assign_matching(&loc2, arr2, med2_minus-step2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -48126,7 +48650,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_f_4cdec_2sa_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, (__pyx_v_med2_minus - __pyx_v_step2), __pyx_v_step2, __pyx_v_self->fda->sent_id->arr);
- /* "rulefactory.pxi":615
+ /* "cdec/sa/rulefactory.pxi":615
* while med2_minus-step2 >= low2:
* assign_matching(&loc2, arr2, med2_minus-step2, step2, self.fda.sent_id.arr)
* if self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) < 1: # <<<<<<<<<<<<<<
@@ -48136,7 +48660,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
__pyx_t_1 = ((((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last) < 1) != 0);
if (__pyx_t_1) {
- /* "rulefactory.pxi":616
+ /* "cdec/sa/rulefactory.pxi":616
* assign_matching(&loc2, arr2, med2_minus-step2, step2, self.fda.sent_id.arr)
* if self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) < 1:
* med2_minus = med2_minus - step2 # <<<<<<<<<<<<<<
@@ -48148,7 +48672,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
}
/*else*/ {
- /* "rulefactory.pxi":618
+ /* "cdec/sa/rulefactory.pxi":618
* med2_minus = med2_minus - step2
* else:
* break # <<<<<<<<<<<<<<
@@ -48161,7 +48685,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
}
__pyx_L20_break:;
- /* "rulefactory.pxi":619
+ /* "cdec/sa/rulefactory.pxi":619
* else:
* break
* i2 = med2_minus # <<<<<<<<<<<<<<
@@ -48170,7 +48694,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_i2 = __pyx_v_med2_minus;
- /* "rulefactory.pxi":620
+ /* "cdec/sa/rulefactory.pxi":620
* break
* i2 = med2_minus
* while i2 < high2: # <<<<<<<<<<<<<<
@@ -48181,7 +48705,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
__pyx_t_1 = ((__pyx_v_i2 < __pyx_v_high2) != 0);
if (!__pyx_t_1) break;
- /* "rulefactory.pxi":621
+ /* "cdec/sa/rulefactory.pxi":621
* i2 = med2_minus
* while i2 < high2:
* assign_matching(&loc2, arr2, i2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -48190,7 +48714,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_f_4cdec_2sa_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_i2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr);
- /* "rulefactory.pxi":622
+ /* "cdec/sa/rulefactory.pxi":622
* while i2 < high2:
* assign_matching(&loc2, arr2, i2, step2, self.fda.sent_id.arr)
* comparison = self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) # <<<<<<<<<<<<<<
@@ -48199,7 +48723,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_comparison = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last);
- /* "rulefactory.pxi":623
+ /* "cdec/sa/rulefactory.pxi":623
* assign_matching(&loc2, arr2, i2, step2, self.fda.sent_id.arr)
* comparison = self.compare_matchings(&loc1, &loc2, offset_by_one, len_last)
* if comparison == 0: # <<<<<<<<<<<<<<
@@ -48209,7 +48733,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
__pyx_t_1 = ((__pyx_v_comparison == 0) != 0);
if (__pyx_t_1) {
- /* "rulefactory.pxi":625
+ /* "cdec/sa/rulefactory.pxi":625
* if comparison == 0:
* pass
* med_result = append_combined_matching(med_result, &loc1, &loc2, offset_by_one, num_subpatterns, &med_result_len) # <<<<<<<<<<<<<<
@@ -48221,7 +48745,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
}
__pyx_L24:;
- /* "rulefactory.pxi":626
+ /* "cdec/sa/rulefactory.pxi":626
* pass
* med_result = append_combined_matching(med_result, &loc1, &loc2, offset_by_one, num_subpatterns, &med_result_len)
* if comparison == -1: # <<<<<<<<<<<<<<
@@ -48231,7 +48755,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
__pyx_t_1 = ((__pyx_v_comparison == -1) != 0);
if (__pyx_t_1) {
- /* "rulefactory.pxi":627
+ /* "cdec/sa/rulefactory.pxi":627
* med_result = append_combined_matching(med_result, &loc1, &loc2, offset_by_one, num_subpatterns, &med_result_len)
* if comparison == -1:
* break # <<<<<<<<<<<<<<
@@ -48241,7 +48765,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
goto __pyx_L23_break;
}
- /* "rulefactory.pxi":628
+ /* "cdec/sa/rulefactory.pxi":628
* if comparison == -1:
* break
* i2 = i2 + step2 # <<<<<<<<<<<<<<
@@ -48252,7 +48776,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
}
__pyx_L23_break:;
- /* "rulefactory.pxi":629
+ /* "cdec/sa/rulefactory.pxi":629
* break
* i2 = i2 + step2
* if i2 > med2_plus: # <<<<<<<<<<<<<<
@@ -48262,7 +48786,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
__pyx_t_1 = ((__pyx_v_i2 > __pyx_v_med2_plus) != 0);
if (__pyx_t_1) {
- /* "rulefactory.pxi":630
+ /* "cdec/sa/rulefactory.pxi":630
* i2 = i2 + step2
* if i2 > med2_plus:
* med2_plus = i2 # <<<<<<<<<<<<<<
@@ -48274,7 +48798,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
}
__pyx_L26:;
- /* "rulefactory.pxi":631
+ /* "cdec/sa/rulefactory.pxi":631
* if i2 > med2_plus:
* med2_plus = i2
* i1 = i1 + step1 # <<<<<<<<<<<<<<
@@ -48284,7 +48808,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
__pyx_v_i1 = (__pyx_v_i1 + __pyx_v_step1);
}
- /* "rulefactory.pxi":633
+ /* "cdec/sa/rulefactory.pxi":633
* i1 = i1 + step1
*
* tmp = med1_minus # <<<<<<<<<<<<<<
@@ -48293,7 +48817,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_tmp = __pyx_v_med1_minus;
- /* "rulefactory.pxi":634
+ /* "cdec/sa/rulefactory.pxi":634
*
* tmp = med1_minus
* med1_minus = med1_plus # <<<<<<<<<<<<<<
@@ -48302,7 +48826,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_med1_minus = __pyx_v_med1_plus;
- /* "rulefactory.pxi":635
+ /* "cdec/sa/rulefactory.pxi":635
* tmp = med1_minus
* med1_minus = med1_plus
* med1_plus = tmp # <<<<<<<<<<<<<<
@@ -48314,7 +48838,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
}
/*else*/ {
- /* "rulefactory.pxi":638
+ /* "cdec/sa/rulefactory.pxi":638
* else:
* # No match; need to figure out the point of division in D and Q
* med2_minus = med2 # <<<<<<<<<<<<<<
@@ -48323,7 +48847,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_med2_minus = __pyx_v_med2;
- /* "rulefactory.pxi":639
+ /* "cdec/sa/rulefactory.pxi":639
* # No match; need to figure out the point of division in D and Q
* med2_minus = med2
* med2_plus = med2 # <<<<<<<<<<<<<<
@@ -48332,7 +48856,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_med2_plus = __pyx_v_med2;
- /* "rulefactory.pxi":640
+ /* "cdec/sa/rulefactory.pxi":640
* med2_minus = med2
* med2_plus = med2
* if d_first: # <<<<<<<<<<<<<<
@@ -48342,7 +48866,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
__pyx_t_1 = (__pyx_v_d_first != 0);
if (__pyx_t_1) {
- /* "rulefactory.pxi":641
+ /* "cdec/sa/rulefactory.pxi":641
* med2_plus = med2
* if d_first:
* med2_minus = med2_minus + step2 # <<<<<<<<<<<<<<
@@ -48351,7 +48875,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_med2_minus = (__pyx_v_med2_minus + __pyx_v_step2);
- /* "rulefactory.pxi":642
+ /* "cdec/sa/rulefactory.pxi":642
* if d_first:
* med2_minus = med2_minus + step2
* if comparison == -1: # <<<<<<<<<<<<<<
@@ -48361,7 +48885,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
__pyx_t_1 = ((__pyx_v_comparison == -1) != 0);
if (__pyx_t_1) {
- /* "rulefactory.pxi":643
+ /* "cdec/sa/rulefactory.pxi":643
* med2_minus = med2_minus + step2
* if comparison == -1:
* med1_minus = med1_plus # <<<<<<<<<<<<<<
@@ -48373,7 +48897,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
}
__pyx_L28:;
- /* "rulefactory.pxi":644
+ /* "cdec/sa/rulefactory.pxi":644
* if comparison == -1:
* med1_minus = med1_plus
* if comparison == 1: # <<<<<<<<<<<<<<
@@ -48383,7 +48907,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
__pyx_t_1 = ((__pyx_v_comparison == 1) != 0);
if (__pyx_t_1) {
- /* "rulefactory.pxi":645
+ /* "cdec/sa/rulefactory.pxi":645
* med1_minus = med1_plus
* if comparison == 1:
* med1_plus = med1_minus # <<<<<<<<<<<<<<
@@ -48398,7 +48922,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
}
/*else*/ {
- /* "rulefactory.pxi":647
+ /* "cdec/sa/rulefactory.pxi":647
* med1_plus = med1_minus
* else:
* tmp = med1_minus # <<<<<<<<<<<<<<
@@ -48407,7 +48931,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_tmp = __pyx_v_med1_minus;
- /* "rulefactory.pxi":648
+ /* "cdec/sa/rulefactory.pxi":648
* else:
* tmp = med1_minus
* med1_minus = med1_plus # <<<<<<<<<<<<<<
@@ -48416,7 +48940,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_med1_minus = __pyx_v_med1_plus;
- /* "rulefactory.pxi":649
+ /* "cdec/sa/rulefactory.pxi":649
* tmp = med1_minus
* med1_minus = med1_plus
* med1_plus = tmp # <<<<<<<<<<<<<<
@@ -48425,7 +48949,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_med1_plus = __pyx_v_tmp;
- /* "rulefactory.pxi":650
+ /* "cdec/sa/rulefactory.pxi":650
* med1_minus = med1_plus
* med1_plus = tmp
* if comparison == 1: # <<<<<<<<<<<<<<
@@ -48435,7 +48959,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
__pyx_t_1 = ((__pyx_v_comparison == 1) != 0);
if (__pyx_t_1) {
- /* "rulefactory.pxi":651
+ /* "cdec/sa/rulefactory.pxi":651
* med1_plus = tmp
* if comparison == 1:
* med2_minus = med2_minus + step2 # <<<<<<<<<<<<<<
@@ -48444,7 +48968,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_med2_minus = (__pyx_v_med2_minus + __pyx_v_step2);
- /* "rulefactory.pxi":652
+ /* "cdec/sa/rulefactory.pxi":652
* if comparison == 1:
* med2_minus = med2_minus + step2
* med2_plus = med2_plus + step2 # <<<<<<<<<<<<<<
@@ -48460,7 +48984,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
}
__pyx_L16:;
- /* "rulefactory.pxi":654
+ /* "cdec/sa/rulefactory.pxi":654
* med2_plus = med2_plus + step2
*
* low_result_len = 0 # <<<<<<<<<<<<<<
@@ -48469,7 +48993,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_low_result_len = 0;
- /* "rulefactory.pxi":655
+ /* "cdec/sa/rulefactory.pxi":655
*
* low_result_len = 0
* low_result = self.baeza_yates_helper(low1, med1_plus, arr1, step1, low2, med2_plus, arr2, step2, offset_by_one, len_last, num_subpatterns, &low_result_len) # <<<<<<<<<<<<<<
@@ -48478,7 +49002,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_low_result = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->baeza_yates_helper(__pyx_v_self, __pyx_v_low1, __pyx_v_med1_plus, __pyx_v_arr1, __pyx_v_step1, __pyx_v_low2, __pyx_v_med2_plus, __pyx_v_arr2, __pyx_v_step2, __pyx_v_offset_by_one, __pyx_v_len_last, __pyx_v_num_subpatterns, (&__pyx_v_low_result_len));
- /* "rulefactory.pxi":656
+ /* "cdec/sa/rulefactory.pxi":656
* low_result_len = 0
* low_result = self.baeza_yates_helper(low1, med1_plus, arr1, step1, low2, med2_plus, arr2, step2, offset_by_one, len_last, num_subpatterns, &low_result_len)
* high_result_len = 0 # <<<<<<<<<<<<<<
@@ -48487,7 +49011,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_high_result_len = 0;
- /* "rulefactory.pxi":657
+ /* "cdec/sa/rulefactory.pxi":657
* low_result = self.baeza_yates_helper(low1, med1_plus, arr1, step1, low2, med2_plus, arr2, step2, offset_by_one, len_last, num_subpatterns, &low_result_len)
* high_result_len = 0
* high_result = self.baeza_yates_helper(med1_minus, high1, arr1, step1, med2_minus, high2, arr2, step2, offset_by_one, len_last, num_subpatterns, &high_result_len) # <<<<<<<<<<<<<<
@@ -48496,7 +49020,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_high_result = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->baeza_yates_helper(__pyx_v_self, __pyx_v_med1_minus, __pyx_v_high1, __pyx_v_arr1, __pyx_v_step1, __pyx_v_med2_minus, __pyx_v_high2, __pyx_v_arr2, __pyx_v_step2, __pyx_v_offset_by_one, __pyx_v_len_last, __pyx_v_num_subpatterns, (&__pyx_v_high_result_len));
- /* "rulefactory.pxi":659
+ /* "cdec/sa/rulefactory.pxi":659
* high_result = self.baeza_yates_helper(med1_minus, high1, arr1, step1, med2_minus, high2, arr2, step2, offset_by_one, len_last, num_subpatterns, &high_result_len)
*
* result = extend_arr(result, result_len, low_result, low_result_len) # <<<<<<<<<<<<<<
@@ -48505,7 +49029,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_result = __pyx_f_4cdec_2sa_3_sa_extend_arr(__pyx_v_result, __pyx_v_result_len, __pyx_v_low_result, __pyx_v_low_result_len);
- /* "rulefactory.pxi":660
+ /* "cdec/sa/rulefactory.pxi":660
*
* result = extend_arr(result, result_len, low_result, low_result_len)
* result = extend_arr(result, result_len, med_result, med_result_len) # <<<<<<<<<<<<<<
@@ -48514,7 +49038,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_result = __pyx_f_4cdec_2sa_3_sa_extend_arr(__pyx_v_result, __pyx_v_result_len, __pyx_v_med_result, __pyx_v_med_result_len);
- /* "rulefactory.pxi":661
+ /* "cdec/sa/rulefactory.pxi":661
* result = extend_arr(result, result_len, low_result, low_result_len)
* result = extend_arr(result, result_len, med_result, med_result_len)
* result = extend_arr(result, result_len, high_result, high_result_len) # <<<<<<<<<<<<<<
@@ -48523,7 +49047,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_result = __pyx_f_4cdec_2sa_3_sa_extend_arr(__pyx_v_result, __pyx_v_result_len, __pyx_v_high_result, __pyx_v_high_result_len);
- /* "rulefactory.pxi":662
+ /* "cdec/sa/rulefactory.pxi":662
* result = extend_arr(result, result_len, med_result, med_result_len)
* result = extend_arr(result, result_len, high_result, high_result_len)
* free(low_result) # <<<<<<<<<<<<<<
@@ -48532,7 +49056,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
free(__pyx_v_low_result);
- /* "rulefactory.pxi":663
+ /* "cdec/sa/rulefactory.pxi":663
* result = extend_arr(result, result_len, high_result, high_result_len)
* free(low_result)
* free(med_result) # <<<<<<<<<<<<<<
@@ -48541,7 +49065,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
free(__pyx_v_med_result);
- /* "rulefactory.pxi":664
+ /* "cdec/sa/rulefactory.pxi":664
* free(low_result)
* free(med_result)
* free(high_result) # <<<<<<<<<<<<<<
@@ -48550,7 +49074,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
free(__pyx_v_high_result);
- /* "rulefactory.pxi":666
+ /* "cdec/sa/rulefactory.pxi":666
* free(high_result)
*
* return result # <<<<<<<<<<<<<<
@@ -48560,7 +49084,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "rulefactory.pxi":517
+ /* "cdec/sa/rulefactory.pxi":517
*
*
* cdef int* baeza_yates_helper(self, int low1, int high1, int* arr1, int step1, # <<<<<<<<<<<<<<
@@ -48577,7 +49101,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
return __pyx_r;
}
-/* "rulefactory.pxi":670
+/* "cdec/sa/rulefactory.pxi":670
*
*
* cdef long compare_matchings_set(self, int i1_minus, int i1_plus, int* arr1, int step1, # <<<<<<<<<<<<<<
@@ -48596,7 +49120,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s
int __pyx_t_1;
__Pyx_RefNannySetupContext("compare_matchings_set", 0);
- /* "rulefactory.pxi":681
+ /* "cdec/sa/rulefactory.pxi":681
* cdef Matching* loc1
*
* loc1 = &l1_stack # <<<<<<<<<<<<<<
@@ -48605,7 +49129,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s
*/
__pyx_v_loc1 = (&__pyx_v_l1_stack);
- /* "rulefactory.pxi":683
+ /* "cdec/sa/rulefactory.pxi":683
* loc1 = &l1_stack
*
* i1 = i1_minus # <<<<<<<<<<<<<<
@@ -48614,7 +49138,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s
*/
__pyx_v_i1 = __pyx_v_i1_minus;
- /* "rulefactory.pxi":684
+ /* "cdec/sa/rulefactory.pxi":684
*
* i1 = i1_minus
* while i1 < i1_plus: # <<<<<<<<<<<<<<
@@ -48625,7 +49149,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s
__pyx_t_1 = ((__pyx_v_i1 < __pyx_v_i1_plus) != 0);
if (!__pyx_t_1) break;
- /* "rulefactory.pxi":685
+ /* "cdec/sa/rulefactory.pxi":685
* i1 = i1_minus
* while i1 < i1_plus:
* assign_matching(loc1, arr1, i1, step1, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -48634,7 +49158,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s
*/
__pyx_f_4cdec_2sa_3_sa_assign_matching(__pyx_v_loc1, __pyx_v_arr1, __pyx_v_i1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr);
- /* "rulefactory.pxi":686
+ /* "cdec/sa/rulefactory.pxi":686
* while i1 < i1_plus:
* assign_matching(loc1, arr1, i1, step1, self.fda.sent_id.arr)
* comparison = self.compare_matchings(loc1, loc2, offset_by_one, len_last) # <<<<<<<<<<<<<<
@@ -48643,7 +49167,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s
*/
__pyx_v_comparison = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, __pyx_v_loc1, __pyx_v_loc2, __pyx_v_offset_by_one, __pyx_v_len_last);
- /* "rulefactory.pxi":687
+ /* "cdec/sa/rulefactory.pxi":687
* assign_matching(loc1, arr1, i1, step1, self.fda.sent_id.arr)
* comparison = self.compare_matchings(loc1, loc2, offset_by_one, len_last)
* if comparison == 0: # <<<<<<<<<<<<<<
@@ -48653,7 +49177,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s
__pyx_t_1 = ((__pyx_v_comparison == 0) != 0);
if (__pyx_t_1) {
- /* "rulefactory.pxi":688
+ /* "cdec/sa/rulefactory.pxi":688
* comparison = self.compare_matchings(loc1, loc2, offset_by_one, len_last)
* if comparison == 0:
* prev_comparison = 0 # <<<<<<<<<<<<<<
@@ -48662,7 +49186,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s
*/
__pyx_v_prev_comparison = 0;
- /* "rulefactory.pxi":689
+ /* "cdec/sa/rulefactory.pxi":689
* if comparison == 0:
* prev_comparison = 0
* break # <<<<<<<<<<<<<<
@@ -48672,7 +49196,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s
goto __pyx_L4_break;
}
- /* "rulefactory.pxi":690
+ /* "cdec/sa/rulefactory.pxi":690
* prev_comparison = 0
* break
* elif i1 == i1_minus: # <<<<<<<<<<<<<<
@@ -48682,7 +49206,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s
__pyx_t_1 = ((__pyx_v_i1 == __pyx_v_i1_minus) != 0);
if (__pyx_t_1) {
- /* "rulefactory.pxi":691
+ /* "cdec/sa/rulefactory.pxi":691
* break
* elif i1 == i1_minus:
* prev_comparison = comparison # <<<<<<<<<<<<<<
@@ -48694,7 +49218,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s
}
/*else*/ {
- /* "rulefactory.pxi":693
+ /* "cdec/sa/rulefactory.pxi":693
* prev_comparison = comparison
* else:
* if comparison != prev_comparison: # <<<<<<<<<<<<<<
@@ -48704,7 +49228,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s
__pyx_t_1 = ((__pyx_v_comparison != __pyx_v_prev_comparison) != 0);
if (__pyx_t_1) {
- /* "rulefactory.pxi":694
+ /* "cdec/sa/rulefactory.pxi":694
* else:
* if comparison != prev_comparison:
* prev_comparison = 0 # <<<<<<<<<<<<<<
@@ -48713,7 +49237,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s
*/
__pyx_v_prev_comparison = 0;
- /* "rulefactory.pxi":695
+ /* "cdec/sa/rulefactory.pxi":695
* if comparison != prev_comparison:
* prev_comparison = 0
* break # <<<<<<<<<<<<<<
@@ -48725,7 +49249,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s
}
__pyx_L5:;
- /* "rulefactory.pxi":696
+ /* "cdec/sa/rulefactory.pxi":696
* prev_comparison = 0
* break
* i1 = i1 + step1 # <<<<<<<<<<<<<<
@@ -48736,7 +49260,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s
}
__pyx_L4_break:;
- /* "rulefactory.pxi":697
+ /* "cdec/sa/rulefactory.pxi":697
* break
* i1 = i1 + step1
* return prev_comparison # <<<<<<<<<<<<<<
@@ -48746,7 +49270,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s
__pyx_r = __pyx_v_prev_comparison;
goto __pyx_L0;
- /* "rulefactory.pxi":670
+ /* "cdec/sa/rulefactory.pxi":670
*
*
* cdef long compare_matchings_set(self, int i1_minus, int i1_plus, int* arr1, int step1, # <<<<<<<<<<<<<<
@@ -48760,7 +49284,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s
return __pyx_r;
}
-/* "rulefactory.pxi":700
+/* "cdec/sa/rulefactory.pxi":700
*
*
* cdef long compare_matchings(self, Matching* loc1, Matching* loc2, int offset_by_one, int len_last): # <<<<<<<<<<<<<<
@@ -48777,7 +49301,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
int __pyx_t_3;
__Pyx_RefNannySetupContext("compare_matchings", 0);
- /* "rulefactory.pxi":703
+ /* "cdec/sa/rulefactory.pxi":703
* cdef int i
*
* if loc1.sent_id > loc2.sent_id: # <<<<<<<<<<<<<<
@@ -48787,7 +49311,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
__pyx_t_1 = ((__pyx_v_loc1->sent_id > __pyx_v_loc2->sent_id) != 0);
if (__pyx_t_1) {
- /* "rulefactory.pxi":704
+ /* "cdec/sa/rulefactory.pxi":704
*
* if loc1.sent_id > loc2.sent_id:
* return 1 # <<<<<<<<<<<<<<
@@ -48798,7 +49322,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
goto __pyx_L0;
}
- /* "rulefactory.pxi":705
+ /* "cdec/sa/rulefactory.pxi":705
* if loc1.sent_id > loc2.sent_id:
* return 1
* if loc2.sent_id > loc1.sent_id: # <<<<<<<<<<<<<<
@@ -48808,7 +49332,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
__pyx_t_1 = ((__pyx_v_loc2->sent_id > __pyx_v_loc1->sent_id) != 0);
if (__pyx_t_1) {
- /* "rulefactory.pxi":706
+ /* "cdec/sa/rulefactory.pxi":706
* return 1
* if loc2.sent_id > loc1.sent_id:
* return -1 # <<<<<<<<<<<<<<
@@ -48819,7 +49343,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
goto __pyx_L0;
}
- /* "rulefactory.pxi":708
+ /* "cdec/sa/rulefactory.pxi":708
* return -1
*
* if loc1.size == 1 and loc2.size == 1: # <<<<<<<<<<<<<<
@@ -48839,7 +49363,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
__pyx_L6_bool_binop_done:;
if (__pyx_t_1) {
- /* "rulefactory.pxi":709
+ /* "cdec/sa/rulefactory.pxi":709
*
* if loc1.size == 1 and loc2.size == 1:
* if loc2.arr[loc2.start] - loc1.arr[loc1.start] <= self.train_min_gap_size: # <<<<<<<<<<<<<<
@@ -48849,7 +49373,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
__pyx_t_1 = ((((__pyx_v_loc2->arr[__pyx_v_loc2->start]) - (__pyx_v_loc1->arr[__pyx_v_loc1->start])) <= __pyx_v_self->train_min_gap_size) != 0);
if (__pyx_t_1) {
- /* "rulefactory.pxi":710
+ /* "cdec/sa/rulefactory.pxi":710
* if loc1.size == 1 and loc2.size == 1:
* if loc2.arr[loc2.start] - loc1.arr[loc1.start] <= self.train_min_gap_size:
* return 1 # <<<<<<<<<<<<<<
@@ -48862,7 +49386,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
goto __pyx_L5;
}
- /* "rulefactory.pxi":712
+ /* "cdec/sa/rulefactory.pxi":712
* return 1
*
* elif offset_by_one: # <<<<<<<<<<<<<<
@@ -48872,7 +49396,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
__pyx_t_1 = (__pyx_v_offset_by_one != 0);
if (__pyx_t_1) {
- /* "rulefactory.pxi":713
+ /* "cdec/sa/rulefactory.pxi":713
*
* elif offset_by_one:
* for i from 1 <= i < loc1.size: # <<<<<<<<<<<<<<
@@ -48882,7 +49406,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
__pyx_t_3 = __pyx_v_loc1->size;
for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_3; __pyx_v_i++) {
- /* "rulefactory.pxi":714
+ /* "cdec/sa/rulefactory.pxi":714
* elif offset_by_one:
* for i from 1 <= i < loc1.size:
* if loc1.arr[loc1.start+i] > loc2.arr[loc2.start+i-1]: # <<<<<<<<<<<<<<
@@ -48892,7 +49416,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
__pyx_t_1 = (((__pyx_v_loc1->arr[(__pyx_v_loc1->start + __pyx_v_i)]) > (__pyx_v_loc2->arr[((__pyx_v_loc2->start + __pyx_v_i) - 1)])) != 0);
if (__pyx_t_1) {
- /* "rulefactory.pxi":715
+ /* "cdec/sa/rulefactory.pxi":715
* for i from 1 <= i < loc1.size:
* if loc1.arr[loc1.start+i] > loc2.arr[loc2.start+i-1]:
* return 1 # <<<<<<<<<<<<<<
@@ -48903,7 +49427,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
goto __pyx_L0;
}
- /* "rulefactory.pxi":716
+ /* "cdec/sa/rulefactory.pxi":716
* if loc1.arr[loc1.start+i] > loc2.arr[loc2.start+i-1]:
* return 1
* if loc1.arr[loc1.start+i] < loc2.arr[loc2.start+i-1]: # <<<<<<<<<<<<<<
@@ -48913,7 +49437,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
__pyx_t_1 = (((__pyx_v_loc1->arr[(__pyx_v_loc1->start + __pyx_v_i)]) < (__pyx_v_loc2->arr[((__pyx_v_loc2->start + __pyx_v_i) - 1)])) != 0);
if (__pyx_t_1) {
- /* "rulefactory.pxi":717
+ /* "cdec/sa/rulefactory.pxi":717
* return 1
* if loc1.arr[loc1.start+i] < loc2.arr[loc2.start+i-1]:
* return -1 # <<<<<<<<<<<<<<
@@ -48928,7 +49452,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
}
/*else*/ {
- /* "rulefactory.pxi":720
+ /* "cdec/sa/rulefactory.pxi":720
*
* else:
* if loc1.arr[loc1.start]+1 > loc2.arr[loc2.start]: # <<<<<<<<<<<<<<
@@ -48938,7 +49462,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
__pyx_t_1 = ((((__pyx_v_loc1->arr[__pyx_v_loc1->start]) + 1) > (__pyx_v_loc2->arr[__pyx_v_loc2->start])) != 0);
if (__pyx_t_1) {
- /* "rulefactory.pxi":721
+ /* "cdec/sa/rulefactory.pxi":721
* else:
* if loc1.arr[loc1.start]+1 > loc2.arr[loc2.start]:
* return 1 # <<<<<<<<<<<<<<
@@ -48949,7 +49473,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
goto __pyx_L0;
}
- /* "rulefactory.pxi":722
+ /* "cdec/sa/rulefactory.pxi":722
* if loc1.arr[loc1.start]+1 > loc2.arr[loc2.start]:
* return 1
* if loc1.arr[loc1.start]+1 < loc2.arr[loc2.start]: # <<<<<<<<<<<<<<
@@ -48959,7 +49483,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
__pyx_t_1 = ((((__pyx_v_loc1->arr[__pyx_v_loc1->start]) + 1) < (__pyx_v_loc2->arr[__pyx_v_loc2->start])) != 0);
if (__pyx_t_1) {
- /* "rulefactory.pxi":723
+ /* "cdec/sa/rulefactory.pxi":723
* return 1
* if loc1.arr[loc1.start]+1 < loc2.arr[loc2.start]:
* return -1 # <<<<<<<<<<<<<<
@@ -48970,7 +49494,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
goto __pyx_L0;
}
- /* "rulefactory.pxi":725
+ /* "cdec/sa/rulefactory.pxi":725
* return -1
*
* for i from 1 <= i < loc1.size: # <<<<<<<<<<<<<<
@@ -48980,7 +49504,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
__pyx_t_3 = __pyx_v_loc1->size;
for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_3; __pyx_v_i++) {
- /* "rulefactory.pxi":726
+ /* "cdec/sa/rulefactory.pxi":726
*
* for i from 1 <= i < loc1.size:
* if loc1.arr[loc1.start+i] > loc2.arr[loc2.start+i]: # <<<<<<<<<<<<<<
@@ -48990,7 +49514,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
__pyx_t_1 = (((__pyx_v_loc1->arr[(__pyx_v_loc1->start + __pyx_v_i)]) > (__pyx_v_loc2->arr[(__pyx_v_loc2->start + __pyx_v_i)])) != 0);
if (__pyx_t_1) {
- /* "rulefactory.pxi":727
+ /* "cdec/sa/rulefactory.pxi":727
* for i from 1 <= i < loc1.size:
* if loc1.arr[loc1.start+i] > loc2.arr[loc2.start+i]:
* return 1 # <<<<<<<<<<<<<<
@@ -49001,7 +49525,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
goto __pyx_L0;
}
- /* "rulefactory.pxi":728
+ /* "cdec/sa/rulefactory.pxi":728
* if loc1.arr[loc1.start+i] > loc2.arr[loc2.start+i]:
* return 1
* if loc1.arr[loc1.start+i] < loc2.arr[loc2.start+i]: # <<<<<<<<<<<<<<
@@ -49011,7 +49535,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
__pyx_t_1 = (((__pyx_v_loc1->arr[(__pyx_v_loc1->start + __pyx_v_i)]) < (__pyx_v_loc2->arr[(__pyx_v_loc2->start + __pyx_v_i)])) != 0);
if (__pyx_t_1) {
- /* "rulefactory.pxi":729
+ /* "cdec/sa/rulefactory.pxi":729
* return 1
* if loc1.arr[loc1.start+i] < loc2.arr[loc2.start+i]:
* return -1 # <<<<<<<<<<<<<<
@@ -49025,7 +49549,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
}
__pyx_L5:;
- /* "rulefactory.pxi":731
+ /* "cdec/sa/rulefactory.pxi":731
* return -1
*
* if loc2.arr[loc2.end-1] + len_last - loc1.arr[loc1.start] > self.train_max_initial_size: # <<<<<<<<<<<<<<
@@ -49035,7 +49559,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
__pyx_t_1 = (((((__pyx_v_loc2->arr[(__pyx_v_loc2->end - 1)]) + __pyx_v_len_last) - (__pyx_v_loc1->arr[__pyx_v_loc1->start])) > __pyx_v_self->train_max_initial_size) != 0);
if (__pyx_t_1) {
- /* "rulefactory.pxi":732
+ /* "cdec/sa/rulefactory.pxi":732
*
* if loc2.arr[loc2.end-1] + len_last - loc1.arr[loc1.start] > self.train_max_initial_size:
* return -1 # <<<<<<<<<<<<<<
@@ -49046,7 +49570,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
goto __pyx_L0;
}
- /* "rulefactory.pxi":733
+ /* "cdec/sa/rulefactory.pxi":733
* if loc2.arr[loc2.end-1] + len_last - loc1.arr[loc1.start] > self.train_max_initial_size:
* return -1
* return 0 # <<<<<<<<<<<<<<
@@ -49056,7 +49580,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
__pyx_r = 0;
goto __pyx_L0;
- /* "rulefactory.pxi":700
+ /* "cdec/sa/rulefactory.pxi":700
*
*
* cdef long compare_matchings(self, Matching* loc1, Matching* loc2, int offset_by_one, int len_last): # <<<<<<<<<<<<<<
@@ -49070,7 +49594,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
return __pyx_r;
}
-/* "rulefactory.pxi":736
+/* "cdec/sa/rulefactory.pxi":736
*
*
* cdef int* merge_helper(self, int low1, int high1, int* arr1, int step1, # <<<<<<<<<<<<<<
@@ -49093,7 +49617,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
int __pyx_t_2;
__Pyx_RefNannySetupContext("merge_helper", 0);
- /* "rulefactory.pxi":744
+ /* "cdec/sa/rulefactory.pxi":744
* cdef Matching loc1, loc2
*
* result_len[0] = 0 # <<<<<<<<<<<<<<
@@ -49102,7 +49626,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
*/
(__pyx_v_result_len[0]) = 0;
- /* "rulefactory.pxi":745
+ /* "cdec/sa/rulefactory.pxi":745
*
* result_len[0] = 0
* result = <int*> malloc(0*sizeof(int)) # <<<<<<<<<<<<<<
@@ -49111,7 +49635,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
*/
__pyx_v_result = ((int *)malloc((0 * (sizeof(int)))));
- /* "rulefactory.pxi":747
+ /* "cdec/sa/rulefactory.pxi":747
* result = <int*> malloc(0*sizeof(int))
*
* i1 = low1 # <<<<<<<<<<<<<<
@@ -49120,7 +49644,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
*/
__pyx_v_i1 = __pyx_v_low1;
- /* "rulefactory.pxi":748
+ /* "cdec/sa/rulefactory.pxi":748
*
* i1 = low1
* i2 = low2 # <<<<<<<<<<<<<<
@@ -49129,7 +49653,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
*/
__pyx_v_i2 = __pyx_v_low2;
- /* "rulefactory.pxi":749
+ /* "cdec/sa/rulefactory.pxi":749
* i1 = low1
* i2 = low2
* while i1 < high1 and i2 < high2: # <<<<<<<<<<<<<<
@@ -49150,7 +49674,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
__pyx_L5_bool_binop_done:;
if (!__pyx_t_1) break;
- /* "rulefactory.pxi":752
+ /* "cdec/sa/rulefactory.pxi":752
*
* # First, pop all unneeded loc2's off the stack
* assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -49159,7 +49683,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
*/
__pyx_f_4cdec_2sa_3_sa_assign_matching((&__pyx_v_loc1), __pyx_v_arr1, __pyx_v_i1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr);
- /* "rulefactory.pxi":753
+ /* "cdec/sa/rulefactory.pxi":753
* # First, pop all unneeded loc2's off the stack
* assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr)
* while i2 < high2: # <<<<<<<<<<<<<<
@@ -49170,7 +49694,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
__pyx_t_1 = ((__pyx_v_i2 < __pyx_v_high2) != 0);
if (!__pyx_t_1) break;
- /* "rulefactory.pxi":754
+ /* "cdec/sa/rulefactory.pxi":754
* assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr)
* while i2 < high2:
* assign_matching(&loc2, arr2, i2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -49179,7 +49703,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
*/
__pyx_f_4cdec_2sa_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_i2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr);
- /* "rulefactory.pxi":755
+ /* "cdec/sa/rulefactory.pxi":755
* while i2 < high2:
* assign_matching(&loc2, arr2, i2, step2, self.fda.sent_id.arr)
* if self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) == 1: # <<<<<<<<<<<<<<
@@ -49189,7 +49713,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
__pyx_t_1 = ((((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last) == 1) != 0);
if (__pyx_t_1) {
- /* "rulefactory.pxi":756
+ /* "cdec/sa/rulefactory.pxi":756
* assign_matching(&loc2, arr2, i2, step2, self.fda.sent_id.arr)
* if self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) == 1:
* i2 = i2 + step2 # <<<<<<<<<<<<<<
@@ -49201,7 +49725,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
}
/*else*/ {
- /* "rulefactory.pxi":758
+ /* "cdec/sa/rulefactory.pxi":758
* i2 = i2 + step2
* else:
* break # <<<<<<<<<<<<<<
@@ -49214,7 +49738,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
}
__pyx_L8_break:;
- /* "rulefactory.pxi":761
+ /* "cdec/sa/rulefactory.pxi":761
*
* # Next: process all loc1's with the same starting val
* j1 = i1 # <<<<<<<<<<<<<<
@@ -49223,7 +49747,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
*/
__pyx_v_j1 = __pyx_v_i1;
- /* "rulefactory.pxi":762
+ /* "cdec/sa/rulefactory.pxi":762
* # Next: process all loc1's with the same starting val
* j1 = i1
* while i1 < high1 and arr1[j1] == arr1[i1]: # <<<<<<<<<<<<<<
@@ -49244,7 +49768,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
__pyx_L12_bool_binop_done:;
if (!__pyx_t_1) break;
- /* "rulefactory.pxi":763
+ /* "cdec/sa/rulefactory.pxi":763
* j1 = i1
* while i1 < high1 and arr1[j1] == arr1[i1]:
* assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -49253,7 +49777,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
*/
__pyx_f_4cdec_2sa_3_sa_assign_matching((&__pyx_v_loc1), __pyx_v_arr1, __pyx_v_i1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr);
- /* "rulefactory.pxi":764
+ /* "cdec/sa/rulefactory.pxi":764
* while i1 < high1 and arr1[j1] == arr1[i1]:
* assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr)
* j2 = i2 # <<<<<<<<<<<<<<
@@ -49262,7 +49786,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
*/
__pyx_v_j2 = __pyx_v_i2;
- /* "rulefactory.pxi":765
+ /* "cdec/sa/rulefactory.pxi":765
* assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr)
* j2 = i2
* while j2 < high2: # <<<<<<<<<<<<<<
@@ -49273,7 +49797,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
__pyx_t_1 = ((__pyx_v_j2 < __pyx_v_high2) != 0);
if (!__pyx_t_1) break;
- /* "rulefactory.pxi":766
+ /* "cdec/sa/rulefactory.pxi":766
* j2 = i2
* while j2 < high2:
* assign_matching(&loc2, arr2, j2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -49282,7 +49806,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
*/
__pyx_f_4cdec_2sa_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_j2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr);
- /* "rulefactory.pxi":767
+ /* "cdec/sa/rulefactory.pxi":767
* while j2 < high2:
* assign_matching(&loc2, arr2, j2, step2, self.fda.sent_id.arr)
* comparison = self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) # <<<<<<<<<<<<<<
@@ -49291,7 +49815,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
*/
__pyx_v_comparison = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last);
- /* "rulefactory.pxi":768
+ /* "cdec/sa/rulefactory.pxi":768
* assign_matching(&loc2, arr2, j2, step2, self.fda.sent_id.arr)
* comparison = self.compare_matchings(&loc1, &loc2, offset_by_one, len_last)
* if comparison == 0: # <<<<<<<<<<<<<<
@@ -49301,7 +49825,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
__pyx_t_1 = ((__pyx_v_comparison == 0) != 0);
if (__pyx_t_1) {
- /* "rulefactory.pxi":769
+ /* "cdec/sa/rulefactory.pxi":769
* comparison = self.compare_matchings(&loc1, &loc2, offset_by_one, len_last)
* if comparison == 0:
* result = append_combined_matching(result, &loc1, &loc2, offset_by_one, num_subpatterns, result_len) # <<<<<<<<<<<<<<
@@ -49313,7 +49837,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
}
__pyx_L16:;
- /* "rulefactory.pxi":770
+ /* "cdec/sa/rulefactory.pxi":770
* if comparison == 0:
* result = append_combined_matching(result, &loc1, &loc2, offset_by_one, num_subpatterns, result_len)
* if comparison == 1: # <<<<<<<<<<<<<<
@@ -49326,7 +49850,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
}
__pyx_L17:;
- /* "rulefactory.pxi":772
+ /* "cdec/sa/rulefactory.pxi":772
* if comparison == 1:
* pass
* if comparison == -1: # <<<<<<<<<<<<<<
@@ -49336,7 +49860,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
__pyx_t_1 = ((__pyx_v_comparison == -1) != 0);
if (__pyx_t_1) {
- /* "rulefactory.pxi":773
+ /* "cdec/sa/rulefactory.pxi":773
* pass
* if comparison == -1:
* break # <<<<<<<<<<<<<<
@@ -49347,7 +49871,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
}
/*else*/ {
- /* "rulefactory.pxi":775
+ /* "cdec/sa/rulefactory.pxi":775
* break
* else:
* j2 = j2 + step2 # <<<<<<<<<<<<<<
@@ -49359,7 +49883,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
}
__pyx_L15_break:;
- /* "rulefactory.pxi":776
+ /* "cdec/sa/rulefactory.pxi":776
* else:
* j2 = j2 + step2
* i1 = i1 + step1 # <<<<<<<<<<<<<<
@@ -49370,7 +49894,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
}
}
- /* "rulefactory.pxi":777
+ /* "cdec/sa/rulefactory.pxi":777
* j2 = j2 + step2
* i1 = i1 + step1
* return result # <<<<<<<<<<<<<<
@@ -49380,7 +49904,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "rulefactory.pxi":736
+ /* "cdec/sa/rulefactory.pxi":736
*
*
* cdef int* merge_helper(self, int low1, int high1, int* arr1, int step1, # <<<<<<<<<<<<<<
@@ -49394,7 +49918,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
return __pyx_r;
}
-/* "rulefactory.pxi":780
+/* "cdec/sa/rulefactory.pxi":780
*
*
* cdef void sort_phrase_loc(self, IntList arr, PhraseLocation loc, Phrase phrase): # <<<<<<<<<<<<<<
@@ -49417,7 +49941,7 @@ static void __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(str
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("sort_phrase_loc", 0);
- /* "rulefactory.pxi":785
+ /* "cdec/sa/rulefactory.pxi":785
* cdef IntList result
*
* if phrase in self.precomputed_index: # <<<<<<<<<<<<<<
@@ -49428,7 +49952,7 @@ static void __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(str
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "rulefactory.pxi":786
+ /* "cdec/sa/rulefactory.pxi":786
*
* if phrase in self.precomputed_index:
* loc.arr = self.precomputed_index[phrase] # <<<<<<<<<<<<<<
@@ -49447,7 +49971,7 @@ static void __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(str
}
/*else*/ {
- /* "rulefactory.pxi":788
+ /* "cdec/sa/rulefactory.pxi":788
* loc.arr = self.precomputed_index[phrase]
* else:
* loc.arr = IntList(initial_len=loc.sa_high-loc.sa_low) # <<<<<<<<<<<<<<
@@ -49469,7 +49993,7 @@ static void __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(str
__pyx_v_loc->arr = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_4);
__pyx_t_4 = 0;
- /* "rulefactory.pxi":789
+ /* "cdec/sa/rulefactory.pxi":789
* else:
* loc.arr = IntList(initial_len=loc.sa_high-loc.sa_low)
* veb = VEB(arr.len) # <<<<<<<<<<<<<<
@@ -49489,7 +50013,7 @@ static void __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(str
__pyx_v_veb = ((struct __pyx_obj_4cdec_2sa_3_sa_VEB *)__pyx_t_4);
__pyx_t_4 = 0;
- /* "rulefactory.pxi":790
+ /* "cdec/sa/rulefactory.pxi":790
* loc.arr = IntList(initial_len=loc.sa_high-loc.sa_low)
* veb = VEB(arr.len)
* for i from loc.sa_low <= i < loc.sa_high: # <<<<<<<<<<<<<<
@@ -49499,7 +50023,7 @@ static void __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(str
__pyx_t_5 = __pyx_v_loc->sa_high;
for (__pyx_v_i = __pyx_v_loc->sa_low; __pyx_v_i < __pyx_t_5; __pyx_v_i++) {
- /* "rulefactory.pxi":791
+ /* "cdec/sa/rulefactory.pxi":791
* veb = VEB(arr.len)
* for i from loc.sa_low <= i < loc.sa_high:
* veb._insert(arr.arr[i]) # <<<<<<<<<<<<<<
@@ -49509,7 +50033,7 @@ static void __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(str
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_VEB *)__pyx_v_veb->__pyx_vtab)->_insert(__pyx_v_veb, (__pyx_v_arr->arr[__pyx_v_i]));
}
- /* "rulefactory.pxi":792
+ /* "cdec/sa/rulefactory.pxi":792
* for i from loc.sa_low <= i < loc.sa_high:
* veb._insert(arr.arr[i])
* i = veb.veb.min_val # <<<<<<<<<<<<<<
@@ -49519,7 +50043,7 @@ static void __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(str
__pyx_t_5 = __pyx_v_veb->veb->min_val;
__pyx_v_i = __pyx_t_5;
- /* "rulefactory.pxi":793
+ /* "cdec/sa/rulefactory.pxi":793
* veb._insert(arr.arr[i])
* i = veb.veb.min_val
* for j from 0 <= j < loc.sa_high-loc.sa_low: # <<<<<<<<<<<<<<
@@ -49529,7 +50053,7 @@ static void __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(str
__pyx_t_5 = (__pyx_v_loc->sa_high - __pyx_v_loc->sa_low);
for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) {
- /* "rulefactory.pxi":794
+ /* "cdec/sa/rulefactory.pxi":794
* i = veb.veb.min_val
* for j from 0 <= j < loc.sa_high-loc.sa_low:
* loc.arr.arr[j] = i # <<<<<<<<<<<<<<
@@ -49538,7 +50062,7 @@ static void __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(str
*/
(__pyx_v_loc->arr->arr[__pyx_v_j]) = __pyx_v_i;
- /* "rulefactory.pxi":795
+ /* "cdec/sa/rulefactory.pxi":795
* for j from 0 <= j < loc.sa_high-loc.sa_low:
* loc.arr.arr[j] = i
* i = veb._findsucc(i) # <<<<<<<<<<<<<<
@@ -49550,7 +50074,7 @@ static void __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(str
}
__pyx_L3:;
- /* "rulefactory.pxi":796
+ /* "cdec/sa/rulefactory.pxi":796
* loc.arr.arr[j] = i
* i = veb._findsucc(i)
* loc.arr_low = 0 # <<<<<<<<<<<<<<
@@ -49559,7 +50083,7 @@ static void __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(str
*/
__pyx_v_loc->arr_low = 0;
- /* "rulefactory.pxi":797
+ /* "cdec/sa/rulefactory.pxi":797
* i = veb._findsucc(i)
* loc.arr_low = 0
* loc.arr_high = loc.arr.len # <<<<<<<<<<<<<<
@@ -49569,7 +50093,7 @@ static void __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(str
__pyx_t_5 = __pyx_v_loc->arr->len;
__pyx_v_loc->arr_high = __pyx_t_5;
- /* "rulefactory.pxi":780
+ /* "cdec/sa/rulefactory.pxi":780
*
*
* cdef void sort_phrase_loc(self, IntList arr, PhraseLocation loc, Phrase phrase): # <<<<<<<<<<<<<<
@@ -49588,7 +50112,7 @@ static void __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(str
__Pyx_RefNannyFinishContext();
}
-/* "rulefactory.pxi":800
+/* "cdec/sa/rulefactory.pxi":800
*
*
* cdef intersect_helper(self, Phrase prefix, Phrase suffix, # <<<<<<<<<<<<<<
@@ -49627,7 +50151,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("intersect_helper", 0);
- /* "rulefactory.pxi":807
+ /* "cdec/sa/rulefactory.pxi":807
* cdef int* result_ptr
*
* result_len = 0 # <<<<<<<<<<<<<<
@@ -49636,7 +50160,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
*/
__pyx_v_result_len = 0;
- /* "rulefactory.pxi":809
+ /* "cdec/sa/rulefactory.pxi":809
* result_len = 0
*
* if sym_isvar(suffix[0]): # <<<<<<<<<<<<<<
@@ -49650,7 +50174,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
__pyx_t_3 = (__pyx_f_4cdec_2sa_3_sa_sym_isvar(__pyx_t_2) != 0);
if (__pyx_t_3) {
- /* "rulefactory.pxi":810
+ /* "cdec/sa/rulefactory.pxi":810
*
* if sym_isvar(suffix[0]):
* offset_by_one = 1 # <<<<<<<<<<<<<<
@@ -49662,7 +50186,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
}
/*else*/ {
- /* "rulefactory.pxi":812
+ /* "cdec/sa/rulefactory.pxi":812
* offset_by_one = 1
* else:
* offset_by_one = 0 # <<<<<<<<<<<<<<
@@ -49673,7 +50197,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
}
__pyx_L3:;
- /* "rulefactory.pxi":814
+ /* "cdec/sa/rulefactory.pxi":814
* offset_by_one = 0
*
* len_last = len(suffix.getchunk(suffix.arity())) # <<<<<<<<<<<<<<
@@ -49732,7 +50256,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_len_last = __pyx_t_8;
- /* "rulefactory.pxi":816
+ /* "cdec/sa/rulefactory.pxi":816
* len_last = len(suffix.getchunk(suffix.arity()))
*
* if prefix_loc.arr is None: # <<<<<<<<<<<<<<
@@ -49743,7 +50267,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
__pyx_t_9 = (__pyx_t_3 != 0);
if (__pyx_t_9) {
- /* "rulefactory.pxi":817
+ /* "cdec/sa/rulefactory.pxi":817
*
* if prefix_loc.arr is None:
* self.sort_phrase_loc(self.fsa.sa, prefix_loc, prefix) # <<<<<<<<<<<<<<
@@ -49758,7 +50282,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
}
__pyx_L4:;
- /* "rulefactory.pxi":818
+ /* "cdec/sa/rulefactory.pxi":818
* if prefix_loc.arr is None:
* self.sort_phrase_loc(self.fsa.sa, prefix_loc, prefix)
* arr1 = prefix_loc.arr # <<<<<<<<<<<<<<
@@ -49770,7 +50294,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
__pyx_v_arr1 = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "rulefactory.pxi":819
+ /* "cdec/sa/rulefactory.pxi":819
* self.sort_phrase_loc(self.fsa.sa, prefix_loc, prefix)
* arr1 = prefix_loc.arr
* low1 = prefix_loc.arr_low # <<<<<<<<<<<<<<
@@ -49780,7 +50304,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
__pyx_t_2 = __pyx_v_prefix_loc->arr_low;
__pyx_v_low1 = __pyx_t_2;
- /* "rulefactory.pxi":820
+ /* "cdec/sa/rulefactory.pxi":820
* arr1 = prefix_loc.arr
* low1 = prefix_loc.arr_low
* high1 = prefix_loc.arr_high # <<<<<<<<<<<<<<
@@ -49790,7 +50314,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
__pyx_t_2 = __pyx_v_prefix_loc->arr_high;
__pyx_v_high1 = __pyx_t_2;
- /* "rulefactory.pxi":821
+ /* "cdec/sa/rulefactory.pxi":821
* low1 = prefix_loc.arr_low
* high1 = prefix_loc.arr_high
* step1 = prefix_loc.num_subpatterns # <<<<<<<<<<<<<<
@@ -49800,7 +50324,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
__pyx_t_2 = __pyx_v_prefix_loc->num_subpatterns;
__pyx_v_step1 = __pyx_t_2;
- /* "rulefactory.pxi":823
+ /* "cdec/sa/rulefactory.pxi":823
* step1 = prefix_loc.num_subpatterns
*
* if suffix_loc.arr is None: # <<<<<<<<<<<<<<
@@ -49811,7 +50335,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
__pyx_t_3 = (__pyx_t_9 != 0);
if (__pyx_t_3) {
- /* "rulefactory.pxi":824
+ /* "cdec/sa/rulefactory.pxi":824
*
* if suffix_loc.arr is None:
* self.sort_phrase_loc(self.fsa.sa, suffix_loc, suffix) # <<<<<<<<<<<<<<
@@ -49826,7 +50350,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
}
__pyx_L5:;
- /* "rulefactory.pxi":825
+ /* "cdec/sa/rulefactory.pxi":825
* if suffix_loc.arr is None:
* self.sort_phrase_loc(self.fsa.sa, suffix_loc, suffix)
* arr2 = suffix_loc.arr # <<<<<<<<<<<<<<
@@ -49838,7 +50362,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
__pyx_v_arr2 = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "rulefactory.pxi":826
+ /* "cdec/sa/rulefactory.pxi":826
* self.sort_phrase_loc(self.fsa.sa, suffix_loc, suffix)
* arr2 = suffix_loc.arr
* low2 = suffix_loc.arr_low # <<<<<<<<<<<<<<
@@ -49848,7 +50372,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
__pyx_t_2 = __pyx_v_suffix_loc->arr_low;
__pyx_v_low2 = __pyx_t_2;
- /* "rulefactory.pxi":827
+ /* "cdec/sa/rulefactory.pxi":827
* arr2 = suffix_loc.arr
* low2 = suffix_loc.arr_low
* high2 = suffix_loc.arr_high # <<<<<<<<<<<<<<
@@ -49858,7 +50382,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
__pyx_t_2 = __pyx_v_suffix_loc->arr_high;
__pyx_v_high2 = __pyx_t_2;
- /* "rulefactory.pxi":828
+ /* "cdec/sa/rulefactory.pxi":828
* low2 = suffix_loc.arr_low
* high2 = suffix_loc.arr_high
* step2 = suffix_loc.num_subpatterns # <<<<<<<<<<<<<<
@@ -49868,7 +50392,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
__pyx_t_2 = __pyx_v_suffix_loc->num_subpatterns;
__pyx_v_step2 = __pyx_t_2;
- /* "rulefactory.pxi":830
+ /* "cdec/sa/rulefactory.pxi":830
* step2 = suffix_loc.num_subpatterns
*
* num_subpatterns = prefix.arity()+1 # <<<<<<<<<<<<<<
@@ -49902,7 +50426,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_num_subpatterns = __pyx_t_2;
- /* "rulefactory.pxi":832
+ /* "cdec/sa/rulefactory.pxi":832
* num_subpatterns = prefix.arity()+1
*
* if algorithm == MERGE: # <<<<<<<<<<<<<<
@@ -49912,7 +50436,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
__pyx_t_3 = ((__pyx_v_algorithm == __pyx_v_4cdec_2sa_3_sa_MERGE) != 0);
if (__pyx_t_3) {
- /* "rulefactory.pxi":833
+ /* "cdec/sa/rulefactory.pxi":833
*
* if algorithm == MERGE:
* result_ptr = self.merge_helper(low1, high1, arr1.arr, step1, # <<<<<<<<<<<<<<
@@ -49924,7 +50448,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
}
/*else*/ {
- /* "rulefactory.pxi":837
+ /* "cdec/sa/rulefactory.pxi":837
* offset_by_one, len_last, num_subpatterns, &result_len)
* else:
* result_ptr = self.baeza_yates_helper(low1, high1, arr1.arr, step1, # <<<<<<<<<<<<<<
@@ -49935,7 +50459,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
}
__pyx_L6:;
- /* "rulefactory.pxi":841
+ /* "cdec/sa/rulefactory.pxi":841
* offset_by_one, len_last, num_subpatterns, &result_len)
*
* if result_len == 0: # <<<<<<<<<<<<<<
@@ -49945,7 +50469,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
__pyx_t_3 = ((__pyx_v_result_len == 0) != 0);
if (__pyx_t_3) {
- /* "rulefactory.pxi":842
+ /* "cdec/sa/rulefactory.pxi":842
*
* if result_len == 0:
* free(result_ptr) # <<<<<<<<<<<<<<
@@ -49954,7 +50478,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
*/
free(__pyx_v_result_ptr);
- /* "rulefactory.pxi":843
+ /* "cdec/sa/rulefactory.pxi":843
* if result_len == 0:
* free(result_ptr)
* return None # <<<<<<<<<<<<<<
@@ -49968,7 +50492,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
}
/*else*/ {
- /* "rulefactory.pxi":845
+ /* "cdec/sa/rulefactory.pxi":845
* return None
* else:
* result = IntList() # <<<<<<<<<<<<<<
@@ -49980,7 +50504,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
__pyx_v_result = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_4);
__pyx_t_4 = 0;
- /* "rulefactory.pxi":846
+ /* "cdec/sa/rulefactory.pxi":846
* else:
* result = IntList()
* free(result.arr) # <<<<<<<<<<<<<<
@@ -49989,7 +50513,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
*/
free(__pyx_v_result->arr);
- /* "rulefactory.pxi":847
+ /* "cdec/sa/rulefactory.pxi":847
* result = IntList()
* free(result.arr)
* result.arr = result_ptr # <<<<<<<<<<<<<<
@@ -49998,7 +50522,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
*/
__pyx_v_result->arr = __pyx_v_result_ptr;
- /* "rulefactory.pxi":848
+ /* "cdec/sa/rulefactory.pxi":848
* free(result.arr)
* result.arr = result_ptr
* result.len = result_len # <<<<<<<<<<<<<<
@@ -50007,7 +50531,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
*/
__pyx_v_result->len = __pyx_v_result_len;
- /* "rulefactory.pxi":849
+ /* "cdec/sa/rulefactory.pxi":849
* result.arr = result_ptr
* result.len = result_len
* result.size = result_len # <<<<<<<<<<<<<<
@@ -50016,7 +50540,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
*/
__pyx_v_result->size = __pyx_v_result_len;
- /* "rulefactory.pxi":850
+ /* "cdec/sa/rulefactory.pxi":850
* result.len = result_len
* result.size = result_len
* return PhraseLocation(arr_low=0, arr_high=result_len, arr=result, num_subpatterns=num_subpatterns) # <<<<<<<<<<<<<<
@@ -50044,7 +50568,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
goto __pyx_L0;
}
- /* "rulefactory.pxi":800
+ /* "cdec/sa/rulefactory.pxi":800
*
*
* cdef intersect_helper(self, Phrase prefix, Phrase suffix, # <<<<<<<<<<<<<<
@@ -50070,7 +50594,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
return __pyx_r;
}
-/* "rulefactory.pxi":852
+/* "cdec/sa/rulefactory.pxi":852
* return PhraseLocation(arr_low=0, arr_high=result_len, arr=result, num_subpatterns=num_subpatterns)
*
* cdef loc2str(self, PhraseLocation loc): # <<<<<<<<<<<<<<
@@ -50093,7 +50617,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("loc2str", 0);
- /* "rulefactory.pxi":854
+ /* "cdec/sa/rulefactory.pxi":854
* cdef loc2str(self, PhraseLocation loc):
* cdef int i, j
* result = "{" # <<<<<<<<<<<<<<
@@ -50103,7 +50627,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON
__Pyx_INCREF(__pyx_kp_s__63);
__pyx_v_result = __pyx_kp_s__63;
- /* "rulefactory.pxi":855
+ /* "cdec/sa/rulefactory.pxi":855
* cdef int i, j
* result = "{"
* i = 0 # <<<<<<<<<<<<<<
@@ -50112,7 +50636,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON
*/
__pyx_v_i = 0;
- /* "rulefactory.pxi":856
+ /* "cdec/sa/rulefactory.pxi":856
* result = "{"
* i = 0
* while i < loc.arr_high: # <<<<<<<<<<<<<<
@@ -50123,7 +50647,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON
__pyx_t_1 = ((__pyx_v_i < __pyx_v_loc->arr_high) != 0);
if (!__pyx_t_1) break;
- /* "rulefactory.pxi":857
+ /* "cdec/sa/rulefactory.pxi":857
* i = 0
* while i < loc.arr_high:
* result = result + "(" # <<<<<<<<<<<<<<
@@ -50135,7 +50659,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON
__Pyx_DECREF_SET(__pyx_v_result, __pyx_t_2);
__pyx_t_2 = 0;
- /* "rulefactory.pxi":858
+ /* "cdec/sa/rulefactory.pxi":858
* while i < loc.arr_high:
* result = result + "("
* for j from i <= j < i + loc.num_subpatterns: # <<<<<<<<<<<<<<
@@ -50145,7 +50669,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON
__pyx_t_3 = (__pyx_v_i + __pyx_v_loc->num_subpatterns);
for (__pyx_v_j = __pyx_v_i; __pyx_v_j < __pyx_t_3; __pyx_v_j++) {
- /* "rulefactory.pxi":859
+ /* "cdec/sa/rulefactory.pxi":859
* result = result + "("
* for j from i <= j < i + loc.num_subpatterns:
* result = result + ("%d " %loc.arr[j]) # <<<<<<<<<<<<<<
@@ -50164,7 +50688,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON
__pyx_t_2 = 0;
}
- /* "rulefactory.pxi":860
+ /* "cdec/sa/rulefactory.pxi":860
* for j from i <= j < i + loc.num_subpatterns:
* result = result + ("%d " %loc.arr[j])
* result = result + ")" # <<<<<<<<<<<<<<
@@ -50176,7 +50700,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON
__Pyx_DECREF_SET(__pyx_v_result, __pyx_t_2);
__pyx_t_2 = 0;
- /* "rulefactory.pxi":861
+ /* "cdec/sa/rulefactory.pxi":861
* result = result + ("%d " %loc.arr[j])
* result = result + ")"
* i = i + loc.num_subpatterns # <<<<<<<<<<<<<<
@@ -50186,7 +50710,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON
__pyx_v_i = (__pyx_v_i + __pyx_v_loc->num_subpatterns);
}
- /* "rulefactory.pxi":862
+ /* "cdec/sa/rulefactory.pxi":862
* result = result + ")"
* i = i + loc.num_subpatterns
* result = result + "}" # <<<<<<<<<<<<<<
@@ -50198,7 +50722,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON
__Pyx_DECREF_SET(__pyx_v_result, __pyx_t_2);
__pyx_t_2 = 0;
- /* "rulefactory.pxi":863
+ /* "cdec/sa/rulefactory.pxi":863
* i = i + loc.num_subpatterns
* result = result + "}"
* return result # <<<<<<<<<<<<<<
@@ -50210,7 +50734,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "rulefactory.pxi":852
+ /* "cdec/sa/rulefactory.pxi":852
* return PhraseLocation(arr_low=0, arr_high=result_len, arr=result, num_subpatterns=num_subpatterns)
*
* cdef loc2str(self, PhraseLocation loc): # <<<<<<<<<<<<<<
@@ -50231,7 +50755,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON
return __pyx_r;
}
-/* "rulefactory.pxi":865
+/* "cdec/sa/rulefactory.pxi":865
* return result
*
* cdef PhraseLocation intersect(self, prefix_node, suffix_node, Phrase phrase): # <<<<<<<<<<<<<<
@@ -50259,7 +50783,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *__pyx_f_4cdec_2sa_3_sa_23
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("intersect", 0);
- /* "rulefactory.pxi":869
+ /* "cdec/sa/rulefactory.pxi":869
* cdef PhraseLocation prefix_loc, suffix_loc, result
*
* prefix = prefix_node.phrase # <<<<<<<<<<<<<<
@@ -50272,7 +50796,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *__pyx_f_4cdec_2sa_3_sa_23
__pyx_v_prefix = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "rulefactory.pxi":870
+ /* "cdec/sa/rulefactory.pxi":870
*
* prefix = prefix_node.phrase
* suffix = suffix_node.phrase # <<<<<<<<<<<<<<
@@ -50285,7 +50809,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *__pyx_f_4cdec_2sa_3_sa_23
__pyx_v_suffix = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "rulefactory.pxi":871
+ /* "cdec/sa/rulefactory.pxi":871
* prefix = prefix_node.phrase
* suffix = suffix_node.phrase
* prefix_loc = prefix_node.phrase_location # <<<<<<<<<<<<<<
@@ -50298,7 +50822,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *__pyx_f_4cdec_2sa_3_sa_23
__pyx_v_prefix_loc = ((struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "rulefactory.pxi":872
+ /* "cdec/sa/rulefactory.pxi":872
* suffix = suffix_node.phrase
* prefix_loc = prefix_node.phrase_location
* suffix_loc = suffix_node.phrase_location # <<<<<<<<<<<<<<
@@ -50311,7 +50835,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *__pyx_f_4cdec_2sa_3_sa_23
__pyx_v_suffix_loc = ((struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "rulefactory.pxi":874
+ /* "cdec/sa/rulefactory.pxi":874
* suffix_loc = suffix_node.phrase_location
*
* result = self.get_precomputed_collocation(phrase) # <<<<<<<<<<<<<<
@@ -50349,7 +50873,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *__pyx_f_4cdec_2sa_3_sa_23
__pyx_v_result = ((struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "rulefactory.pxi":875
+ /* "cdec/sa/rulefactory.pxi":875
*
* result = self.get_precomputed_collocation(phrase)
* if result is not None: # <<<<<<<<<<<<<<
@@ -50360,7 +50884,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *__pyx_f_4cdec_2sa_3_sa_23
__pyx_t_6 = (__pyx_t_5 != 0);
if (__pyx_t_6) {
- /* "rulefactory.pxi":876
+ /* "cdec/sa/rulefactory.pxi":876
* result = self.get_precomputed_collocation(phrase)
* if result is not None:
* intersect_method = "precomputed" # <<<<<<<<<<<<<<
@@ -50373,7 +50897,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *__pyx_f_4cdec_2sa_3_sa_23
}
__pyx_L3:;
- /* "rulefactory.pxi":878
+ /* "cdec/sa/rulefactory.pxi":878
* intersect_method = "precomputed"
*
* if result is None: # <<<<<<<<<<<<<<
@@ -50384,7 +50908,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *__pyx_f_4cdec_2sa_3_sa_23
__pyx_t_5 = (__pyx_t_6 != 0);
if (__pyx_t_5) {
- /* "rulefactory.pxi":879
+ /* "cdec/sa/rulefactory.pxi":879
*
* if result is None:
* if self.use_baeza_yates: # <<<<<<<<<<<<<<
@@ -50394,7 +50918,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *__pyx_f_4cdec_2sa_3_sa_23
__pyx_t_5 = (__pyx_v_self->use_baeza_yates != 0);
if (__pyx_t_5) {
- /* "rulefactory.pxi":880
+ /* "cdec/sa/rulefactory.pxi":880
* if result is None:
* if self.use_baeza_yates:
* result = self.intersect_helper(prefix, suffix, prefix_loc, suffix_loc, BAEZA_YATES) # <<<<<<<<<<<<<<
@@ -50407,7 +50931,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *__pyx_f_4cdec_2sa_3_sa_23
__Pyx_DECREF_SET(__pyx_v_result, ((struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *)__pyx_t_1));
__pyx_t_1 = 0;
- /* "rulefactory.pxi":881
+ /* "cdec/sa/rulefactory.pxi":881
* if self.use_baeza_yates:
* result = self.intersect_helper(prefix, suffix, prefix_loc, suffix_loc, BAEZA_YATES)
* intersect_method="double binary" # <<<<<<<<<<<<<<
@@ -50420,7 +50944,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *__pyx_f_4cdec_2sa_3_sa_23
}
/*else*/ {
- /* "rulefactory.pxi":883
+ /* "cdec/sa/rulefactory.pxi":883
* intersect_method="double binary"
* else:
* result = self.intersect_helper(prefix, suffix, prefix_loc, suffix_loc, MERGE) # <<<<<<<<<<<<<<
@@ -50433,7 +50957,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *__pyx_f_4cdec_2sa_3_sa_23
__Pyx_DECREF_SET(__pyx_v_result, ((struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *)__pyx_t_1));
__pyx_t_1 = 0;
- /* "rulefactory.pxi":884
+ /* "cdec/sa/rulefactory.pxi":884
* else:
* result = self.intersect_helper(prefix, suffix, prefix_loc, suffix_loc, MERGE)
* intersect_method="merge" # <<<<<<<<<<<<<<
@@ -50448,7 +50972,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *__pyx_f_4cdec_2sa_3_sa_23
}
__pyx_L4:;
- /* "rulefactory.pxi":885
+ /* "cdec/sa/rulefactory.pxi":885
* result = self.intersect_helper(prefix, suffix, prefix_loc, suffix_loc, MERGE)
* intersect_method="merge"
* return result # <<<<<<<<<<<<<<
@@ -50460,7 +50984,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *__pyx_f_4cdec_2sa_3_sa_23
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "rulefactory.pxi":865
+ /* "cdec/sa/rulefactory.pxi":865
* return result
*
* cdef PhraseLocation intersect(self, prefix_node, suffix_node, Phrase phrase): # <<<<<<<<<<<<<<
@@ -50488,7 +51012,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *__pyx_f_4cdec_2sa_3_sa_23
return __pyx_r;
}
-/* "rulefactory.pxi":887
+/* "cdec/sa/rulefactory.pxi":887
* return result
*
* def advance(self, frontier, res, fwords): # <<<<<<<<<<<<<<
@@ -50598,7 +51122,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("advance", 0);
- /* "rulefactory.pxi":889
+ /* "cdec/sa/rulefactory.pxi":889
* def advance(self, frontier, res, fwords):
* cdef unsigned na
* nf = [] # <<<<<<<<<<<<<<
@@ -50610,7 +51134,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str
__pyx_v_nf = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "rulefactory.pxi":890
+ /* "cdec/sa/rulefactory.pxi":890
* cdef unsigned na
* nf = []
* for toskip, (i, alt, pathlen) in frontier: # <<<<<<<<<<<<<<
@@ -50770,7 +51294,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str
__Pyx_XDECREF_SET(__pyx_v_pathlen, __pyx_t_10);
__pyx_t_10 = 0;
- /* "rulefactory.pxi":891
+ /* "cdec/sa/rulefactory.pxi":891
* nf = []
* for toskip, (i, alt, pathlen) in frontier:
* spanlen = fwords[i][alt][2] # <<<<<<<<<<<<<<
@@ -50788,7 +51312,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str
__Pyx_XDECREF_SET(__pyx_v_spanlen, __pyx_t_4);
__pyx_t_4 = 0;
- /* "rulefactory.pxi":892
+ /* "cdec/sa/rulefactory.pxi":892
* for toskip, (i, alt, pathlen) in frontier:
* spanlen = fwords[i][alt][2]
* if toskip == 0: # <<<<<<<<<<<<<<
@@ -50800,7 +51324,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_12) {
- /* "rulefactory.pxi":893
+ /* "cdec/sa/rulefactory.pxi":893
* spanlen = fwords[i][alt][2]
* if toskip == 0:
* res.append((i, alt, pathlen)) # <<<<<<<<<<<<<<
@@ -50824,7 +51348,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str
}
__pyx_L9:;
- /* "rulefactory.pxi":894
+ /* "cdec/sa/rulefactory.pxi":894
* if toskip == 0:
* res.append((i, alt, pathlen))
* ni = i + spanlen # <<<<<<<<<<<<<<
@@ -50836,7 +51360,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str
__Pyx_XDECREF_SET(__pyx_v_ni, __pyx_t_4);
__pyx_t_4 = 0;
- /* "rulefactory.pxi":895
+ /* "cdec/sa/rulefactory.pxi":895
* res.append((i, alt, pathlen))
* ni = i + spanlen
* if ni < len(fwords) and pathlen + 1 < self.max_initial_size: # <<<<<<<<<<<<<<
@@ -50870,7 +51394,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str
__pyx_L11_bool_binop_done:;
if (__pyx_t_12) {
- /* "rulefactory.pxi":896
+ /* "cdec/sa/rulefactory.pxi":896
* ni = i + spanlen
* if ni < len(fwords) and pathlen + 1 < self.max_initial_size:
* for na in range(len(fwords[ni])): # <<<<<<<<<<<<<<
@@ -50884,7 +51408,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str
for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_14; __pyx_t_16+=1) {
__pyx_v_na = __pyx_t_16;
- /* "rulefactory.pxi":897
+ /* "cdec/sa/rulefactory.pxi":897
* if ni < len(fwords) and pathlen + 1 < self.max_initial_size:
* for na in range(len(fwords[ni])):
* nf.append((toskip - 1, (ni, na, pathlen + 1))) # <<<<<<<<<<<<<<
@@ -50923,7 +51447,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str
}
__pyx_L10:;
- /* "rulefactory.pxi":890
+ /* "cdec/sa/rulefactory.pxi":890
* cdef unsigned na
* nf = []
* for toskip, (i, alt, pathlen) in frontier: # <<<<<<<<<<<<<<
@@ -50933,7 +51457,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "rulefactory.pxi":898
+ /* "cdec/sa/rulefactory.pxi":898
* for na in range(len(fwords[ni])):
* nf.append((toskip - 1, (ni, na, pathlen + 1)))
* if len(nf) > 0: # <<<<<<<<<<<<<<
@@ -50944,7 +51468,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str
__pyx_t_12 = ((__pyx_t_2 > 0) != 0);
if (__pyx_t_12) {
- /* "rulefactory.pxi":899
+ /* "cdec/sa/rulefactory.pxi":899
* nf.append((toskip - 1, (ni, na, pathlen + 1)))
* if len(nf) > 0:
* return self.advance(nf, res, fwords) # <<<<<<<<<<<<<<
@@ -50990,7 +51514,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str
}
/*else*/ {
- /* "rulefactory.pxi":901
+ /* "cdec/sa/rulefactory.pxi":901
* return self.advance(nf, res, fwords)
* else:
* return res # <<<<<<<<<<<<<<
@@ -51003,7 +51527,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str
goto __pyx_L0;
}
- /* "rulefactory.pxi":887
+ /* "cdec/sa/rulefactory.pxi":887
* return result
*
* def advance(self, frontier, res, fwords): # <<<<<<<<<<<<<<
@@ -51036,7 +51560,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str
return __pyx_r;
}
-/* "rulefactory.pxi":903
+/* "cdec/sa/rulefactory.pxi":903
* return res
*
* def get_all_nodes_isteps_away(self, skip, i, spanlen, pathlen, fwords, next_states, reachable_buffer): # <<<<<<<<<<<<<<
@@ -51181,7 +51705,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("get_all_nodes_isteps_away", 0);
- /* "rulefactory.pxi":905
+ /* "cdec/sa/rulefactory.pxi":905
* def get_all_nodes_isteps_away(self, skip, i, spanlen, pathlen, fwords, next_states, reachable_buffer):
* cdef unsigned alt_it
* frontier = [] # <<<<<<<<<<<<<<
@@ -51193,7 +51717,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod
__pyx_v_frontier = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "rulefactory.pxi":906
+ /* "cdec/sa/rulefactory.pxi":906
* cdef unsigned alt_it
* frontier = []
* if i+spanlen+skip >= len(next_states): # <<<<<<<<<<<<<<
@@ -51215,7 +51739,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_5) {
- /* "rulefactory.pxi":907
+ /* "cdec/sa/rulefactory.pxi":907
* frontier = []
* if i+spanlen+skip >= len(next_states):
* return frontier # <<<<<<<<<<<<<<
@@ -51228,7 +51752,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod
goto __pyx_L0;
}
- /* "rulefactory.pxi":908
+ /* "cdec/sa/rulefactory.pxi":908
* if i+spanlen+skip >= len(next_states):
* return frontier
* key = tuple([i,spanlen]) # <<<<<<<<<<<<<<
@@ -51249,7 +51773,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod
__pyx_v_key = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "rulefactory.pxi":909
+ /* "cdec/sa/rulefactory.pxi":909
* return frontier
* key = tuple([i,spanlen])
* reachable = [] # <<<<<<<<<<<<<<
@@ -51261,7 +51785,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod
__pyx_v_reachable = __pyx_t_1;
__pyx_t_1 = 0;
- /* "rulefactory.pxi":910
+ /* "cdec/sa/rulefactory.pxi":910
* key = tuple([i,spanlen])
* reachable = []
* if key in reachable_buffer: # <<<<<<<<<<<<<<
@@ -51272,7 +51796,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod
__pyx_t_6 = (__pyx_t_5 != 0);
if (__pyx_t_6) {
- /* "rulefactory.pxi":911
+ /* "cdec/sa/rulefactory.pxi":911
* reachable = []
* if key in reachable_buffer:
* reachable = reachable_buffer[key] # <<<<<<<<<<<<<<
@@ -51287,7 +51811,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod
}
/*else*/ {
- /* "rulefactory.pxi":913
+ /* "cdec/sa/rulefactory.pxi":913
* reachable = reachable_buffer[key]
* else:
* reachable = self.reachable(fwords, i, spanlen) # <<<<<<<<<<<<<<
@@ -51329,7 +51853,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod
__Pyx_DECREF_SET(__pyx_v_reachable, __pyx_t_1);
__pyx_t_1 = 0;
- /* "rulefactory.pxi":914
+ /* "cdec/sa/rulefactory.pxi":914
* else:
* reachable = self.reachable(fwords, i, spanlen)
* reachable_buffer[key] = reachable # <<<<<<<<<<<<<<
@@ -51340,7 +51864,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod
}
__pyx_L4:;
- /* "rulefactory.pxi":915
+ /* "cdec/sa/rulefactory.pxi":915
* reachable = self.reachable(fwords, i, spanlen)
* reachable_buffer[key] = reachable
* for nextreachable in reachable: # <<<<<<<<<<<<<<
@@ -51387,7 +51911,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod
__Pyx_XDECREF_SET(__pyx_v_nextreachable, __pyx_t_4);
__pyx_t_4 = 0;
- /* "rulefactory.pxi":916
+ /* "cdec/sa/rulefactory.pxi":916
* reachable_buffer[key] = reachable
* for nextreachable in reachable:
* for next_id in next_states[nextreachable]: # <<<<<<<<<<<<<<
@@ -51437,7 +51961,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod
__Pyx_XDECREF_SET(__pyx_v_next_id, __pyx_t_4);
__pyx_t_4 = 0;
- /* "rulefactory.pxi":917
+ /* "cdec/sa/rulefactory.pxi":917
* for nextreachable in reachable:
* for next_id in next_states[nextreachable]:
* jump = self.shortest(fwords,i,next_id) # <<<<<<<<<<<<<<
@@ -51479,7 +52003,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod
__Pyx_XDECREF_SET(__pyx_v_jump, __pyx_t_4);
__pyx_t_4 = 0;
- /* "rulefactory.pxi":918
+ /* "cdec/sa/rulefactory.pxi":918
* for next_id in next_states[nextreachable]:
* jump = self.shortest(fwords,i,next_id)
* if jump < skip: # <<<<<<<<<<<<<<
@@ -51491,7 +52015,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_6) {
- /* "rulefactory.pxi":919
+ /* "cdec/sa/rulefactory.pxi":919
* jump = self.shortest(fwords,i,next_id)
* if jump < skip:
* continue # <<<<<<<<<<<<<<
@@ -51501,7 +52025,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod
goto __pyx_L7_continue;
}
- /* "rulefactory.pxi":920
+ /* "cdec/sa/rulefactory.pxi":920
* if jump < skip:
* continue
* if pathlen+jump <= self.max_initial_size: # <<<<<<<<<<<<<<
@@ -51519,7 +52043,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
if (__pyx_t_6) {
- /* "rulefactory.pxi":921
+ /* "cdec/sa/rulefactory.pxi":921
* continue
* if pathlen+jump <= self.max_initial_size:
* for alt_id in range(len(fwords[next_id])): # <<<<<<<<<<<<<<
@@ -51533,7 +52057,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod
for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_12; __pyx_t_14+=1) {
__pyx_v_alt_id = __pyx_t_14;
- /* "rulefactory.pxi":922
+ /* "cdec/sa/rulefactory.pxi":922
* if pathlen+jump <= self.max_initial_size:
* for alt_id in range(len(fwords[next_id])):
* if fwords[next_id][alt_id][0] != EPSILON: # <<<<<<<<<<<<<<
@@ -51557,7 +52081,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_6) {
- /* "rulefactory.pxi":923
+ /* "cdec/sa/rulefactory.pxi":923
* for alt_id in range(len(fwords[next_id])):
* if fwords[next_id][alt_id][0] != EPSILON:
* newel = (next_id,alt_id,pathlen+jump) # <<<<<<<<<<<<<<
@@ -51582,7 +52106,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod
__Pyx_XDECREF_SET(__pyx_v_newel, ((PyObject*)__pyx_t_13));
__pyx_t_13 = 0;
- /* "rulefactory.pxi":924
+ /* "cdec/sa/rulefactory.pxi":924
* if fwords[next_id][alt_id][0] != EPSILON:
* newel = (next_id,alt_id,pathlen+jump)
* if newel not in frontier: # <<<<<<<<<<<<<<
@@ -51593,7 +52117,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod
__pyx_t_5 = (__pyx_t_6 != 0);
if (__pyx_t_5) {
- /* "rulefactory.pxi":925
+ /* "cdec/sa/rulefactory.pxi":925
* newel = (next_id,alt_id,pathlen+jump)
* if newel not in frontier:
* frontier.append((next_id,alt_id,pathlen+jump)) # <<<<<<<<<<<<<<
@@ -51628,7 +52152,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod
}
__pyx_L10:;
- /* "rulefactory.pxi":916
+ /* "cdec/sa/rulefactory.pxi":916
* reachable_buffer[key] = reachable
* for nextreachable in reachable:
* for next_id in next_states[nextreachable]: # <<<<<<<<<<<<<<
@@ -51639,7 +52163,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod
}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "rulefactory.pxi":915
+ /* "cdec/sa/rulefactory.pxi":915
* reachable = self.reachable(fwords, i, spanlen)
* reachable_buffer[key] = reachable
* for nextreachable in reachable: # <<<<<<<<<<<<<<
@@ -51649,7 +52173,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "rulefactory.pxi":926
+ /* "cdec/sa/rulefactory.pxi":926
* if newel not in frontier:
* frontier.append((next_id,alt_id,pathlen+jump))
* return frontier # <<<<<<<<<<<<<<
@@ -51661,7 +52185,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod
__pyx_r = __pyx_v_frontier;
goto __pyx_L0;
- /* "rulefactory.pxi":903
+ /* "cdec/sa/rulefactory.pxi":903
* return res
*
* def get_all_nodes_isteps_away(self, skip, i, spanlen, pathlen, fwords, next_states, reachable_buffer): # <<<<<<<<<<<<<<
@@ -51692,7 +52216,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod
return __pyx_r;
}
-/* "rulefactory.pxi":928
+/* "cdec/sa/rulefactory.pxi":928
* return frontier
*
* def reachable(self, fwords, ifrom, dist): # <<<<<<<<<<<<<<
@@ -51794,7 +52318,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_16reachable(s
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("reachable", 0);
- /* "rulefactory.pxi":929
+ /* "cdec/sa/rulefactory.pxi":929
*
* def reachable(self, fwords, ifrom, dist):
* ret = [] # <<<<<<<<<<<<<<
@@ -51806,7 +52330,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_16reachable(s
__pyx_v_ret = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "rulefactory.pxi":930
+ /* "cdec/sa/rulefactory.pxi":930
* def reachable(self, fwords, ifrom, dist):
* ret = []
* if ifrom >= len(fwords): # <<<<<<<<<<<<<<
@@ -51822,7 +52346,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_16reachable(s
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_4) {
- /* "rulefactory.pxi":931
+ /* "cdec/sa/rulefactory.pxi":931
* ret = []
* if ifrom >= len(fwords):
* return ret # <<<<<<<<<<<<<<
@@ -51835,7 +52359,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_16reachable(s
goto __pyx_L0;
}
- /* "rulefactory.pxi":932
+ /* "cdec/sa/rulefactory.pxi":932
* if ifrom >= len(fwords):
* return ret
* for alt_id in range(len(fwords[ifrom])): # <<<<<<<<<<<<<<
@@ -51849,7 +52373,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_16reachable(s
for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_2; __pyx_t_5+=1) {
__pyx_v_alt_id = __pyx_t_5;
- /* "rulefactory.pxi":933
+ /* "cdec/sa/rulefactory.pxi":933
* return ret
* for alt_id in range(len(fwords[ifrom])):
* if fwords[ifrom][alt_id][0] == EPSILON: # <<<<<<<<<<<<<<
@@ -51873,7 +52397,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_16reachable(s
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (__pyx_t_4) {
- /* "rulefactory.pxi":934
+ /* "cdec/sa/rulefactory.pxi":934
* for alt_id in range(len(fwords[ifrom])):
* if fwords[ifrom][alt_id][0] == EPSILON:
* ret.extend(self.reachable(fwords,ifrom+fwords[ifrom][alt_id][2],dist)) # <<<<<<<<<<<<<<
@@ -51929,7 +52453,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_16reachable(s
}
/*else*/ {
- /* "rulefactory.pxi":936
+ /* "cdec/sa/rulefactory.pxi":936
* ret.extend(self.reachable(fwords,ifrom+fwords[ifrom][alt_id][2],dist))
* else:
* if dist == 0: # <<<<<<<<<<<<<<
@@ -51941,7 +52465,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_16reachable(s
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (__pyx_t_4) {
- /* "rulefactory.pxi":937
+ /* "cdec/sa/rulefactory.pxi":937
* else:
* if dist == 0:
* if ifrom not in ret: # <<<<<<<<<<<<<<
@@ -51952,7 +52476,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_16reachable(s
__pyx_t_11 = (__pyx_t_4 != 0);
if (__pyx_t_11) {
- /* "rulefactory.pxi":938
+ /* "cdec/sa/rulefactory.pxi":938
* if dist == 0:
* if ifrom not in ret:
* ret.append(ifrom) # <<<<<<<<<<<<<<
@@ -51967,7 +52491,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_16reachable(s
}
/*else*/ {
- /* "rulefactory.pxi":940
+ /* "cdec/sa/rulefactory.pxi":940
* ret.append(ifrom)
* else:
* for ifromchild in self.reachable(fwords,ifrom+fwords[ifrom][alt_id][2],dist-1): # <<<<<<<<<<<<<<
@@ -52060,7 +52584,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_16reachable(s
__Pyx_XDECREF_SET(__pyx_v_ifromchild, __pyx_t_6);
__pyx_t_6 = 0;
- /* "rulefactory.pxi":941
+ /* "cdec/sa/rulefactory.pxi":941
* else:
* for ifromchild in self.reachable(fwords,ifrom+fwords[ifrom][alt_id][2],dist-1):
* if ifromchild not in ret: # <<<<<<<<<<<<<<
@@ -52071,7 +52595,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_16reachable(s
__pyx_t_4 = (__pyx_t_11 != 0);
if (__pyx_t_4) {
- /* "rulefactory.pxi":942
+ /* "cdec/sa/rulefactory.pxi":942
* for ifromchild in self.reachable(fwords,ifrom+fwords[ifrom][alt_id][2],dist-1):
* if ifromchild not in ret:
* ret.append(ifromchild) # <<<<<<<<<<<<<<
@@ -52083,7 +52607,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_16reachable(s
}
__pyx_L11:;
- /* "rulefactory.pxi":940
+ /* "cdec/sa/rulefactory.pxi":940
* ret.append(ifrom)
* else:
* for ifromchild in self.reachable(fwords,ifrom+fwords[ifrom][alt_id][2],dist-1): # <<<<<<<<<<<<<<
@@ -52098,7 +52622,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_16reachable(s
__pyx_L6:;
}
- /* "rulefactory.pxi":944
+ /* "cdec/sa/rulefactory.pxi":944
* ret.append(ifromchild)
*
* return ret # <<<<<<<<<<<<<<
@@ -52110,7 +52634,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_16reachable(s
__pyx_r = __pyx_v_ret;
goto __pyx_L0;
- /* "rulefactory.pxi":928
+ /* "cdec/sa/rulefactory.pxi":928
* return frontier
*
* def reachable(self, fwords, ifrom, dist): # <<<<<<<<<<<<<<
@@ -52136,7 +52660,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_16reachable(s
return __pyx_r;
}
-/* "rulefactory.pxi":946
+/* "cdec/sa/rulefactory.pxi":946
* return ret
*
* def shortest(self, fwords, ifrom, ito): # <<<<<<<<<<<<<<
@@ -52234,7 +52758,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_18shortest(st
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("shortest", 0);
- /* "rulefactory.pxi":948
+ /* "cdec/sa/rulefactory.pxi":948
* def shortest(self, fwords, ifrom, ito):
* cdef unsigned alt_id
* min = 1000 # <<<<<<<<<<<<<<
@@ -52244,7 +52768,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_18shortest(st
__Pyx_INCREF(__pyx_int_1000);
__pyx_v_min = __pyx_int_1000;
- /* "rulefactory.pxi":949
+ /* "cdec/sa/rulefactory.pxi":949
* cdef unsigned alt_id
* min = 1000
* if ifrom > ito: # <<<<<<<<<<<<<<
@@ -52256,7 +52780,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_18shortest(st
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
- /* "rulefactory.pxi":950
+ /* "cdec/sa/rulefactory.pxi":950
* min = 1000
* if ifrom > ito:
* return min # <<<<<<<<<<<<<<
@@ -52269,7 +52793,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_18shortest(st
goto __pyx_L0;
}
- /* "rulefactory.pxi":951
+ /* "cdec/sa/rulefactory.pxi":951
* if ifrom > ito:
* return min
* if ifrom == ito: # <<<<<<<<<<<<<<
@@ -52281,7 +52805,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_18shortest(st
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
- /* "rulefactory.pxi":952
+ /* "cdec/sa/rulefactory.pxi":952
* return min
* if ifrom == ito:
* return 0 # <<<<<<<<<<<<<<
@@ -52294,7 +52818,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_18shortest(st
goto __pyx_L0;
}
- /* "rulefactory.pxi":953
+ /* "cdec/sa/rulefactory.pxi":953
* if ifrom == ito:
* return 0
* for alt_id in range(len(fwords[ifrom])): # <<<<<<<<<<<<<<
@@ -52308,7 +52832,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_18shortest(st
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
__pyx_v_alt_id = __pyx_t_4;
- /* "rulefactory.pxi":954
+ /* "cdec/sa/rulefactory.pxi":954
* return 0
* for alt_id in range(len(fwords[ifrom])):
* currmin = self.shortest(fwords,ifrom+fwords[ifrom][alt_id][2],ito) # <<<<<<<<<<<<<<
@@ -52361,7 +52885,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_18shortest(st
__Pyx_XDECREF_SET(__pyx_v_currmin, __pyx_t_1);
__pyx_t_1 = 0;
- /* "rulefactory.pxi":955
+ /* "cdec/sa/rulefactory.pxi":955
* for alt_id in range(len(fwords[ifrom])):
* currmin = self.shortest(fwords,ifrom+fwords[ifrom][alt_id][2],ito)
* if fwords[ifrom][alt_id][0] != EPSILON: # <<<<<<<<<<<<<<
@@ -52385,7 +52909,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_18shortest(st
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
if (__pyx_t_2) {
- /* "rulefactory.pxi":956
+ /* "cdec/sa/rulefactory.pxi":956
* currmin = self.shortest(fwords,ifrom+fwords[ifrom][alt_id][2],ito)
* if fwords[ifrom][alt_id][0] != EPSILON:
* currmin += 1 # <<<<<<<<<<<<<<
@@ -52400,7 +52924,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_18shortest(st
}
__pyx_L7:;
- /* "rulefactory.pxi":957
+ /* "cdec/sa/rulefactory.pxi":957
* if fwords[ifrom][alt_id][0] != EPSILON:
* currmin += 1
* if currmin < min: # <<<<<<<<<<<<<<
@@ -52412,7 +52936,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_18shortest(st
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
if (__pyx_t_2) {
- /* "rulefactory.pxi":958
+ /* "cdec/sa/rulefactory.pxi":958
* currmin += 1
* if currmin < min:
* min = currmin # <<<<<<<<<<<<<<
@@ -52426,7 +52950,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_18shortest(st
__pyx_L8:;
}
- /* "rulefactory.pxi":959
+ /* "cdec/sa/rulefactory.pxi":959
* if currmin < min:
* min = currmin
* return min # <<<<<<<<<<<<<<
@@ -52438,7 +52962,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_18shortest(st
__pyx_r = __pyx_v_min;
goto __pyx_L0;
- /* "rulefactory.pxi":946
+ /* "cdec/sa/rulefactory.pxi":946
* return ret
*
* def shortest(self, fwords, ifrom, ito): # <<<<<<<<<<<<<<
@@ -52463,7 +52987,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_18shortest(st
return __pyx_r;
}
-/* "rulefactory.pxi":961
+/* "cdec/sa/rulefactory.pxi":961
* return min
*
* def get_next_states(self, _columns, curr_idx, min_dist=2): # <<<<<<<<<<<<<<
@@ -52569,7 +53093,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("get_next_states", 0);
- /* "rulefactory.pxi":962
+ /* "cdec/sa/rulefactory.pxi":962
*
* def get_next_states(self, _columns, curr_idx, min_dist=2):
* result = [] # <<<<<<<<<<<<<<
@@ -52581,7 +53105,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st
__pyx_v_result = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "rulefactory.pxi":963
+ /* "cdec/sa/rulefactory.pxi":963
* def get_next_states(self, _columns, curr_idx, min_dist=2):
* result = []
* candidate = [[curr_idx,0]] # <<<<<<<<<<<<<<
@@ -52604,7 +53128,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st
__pyx_v_candidate = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
- /* "rulefactory.pxi":965
+ /* "cdec/sa/rulefactory.pxi":965
* candidate = [[curr_idx,0]]
*
* while len(candidate) > 0: # <<<<<<<<<<<<<<
@@ -52616,7 +53140,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st
__pyx_t_4 = ((__pyx_t_3 > 0) != 0);
if (!__pyx_t_4) break;
- /* "rulefactory.pxi":966
+ /* "cdec/sa/rulefactory.pxi":966
*
* while len(candidate) > 0:
* curr = candidate.pop() # <<<<<<<<<<<<<<
@@ -52628,7 +53152,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st
__Pyx_XDECREF_SET(__pyx_v_curr, __pyx_t_2);
__pyx_t_2 = 0;
- /* "rulefactory.pxi":967
+ /* "cdec/sa/rulefactory.pxi":967
* while len(candidate) > 0:
* curr = candidate.pop()
* if curr[0] >= len(_columns): # <<<<<<<<<<<<<<
@@ -52647,7 +53171,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_4) {
- /* "rulefactory.pxi":968
+ /* "cdec/sa/rulefactory.pxi":968
* curr = candidate.pop()
* if curr[0] >= len(_columns):
* continue # <<<<<<<<<<<<<<
@@ -52657,7 +53181,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st
goto __pyx_L3_continue;
}
- /* "rulefactory.pxi":969
+ /* "cdec/sa/rulefactory.pxi":969
* if curr[0] >= len(_columns):
* continue
* if curr[0] not in result and min_dist <= curr[1] <= self.max_initial_size: # <<<<<<<<<<<<<<
@@ -52693,7 +53217,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st
__pyx_L7_bool_binop_done:;
if (__pyx_t_4) {
- /* "rulefactory.pxi":970
+ /* "cdec/sa/rulefactory.pxi":970
* continue
* if curr[0] not in result and min_dist <= curr[1] <= self.max_initial_size:
* result.append(curr[0]); # <<<<<<<<<<<<<<
@@ -52708,7 +53232,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st
}
__pyx_L6:;
- /* "rulefactory.pxi":971
+ /* "cdec/sa/rulefactory.pxi":971
* if curr[0] not in result and min_dist <= curr[1] <= self.max_initial_size:
* result.append(curr[0]);
* curr_col = _columns[curr[0]] # <<<<<<<<<<<<<<
@@ -52723,7 +53247,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st
__Pyx_XDECREF_SET(__pyx_v_curr_col, __pyx_t_5);
__pyx_t_5 = 0;
- /* "rulefactory.pxi":972
+ /* "cdec/sa/rulefactory.pxi":972
* result.append(curr[0]);
* curr_col = _columns[curr[0]]
* for alt in curr_col: # <<<<<<<<<<<<<<
@@ -52770,7 +53294,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st
__Pyx_XDECREF_SET(__pyx_v_alt, __pyx_t_1);
__pyx_t_1 = 0;
- /* "rulefactory.pxi":973
+ /* "cdec/sa/rulefactory.pxi":973
* curr_col = _columns[curr[0]]
* for alt in curr_col:
* next_id = curr[0]+alt[2] # <<<<<<<<<<<<<<
@@ -52788,7 +53312,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st
__Pyx_XDECREF_SET(__pyx_v_next_id, __pyx_t_10);
__pyx_t_10 = 0;
- /* "rulefactory.pxi":974
+ /* "cdec/sa/rulefactory.pxi":974
* for alt in curr_col:
* next_id = curr[0]+alt[2]
* jump = 1 # <<<<<<<<<<<<<<
@@ -52798,7 +53322,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st
__Pyx_INCREF(__pyx_int_1);
__Pyx_XDECREF_SET(__pyx_v_jump, __pyx_int_1);
- /* "rulefactory.pxi":975
+ /* "cdec/sa/rulefactory.pxi":975
* next_id = curr[0]+alt[2]
* jump = 1
* if alt[0] == EPSILON: # <<<<<<<<<<<<<<
@@ -52816,7 +53340,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_4) {
- /* "rulefactory.pxi":976
+ /* "cdec/sa/rulefactory.pxi":976
* jump = 1
* if alt[0] == EPSILON:
* jump = 0 # <<<<<<<<<<<<<<
@@ -52829,7 +53353,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st
}
__pyx_L11:;
- /* "rulefactory.pxi":977
+ /* "cdec/sa/rulefactory.pxi":977
* if alt[0] == EPSILON:
* jump = 0
* if next_id not in result and min_dist <= curr[1]+jump <= self.max_initial_size+1: # <<<<<<<<<<<<<<
@@ -52865,7 +53389,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st
__pyx_L13_bool_binop_done:;
if (__pyx_t_4) {
- /* "rulefactory.pxi":978
+ /* "cdec/sa/rulefactory.pxi":978
* jump = 0
* if next_id not in result and min_dist <= curr[1]+jump <= self.max_initial_size+1:
* candidate.append([next_id,curr[1]+jump]) # <<<<<<<<<<<<<<
@@ -52891,7 +53415,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st
}
__pyx_L12:;
- /* "rulefactory.pxi":972
+ /* "cdec/sa/rulefactory.pxi":972
* result.append(curr[0]);
* curr_col = _columns[curr[0]]
* for alt in curr_col: # <<<<<<<<<<<<<<
@@ -52903,7 +53427,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st
__pyx_L3_continue:;
}
- /* "rulefactory.pxi":979
+ /* "cdec/sa/rulefactory.pxi":979
* if next_id not in result and min_dist <= curr[1]+jump <= self.max_initial_size+1:
* candidate.append([next_id,curr[1]+jump])
* return sorted(result); # <<<<<<<<<<<<<<
@@ -52923,7 +53447,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "rulefactory.pxi":961
+ /* "cdec/sa/rulefactory.pxi":961
* return min
*
* def get_next_states(self, _columns, curr_idx, min_dist=2): # <<<<<<<<<<<<<<
@@ -52951,9 +53475,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator5(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-/* "rulefactory.pxi":981
+/* "cdec/sa/rulefactory.pxi":981
* return sorted(result);
*
* def input(self, fwords, meta, ctx_name=None): # <<<<<<<<<<<<<<
@@ -53035,7 +53559,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_23input(PyObj
return __pyx_r;
}
-/* "rulefactory.pxi":1150
+/* "cdec/sa/rulefactory.pxi":1150
* if len(extracts) > 0:
* fcount = Counter()
* fphrases = defaultdict(lambda: defaultdict(lambda: defaultdict(list))) # <<<<<<<<<<<<<<
@@ -53044,13 +53568,13 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_23input(PyObj
*/
/* Python wrapper */
-static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_lambda3(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_lambda3 = {"lambda3", (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_lambda3, METH_NOARGS, 0};
-static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_lambda3(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_lambda5(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_lambda5 = {"lambda5", (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_lambda5, METH_NOARGS, 0};
+static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_lambda5(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("lambda3 (wrapper)", 0);
- __pyx_r = __pyx_lambda_funcdef_lambda3(__pyx_self);
+ __Pyx_RefNannySetupContext("lambda5 (wrapper)", 0);
+ __pyx_r = __pyx_lambda_funcdef_lambda5(__pyx_self);
/* function exit code */
__Pyx_RefNannyFinishContext();
@@ -53058,20 +53582,20 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_lambda
}
/* Python wrapper */
-static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_7lambda3_lambda4(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_7lambda3_lambda4 = {"lambda4", (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_7lambda3_lambda4, METH_NOARGS, 0};
-static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_7lambda3_lambda4(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_7lambda5_lambda6(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_7lambda5_lambda6 = {"lambda6", (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_7lambda5_lambda6, METH_NOARGS, 0};
+static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_7lambda5_lambda6(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("lambda4 (wrapper)", 0);
- __pyx_r = __pyx_lambda_funcdef_lambda4(__pyx_self);
+ __Pyx_RefNannySetupContext("lambda6 (wrapper)", 0);
+ __pyx_r = __pyx_lambda_funcdef_lambda6(__pyx_self);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_lambda_funcdef_lambda4(CYTHON_UNUSED PyObject *__pyx_self) {
+static PyObject *__pyx_lambda_funcdef_lambda6(CYTHON_UNUSED PyObject *__pyx_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
@@ -53081,7 +53605,7 @@ static PyObject *__pyx_lambda_funcdef_lambda4(CYTHON_UNUSED PyObject *__pyx_self
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("lambda4", 0);
+ __Pyx_RefNannySetupContext("lambda6", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_defaultdict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
@@ -53120,7 +53644,7 @@ static PyObject *__pyx_lambda_funcdef_lambda4(CYTHON_UNUSED PyObject *__pyx_self
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.input.lambda3.lambda4", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.input.lambda5.lambda6", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -53128,7 +53652,7 @@ static PyObject *__pyx_lambda_funcdef_lambda4(CYTHON_UNUSED PyObject *__pyx_self
return __pyx_r;
}
-static PyObject *__pyx_lambda_funcdef_lambda3(CYTHON_UNUSED PyObject *__pyx_self) {
+static PyObject *__pyx_lambda_funcdef_lambda5(CYTHON_UNUSED PyObject *__pyx_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
@@ -53139,11 +53663,11 @@ static PyObject *__pyx_lambda_funcdef_lambda3(CYTHON_UNUSED PyObject *__pyx_self
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("lambda3", 0);
+ __Pyx_RefNannySetupContext("lambda5", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_defaultdict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_7lambda3_lambda4, 0, __pyx_n_s_input_locals_lambda_locals_lambd, NULL, __pyx_n_s_cdec_sa__sa, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_7lambda5_lambda6, 0, __pyx_n_s_input_locals_lambda_locals_lambd, NULL, __pyx_n_s_cdec_sa__sa, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
@@ -53182,7 +53706,7 @@ static PyObject *__pyx_lambda_funcdef_lambda3(CYTHON_UNUSED PyObject *__pyx_self
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.input.lambda3", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.input.lambda5", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -53190,7 +53714,7 @@ static PyObject *__pyx_lambda_funcdef_lambda3(CYTHON_UNUSED PyObject *__pyx_self
return __pyx_r;
}
-/* "rulefactory.pxi":1156
+/* "cdec/sa/rulefactory.pxi":1156
* for f, elist in fphrases.iteritems():
* for e, alslist in elist.iteritems():
* alignment, max_locs = max(alslist.iteritems(), key=lambda x: len(x[1])) # <<<<<<<<<<<<<<
@@ -53199,20 +53723,20 @@ static PyObject *__pyx_lambda_funcdef_lambda3(CYTHON_UNUSED PyObject *__pyx_self
*/
/* Python wrapper */
-static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_1lambda5(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
-static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_1lambda5 = {"lambda5", (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_1lambda5, METH_O, 0};
-static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_1lambda5(PyObject *__pyx_self, PyObject *__pyx_v_x) {
+static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_1lambda7(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
+static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_1lambda7 = {"lambda7", (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_1lambda7, METH_O, 0};
+static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_1lambda7(PyObject *__pyx_self, PyObject *__pyx_v_x) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("lambda5 (wrapper)", 0);
- __pyx_r = __pyx_lambda_funcdef_lambda5(__pyx_self, ((PyObject *)__pyx_v_x));
+ __Pyx_RefNannySetupContext("lambda7 (wrapper)", 0);
+ __pyx_r = __pyx_lambda_funcdef_lambda7(__pyx_self, ((PyObject *)__pyx_v_x));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_lambda_funcdef_lambda5(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) {
+static PyObject *__pyx_lambda_funcdef_lambda7(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
@@ -53220,7 +53744,7 @@ static PyObject *__pyx_lambda_funcdef_lambda5(CYTHON_UNUSED PyObject *__pyx_self
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("lambda5", 0);
+ __Pyx_RefNannySetupContext("lambda7", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
__Pyx_GOTREF(__pyx_t_1);
@@ -53235,16 +53759,16 @@ static PyObject *__pyx_lambda_funcdef_lambda5(CYTHON_UNUSED PyObject *__pyx_self
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.input.lambda5", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.input.lambda7", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_4generator14(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_4generator15(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-/* "rulefactory.pxi":1196
+/* "cdec/sa/rulefactory.pxi":1196
* if self.online:
* stats = self.online_stats[ctx_name]
* f_syms = tuple(word[0][0] for word in fwords) # <<<<<<<<<<<<<<
@@ -53253,24 +53777,24 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_4gener
*/
static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_2genexpr(PyObject *__pyx_self) {
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr *__pyx_cur_scope;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_genexpr *__pyx_cur_scope;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("genexpr", 0);
- __pyx_cur_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr *)__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr(__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr, __pyx_empty_tuple, NULL);
+ __pyx_cur_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_genexpr *)__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_21_genexpr(__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_21_genexpr, __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_cur_scope)) {
__Pyx_RefNannyFinishContext();
return NULL;
}
__Pyx_GOTREF(__pyx_cur_scope);
- __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input *) __pyx_self;
+ __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_input *) __pyx_self;
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
{
- __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_4generator14, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_input_locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_4generator15, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_input_locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_cur_scope);
__Pyx_RefNannyFinishContext();
return (PyObject *) gen;
@@ -53286,9 +53810,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_2genex
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_4generator14(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_4generator15(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr *)__pyx_generator->closure);
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_genexpr *)__pyx_generator->closure);
PyObject *__pyx_r = NULL;
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
@@ -53393,7 +53917,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_4gener
return NULL;
}
-/* "rulefactory.pxi":981
+/* "cdec/sa/rulefactory.pxi":981
* return sorted(result);
*
* def input(self, fwords, meta, ctx_name=None): # <<<<<<<<<<<<<<
@@ -53402,14 +53926,14 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_4gener
*/
static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_22input(struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_fwords, PyObject *__pyx_v_meta, PyObject *__pyx_v_ctx_name) {
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input *__pyx_cur_scope;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_input *__pyx_cur_scope;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("input", 0);
- __pyx_cur_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input *)__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_19_input(__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_19_input, __pyx_empty_tuple, NULL);
+ __pyx_cur_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_input *)__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_20_input(__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_20_input, __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_cur_scope)) {
__Pyx_RefNannyFinishContext();
return NULL;
@@ -53428,7 +53952,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_22input(struc
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_ctx_name);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_ctx_name);
{
- __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4, (PyObject *) __pyx_cur_scope, __pyx_n_s_input, __pyx_n_s_HieroCachingRuleFactory_input); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator5, (PyObject *) __pyx_cur_scope, __pyx_n_s_input, __pyx_n_s_HieroCachingRuleFactory_input); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_cur_scope);
__Pyx_RefNannyFinishContext();
return (PyObject *) gen;
@@ -53444,9 +53968,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_22input(struc
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator5(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input *__pyx_cur_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input *)__pyx_generator->closure);
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_input *__pyx_cur_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_input *)__pyx_generator->closure);
PyObject *__pyx_r = NULL;
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
@@ -53492,7 +54016,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_L3_first_run:;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "rulefactory.pxi":992
+ /* "cdec/sa/rulefactory.pxi":992
* cdef Phrase hiero_phrase
*
* flen = len(fwords) # <<<<<<<<<<<<<<
@@ -53505,7 +54029,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_cur_scope->__pyx_v_flen = __pyx_t_2;
- /* "rulefactory.pxi":993
+ /* "cdec/sa/rulefactory.pxi":993
*
* flen = len(fwords)
* start_time = monitor_cpu() # <<<<<<<<<<<<<<
@@ -53536,7 +54060,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_cur_scope->__pyx_v_start_time = __pyx_t_5;
- /* "rulefactory.pxi":994
+ /* "cdec/sa/rulefactory.pxi":994
* flen = len(fwords)
* start_time = monitor_cpu()
* self.extract_time = 0.0 # <<<<<<<<<<<<<<
@@ -53545,7 +54069,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
*/
__pyx_cur_scope->__pyx_v_self->extract_time = 0.0;
- /* "rulefactory.pxi":995
+ /* "cdec/sa/rulefactory.pxi":995
* start_time = monitor_cpu()
* self.extract_time = 0.0
* self.intersect_time = 0.0 # <<<<<<<<<<<<<<
@@ -53554,7 +54078,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
*/
__pyx_cur_scope->__pyx_v_self->intersect_time = 0.0;
- /* "rulefactory.pxi":996
+ /* "cdec/sa/rulefactory.pxi":996
* self.extract_time = 0.0
* self.intersect_time = 0.0
* nodes_isteps_away_buffer = {} # <<<<<<<<<<<<<<
@@ -53567,7 +54091,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_cur_scope->__pyx_v_nodes_isteps_away_buffer = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "rulefactory.pxi":997
+ /* "cdec/sa/rulefactory.pxi":997
* self.intersect_time = 0.0
* nodes_isteps_away_buffer = {}
* hit = 0 # <<<<<<<<<<<<<<
@@ -53576,7 +54100,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
*/
__pyx_cur_scope->__pyx_v_hit = 0;
- /* "rulefactory.pxi":998
+ /* "cdec/sa/rulefactory.pxi":998
* nodes_isteps_away_buffer = {}
* hit = 0
* reachable_buffer = {} # <<<<<<<<<<<<<<
@@ -53589,7 +54113,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_cur_scope->__pyx_v_reachable_buffer = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "rulefactory.pxi":1003
+ /* "cdec/sa/rulefactory.pxi":1003
* # during online extraction. This is probably the hackiest part of
* # online grammar extraction.
* seen_phrases = set() # <<<<<<<<<<<<<<
@@ -53602,7 +54126,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_cur_scope->__pyx_v_seen_phrases = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "rulefactory.pxi":1006
+ /* "cdec/sa/rulefactory.pxi":1006
*
* # Do not cache between sentences
* self.rules.root = ExtendedTrieNode(phrase_location=PhraseLocation()) # <<<<<<<<<<<<<<
@@ -53624,7 +54148,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_cur_scope->__pyx_v_self->rules->root = __pyx_t_3;
__pyx_t_3 = 0;
- /* "rulefactory.pxi":1008
+ /* "cdec/sa/rulefactory.pxi":1008
* self.rules.root = ExtendedTrieNode(phrase_location=PhraseLocation())
*
* frontier = [] # <<<<<<<<<<<<<<
@@ -53637,7 +54161,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_cur_scope->__pyx_v_frontier = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
- /* "rulefactory.pxi":1009
+ /* "cdec/sa/rulefactory.pxi":1009
*
* frontier = []
* for i in range(len(fwords)): # <<<<<<<<<<<<<<
@@ -53651,7 +54175,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_2; __pyx_t_6+=1) {
__pyx_cur_scope->__pyx_v_i = __pyx_t_6;
- /* "rulefactory.pxi":1010
+ /* "cdec/sa/rulefactory.pxi":1010
* frontier = []
* for i in range(len(fwords)):
* for alt in range(0, len(fwords[i])): # <<<<<<<<<<<<<<
@@ -53665,7 +54189,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
__pyx_cur_scope->__pyx_v_alt = __pyx_t_8;
- /* "rulefactory.pxi":1011
+ /* "cdec/sa/rulefactory.pxi":1011
* for i in range(len(fwords)):
* for alt in range(0, len(fwords[i])):
* if fwords[i][alt][0] != EPSILON: # <<<<<<<<<<<<<<
@@ -53689,7 +54213,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_9) {
- /* "rulefactory.pxi":1012
+ /* "cdec/sa/rulefactory.pxi":1012
* for alt in range(0, len(fwords[i])):
* if fwords[i][alt][0] != EPSILON:
* frontier.append((i, i, (i,), alt, 0, self.rules.root, (), False)) # <<<<<<<<<<<<<<
@@ -53743,7 +54267,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
}
- /* "rulefactory.pxi":1014
+ /* "cdec/sa/rulefactory.pxi":1014
* frontier.append((i, i, (i,), alt, 0, self.rules.root, (), False))
*
* xroot = None # <<<<<<<<<<<<<<
@@ -53754,7 +54278,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(Py_None);
__pyx_cur_scope->__pyx_v_xroot = Py_None;
- /* "rulefactory.pxi":1015
+ /* "cdec/sa/rulefactory.pxi":1015
*
* xroot = None
* x1 = sym_setindex(self.category, 1) # <<<<<<<<<<<<<<
@@ -53763,7 +54287,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
*/
__pyx_cur_scope->__pyx_v_x1 = __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, 1);
- /* "rulefactory.pxi":1016
+ /* "cdec/sa/rulefactory.pxi":1016
* xroot = None
* x1 = sym_setindex(self.category, 1)
* if x1 in self.rules.root.children: # <<<<<<<<<<<<<<
@@ -53780,7 +54304,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_13 = (__pyx_t_9 != 0);
if (__pyx_t_13) {
- /* "rulefactory.pxi":1017
+ /* "cdec/sa/rulefactory.pxi":1017
* x1 = sym_setindex(self.category, 1)
* if x1 in self.rules.root.children:
* xroot = self.rules.root.children[x1] # <<<<<<<<<<<<<<
@@ -53800,7 +54324,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
/*else*/ {
- /* "rulefactory.pxi":1019
+ /* "cdec/sa/rulefactory.pxi":1019
* xroot = self.rules.root.children[x1]
* else:
* xroot = ExtendedTrieNode(suffix_link=self.rules.root, phrase_location=PhraseLocation()) # <<<<<<<<<<<<<<
@@ -53822,7 +54346,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_3);
__pyx_t_3 = 0;
- /* "rulefactory.pxi":1020
+ /* "cdec/sa/rulefactory.pxi":1020
* else:
* xroot = ExtendedTrieNode(suffix_link=self.rules.root, phrase_location=PhraseLocation())
* self.rules.root.children[x1] = xroot # <<<<<<<<<<<<<<
@@ -53836,7 +54360,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
__pyx_L9:;
- /* "rulefactory.pxi":1022
+ /* "cdec/sa/rulefactory.pxi":1022
* self.rules.root.children[x1] = xroot
*
* for i in range(self.min_gap_size, len(fwords)): # <<<<<<<<<<<<<<
@@ -53850,7 +54374,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
for (__pyx_t_6 = __pyx_cur_scope->__pyx_v_self->min_gap_size; __pyx_t_6 < __pyx_t_2; __pyx_t_6+=1) {
__pyx_cur_scope->__pyx_v_i = __pyx_t_6;
- /* "rulefactory.pxi":1023
+ /* "cdec/sa/rulefactory.pxi":1023
*
* for i in range(self.min_gap_size, len(fwords)):
* for alt in range(0, len(fwords[i])): # <<<<<<<<<<<<<<
@@ -53864,7 +54388,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
__pyx_cur_scope->__pyx_v_alt = __pyx_t_8;
- /* "rulefactory.pxi":1024
+ /* "cdec/sa/rulefactory.pxi":1024
* for i in range(self.min_gap_size, len(fwords)):
* for alt in range(0, len(fwords[i])):
* if fwords[i][alt][0] != EPSILON: # <<<<<<<<<<<<<<
@@ -53888,7 +54412,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
if (__pyx_t_13) {
- /* "rulefactory.pxi":1025
+ /* "cdec/sa/rulefactory.pxi":1025
* for alt in range(0, len(fwords[i])):
* if fwords[i][alt][0] != EPSILON:
* frontier.append((i-self.min_gap_size, i, (i,), alt, self.min_gap_size, xroot, (x1,), True)) # <<<<<<<<<<<<<<
@@ -53951,7 +54475,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
}
- /* "rulefactory.pxi":1027
+ /* "cdec/sa/rulefactory.pxi":1027
* frontier.append((i-self.min_gap_size, i, (i,), alt, self.min_gap_size, xroot, (x1,), True))
*
* next_states = [] # <<<<<<<<<<<<<<
@@ -53964,7 +54488,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_cur_scope->__pyx_v_next_states = ((PyObject*)__pyx_t_14);
__pyx_t_14 = 0;
- /* "rulefactory.pxi":1028
+ /* "cdec/sa/rulefactory.pxi":1028
*
* next_states = []
* for i in range(len(fwords)): # <<<<<<<<<<<<<<
@@ -53978,7 +54502,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_2; __pyx_t_6+=1) {
__pyx_cur_scope->__pyx_v_i = __pyx_t_6;
- /* "rulefactory.pxi":1029
+ /* "cdec/sa/rulefactory.pxi":1029
* next_states = []
* for i in range(len(fwords)):
* next_states.append(self.get_next_states(fwords,i,self.min_gap_size)) # <<<<<<<<<<<<<<
@@ -54025,7 +54549,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
}
- /* "rulefactory.pxi":1031
+ /* "cdec/sa/rulefactory.pxi":1031
* next_states.append(self.get_next_states(fwords,i,self.min_gap_size))
*
* while len(frontier) > 0: # <<<<<<<<<<<<<<
@@ -54037,7 +54561,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_13 = ((__pyx_t_2 > 0) != 0);
if (!__pyx_t_13) break;
- /* "rulefactory.pxi":1032
+ /* "cdec/sa/rulefactory.pxi":1032
*
* while len(frontier) > 0:
* new_frontier = [] # <<<<<<<<<<<<<<
@@ -54051,7 +54575,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_14);
__pyx_t_14 = 0;
- /* "rulefactory.pxi":1033
+ /* "cdec/sa/rulefactory.pxi":1033
* while len(frontier) > 0:
* new_frontier = []
* for k, i, input_match, alt, pathlen, node, prefix, is_shadow_path in frontier: # <<<<<<<<<<<<<<
@@ -54171,7 +54695,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_18);
__pyx_t_18 = 0;
- /* "rulefactory.pxi":1034
+ /* "cdec/sa/rulefactory.pxi":1034
* new_frontier = []
* for k, i, input_match, alt, pathlen, node, prefix, is_shadow_path in frontier:
* word_id = fwords[i][alt][0] # <<<<<<<<<<<<<<
@@ -54191,7 +54715,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_15);
__pyx_t_15 = 0;
- /* "rulefactory.pxi":1035
+ /* "cdec/sa/rulefactory.pxi":1035
* for k, i, input_match, alt, pathlen, node, prefix, is_shadow_path in frontier:
* word_id = fwords[i][alt][0]
* spanlen = fwords[i][alt][2] # <<<<<<<<<<<<<<
@@ -54211,7 +54735,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_15);
__pyx_t_15 = 0;
- /* "rulefactory.pxi":1037
+ /* "cdec/sa/rulefactory.pxi":1037
* spanlen = fwords[i][alt][2]
* # TODO get rid of k -- pathlen is replacing it
* if word_id == EPSILON: # <<<<<<<<<<<<<<
@@ -54226,7 +54750,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
if (__pyx_t_13) {
- /* "rulefactory.pxi":1039
+ /* "cdec/sa/rulefactory.pxi":1039
* if word_id == EPSILON:
* # skipping because word_id is epsilon
* if i+spanlen >= len(fwords): # <<<<<<<<<<<<<<
@@ -54251,7 +54775,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
if (__pyx_t_13) {
- /* "rulefactory.pxi":1040
+ /* "cdec/sa/rulefactory.pxi":1040
* # skipping because word_id is epsilon
* if i+spanlen >= len(fwords):
* continue # <<<<<<<<<<<<<<
@@ -54261,7 +54785,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
goto __pyx_L19_continue;
}
- /* "rulefactory.pxi":1041
+ /* "cdec/sa/rulefactory.pxi":1041
* if i+spanlen >= len(fwords):
* continue
* for nualt in range(0,len(fwords[i+spanlen])): # <<<<<<<<<<<<<<
@@ -54281,7 +54805,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_7; __pyx_t_21+=1) {
__pyx_cur_scope->__pyx_v_nualt = __pyx_t_21;
- /* "rulefactory.pxi":1042
+ /* "cdec/sa/rulefactory.pxi":1042
* continue
* for nualt in range(0,len(fwords[i+spanlen])):
* frontier.append((k, i+spanlen, input_match, nualt, pathlen, node, prefix, is_shadow_path)) # <<<<<<<<<<<<<<
@@ -54327,7 +54851,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
}
- /* "rulefactory.pxi":1043
+ /* "cdec/sa/rulefactory.pxi":1043
* for nualt in range(0,len(fwords[i+spanlen])):
* frontier.append((k, i+spanlen, input_match, nualt, pathlen, node, prefix, is_shadow_path))
* continue # <<<<<<<<<<<<<<
@@ -54337,7 +54861,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
goto __pyx_L19_continue;
}
- /* "rulefactory.pxi":1045
+ /* "cdec/sa/rulefactory.pxi":1045
* continue
*
* phrase = prefix + (word_id,) # <<<<<<<<<<<<<<
@@ -54357,7 +54881,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_18);
__pyx_t_18 = 0;
- /* "rulefactory.pxi":1046
+ /* "cdec/sa/rulefactory.pxi":1046
*
* phrase = prefix + (word_id,)
* hiero_phrase = Phrase(phrase) # <<<<<<<<<<<<<<
@@ -54377,7 +54901,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_16);
__pyx_t_16 = 0;
- /* "rulefactory.pxi":1047
+ /* "cdec/sa/rulefactory.pxi":1047
* phrase = prefix + (word_id,)
* hiero_phrase = Phrase(phrase)
* arity = hiero_phrase.arity() # <<<<<<<<<<<<<<
@@ -54408,7 +54932,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
__pyx_cur_scope->__pyx_v_arity = __pyx_t_21;
- /* "rulefactory.pxi":1049
+ /* "cdec/sa/rulefactory.pxi":1049
* arity = hiero_phrase.arity()
*
* lookup_required = False # <<<<<<<<<<<<<<
@@ -54417,7 +54941,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
*/
__pyx_cur_scope->__pyx_v_lookup_required = 0;
- /* "rulefactory.pxi":1050
+ /* "cdec/sa/rulefactory.pxi":1050
*
* lookup_required = False
* if word_id in node.children: # <<<<<<<<<<<<<<
@@ -54431,7 +54955,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_9 = (__pyx_t_13 != 0);
if (__pyx_t_9) {
- /* "rulefactory.pxi":1051
+ /* "cdec/sa/rulefactory.pxi":1051
* lookup_required = False
* if word_id in node.children:
* if node.children[word_id] is None: # <<<<<<<<<<<<<<
@@ -54448,7 +54972,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_13 = (__pyx_t_9 != 0);
if (__pyx_t_13) {
- /* "rulefactory.pxi":1053
+ /* "cdec/sa/rulefactory.pxi":1053
* if node.children[word_id] is None:
* # Path dead-ends at this node
* continue # <<<<<<<<<<<<<<
@@ -54459,7 +54983,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
/*else*/ {
- /* "rulefactory.pxi":1056
+ /* "cdec/sa/rulefactory.pxi":1056
* else:
* # Path continues at this node
* node = node.children[word_id] # <<<<<<<<<<<<<<
@@ -54480,7 +55004,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
/*else*/ {
- /* "rulefactory.pxi":1058
+ /* "cdec/sa/rulefactory.pxi":1058
* node = node.children[word_id]
* else:
* if node.suffix_link is None: # <<<<<<<<<<<<<<
@@ -54494,7 +55018,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_9 = (__pyx_t_13 != 0);
if (__pyx_t_9) {
- /* "rulefactory.pxi":1060
+ /* "cdec/sa/rulefactory.pxi":1060
* if node.suffix_link is None:
* # Current node is root; lookup required
* lookup_required = True # <<<<<<<<<<<<<<
@@ -54506,7 +55030,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
/*else*/ {
- /* "rulefactory.pxi":1062
+ /* "cdec/sa/rulefactory.pxi":1062
* lookup_required = True
* else:
* if word_id in node.suffix_link.children: # <<<<<<<<<<<<<<
@@ -54523,7 +55047,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_13 = (__pyx_t_9 != 0);
if (__pyx_t_13) {
- /* "rulefactory.pxi":1063
+ /* "cdec/sa/rulefactory.pxi":1063
* else:
* if word_id in node.suffix_link.children:
* if node.suffix_link.children[word_id] is None: # <<<<<<<<<<<<<<
@@ -54543,7 +55067,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_9 = (__pyx_t_13 != 0);
if (__pyx_t_9) {
- /* "rulefactory.pxi":1065
+ /* "cdec/sa/rulefactory.pxi":1065
* if node.suffix_link.children[word_id] is None:
* # Suffix link reports path is dead end
* node.children[word_id] = None # <<<<<<<<<<<<<<
@@ -54555,7 +55079,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
if (unlikely(PyObject_SetItem(__pyx_t_18, __pyx_cur_scope->__pyx_v_word_id, Py_None) < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
- /* "rulefactory.pxi":1066
+ /* "cdec/sa/rulefactory.pxi":1066
* # Suffix link reports path is dead end
* node.children[word_id] = None
* continue # <<<<<<<<<<<<<<
@@ -54566,7 +55090,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
/*else*/ {
- /* "rulefactory.pxi":1069
+ /* "cdec/sa/rulefactory.pxi":1069
* else:
* # Suffix link indicates lookup is reqired
* lookup_required = True # <<<<<<<<<<<<<<
@@ -54579,7 +55103,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
/*else*/ {
- /* "rulefactory.pxi":1072
+ /* "cdec/sa/rulefactory.pxi":1072
* else:
* #ERROR: We never get here
* raise Exception("Keyword trie error") # <<<<<<<<<<<<<<
@@ -54598,7 +55122,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
__pyx_L27:;
- /* "rulefactory.pxi":1074
+ /* "cdec/sa/rulefactory.pxi":1074
* raise Exception("Keyword trie error")
* # checking whether lookup_required
* if lookup_required: # <<<<<<<<<<<<<<
@@ -54608,7 +55132,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_9 = (__pyx_cur_scope->__pyx_v_lookup_required != 0);
if (__pyx_t_9) {
- /* "rulefactory.pxi":1075
+ /* "cdec/sa/rulefactory.pxi":1075
* # checking whether lookup_required
* if lookup_required:
* new_node = None # <<<<<<<<<<<<<<
@@ -54620,7 +55144,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_new_node, Py_None);
__Pyx_GIVEREF(Py_None);
- /* "rulefactory.pxi":1076
+ /* "cdec/sa/rulefactory.pxi":1076
* if lookup_required:
* new_node = None
* if is_shadow_path: # <<<<<<<<<<<<<<
@@ -54630,7 +55154,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_9) {
- /* "rulefactory.pxi":1079
+ /* "cdec/sa/rulefactory.pxi":1079
* # Extending shadow path
* # on the shadow path we don't do any search, we just use info from suffix link
* new_node = ExtendedTrieNode(phrase_location=node.suffix_link.children[word_id].phrase_location, # <<<<<<<<<<<<<<
@@ -54653,7 +55177,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
if (PyDict_SetItem(__pyx_t_18, __pyx_n_s_phrase_location, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- /* "rulefactory.pxi":1080
+ /* "cdec/sa/rulefactory.pxi":1080
* # on the shadow path we don't do any search, we just use info from suffix link
* new_node = ExtendedTrieNode(phrase_location=node.suffix_link.children[word_id].phrase_location,
* suffix_link=node.suffix_link.children[word_id], # <<<<<<<<<<<<<<
@@ -54671,7 +55195,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
if (PyDict_SetItem(__pyx_t_18, __pyx_n_s_suffix_link, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- /* "rulefactory.pxi":1081
+ /* "cdec/sa/rulefactory.pxi":1081
* new_node = ExtendedTrieNode(phrase_location=node.suffix_link.children[word_id].phrase_location,
* suffix_link=node.suffix_link.children[word_id],
* phrase=hiero_phrase) # <<<<<<<<<<<<<<
@@ -54680,7 +55204,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
*/
if (PyDict_SetItem(__pyx_t_18, __pyx_n_s_phrase, ((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase)) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "rulefactory.pxi":1079
+ /* "cdec/sa/rulefactory.pxi":1079
* # Extending shadow path
* # on the shadow path we don't do any search, we just use info from suffix link
* new_node = ExtendedTrieNode(phrase_location=node.suffix_link.children[word_id].phrase_location, # <<<<<<<<<<<<<<
@@ -54698,7 +55222,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
/*else*/ {
- /* "rulefactory.pxi":1083
+ /* "cdec/sa/rulefactory.pxi":1083
* phrase=hiero_phrase)
* else:
* if arity > 0: # <<<<<<<<<<<<<<
@@ -54708,7 +55232,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_9 = ((__pyx_cur_scope->__pyx_v_arity > 0) != 0);
if (__pyx_t_9) {
- /* "rulefactory.pxi":1085
+ /* "cdec/sa/rulefactory.pxi":1085
* if arity > 0:
* # Intersecting because of arity > 0
* intersect_start_time = monitor_cpu() # <<<<<<<<<<<<<<
@@ -54740,7 +55264,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_15);
__pyx_t_15 = 0;
- /* "rulefactory.pxi":1086
+ /* "cdec/sa/rulefactory.pxi":1086
* # Intersecting because of arity > 0
* intersect_start_time = monitor_cpu()
* phrase_location = self.intersect(node, node.suffix_link.children[word_id], hiero_phrase) # <<<<<<<<<<<<<<
@@ -54763,7 +55287,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_18);
__pyx_t_18 = 0;
- /* "rulefactory.pxi":1087
+ /* "cdec/sa/rulefactory.pxi":1087
* intersect_start_time = monitor_cpu()
* phrase_location = self.intersect(node, node.suffix_link.children[word_id], hiero_phrase)
* intersect_stop_time = monitor_cpu() # <<<<<<<<<<<<<<
@@ -54795,7 +55319,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_18);
__pyx_t_18 = 0;
- /* "rulefactory.pxi":1088
+ /* "cdec/sa/rulefactory.pxi":1088
* phrase_location = self.intersect(node, node.suffix_link.children[word_id], hiero_phrase)
* intersect_stop_time = monitor_cpu()
* self.intersect_time += intersect_stop_time - intersect_start_time # <<<<<<<<<<<<<<
@@ -54817,7 +55341,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
/*else*/ {
- /* "rulefactory.pxi":1091
+ /* "cdec/sa/rulefactory.pxi":1091
* else:
* # Suffix array search
* phrase_location = node.phrase_location # <<<<<<<<<<<<<<
@@ -54832,7 +55356,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_16);
__pyx_t_16 = 0;
- /* "rulefactory.pxi":1092
+ /* "cdec/sa/rulefactory.pxi":1092
* # Suffix array search
* phrase_location = node.phrase_location
* sa_range = self.fsa.lookup(sym_tostring(phrase[-1]), len(phrase)-1, phrase_location.sa_low, phrase_location.sa_high) # <<<<<<<<<<<<<<
@@ -54892,7 +55416,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_16);
__pyx_t_16 = 0;
- /* "rulefactory.pxi":1093
+ /* "cdec/sa/rulefactory.pxi":1093
* phrase_location = node.phrase_location
* sa_range = self.fsa.lookup(sym_tostring(phrase[-1]), len(phrase)-1, phrase_location.sa_low, phrase_location.sa_high)
* if sa_range is not None: # <<<<<<<<<<<<<<
@@ -54903,7 +55427,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_13 = (__pyx_t_9 != 0);
if (__pyx_t_13) {
- /* "rulefactory.pxi":1094
+ /* "cdec/sa/rulefactory.pxi":1094
* sa_range = self.fsa.lookup(sym_tostring(phrase[-1]), len(phrase)-1, phrase_location.sa_low, phrase_location.sa_high)
* if sa_range is not None:
* phrase_location = PhraseLocation(sa_low=sa_range[0], sa_high=sa_range[1]) # <<<<<<<<<<<<<<
@@ -54931,7 +55455,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
/*else*/ {
- /* "rulefactory.pxi":1096
+ /* "cdec/sa/rulefactory.pxi":1096
* phrase_location = PhraseLocation(sa_low=sa_range[0], sa_high=sa_range[1])
* else:
* phrase_location = None # <<<<<<<<<<<<<<
@@ -54947,7 +55471,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
__pyx_L34:;
- /* "rulefactory.pxi":1098
+ /* "cdec/sa/rulefactory.pxi":1098
* phrase_location = None
*
* if phrase_location is None: # <<<<<<<<<<<<<<
@@ -54958,7 +55482,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_9 = (__pyx_t_13 != 0);
if (__pyx_t_9) {
- /* "rulefactory.pxi":1099
+ /* "cdec/sa/rulefactory.pxi":1099
*
* if phrase_location is None:
* node.children[word_id] = None # <<<<<<<<<<<<<<
@@ -54970,7 +55494,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
if (unlikely(PyObject_SetItem(__pyx_t_15, __pyx_cur_scope->__pyx_v_word_id, Py_None) < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- /* "rulefactory.pxi":1101
+ /* "cdec/sa/rulefactory.pxi":1101
* node.children[word_id] = None
* # Search failed
* continue # <<<<<<<<<<<<<<
@@ -54980,7 +55504,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
goto __pyx_L19_continue;
}
- /* "rulefactory.pxi":1103
+ /* "cdec/sa/rulefactory.pxi":1103
* continue
* # Search succeeded
* suffix_link = self.rules.root # <<<<<<<<<<<<<<
@@ -54994,7 +55518,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_15);
__pyx_t_15 = 0;
- /* "rulefactory.pxi":1104
+ /* "cdec/sa/rulefactory.pxi":1104
* # Search succeeded
* suffix_link = self.rules.root
* if node.suffix_link is not None: # <<<<<<<<<<<<<<
@@ -55008,7 +55532,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_13 = (__pyx_t_9 != 0);
if (__pyx_t_13) {
- /* "rulefactory.pxi":1105
+ /* "cdec/sa/rulefactory.pxi":1105
* suffix_link = self.rules.root
* if node.suffix_link is not None:
* suffix_link = node.suffix_link.children[word_id] # <<<<<<<<<<<<<<
@@ -55031,7 +55555,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
__pyx_L37:;
- /* "rulefactory.pxi":1106
+ /* "cdec/sa/rulefactory.pxi":1106
* if node.suffix_link is not None:
* suffix_link = node.suffix_link.children[word_id]
* new_node = ExtendedTrieNode(phrase_location=phrase_location, # <<<<<<<<<<<<<<
@@ -55042,7 +55566,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GOTREF(__pyx_t_15);
if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_phrase_location, ((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location)) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "rulefactory.pxi":1107
+ /* "cdec/sa/rulefactory.pxi":1107
* suffix_link = node.suffix_link.children[word_id]
* new_node = ExtendedTrieNode(phrase_location=phrase_location,
* suffix_link=suffix_link, # <<<<<<<<<<<<<<
@@ -55051,7 +55575,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
*/
if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_suffix_link, __pyx_cur_scope->__pyx_v_suffix_link) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "rulefactory.pxi":1108
+ /* "cdec/sa/rulefactory.pxi":1108
* new_node = ExtendedTrieNode(phrase_location=phrase_location,
* suffix_link=suffix_link,
* phrase=hiero_phrase) # <<<<<<<<<<<<<<
@@ -55060,7 +55584,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
*/
if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_phrase, ((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase)) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "rulefactory.pxi":1106
+ /* "cdec/sa/rulefactory.pxi":1106
* if node.suffix_link is not None:
* suffix_link = node.suffix_link.children[word_id]
* new_node = ExtendedTrieNode(phrase_location=phrase_location, # <<<<<<<<<<<<<<
@@ -55077,7 +55601,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
__pyx_L33:;
- /* "rulefactory.pxi":1109
+ /* "cdec/sa/rulefactory.pxi":1109
* suffix_link=suffix_link,
* phrase=hiero_phrase)
* node.children[word_id] = new_node # <<<<<<<<<<<<<<
@@ -55089,7 +55613,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
if (unlikely(PyObject_SetItem(__pyx_t_16, __pyx_cur_scope->__pyx_v_word_id, __pyx_cur_scope->__pyx_v_new_node) < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- /* "rulefactory.pxi":1110
+ /* "cdec/sa/rulefactory.pxi":1110
* phrase=hiero_phrase)
* node.children[word_id] = new_node
* node = new_node # <<<<<<<<<<<<<<
@@ -55101,7 +55625,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_node, __pyx_cur_scope->__pyx_v_new_node);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_new_node);
- /* "rulefactory.pxi":1115
+ /* "cdec/sa/rulefactory.pxi":1115
* This should happen before we get to extraction (so that
* the node will exist if needed)'''
* if arity < self.max_nonterminals: # <<<<<<<<<<<<<<
@@ -55111,7 +55635,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_13 = ((__pyx_cur_scope->__pyx_v_arity < __pyx_cur_scope->__pyx_v_self->max_nonterminals) != 0);
if (__pyx_t_13) {
- /* "rulefactory.pxi":1116
+ /* "cdec/sa/rulefactory.pxi":1116
* the node will exist if needed)'''
* if arity < self.max_nonterminals:
* xcat_index = arity+1 # <<<<<<<<<<<<<<
@@ -55125,7 +55649,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_16);
__pyx_t_16 = 0;
- /* "rulefactory.pxi":1117
+ /* "cdec/sa/rulefactory.pxi":1117
* if arity < self.max_nonterminals:
* xcat_index = arity+1
* xcat = sym_setindex(self.category, xcat_index) # <<<<<<<<<<<<<<
@@ -55135,7 +55659,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_21 = __Pyx_PyInt_As_int(__pyx_cur_scope->__pyx_v_xcat_index); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_cur_scope->__pyx_v_xcat = __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_21);
- /* "rulefactory.pxi":1118
+ /* "cdec/sa/rulefactory.pxi":1118
* xcat_index = arity+1
* xcat = sym_setindex(self.category, xcat_index)
* suffix_link_xcat_index = xcat_index # <<<<<<<<<<<<<<
@@ -55147,7 +55671,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_suffix_link_xcat_index, __pyx_cur_scope->__pyx_v_xcat_index);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_xcat_index);
- /* "rulefactory.pxi":1119
+ /* "cdec/sa/rulefactory.pxi":1119
* xcat = sym_setindex(self.category, xcat_index)
* suffix_link_xcat_index = xcat_index
* if is_shadow_path: # <<<<<<<<<<<<<<
@@ -55157,7 +55681,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_13) {
- /* "rulefactory.pxi":1120
+ /* "cdec/sa/rulefactory.pxi":1120
* suffix_link_xcat_index = xcat_index
* if is_shadow_path:
* suffix_link_xcat_index = xcat_index-1 # <<<<<<<<<<<<<<
@@ -55174,7 +55698,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
__pyx_L39:;
- /* "rulefactory.pxi":1121
+ /* "cdec/sa/rulefactory.pxi":1121
* if is_shadow_path:
* suffix_link_xcat_index = xcat_index-1
* suffix_link_xcat = sym_setindex(self.category, suffix_link_xcat_index) # <<<<<<<<<<<<<<
@@ -55184,7 +55708,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_21 = __Pyx_PyInt_As_int(__pyx_cur_scope->__pyx_v_suffix_link_xcat_index); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_cur_scope->__pyx_v_suffix_link_xcat = __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_21);
- /* "rulefactory.pxi":1122
+ /* "cdec/sa/rulefactory.pxi":1122
* suffix_link_xcat_index = xcat_index-1
* suffix_link_xcat = sym_setindex(self.category, suffix_link_xcat_index)
* node.children[xcat] = ExtendedTrieNode(phrase_location=node.phrase_location, # <<<<<<<<<<<<<<
@@ -55198,7 +55722,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
if (PyDict_SetItem(__pyx_t_16, __pyx_n_s_phrase_location, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- /* "rulefactory.pxi":1123
+ /* "cdec/sa/rulefactory.pxi":1123
* suffix_link_xcat = sym_setindex(self.category, suffix_link_xcat_index)
* node.children[xcat] = ExtendedTrieNode(phrase_location=node.phrase_location,
* suffix_link=node.suffix_link.children[suffix_link_xcat], # <<<<<<<<<<<<<<
@@ -55216,7 +55740,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
if (PyDict_SetItem(__pyx_t_16, __pyx_n_s_suffix_link, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- /* "rulefactory.pxi":1124
+ /* "cdec/sa/rulefactory.pxi":1124
* node.children[xcat] = ExtendedTrieNode(phrase_location=node.phrase_location,
* suffix_link=node.suffix_link.children[suffix_link_xcat],
* phrase= Phrase(phrase + (xcat,))) # <<<<<<<<<<<<<<
@@ -55244,7 +55768,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
if (PyDict_SetItem(__pyx_t_16, __pyx_n_s_phrase, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- /* "rulefactory.pxi":1122
+ /* "cdec/sa/rulefactory.pxi":1122
* suffix_link_xcat_index = xcat_index-1
* suffix_link_xcat = sym_setindex(self.category, suffix_link_xcat_index)
* node.children[xcat] = ExtendedTrieNode(phrase_location=node.phrase_location, # <<<<<<<<<<<<<<
@@ -55263,7 +55787,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
__pyx_L38:;
- /* "rulefactory.pxi":1127
+ /* "cdec/sa/rulefactory.pxi":1127
*
* # sample from range
* if not is_shadow_path: # <<<<<<<<<<<<<<
@@ -55274,7 +55798,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_9 = ((!__pyx_t_13) != 0);
if (__pyx_t_9) {
- /* "rulefactory.pxi":1128
+ /* "cdec/sa/rulefactory.pxi":1128
* # sample from range
* if not is_shadow_path:
* sample = self.sampler.sample(node.phrase_location) # <<<<<<<<<<<<<<
@@ -55317,7 +55841,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_15);
__pyx_t_15 = 0;
- /* "rulefactory.pxi":1129
+ /* "cdec/sa/rulefactory.pxi":1129
* if not is_shadow_path:
* sample = self.sampler.sample(node.phrase_location)
* num_subpatterns = (<PhraseLocation> node.phrase_location).num_subpatterns # <<<<<<<<<<<<<<
@@ -55330,7 +55854,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
__pyx_cur_scope->__pyx_v_num_subpatterns = __pyx_t_21;
- /* "rulefactory.pxi":1130
+ /* "cdec/sa/rulefactory.pxi":1130
* sample = self.sampler.sample(node.phrase_location)
* num_subpatterns = (<PhraseLocation> node.phrase_location).num_subpatterns
* chunklen = IntList(initial_len=num_subpatterns) # <<<<<<<<<<<<<<
@@ -55351,7 +55875,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_16);
__pyx_t_16 = 0;
- /* "rulefactory.pxi":1131
+ /* "cdec/sa/rulefactory.pxi":1131
* num_subpatterns = (<PhraseLocation> node.phrase_location).num_subpatterns
* chunklen = IntList(initial_len=num_subpatterns)
* for j from 0 <= j < num_subpatterns: # <<<<<<<<<<<<<<
@@ -55361,7 +55885,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_21 = __pyx_cur_scope->__pyx_v_num_subpatterns;
for (__pyx_cur_scope->__pyx_v_j = 0; __pyx_cur_scope->__pyx_v_j < __pyx_t_21; __pyx_cur_scope->__pyx_v_j++) {
- /* "rulefactory.pxi":1132
+ /* "cdec/sa/rulefactory.pxi":1132
* chunklen = IntList(initial_len=num_subpatterns)
* for j from 0 <= j < num_subpatterns:
* chunklen.arr[j] = hiero_phrase.chunklen(j) # <<<<<<<<<<<<<<
@@ -55371,7 +55895,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
(__pyx_cur_scope->__pyx_v_chunklen->arr[__pyx_cur_scope->__pyx_v_j]) = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Phrase *)__pyx_cur_scope->__pyx_v_hiero_phrase->__pyx_vtab)->chunklen(__pyx_cur_scope->__pyx_v_hiero_phrase, __pyx_cur_scope->__pyx_v_j);
}
- /* "rulefactory.pxi":1133
+ /* "cdec/sa/rulefactory.pxi":1133
* for j from 0 <= j < num_subpatterns:
* chunklen.arr[j] = hiero_phrase.chunklen(j)
* extracts = [] # <<<<<<<<<<<<<<
@@ -55385,7 +55909,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_16);
__pyx_t_16 = 0;
- /* "rulefactory.pxi":1134
+ /* "cdec/sa/rulefactory.pxi":1134
* chunklen.arr[j] = hiero_phrase.chunklen(j)
* extracts = []
* j = 0 # <<<<<<<<<<<<<<
@@ -55394,7 +55918,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
*/
__pyx_cur_scope->__pyx_v_j = 0;
- /* "rulefactory.pxi":1135
+ /* "cdec/sa/rulefactory.pxi":1135
* extracts = []
* j = 0
* extract_start = monitor_cpu() # <<<<<<<<<<<<<<
@@ -55426,7 +55950,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_16);
__pyx_t_16 = 0;
- /* "rulefactory.pxi":1136
+ /* "cdec/sa/rulefactory.pxi":1136
* j = 0
* extract_start = monitor_cpu()
* while j < sample.len: # <<<<<<<<<<<<<<
@@ -55437,7 +55961,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_9 = ((__pyx_cur_scope->__pyx_v_j < __pyx_cur_scope->__pyx_v_sample->len) != 0);
if (!__pyx_t_9) break;
- /* "rulefactory.pxi":1137
+ /* "cdec/sa/rulefactory.pxi":1137
* extract_start = monitor_cpu()
* while j < sample.len:
* extract = [] # <<<<<<<<<<<<<<
@@ -55451,7 +55975,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_16);
__pyx_t_16 = 0;
- /* "rulefactory.pxi":1139
+ /* "cdec/sa/rulefactory.pxi":1139
* extract = []
*
* assign_matching(&matching, sample.arr, j, num_subpatterns, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -55460,7 +55984,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
*/
__pyx_f_4cdec_2sa_3_sa_assign_matching((&__pyx_cur_scope->__pyx_v_matching), __pyx_cur_scope->__pyx_v_sample->arr, __pyx_cur_scope->__pyx_v_j, __pyx_cur_scope->__pyx_v_num_subpatterns, __pyx_cur_scope->__pyx_v_self->fda->sent_id->arr);
- /* "rulefactory.pxi":1140
+ /* "cdec/sa/rulefactory.pxi":1140
*
* assign_matching(&matching, sample.arr, j, num_subpatterns, self.fda.sent_id.arr)
* loc = tuple(sample[j:j+num_subpatterns]) # <<<<<<<<<<<<<<
@@ -55482,7 +56006,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_16);
__pyx_t_16 = 0;
- /* "rulefactory.pxi":1141
+ /* "cdec/sa/rulefactory.pxi":1141
* assign_matching(&matching, sample.arr, j, num_subpatterns, self.fda.sent_id.arr)
* loc = tuple(sample[j:j+num_subpatterns])
* extract = self.extract(hiero_phrase, &matching, chunklen.arr, num_subpatterns) # <<<<<<<<<<<<<<
@@ -55496,7 +56020,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_16);
__pyx_t_16 = 0;
- /* "rulefactory.pxi":1142
+ /* "cdec/sa/rulefactory.pxi":1142
* loc = tuple(sample[j:j+num_subpatterns])
* extract = self.extract(hiero_phrase, &matching, chunklen.arr, num_subpatterns)
* extracts.extend([(e, loc) for e in extract]) # <<<<<<<<<<<<<<
@@ -55561,7 +56085,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_12 = __Pyx_PyList_Extend(__pyx_cur_scope->__pyx_v_extracts, __pyx_t_16); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- /* "rulefactory.pxi":1143
+ /* "cdec/sa/rulefactory.pxi":1143
* extract = self.extract(hiero_phrase, &matching, chunklen.arr, num_subpatterns)
* extracts.extend([(e, loc) for e in extract])
* j = j + num_subpatterns # <<<<<<<<<<<<<<
@@ -55571,7 +56095,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_cur_scope->__pyx_v_j = (__pyx_cur_scope->__pyx_v_j + __pyx_cur_scope->__pyx_v_num_subpatterns);
}
- /* "rulefactory.pxi":1145
+ /* "cdec/sa/rulefactory.pxi":1145
* j = j + num_subpatterns
*
* num_samples = sample.len/num_subpatterns # <<<<<<<<<<<<<<
@@ -55600,7 +56124,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
__pyx_cur_scope->__pyx_v_num_samples = __Pyx_div_int(__pyx_cur_scope->__pyx_v_sample->len, __pyx_cur_scope->__pyx_v_num_subpatterns);
- /* "rulefactory.pxi":1146
+ /* "cdec/sa/rulefactory.pxi":1146
*
* num_samples = sample.len/num_subpatterns
* extract_stop = monitor_cpu() # <<<<<<<<<<<<<<
@@ -55632,7 +56156,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_16);
__pyx_t_16 = 0;
- /* "rulefactory.pxi":1147
+ /* "cdec/sa/rulefactory.pxi":1147
* num_samples = sample.len/num_subpatterns
* extract_stop = monitor_cpu()
* self.extract_time = self.extract_time + extract_stop - extract_start # <<<<<<<<<<<<<<
@@ -55651,7 +56175,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
__pyx_cur_scope->__pyx_v_self->extract_time = __pyx_t_5;
- /* "rulefactory.pxi":1148
+ /* "cdec/sa/rulefactory.pxi":1148
* extract_stop = monitor_cpu()
* self.extract_time = self.extract_time + extract_stop - extract_start
* if len(extracts) > 0: # <<<<<<<<<<<<<<
@@ -55662,7 +56186,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_9 = ((__pyx_t_7 > 0) != 0);
if (__pyx_t_9) {
- /* "rulefactory.pxi":1149
+ /* "cdec/sa/rulefactory.pxi":1149
* self.extract_time = self.extract_time + extract_stop - extract_start
* if len(extracts) > 0:
* fcount = Counter() # <<<<<<<<<<<<<<
@@ -55694,7 +56218,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_16);
__pyx_t_16 = 0;
- /* "rulefactory.pxi":1150
+ /* "cdec/sa/rulefactory.pxi":1150
* if len(extracts) > 0:
* fcount = Counter()
* fphrases = defaultdict(lambda: defaultdict(lambda: defaultdict(list))) # <<<<<<<<<<<<<<
@@ -55703,7 +56227,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
*/
__pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_defaultdict); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- __pyx_t_10 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_lambda3, 0, __pyx_n_s_input_locals_lambda, NULL, __pyx_n_s_cdec_sa__sa, __pyx_d, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_lambda5, 0, __pyx_n_s_input_locals_lambda, NULL, __pyx_n_s_cdec_sa__sa, __pyx_d, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__pyx_t_3 = NULL;
if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_15))) {
@@ -55736,7 +56260,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_16);
__pyx_t_16 = 0;
- /* "rulefactory.pxi":1151
+ /* "cdec/sa/rulefactory.pxi":1151
* fcount = Counter()
* fphrases = defaultdict(lambda: defaultdict(lambda: defaultdict(list)))
* for (f, e, count, als), loc in extracts: # <<<<<<<<<<<<<<
@@ -55885,7 +56409,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_10);
__pyx_t_10 = 0;
- /* "rulefactory.pxi":1152
+ /* "cdec/sa/rulefactory.pxi":1152
* fphrases = defaultdict(lambda: defaultdict(lambda: defaultdict(list)))
* for (f, e, count, als), loc in extracts:
* fcount[f] += count # <<<<<<<<<<<<<<
@@ -55903,7 +56427,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- /* "rulefactory.pxi":1153
+ /* "cdec/sa/rulefactory.pxi":1153
* for (f, e, count, als), loc in extracts:
* fcount[f] += count
* fphrases[f][e][als].append(loc) # <<<<<<<<<<<<<<
@@ -55921,7 +56445,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_12 = __Pyx_PyObject_Append(__pyx_t_15, __pyx_cur_scope->__pyx_v_loc); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- /* "rulefactory.pxi":1151
+ /* "cdec/sa/rulefactory.pxi":1151
* fcount = Counter()
* fphrases = defaultdict(lambda: defaultdict(lambda: defaultdict(list)))
* for (f, e, count, als), loc in extracts: # <<<<<<<<<<<<<<
@@ -55931,7 +56455,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- /* "rulefactory.pxi":1154
+ /* "cdec/sa/rulefactory.pxi":1154
* fcount[f] += count
* fphrases[f][e][als].append(loc)
* for f, elist in fphrases.iteritems(): # <<<<<<<<<<<<<<
@@ -55963,7 +56487,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_1 = 0;
- /* "rulefactory.pxi":1155
+ /* "cdec/sa/rulefactory.pxi":1155
* fphrases[f][e][als].append(loc)
* for f, elist in fphrases.iteritems():
* for e, alslist in elist.iteritems(): # <<<<<<<<<<<<<<
@@ -55995,7 +56519,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_10);
__pyx_t_10 = 0;
- /* "rulefactory.pxi":1156
+ /* "cdec/sa/rulefactory.pxi":1156
* for f, elist in fphrases.iteritems():
* for e, alslist in elist.iteritems():
* alignment, max_locs = max(alslist.iteritems(), key=lambda x: len(x[1])) # <<<<<<<<<<<<<<
@@ -56029,7 +56553,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_10 = 0;
__pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_1lambda5, 0, __pyx_n_s_input_locals_lambda, NULL, __pyx_n_s_cdec_sa__sa, __pyx_d, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_1lambda7, 0, __pyx_n_s_input_locals_lambda, NULL, __pyx_n_s_cdec_sa__sa, __pyx_d, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_key, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
@@ -56096,7 +56620,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_15);
__pyx_t_15 = 0;
- /* "rulefactory.pxi":1157
+ /* "cdec/sa/rulefactory.pxi":1157
* for e, alslist in elist.iteritems():
* alignment, max_locs = max(alslist.iteritems(), key=lambda x: len(x[1]))
* locs = tuple(itertools.chain.from_iterable(alslist.itervalues())) # <<<<<<<<<<<<<<
@@ -56170,7 +56694,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_4);
__pyx_t_4 = 0;
- /* "rulefactory.pxi":1158
+ /* "cdec/sa/rulefactory.pxi":1158
* alignment, max_locs = max(alslist.iteritems(), key=lambda x: len(x[1]))
* locs = tuple(itertools.chain.from_iterable(alslist.itervalues()))
* count = len(locs) # <<<<<<<<<<<<<<
@@ -56185,7 +56709,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_4);
__pyx_t_4 = 0;
- /* "rulefactory.pxi":1159
+ /* "cdec/sa/rulefactory.pxi":1159
* locs = tuple(itertools.chain.from_iterable(alslist.itervalues()))
* count = len(locs)
* scores = self.scorer.score(FeatureContext( # <<<<<<<<<<<<<<
@@ -56195,7 +56719,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_FeatureContext); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- /* "rulefactory.pxi":1160
+ /* "cdec/sa/rulefactory.pxi":1160
* count = len(locs)
* scores = self.scorer.score(FeatureContext(
* f, e, count, fcount[f], num_samples, # <<<<<<<<<<<<<<
@@ -56207,7 +56731,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_10 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_num_samples); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- /* "rulefactory.pxi":1161
+ /* "cdec/sa/rulefactory.pxi":1161
* scores = self.scorer.score(FeatureContext(
* f, e, count, fcount[f], num_samples,
* (k,i+spanlen), locs, input_match, # <<<<<<<<<<<<<<
@@ -56230,7 +56754,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_18 = 0;
__pyx_t_11 = 0;
- /* "rulefactory.pxi":1165
+ /* "cdec/sa/rulefactory.pxi":1165
* meta,
* # Include online stats. None if none.
* self.online_ctx_lookup(f, e, ctx_name))) # <<<<<<<<<<<<<<
@@ -56330,7 +56854,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- /* "rulefactory.pxi":1159
+ /* "cdec/sa/rulefactory.pxi":1159
* locs = tuple(itertools.chain.from_iterable(alslist.itervalues()))
* count = len(locs)
* scores = self.scorer.score(FeatureContext( # <<<<<<<<<<<<<<
@@ -56345,7 +56869,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_15);
__pyx_t_15 = 0;
- /* "rulefactory.pxi":1167
+ /* "cdec/sa/rulefactory.pxi":1167
* self.online_ctx_lookup(f, e, ctx_name)))
* # Phrase pair processed
* if self.online: # <<<<<<<<<<<<<<
@@ -56355,7 +56879,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_9 = (__pyx_cur_scope->__pyx_v_self->online != 0);
if (__pyx_t_9) {
- /* "rulefactory.pxi":1168
+ /* "cdec/sa/rulefactory.pxi":1168
* # Phrase pair processed
* if self.online:
* seen_phrases.add((f, e)) # <<<<<<<<<<<<<<
@@ -56376,7 +56900,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
__pyx_L60:;
- /* "rulefactory.pxi":1169
+ /* "cdec/sa/rulefactory.pxi":1169
* if self.online:
* seen_phrases.add((f, e))
* yield Rule(self.category, f, e, scores, alignment) # <<<<<<<<<<<<<<
@@ -56457,7 +56981,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
__pyx_L32:;
- /* "rulefactory.pxi":1171
+ /* "cdec/sa/rulefactory.pxi":1171
* yield Rule(self.category, f, e, scores, alignment)
*
* if len(phrase) < self.max_length and i+spanlen < len(fwords) and pathlen+1 <= self.max_initial_size: # <<<<<<<<<<<<<<
@@ -56509,7 +57033,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_L63_bool_binop_done:;
if (__pyx_t_9) {
- /* "rulefactory.pxi":1172
+ /* "cdec/sa/rulefactory.pxi":1172
*
* if len(phrase) < self.max_length and i+spanlen < len(fwords) and pathlen+1 <= self.max_initial_size:
* for alt_id in range(len(fwords[i+spanlen])): # <<<<<<<<<<<<<<
@@ -56529,7 +57053,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_23; __pyx_t_21+=1) {
__pyx_cur_scope->__pyx_v_alt_id = __pyx_t_21;
- /* "rulefactory.pxi":1173
+ /* "cdec/sa/rulefactory.pxi":1173
* if len(phrase) < self.max_length and i+spanlen < len(fwords) and pathlen+1 <= self.max_initial_size:
* for alt_id in range(len(fwords[i+spanlen])):
* new_frontier.append((k, i+spanlen, input_match, alt_id, pathlen + 1, node, phrase, is_shadow_path)) # <<<<<<<<<<<<<<
@@ -56577,7 +57101,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
}
- /* "rulefactory.pxi":1174
+ /* "cdec/sa/rulefactory.pxi":1174
* for alt_id in range(len(fwords[i+spanlen])):
* new_frontier.append((k, i+spanlen, input_match, alt_id, pathlen + 1, node, phrase, is_shadow_path))
* num_subpatterns = arity # <<<<<<<<<<<<<<
@@ -56586,7 +57110,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
*/
__pyx_cur_scope->__pyx_v_num_subpatterns = __pyx_cur_scope->__pyx_v_arity;
- /* "rulefactory.pxi":1175
+ /* "cdec/sa/rulefactory.pxi":1175
* new_frontier.append((k, i+spanlen, input_match, alt_id, pathlen + 1, node, phrase, is_shadow_path))
* num_subpatterns = arity
* if not is_shadow_path: # <<<<<<<<<<<<<<
@@ -56597,7 +57121,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_13 = ((!__pyx_t_9) != 0);
if (__pyx_t_13) {
- /* "rulefactory.pxi":1176
+ /* "cdec/sa/rulefactory.pxi":1176
* num_subpatterns = arity
* if not is_shadow_path:
* num_subpatterns = num_subpatterns + 1 # <<<<<<<<<<<<<<
@@ -56609,7 +57133,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
__pyx_L68:;
- /* "rulefactory.pxi":1177
+ /* "cdec/sa/rulefactory.pxi":1177
* if not is_shadow_path:
* num_subpatterns = num_subpatterns + 1
* if len(phrase)+1 < self.max_length and arity < self.max_nonterminals and num_subpatterns < self.max_chunks: # <<<<<<<<<<<<<<
@@ -56638,7 +57162,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_L70_bool_binop_done:;
if (__pyx_t_13) {
- /* "rulefactory.pxi":1178
+ /* "cdec/sa/rulefactory.pxi":1178
* num_subpatterns = num_subpatterns + 1
* if len(phrase)+1 < self.max_length and arity < self.max_nonterminals and num_subpatterns < self.max_chunks:
* xcat = sym_setindex(self.category, arity+1) # <<<<<<<<<<<<<<
@@ -56647,7 +57171,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
*/
__pyx_cur_scope->__pyx_v_xcat = __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, (__pyx_cur_scope->__pyx_v_arity + 1));
- /* "rulefactory.pxi":1179
+ /* "cdec/sa/rulefactory.pxi":1179
* if len(phrase)+1 < self.max_length and arity < self.max_nonterminals and num_subpatterns < self.max_chunks:
* xcat = sym_setindex(self.category, arity+1)
* xnode = node.children[xcat] # <<<<<<<<<<<<<<
@@ -56664,7 +57188,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_4);
__pyx_t_4 = 0;
- /* "rulefactory.pxi":1181
+ /* "cdec/sa/rulefactory.pxi":1181
* xnode = node.children[xcat]
* # I put spanlen=1 below
* key = tuple([self.min_gap_size, i, 1, pathlen]) # <<<<<<<<<<<<<<
@@ -56697,7 +57221,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_27);
__pyx_t_27 = 0;
- /* "rulefactory.pxi":1182
+ /* "cdec/sa/rulefactory.pxi":1182
* # I put spanlen=1 below
* key = tuple([self.min_gap_size, i, 1, pathlen])
* frontier_nodes = [] # <<<<<<<<<<<<<<
@@ -56711,7 +57235,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_27);
__pyx_t_27 = 0;
- /* "rulefactory.pxi":1183
+ /* "cdec/sa/rulefactory.pxi":1183
* key = tuple([self.min_gap_size, i, 1, pathlen])
* frontier_nodes = []
* if key in nodes_isteps_away_buffer: # <<<<<<<<<<<<<<
@@ -56722,7 +57246,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_9 = (__pyx_t_13 != 0);
if (__pyx_t_9) {
- /* "rulefactory.pxi":1184
+ /* "cdec/sa/rulefactory.pxi":1184
* frontier_nodes = []
* if key in nodes_isteps_away_buffer:
* frontier_nodes = nodes_isteps_away_buffer[key] # <<<<<<<<<<<<<<
@@ -56739,7 +57263,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
/*else*/ {
- /* "rulefactory.pxi":1186
+ /* "cdec/sa/rulefactory.pxi":1186
* frontier_nodes = nodes_isteps_away_buffer[key]
* else:
* frontier_nodes = self.get_all_nodes_isteps_away(self.min_gap_size, i, 1, pathlen, fwords, next_states, reachable_buffer) # <<<<<<<<<<<<<<
@@ -56799,7 +57323,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_27);
__pyx_t_27 = 0;
- /* "rulefactory.pxi":1187
+ /* "cdec/sa/rulefactory.pxi":1187
* else:
* frontier_nodes = self.get_all_nodes_isteps_away(self.min_gap_size, i, 1, pathlen, fwords, next_states, reachable_buffer)
* nodes_isteps_away_buffer[key] = frontier_nodes # <<<<<<<<<<<<<<
@@ -56810,7 +57334,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
__pyx_L73:;
- /* "rulefactory.pxi":1189
+ /* "cdec/sa/rulefactory.pxi":1189
* nodes_isteps_away_buffer[key] = frontier_nodes
*
* for i, alt, pathlen in frontier_nodes: # <<<<<<<<<<<<<<
@@ -56922,7 +57446,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_4);
__pyx_t_4 = 0;
- /* "rulefactory.pxi":1190
+ /* "cdec/sa/rulefactory.pxi":1190
*
* for i, alt, pathlen in frontier_nodes:
* new_frontier.append((k, i, input_match + (i,), alt, pathlen, xnode, phrase +(xcat,), is_shadow_path)) # <<<<<<<<<<<<<<
@@ -56984,7 +57508,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_12 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_new_frontier, __pyx_t_3); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "rulefactory.pxi":1189
+ /* "cdec/sa/rulefactory.pxi":1189
* nodes_isteps_away_buffer[key] = frontier_nodes
*
* for i, alt, pathlen in frontier_nodes: # <<<<<<<<<<<<<<
@@ -57000,7 +57524,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
__pyx_L62:;
- /* "rulefactory.pxi":1033
+ /* "cdec/sa/rulefactory.pxi":1033
* while len(frontier) > 0:
* new_frontier = []
* for k, i, input_match, alt, pathlen, node, prefix, is_shadow_path in frontier: # <<<<<<<<<<<<<<
@@ -57011,7 +57535,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- /* "rulefactory.pxi":1191
+ /* "cdec/sa/rulefactory.pxi":1191
* for i, alt, pathlen in frontier_nodes:
* new_frontier.append((k, i, input_match + (i,), alt, pathlen, xnode, phrase +(xcat,), is_shadow_path))
* frontier = new_frontier # <<<<<<<<<<<<<<
@@ -57024,7 +57548,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_new_frontier);
}
- /* "rulefactory.pxi":1194
+ /* "cdec/sa/rulefactory.pxi":1194
*
* # Online rule extraction and scoring
* if self.online: # <<<<<<<<<<<<<<
@@ -57034,7 +57558,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_9 = (__pyx_cur_scope->__pyx_v_self->online != 0);
if (__pyx_t_9) {
- /* "rulefactory.pxi":1195
+ /* "cdec/sa/rulefactory.pxi":1195
* # Online rule extraction and scoring
* if self.online:
* stats = self.online_stats[ctx_name] # <<<<<<<<<<<<<<
@@ -57047,7 +57571,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_cur_scope->__pyx_v_stats = __pyx_t_14;
__pyx_t_14 = 0;
- /* "rulefactory.pxi":1196
+ /* "cdec/sa/rulefactory.pxi":1196
* if self.online:
* stats = self.online_stats[ctx_name]
* f_syms = tuple(word[0][0] for word in fwords) # <<<<<<<<<<<<<<
@@ -57068,7 +57592,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_cur_scope->__pyx_v_f_syms = ((PyObject*)__pyx_t_14);
__pyx_t_14 = 0;
- /* "rulefactory.pxi":1197
+ /* "cdec/sa/rulefactory.pxi":1197
* stats = self.online_stats[ctx_name]
* f_syms = tuple(word[0][0] for word in fwords)
* for f, lex_i, lex_j in self.get_f_phrases(f_syms): # <<<<<<<<<<<<<<
@@ -57210,7 +57734,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_11);
__pyx_t_11 = 0;
- /* "rulefactory.pxi":1198
+ /* "cdec/sa/rulefactory.pxi":1198
* f_syms = tuple(word[0][0] for word in fwords)
* for f, lex_i, lex_j in self.get_f_phrases(f_syms):
* spanlen = (lex_j - lex_i) + 1 # <<<<<<<<<<<<<<
@@ -57227,7 +57751,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_11);
__pyx_t_11 = 0;
- /* "rulefactory.pxi":1199
+ /* "cdec/sa/rulefactory.pxi":1199
* for f, lex_i, lex_j in self.get_f_phrases(f_syms):
* spanlen = (lex_j - lex_i) + 1
* if not sym_isvar(f[0]): # <<<<<<<<<<<<<<
@@ -57241,7 +57765,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_9 = ((!(__pyx_f_4cdec_2sa_3_sa_sym_isvar(__pyx_t_8) != 0)) != 0);
if (__pyx_t_9) {
- /* "rulefactory.pxi":1200
+ /* "cdec/sa/rulefactory.pxi":1200
* spanlen = (lex_j - lex_i) + 1
* if not sym_isvar(f[0]):
* spanlen += 1 # <<<<<<<<<<<<<<
@@ -57258,7 +57782,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
__pyx_L83:;
- /* "rulefactory.pxi":1201
+ /* "cdec/sa/rulefactory.pxi":1201
* if not sym_isvar(f[0]):
* spanlen += 1
* if not sym_isvar(f[1]): # <<<<<<<<<<<<<<
@@ -57272,7 +57796,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_9 = ((!(__pyx_f_4cdec_2sa_3_sa_sym_isvar(__pyx_t_8) != 0)) != 0);
if (__pyx_t_9) {
- /* "rulefactory.pxi":1202
+ /* "cdec/sa/rulefactory.pxi":1202
* spanlen += 1
* if not sym_isvar(f[1]):
* spanlen += 1 # <<<<<<<<<<<<<<
@@ -57289,7 +57813,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
__pyx_L84:;
- /* "rulefactory.pxi":1203
+ /* "cdec/sa/rulefactory.pxi":1203
* if not sym_isvar(f[1]):
* spanlen += 1
* for e in stats.phrases_fe.get(f, ()): # <<<<<<<<<<<<<<
@@ -57371,7 +57895,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_11);
__pyx_t_11 = 0;
- /* "rulefactory.pxi":1204
+ /* "cdec/sa/rulefactory.pxi":1204
* spanlen += 1
* for e in stats.phrases_fe.get(f, ()):
* if (f, e) not in seen_phrases: # <<<<<<<<<<<<<<
@@ -57391,7 +57915,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_13 = (__pyx_t_9 != 0);
if (__pyx_t_13) {
- /* "rulefactory.pxi":1206
+ /* "cdec/sa/rulefactory.pxi":1206
* if (f, e) not in seen_phrases:
* # Don't add multiple instances of the same phrase here
* seen_phrases.add((f, e)) # <<<<<<<<<<<<<<
@@ -57409,7 +57933,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_12 = PySet_Add(__pyx_cur_scope->__pyx_v_seen_phrases, __pyx_t_11); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- /* "rulefactory.pxi":1207
+ /* "cdec/sa/rulefactory.pxi":1207
* # Don't add multiple instances of the same phrase here
* seen_phrases.add((f, e))
* scores = self.scorer.score(FeatureContext( # <<<<<<<<<<<<<<
@@ -57419,7 +57943,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FeatureContext); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- /* "rulefactory.pxi":1212
+ /* "cdec/sa/rulefactory.pxi":1212
* fwords, self.fda, self.eda,
* meta,
* self.online_ctx_lookup(f, e, ctx_name))) # <<<<<<<<<<<<<<
@@ -57519,7 +58043,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "rulefactory.pxi":1207
+ /* "cdec/sa/rulefactory.pxi":1207
* # Don't add multiple instances of the same phrase here
* seen_phrases.add((f, e))
* scores = self.scorer.score(FeatureContext( # <<<<<<<<<<<<<<
@@ -57534,7 +58058,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_1 = 0;
- /* "rulefactory.pxi":1213
+ /* "cdec/sa/rulefactory.pxi":1213
* meta,
* self.online_ctx_lookup(f, e, ctx_name)))
* alignment = stats.phrases_al[f][e] # <<<<<<<<<<<<<<
@@ -57554,7 +58078,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_1 = 0;
- /* "rulefactory.pxi":1214
+ /* "cdec/sa/rulefactory.pxi":1214
* self.online_ctx_lookup(f, e, ctx_name)))
* alignment = stats.phrases_al[f][e]
* yield Rule(self.category, f, e, scores, alignment) # <<<<<<<<<<<<<<
@@ -57614,7 +58138,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
__pyx_L87:;
- /* "rulefactory.pxi":1203
+ /* "cdec/sa/rulefactory.pxi":1203
* if not sym_isvar(f[1]):
* spanlen += 1
* for e in stats.phrases_fe.get(f, ()): # <<<<<<<<<<<<<<
@@ -57624,7 +58148,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "rulefactory.pxi":1197
+ /* "cdec/sa/rulefactory.pxi":1197
* stats = self.online_stats[ctx_name]
* f_syms = tuple(word[0][0] for word in fwords)
* for f, lex_i, lex_j in self.get_f_phrases(f_syms): # <<<<<<<<<<<<<<
@@ -57637,7 +58161,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
__pyx_L78:;
- /* "rulefactory.pxi":1216
+ /* "cdec/sa/rulefactory.pxi":1216
* yield Rule(self.category, f, e, scores, alignment)
*
* stop_time = monitor_cpu() # <<<<<<<<<<<<<<
@@ -57668,7 +58192,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_cur_scope->__pyx_v_stop_time = __pyx_t_27;
__pyx_t_27 = 0;
- /* "rulefactory.pxi":1217
+ /* "cdec/sa/rulefactory.pxi":1217
*
* stop_time = monitor_cpu()
* logger.info("Total time for rule lookup, extraction, and scoring = %f seconds", (stop_time - start_time)) # <<<<<<<<<<<<<<
@@ -57714,7 +58238,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
- /* "rulefactory.pxi":1218
+ /* "cdec/sa/rulefactory.pxi":1218
* stop_time = monitor_cpu()
* logger.info("Total time for rule lookup, extraction, and scoring = %f seconds", (stop_time - start_time))
* gc.collect() # <<<<<<<<<<<<<<
@@ -57746,7 +58270,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
__Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
- /* "rulefactory.pxi":1219
+ /* "cdec/sa/rulefactory.pxi":1219
* logger.info("Total time for rule lookup, extraction, and scoring = %f seconds", (stop_time - start_time))
* gc.collect()
* logger.info(" Extract time = %f seconds", self.extract_time) # <<<<<<<<<<<<<<
@@ -57789,7 +58313,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
- /* "rulefactory.pxi":1220
+ /* "cdec/sa/rulefactory.pxi":1220
* gc.collect()
* logger.info(" Extract time = %f seconds", self.extract_time)
* logger.info(" Intersect time = %f seconds", self.intersect_time) # <<<<<<<<<<<<<<
@@ -57832,7 +58356,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
- /* "rulefactory.pxi":981
+ /* "cdec/sa/rulefactory.pxi":981
* return sorted(result);
*
* def input(self, fwords, meta, ctx_name=None): # <<<<<<<<<<<<<<
@@ -57865,7 +58389,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
return NULL;
}
-/* "rulefactory.pxi":1223
+/* "cdec/sa/rulefactory.pxi":1223
*
*
* cdef int find_fixpoint(self, # <<<<<<<<<<<<<<
@@ -57894,7 +58418,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("find_fixpoint", 0);
- /* "rulefactory.pxi":1238
+ /* "cdec/sa/rulefactory.pxi":1238
* cdef int e_low_prev, e_high_prev, f_low_prev, f_high_prev, new_x, new_low_x, new_high_x
*
* e_low[0] = e_in_low # <<<<<<<<<<<<<<
@@ -57903,7 +58427,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
*/
(__pyx_v_e_low[0]) = __pyx_v_e_in_low;
- /* "rulefactory.pxi":1239
+ /* "cdec/sa/rulefactory.pxi":1239
*
* e_low[0] = e_in_low
* e_high[0] = e_in_high # <<<<<<<<<<<<<<
@@ -57912,7 +58436,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
*/
(__pyx_v_e_high[0]) = __pyx_v_e_in_high;
- /* "rulefactory.pxi":1240
+ /* "cdec/sa/rulefactory.pxi":1240
* e_low[0] = e_in_low
* e_high[0] = e_in_high
* self.find_projection(f_low, f_high, f_links_low, f_links_high, e_low, e_high) # <<<<<<<<<<<<<<
@@ -57924,7 +58448,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "rulefactory.pxi":1241
+ /* "cdec/sa/rulefactory.pxi":1241
* e_high[0] = e_in_high
* self.find_projection(f_low, f_high, f_links_low, f_links_high, e_low, e_high)
* if e_low[0] == -1: # <<<<<<<<<<<<<<
@@ -57934,7 +58458,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_t_3 = (((__pyx_v_e_low[0]) == -1) != 0);
if (__pyx_t_3) {
- /* "rulefactory.pxi":1247
+ /* "cdec/sa/rulefactory.pxi":1247
* # rule X -> X_1 w X_2 / X_1 X_2. This is probably
* # not worth the bother, though.
* return 0 # <<<<<<<<<<<<<<
@@ -57945,7 +58469,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
goto __pyx_L0;
}
- /* "rulefactory.pxi":1248
+ /* "cdec/sa/rulefactory.pxi":1248
* # not worth the bother, though.
* return 0
* elif e_in_low != -1 and e_low[0] != e_in_low: # <<<<<<<<<<<<<<
@@ -57965,7 +58489,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_L4_bool_binop_done:;
if (__pyx_t_3) {
- /* "rulefactory.pxi":1249
+ /* "cdec/sa/rulefactory.pxi":1249
* return 0
* elif e_in_low != -1 and e_low[0] != e_in_low:
* if e_in_low - e_low[0] < min_ex_size: # <<<<<<<<<<<<<<
@@ -57975,7 +58499,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_t_3 = (((__pyx_v_e_in_low - (__pyx_v_e_low[0])) < __pyx_v_min_ex_size) != 0);
if (__pyx_t_3) {
- /* "rulefactory.pxi":1250
+ /* "cdec/sa/rulefactory.pxi":1250
* elif e_in_low != -1 and e_low[0] != e_in_low:
* if e_in_low - e_low[0] < min_ex_size:
* e_low[0] = e_in_low - min_ex_size # <<<<<<<<<<<<<<
@@ -57984,7 +58508,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
*/
(__pyx_v_e_low[0]) = (__pyx_v_e_in_low - __pyx_v_min_ex_size);
- /* "rulefactory.pxi":1251
+ /* "cdec/sa/rulefactory.pxi":1251
* if e_in_low - e_low[0] < min_ex_size:
* e_low[0] = e_in_low - min_ex_size
* if e_low[0] < 0: # <<<<<<<<<<<<<<
@@ -57994,7 +58518,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_t_3 = (((__pyx_v_e_low[0]) < 0) != 0);
if (__pyx_t_3) {
- /* "rulefactory.pxi":1252
+ /* "cdec/sa/rulefactory.pxi":1252
* e_low[0] = e_in_low - min_ex_size
* if e_low[0] < 0:
* return 0 # <<<<<<<<<<<<<<
@@ -58011,7 +58535,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
}
__pyx_L3:;
- /* "rulefactory.pxi":1254
+ /* "cdec/sa/rulefactory.pxi":1254
* return 0
*
* if e_high[0] - e_low[0] > max_e_len: # <<<<<<<<<<<<<<
@@ -58021,7 +58545,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_t_3 = ((((__pyx_v_e_high[0]) - (__pyx_v_e_low[0])) > __pyx_v_max_e_len) != 0);
if (__pyx_t_3) {
- /* "rulefactory.pxi":1255
+ /* "cdec/sa/rulefactory.pxi":1255
*
* if e_high[0] - e_low[0] > max_e_len:
* return 0 # <<<<<<<<<<<<<<
@@ -58032,7 +58556,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
goto __pyx_L0;
}
- /* "rulefactory.pxi":1256
+ /* "cdec/sa/rulefactory.pxi":1256
* if e_high[0] - e_low[0] > max_e_len:
* return 0
* elif e_in_high != -1 and e_high[0] != e_in_high: # <<<<<<<<<<<<<<
@@ -58052,7 +58576,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_L9_bool_binop_done:;
if (__pyx_t_3) {
- /* "rulefactory.pxi":1257
+ /* "cdec/sa/rulefactory.pxi":1257
* return 0
* elif e_in_high != -1 and e_high[0] != e_in_high:
* if e_high[0] - e_in_high < min_ex_size: # <<<<<<<<<<<<<<
@@ -58062,7 +58586,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_t_3 = ((((__pyx_v_e_high[0]) - __pyx_v_e_in_high) < __pyx_v_min_ex_size) != 0);
if (__pyx_t_3) {
- /* "rulefactory.pxi":1258
+ /* "cdec/sa/rulefactory.pxi":1258
* elif e_in_high != -1 and e_high[0] != e_in_high:
* if e_high[0] - e_in_high < min_ex_size:
* e_high[0] = e_in_high + min_ex_size # <<<<<<<<<<<<<<
@@ -58071,7 +58595,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
*/
(__pyx_v_e_high[0]) = (__pyx_v_e_in_high + __pyx_v_min_ex_size);
- /* "rulefactory.pxi":1259
+ /* "cdec/sa/rulefactory.pxi":1259
* if e_high[0] - e_in_high < min_ex_size:
* e_high[0] = e_in_high + min_ex_size
* if e_high[0] > e_sent_len: # <<<<<<<<<<<<<<
@@ -58081,7 +58605,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_t_3 = (((__pyx_v_e_high[0]) > __pyx_v_e_sent_len) != 0);
if (__pyx_t_3) {
- /* "rulefactory.pxi":1260
+ /* "cdec/sa/rulefactory.pxi":1260
* e_high[0] = e_in_high + min_ex_size
* if e_high[0] > e_sent_len:
* return 0 # <<<<<<<<<<<<<<
@@ -58098,7 +58622,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
}
__pyx_L8:;
- /* "rulefactory.pxi":1262
+ /* "cdec/sa/rulefactory.pxi":1262
* return 0
*
* f_back_low[0] = -1 # <<<<<<<<<<<<<<
@@ -58107,7 +58631,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
*/
(__pyx_v_f_back_low[0]) = -1;
- /* "rulefactory.pxi":1263
+ /* "cdec/sa/rulefactory.pxi":1263
*
* f_back_low[0] = -1
* f_back_high[0] = -1 # <<<<<<<<<<<<<<
@@ -58116,7 +58640,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
*/
(__pyx_v_f_back_high[0]) = -1;
- /* "rulefactory.pxi":1264
+ /* "cdec/sa/rulefactory.pxi":1264
* f_back_low[0] = -1
* f_back_high[0] = -1
* f_low_prev = f_low # <<<<<<<<<<<<<<
@@ -58125,7 +58649,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
*/
__pyx_v_f_low_prev = __pyx_v_f_low;
- /* "rulefactory.pxi":1265
+ /* "cdec/sa/rulefactory.pxi":1265
* f_back_high[0] = -1
* f_low_prev = f_low
* f_high_prev = f_high # <<<<<<<<<<<<<<
@@ -58135,7 +58659,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_f_high); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_f_high_prev = __pyx_t_1;
- /* "rulefactory.pxi":1266
+ /* "cdec/sa/rulefactory.pxi":1266
* f_low_prev = f_low
* f_high_prev = f_high
* new_x = 0 # <<<<<<<<<<<<<<
@@ -58144,7 +58668,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
*/
__pyx_v_new_x = 0;
- /* "rulefactory.pxi":1267
+ /* "cdec/sa/rulefactory.pxi":1267
* f_high_prev = f_high
* new_x = 0
* new_low_x = 0 # <<<<<<<<<<<<<<
@@ -58153,7 +58677,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
*/
__pyx_v_new_low_x = 0;
- /* "rulefactory.pxi":1268
+ /* "cdec/sa/rulefactory.pxi":1268
* new_x = 0
* new_low_x = 0
* new_high_x = 0 # <<<<<<<<<<<<<<
@@ -58162,7 +58686,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
*/
__pyx_v_new_high_x = 0;
- /* "rulefactory.pxi":1270
+ /* "cdec/sa/rulefactory.pxi":1270
* new_high_x = 0
*
* while True: # <<<<<<<<<<<<<<
@@ -58171,7 +58695,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
*/
while (1) {
- /* "rulefactory.pxi":1272
+ /* "cdec/sa/rulefactory.pxi":1272
* while True:
*
* if f_back_low[0] == -1: # <<<<<<<<<<<<<<
@@ -58181,7 +58705,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_t_3 = (((__pyx_v_f_back_low[0]) == -1) != 0);
if (__pyx_t_3) {
- /* "rulefactory.pxi":1273
+ /* "cdec/sa/rulefactory.pxi":1273
*
* if f_back_low[0] == -1:
* self.find_projection(e_low[0], e_high[0], e_links_low, e_links_high, f_back_low, f_back_high) # <<<<<<<<<<<<<<
@@ -58195,7 +58719,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
}
/*else*/ {
- /* "rulefactory.pxi":1275
+ /* "cdec/sa/rulefactory.pxi":1275
* self.find_projection(e_low[0], e_high[0], e_links_low, e_links_high, f_back_low, f_back_high)
* else:
* self.find_projection(e_low[0], e_low_prev, e_links_low, e_links_high, f_back_low, f_back_high) # <<<<<<<<<<<<<<
@@ -58206,7 +58730,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "rulefactory.pxi":1276
+ /* "cdec/sa/rulefactory.pxi":1276
* else:
* self.find_projection(e_low[0], e_low_prev, e_links_low, e_links_high, f_back_low, f_back_high)
* self.find_projection(e_high_prev, e_high[0], e_links_low, e_links_high, f_back_low, f_back_high) # <<<<<<<<<<<<<<
@@ -58219,7 +58743,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
}
__pyx_L15:;
- /* "rulefactory.pxi":1278
+ /* "cdec/sa/rulefactory.pxi":1278
* self.find_projection(e_high_prev, e_high[0], e_links_low, e_links_high, f_back_low, f_back_high)
*
* if f_back_low[0] > f_low: # <<<<<<<<<<<<<<
@@ -58229,7 +58753,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_t_3 = (((__pyx_v_f_back_low[0]) > __pyx_v_f_low) != 0);
if (__pyx_t_3) {
- /* "rulefactory.pxi":1279
+ /* "cdec/sa/rulefactory.pxi":1279
*
* if f_back_low[0] > f_low:
* f_back_low[0] = f_low # <<<<<<<<<<<<<<
@@ -58241,7 +58765,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
}
__pyx_L16:;
- /* "rulefactory.pxi":1281
+ /* "cdec/sa/rulefactory.pxi":1281
* f_back_low[0] = f_low
*
* if f_back_high[0] < f_high: # <<<<<<<<<<<<<<
@@ -58256,7 +58780,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_3) {
- /* "rulefactory.pxi":1282
+ /* "cdec/sa/rulefactory.pxi":1282
*
* if f_back_high[0] < f_high:
* f_back_high[0] = f_high # <<<<<<<<<<<<<<
@@ -58269,7 +58793,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
}
__pyx_L17:;
- /* "rulefactory.pxi":1284
+ /* "cdec/sa/rulefactory.pxi":1284
* f_back_high[0] = f_high
*
* if f_back_low[0] == f_low_prev and f_back_high[0] == f_high_prev: # <<<<<<<<<<<<<<
@@ -58289,7 +58813,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_L19_bool_binop_done:;
if (__pyx_t_3) {
- /* "rulefactory.pxi":1285
+ /* "cdec/sa/rulefactory.pxi":1285
*
* if f_back_low[0] == f_low_prev and f_back_high[0] == f_high_prev:
* return 1 # <<<<<<<<<<<<<<
@@ -58300,7 +58824,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
goto __pyx_L0;
}
- /* "rulefactory.pxi":1287
+ /* "cdec/sa/rulefactory.pxi":1287
* return 1
*
* if allow_low_x == 0 and f_back_low[0] < f_low: # <<<<<<<<<<<<<<
@@ -58320,7 +58844,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_L22_bool_binop_done:;
if (__pyx_t_3) {
- /* "rulefactory.pxi":1289
+ /* "cdec/sa/rulefactory.pxi":1289
* if allow_low_x == 0 and f_back_low[0] < f_low:
* # FAIL: f phrase is not tight
* return 0 # <<<<<<<<<<<<<<
@@ -58331,7 +58855,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
goto __pyx_L0;
}
- /* "rulefactory.pxi":1291
+ /* "cdec/sa/rulefactory.pxi":1291
* return 0
*
* if f_back_high[0] - f_back_low[0] > max_f_len: # <<<<<<<<<<<<<<
@@ -58341,7 +58865,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_t_3 = ((((__pyx_v_f_back_high[0]) - (__pyx_v_f_back_low[0])) > __pyx_v_max_f_len) != 0);
if (__pyx_t_3) {
- /* "rulefactory.pxi":1293
+ /* "cdec/sa/rulefactory.pxi":1293
* if f_back_high[0] - f_back_low[0] > max_f_len:
* # FAIL: f back projection is too wide
* return 0 # <<<<<<<<<<<<<<
@@ -58352,7 +58876,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
goto __pyx_L0;
}
- /* "rulefactory.pxi":1295
+ /* "cdec/sa/rulefactory.pxi":1295
* return 0
*
* if allow_high_x == 0 and f_back_high[0] > f_high: # <<<<<<<<<<<<<<
@@ -58377,7 +58901,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_L26_bool_binop_done:;
if (__pyx_t_3) {
- /* "rulefactory.pxi":1297
+ /* "cdec/sa/rulefactory.pxi":1297
* if allow_high_x == 0 and f_back_high[0] > f_high:
* # FAIL: extension on high side not allowed
* return 0 # <<<<<<<<<<<<<<
@@ -58388,7 +58912,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
goto __pyx_L0;
}
- /* "rulefactory.pxi":1299
+ /* "cdec/sa/rulefactory.pxi":1299
* return 0
*
* if f_low != f_back_low[0]: # <<<<<<<<<<<<<<
@@ -58398,7 +58922,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_t_3 = ((__pyx_v_f_low != (__pyx_v_f_back_low[0])) != 0);
if (__pyx_t_3) {
- /* "rulefactory.pxi":1300
+ /* "cdec/sa/rulefactory.pxi":1300
*
* if f_low != f_back_low[0]:
* if new_low_x == 0: # <<<<<<<<<<<<<<
@@ -58408,7 +58932,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_t_3 = ((__pyx_v_new_low_x == 0) != 0);
if (__pyx_t_3) {
- /* "rulefactory.pxi":1301
+ /* "cdec/sa/rulefactory.pxi":1301
* if f_low != f_back_low[0]:
* if new_low_x == 0:
* if new_x >= max_new_x: # <<<<<<<<<<<<<<
@@ -58418,7 +58942,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_t_3 = ((__pyx_v_new_x >= __pyx_v_max_new_x) != 0);
if (__pyx_t_3) {
- /* "rulefactory.pxi":1303
+ /* "cdec/sa/rulefactory.pxi":1303
* if new_x >= max_new_x:
* # FAIL: extension required on low side violates max # of gaps
* return 0 # <<<<<<<<<<<<<<
@@ -58430,7 +58954,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
}
/*else*/ {
- /* "rulefactory.pxi":1305
+ /* "cdec/sa/rulefactory.pxi":1305
* return 0
* else:
* new_x = new_x + 1 # <<<<<<<<<<<<<<
@@ -58439,7 +58963,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
*/
__pyx_v_new_x = (__pyx_v_new_x + 1);
- /* "rulefactory.pxi":1306
+ /* "cdec/sa/rulefactory.pxi":1306
* else:
* new_x = new_x + 1
* new_low_x = 1 # <<<<<<<<<<<<<<
@@ -58452,7 +58976,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
}
__pyx_L29:;
- /* "rulefactory.pxi":1307
+ /* "cdec/sa/rulefactory.pxi":1307
* new_x = new_x + 1
* new_low_x = 1
* if f_low - f_back_low[0] < min_fx_size: # <<<<<<<<<<<<<<
@@ -58462,7 +58986,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_t_3 = (((__pyx_v_f_low - (__pyx_v_f_back_low[0])) < __pyx_v_min_fx_size) != 0);
if (__pyx_t_3) {
- /* "rulefactory.pxi":1308
+ /* "cdec/sa/rulefactory.pxi":1308
* new_low_x = 1
* if f_low - f_back_low[0] < min_fx_size:
* f_back_low[0] = f_low - min_fx_size # <<<<<<<<<<<<<<
@@ -58471,7 +58995,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
*/
(__pyx_v_f_back_low[0]) = (__pyx_v_f_low - __pyx_v_min_fx_size);
- /* "rulefactory.pxi":1309
+ /* "cdec/sa/rulefactory.pxi":1309
* if f_low - f_back_low[0] < min_fx_size:
* f_back_low[0] = f_low - min_fx_size
* if f_back_high[0] - f_back_low[0] > max_f_len: # <<<<<<<<<<<<<<
@@ -58481,7 +59005,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_t_3 = ((((__pyx_v_f_back_high[0]) - (__pyx_v_f_back_low[0])) > __pyx_v_max_f_len) != 0);
if (__pyx_t_3) {
- /* "rulefactory.pxi":1311
+ /* "cdec/sa/rulefactory.pxi":1311
* if f_back_high[0] - f_back_low[0] > max_f_len:
* # FAIL: extension required on low side violates max initial length
* return 0 # <<<<<<<<<<<<<<
@@ -58492,7 +59016,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
goto __pyx_L0;
}
- /* "rulefactory.pxi":1312
+ /* "cdec/sa/rulefactory.pxi":1312
* # FAIL: extension required on low side violates max initial length
* return 0
* if f_back_low[0] < 0: # <<<<<<<<<<<<<<
@@ -58502,7 +59026,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_t_3 = (((__pyx_v_f_back_low[0]) < 0) != 0);
if (__pyx_t_3) {
- /* "rulefactory.pxi":1314
+ /* "cdec/sa/rulefactory.pxi":1314
* if f_back_low[0] < 0:
* # FAIL: extension required on low side violates sentence boundary
* return 0 # <<<<<<<<<<<<<<
@@ -58519,7 +59043,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
}
__pyx_L28:;
- /* "rulefactory.pxi":1316
+ /* "cdec/sa/rulefactory.pxi":1316
* return 0
*
* if f_high != f_back_high[0]: # <<<<<<<<<<<<<<
@@ -58534,7 +59058,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_3) {
- /* "rulefactory.pxi":1317
+ /* "cdec/sa/rulefactory.pxi":1317
*
* if f_high != f_back_high[0]:
* if new_high_x == 0: # <<<<<<<<<<<<<<
@@ -58544,7 +59068,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_t_3 = ((__pyx_v_new_high_x == 0) != 0);
if (__pyx_t_3) {
- /* "rulefactory.pxi":1318
+ /* "cdec/sa/rulefactory.pxi":1318
* if f_high != f_back_high[0]:
* if new_high_x == 0:
* if new_x >= max_new_x: # <<<<<<<<<<<<<<
@@ -58554,7 +59078,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_t_3 = ((__pyx_v_new_x >= __pyx_v_max_new_x) != 0);
if (__pyx_t_3) {
- /* "rulefactory.pxi":1320
+ /* "cdec/sa/rulefactory.pxi":1320
* if new_x >= max_new_x:
* # FAIL: extension required on high side violates max # of gaps
* return 0 # <<<<<<<<<<<<<<
@@ -58566,7 +59090,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
}
/*else*/ {
- /* "rulefactory.pxi":1322
+ /* "cdec/sa/rulefactory.pxi":1322
* return 0
* else:
* new_x = new_x + 1 # <<<<<<<<<<<<<<
@@ -58575,7 +59099,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
*/
__pyx_v_new_x = (__pyx_v_new_x + 1);
- /* "rulefactory.pxi":1323
+ /* "cdec/sa/rulefactory.pxi":1323
* else:
* new_x = new_x + 1
* new_high_x = 1 # <<<<<<<<<<<<<<
@@ -58588,7 +59112,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
}
__pyx_L35:;
- /* "rulefactory.pxi":1324
+ /* "cdec/sa/rulefactory.pxi":1324
* new_x = new_x + 1
* new_high_x = 1
* if f_back_high[0] - f_high < min_fx_size: # <<<<<<<<<<<<<<
@@ -58609,7 +59133,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (__pyx_t_3) {
- /* "rulefactory.pxi":1325
+ /* "cdec/sa/rulefactory.pxi":1325
* new_high_x = 1
* if f_back_high[0] - f_high < min_fx_size:
* f_back_high[0] = f_high + min_fx_size # <<<<<<<<<<<<<<
@@ -58625,7 +59149,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
(__pyx_v_f_back_high[0]) = __pyx_t_1;
- /* "rulefactory.pxi":1326
+ /* "cdec/sa/rulefactory.pxi":1326
* if f_back_high[0] - f_high < min_fx_size:
* f_back_high[0] = f_high + min_fx_size
* if f_back_high[0] - f_back_low[0] > max_f_len: # <<<<<<<<<<<<<<
@@ -58635,7 +59159,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_t_3 = ((((__pyx_v_f_back_high[0]) - (__pyx_v_f_back_low[0])) > __pyx_v_max_f_len) != 0);
if (__pyx_t_3) {
- /* "rulefactory.pxi":1328
+ /* "cdec/sa/rulefactory.pxi":1328
* if f_back_high[0] - f_back_low[0] > max_f_len:
* # FAIL: extension required on high side violates max initial length
* return 0 # <<<<<<<<<<<<<<
@@ -58646,7 +59170,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
goto __pyx_L0;
}
- /* "rulefactory.pxi":1329
+ /* "cdec/sa/rulefactory.pxi":1329
* # FAIL: extension required on high side violates max initial length
* return 0
* if f_back_high[0] > f_sent_len: # <<<<<<<<<<<<<<
@@ -58656,7 +59180,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_t_3 = (((__pyx_v_f_back_high[0]) > __pyx_v_f_sent_len) != 0);
if (__pyx_t_3) {
- /* "rulefactory.pxi":1331
+ /* "cdec/sa/rulefactory.pxi":1331
* if f_back_high[0] > f_sent_len:
* # FAIL: extension required on high side violates sentence boundary
* return 0 # <<<<<<<<<<<<<<
@@ -58673,7 +59197,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
}
__pyx_L34:;
- /* "rulefactory.pxi":1333
+ /* "cdec/sa/rulefactory.pxi":1333
* return 0
*
* e_low_prev = e_low[0] # <<<<<<<<<<<<<<
@@ -58682,7 +59206,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
*/
__pyx_v_e_low_prev = (__pyx_v_e_low[0]);
- /* "rulefactory.pxi":1334
+ /* "cdec/sa/rulefactory.pxi":1334
*
* e_low_prev = e_low[0]
* e_high_prev = e_high[0] # <<<<<<<<<<<<<<
@@ -58691,7 +59215,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
*/
__pyx_v_e_high_prev = (__pyx_v_e_high[0]);
- /* "rulefactory.pxi":1336
+ /* "cdec/sa/rulefactory.pxi":1336
* e_high_prev = e_high[0]
*
* self.find_projection(f_back_low[0], f_low_prev, f_links_low, f_links_high, e_low, e_high) # <<<<<<<<<<<<<<
@@ -58702,7 +59226,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "rulefactory.pxi":1337
+ /* "cdec/sa/rulefactory.pxi":1337
*
* self.find_projection(f_back_low[0], f_low_prev, f_links_low, f_links_high, e_low, e_high)
* self.find_projection(f_high_prev, f_back_high[0], f_links_low, f_links_high, e_low, e_high) # <<<<<<<<<<<<<<
@@ -58713,7 +59237,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "rulefactory.pxi":1338
+ /* "cdec/sa/rulefactory.pxi":1338
* self.find_projection(f_back_low[0], f_low_prev, f_links_low, f_links_high, e_low, e_high)
* self.find_projection(f_high_prev, f_back_high[0], f_links_low, f_links_high, e_low, e_high)
* if e_low[0] == e_low_prev and e_high[0] == e_high_prev: # <<<<<<<<<<<<<<
@@ -58733,7 +59257,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_L41_bool_binop_done:;
if (__pyx_t_3) {
- /* "rulefactory.pxi":1339
+ /* "cdec/sa/rulefactory.pxi":1339
* self.find_projection(f_high_prev, f_back_high[0], f_links_low, f_links_high, e_low, e_high)
* if e_low[0] == e_low_prev and e_high[0] == e_high_prev:
* return 1 # <<<<<<<<<<<<<<
@@ -58744,7 +59268,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
goto __pyx_L0;
}
- /* "rulefactory.pxi":1340
+ /* "cdec/sa/rulefactory.pxi":1340
* if e_low[0] == e_low_prev and e_high[0] == e_high_prev:
* return 1
* if allow_arbitrary_x == 0: # <<<<<<<<<<<<<<
@@ -58754,7 +59278,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_t_3 = ((__pyx_v_allow_arbitrary_x == 0) != 0);
if (__pyx_t_3) {
- /* "rulefactory.pxi":1342
+ /* "cdec/sa/rulefactory.pxi":1342
* if allow_arbitrary_x == 0:
* # FAIL: arbitrary expansion not permitted
* return 0 # <<<<<<<<<<<<<<
@@ -58765,7 +59289,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
goto __pyx_L0;
}
- /* "rulefactory.pxi":1343
+ /* "cdec/sa/rulefactory.pxi":1343
* # FAIL: arbitrary expansion not permitted
* return 0
* if e_high[0] - e_low[0] > max_e_len: # <<<<<<<<<<<<<<
@@ -58775,7 +59299,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_t_3 = ((((__pyx_v_e_high[0]) - (__pyx_v_e_low[0])) > __pyx_v_max_e_len) != 0);
if (__pyx_t_3) {
- /* "rulefactory.pxi":1345
+ /* "cdec/sa/rulefactory.pxi":1345
* if e_high[0] - e_low[0] > max_e_len:
* # FAIL: re-projection violates sentence max phrase length
* return 0 # <<<<<<<<<<<<<<
@@ -58786,7 +59310,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
goto __pyx_L0;
}
- /* "rulefactory.pxi":1346
+ /* "cdec/sa/rulefactory.pxi":1346
* # FAIL: re-projection violates sentence max phrase length
* return 0
* f_low_prev = f_back_low[0] # <<<<<<<<<<<<<<
@@ -58795,7 +59319,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
*/
__pyx_v_f_low_prev = (__pyx_v_f_back_low[0]);
- /* "rulefactory.pxi":1347
+ /* "cdec/sa/rulefactory.pxi":1347
* return 0
* f_low_prev = f_back_low[0]
* f_high_prev = f_back_high[0] # <<<<<<<<<<<<<<
@@ -58805,7 +59329,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_v_f_high_prev = (__pyx_v_f_back_high[0]);
}
- /* "rulefactory.pxi":1223
+ /* "cdec/sa/rulefactory.pxi":1223
*
*
* cdef int find_fixpoint(self, # <<<<<<<<<<<<<<
@@ -58827,7 +59351,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
return __pyx_r;
}
-/* "rulefactory.pxi":1350
+/* "cdec/sa/rulefactory.pxi":1350
*
*
* cdef find_projection(self, int in_low, int in_high, int* in_links_low, int* in_links_high, # <<<<<<<<<<<<<<
@@ -58844,7 +59368,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_projectio
int __pyx_t_3;
__Pyx_RefNannySetupContext("find_projection", 0);
- /* "rulefactory.pxi":1353
+ /* "cdec/sa/rulefactory.pxi":1353
* int* out_low, int* out_high):
* cdef int i
* for i from in_low <= i < in_high: # <<<<<<<<<<<<<<
@@ -58854,7 +59378,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_projectio
__pyx_t_1 = __pyx_v_in_high;
for (__pyx_v_i = __pyx_v_in_low; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {
- /* "rulefactory.pxi":1354
+ /* "cdec/sa/rulefactory.pxi":1354
* cdef int i
* for i from in_low <= i < in_high:
* if in_links_low[i] != -1: # <<<<<<<<<<<<<<
@@ -58864,7 +59388,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_projectio
__pyx_t_2 = (((__pyx_v_in_links_low[__pyx_v_i]) != -1) != 0);
if (__pyx_t_2) {
- /* "rulefactory.pxi":1355
+ /* "cdec/sa/rulefactory.pxi":1355
* for i from in_low <= i < in_high:
* if in_links_low[i] != -1:
* if out_low[0] == -1 or in_links_low[i] < out_low[0]: # <<<<<<<<<<<<<<
@@ -58884,7 +59408,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_projectio
__pyx_L7_bool_binop_done:;
if (__pyx_t_2) {
- /* "rulefactory.pxi":1356
+ /* "cdec/sa/rulefactory.pxi":1356
* if in_links_low[i] != -1:
* if out_low[0] == -1 or in_links_low[i] < out_low[0]:
* out_low[0] = in_links_low[i] # <<<<<<<<<<<<<<
@@ -58896,7 +59420,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_projectio
}
__pyx_L6:;
- /* "rulefactory.pxi":1357
+ /* "cdec/sa/rulefactory.pxi":1357
* if out_low[0] == -1 or in_links_low[i] < out_low[0]:
* out_low[0] = in_links_low[i]
* if out_high[0] == -1 or in_links_high[i] > out_high[0]: # <<<<<<<<<<<<<<
@@ -58916,7 +59440,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_projectio
__pyx_L10_bool_binop_done:;
if (__pyx_t_2) {
- /* "rulefactory.pxi":1358
+ /* "cdec/sa/rulefactory.pxi":1358
* out_low[0] = in_links_low[i]
* if out_high[0] == -1 or in_links_high[i] > out_high[0]:
* out_high[0] = in_links_high[i] # <<<<<<<<<<<<<<
@@ -58932,7 +59456,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_projectio
__pyx_L5:;
}
- /* "rulefactory.pxi":1350
+ /* "cdec/sa/rulefactory.pxi":1350
*
*
* cdef find_projection(self, int in_low, int in_high, int* in_links_low, int* in_links_high, # <<<<<<<<<<<<<<
@@ -58947,7 +59471,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_projectio
return __pyx_r;
}
-/* "rulefactory.pxi":1361
+/* "cdec/sa/rulefactory.pxi":1361
*
*
* cdef int* int_arr_extend(self, int* arr, int* arr_len, int* data, int data_len): # <<<<<<<<<<<<<<
@@ -58961,7 +59485,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTH
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("int_arr_extend", 0);
- /* "rulefactory.pxi":1363
+ /* "cdec/sa/rulefactory.pxi":1363
* cdef int* int_arr_extend(self, int* arr, int* arr_len, int* data, int data_len):
* cdef int new_len
* new_len = arr_len[0] + data_len # <<<<<<<<<<<<<<
@@ -58970,7 +59494,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTH
*/
__pyx_v_new_len = ((__pyx_v_arr_len[0]) + __pyx_v_data_len);
- /* "rulefactory.pxi":1364
+ /* "cdec/sa/rulefactory.pxi":1364
* cdef int new_len
* new_len = arr_len[0] + data_len
* arr = <int*> realloc(arr, new_len*sizeof(int)) # <<<<<<<<<<<<<<
@@ -58979,7 +59503,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTH
*/
__pyx_v_arr = ((int *)realloc(__pyx_v_arr, (__pyx_v_new_len * (sizeof(int)))));
- /* "rulefactory.pxi":1365
+ /* "cdec/sa/rulefactory.pxi":1365
* new_len = arr_len[0] + data_len
* arr = <int*> realloc(arr, new_len*sizeof(int))
* memcpy(arr+arr_len[0], data, data_len*sizeof(int)) # <<<<<<<<<<<<<<
@@ -58988,7 +59512,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTH
*/
memcpy((__pyx_v_arr + (__pyx_v_arr_len[0])), __pyx_v_data, (__pyx_v_data_len * (sizeof(int))));
- /* "rulefactory.pxi":1366
+ /* "cdec/sa/rulefactory.pxi":1366
* arr = <int*> realloc(arr, new_len*sizeof(int))
* memcpy(arr+arr_len[0], data, data_len*sizeof(int))
* arr_len[0] = new_len # <<<<<<<<<<<<<<
@@ -58997,7 +59521,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTH
*/
(__pyx_v_arr_len[0]) = __pyx_v_new_len;
- /* "rulefactory.pxi":1367
+ /* "cdec/sa/rulefactory.pxi":1367
* memcpy(arr+arr_len[0], data, data_len*sizeof(int))
* arr_len[0] = new_len
* return arr # <<<<<<<<<<<<<<
@@ -59007,7 +59531,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTH
__pyx_r = __pyx_v_arr;
goto __pyx_L0;
- /* "rulefactory.pxi":1361
+ /* "cdec/sa/rulefactory.pxi":1361
*
*
* cdef int* int_arr_extend(self, int* arr, int* arr_len, int* data, int data_len): # <<<<<<<<<<<<<<
@@ -59021,7 +59545,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTH
return __pyx_r;
}
-/* "rulefactory.pxi":1370
+/* "cdec/sa/rulefactory.pxi":1370
*
*
* cdef extract_phrases(self, int e_low, int e_high, int* e_gap_low, int* e_gap_high, int* e_links_low, int num_gaps, # <<<<<<<<<<<<<<
@@ -59065,7 +59589,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("extract_phrases", 0);
- /* "rulefactory.pxi":1382
+ /* "cdec/sa/rulefactory.pxi":1382
* cdef result
*
* result = [] # <<<<<<<<<<<<<<
@@ -59077,7 +59601,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_v_result = __pyx_t_1;
__pyx_t_1 = 0;
- /* "rulefactory.pxi":1383
+ /* "cdec/sa/rulefactory.pxi":1383
*
* result = []
* len1 = 0 # <<<<<<<<<<<<<<
@@ -59086,7 +59610,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_len1 = 0;
- /* "rulefactory.pxi":1384
+ /* "cdec/sa/rulefactory.pxi":1384
* result = []
* len1 = 0
* e_gaps1 = <int*> malloc(0) # <<<<<<<<<<<<<<
@@ -59095,7 +59619,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_e_gaps1 = ((int *)malloc(0));
- /* "rulefactory.pxi":1385
+ /* "cdec/sa/rulefactory.pxi":1385
* len1 = 0
* e_gaps1 = <int*> malloc(0)
* ephr_arr = IntList() # <<<<<<<<<<<<<<
@@ -59107,7 +59631,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_v_ephr_arr = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "rulefactory.pxi":1387
+ /* "cdec/sa/rulefactory.pxi":1387
* ephr_arr = IntList()
*
* e_gap_order = <int*> malloc(num_gaps*sizeof(int)) # <<<<<<<<<<<<<<
@@ -59116,7 +59640,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_e_gap_order = ((int *)malloc((__pyx_v_num_gaps * (sizeof(int)))));
- /* "rulefactory.pxi":1388
+ /* "cdec/sa/rulefactory.pxi":1388
*
* e_gap_order = <int*> malloc(num_gaps*sizeof(int))
* if num_gaps > 0: # <<<<<<<<<<<<<<
@@ -59126,7 +59650,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_t_2 = ((__pyx_v_num_gaps > 0) != 0);
if (__pyx_t_2) {
- /* "rulefactory.pxi":1389
+ /* "cdec/sa/rulefactory.pxi":1389
* e_gap_order = <int*> malloc(num_gaps*sizeof(int))
* if num_gaps > 0:
* e_gap_order[0] = 0 # <<<<<<<<<<<<<<
@@ -59135,7 +59659,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
(__pyx_v_e_gap_order[0]) = 0;
- /* "rulefactory.pxi":1390
+ /* "cdec/sa/rulefactory.pxi":1390
* if num_gaps > 0:
* e_gap_order[0] = 0
* for i from 1 <= i < num_gaps: # <<<<<<<<<<<<<<
@@ -59145,7 +59669,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_t_3 = __pyx_v_num_gaps;
for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_3; __pyx_v_i++) {
- /* "rulefactory.pxi":1391
+ /* "cdec/sa/rulefactory.pxi":1391
* e_gap_order[0] = 0
* for i from 1 <= i < num_gaps:
* for j from 0 <= j < i: # <<<<<<<<<<<<<<
@@ -59155,7 +59679,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_t_4 = __pyx_v_i;
for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_4; __pyx_v_j++) {
- /* "rulefactory.pxi":1392
+ /* "cdec/sa/rulefactory.pxi":1392
* for i from 1 <= i < num_gaps:
* for j from 0 <= j < i:
* if e_gap_low[i] < e_gap_low[j]: # <<<<<<<<<<<<<<
@@ -59165,7 +59689,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_t_2 = (((__pyx_v_e_gap_low[__pyx_v_i]) < (__pyx_v_e_gap_low[__pyx_v_j])) != 0);
if (__pyx_t_2) {
- /* "rulefactory.pxi":1393
+ /* "cdec/sa/rulefactory.pxi":1393
* for j from 0 <= j < i:
* if e_gap_low[i] < e_gap_low[j]:
* for k from j <= k < i: # <<<<<<<<<<<<<<
@@ -59175,7 +59699,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_t_5 = __pyx_v_i;
for (__pyx_v_k = __pyx_v_j; __pyx_v_k < __pyx_t_5; __pyx_v_k++) {
- /* "rulefactory.pxi":1394
+ /* "cdec/sa/rulefactory.pxi":1394
* if e_gap_low[i] < e_gap_low[j]:
* for k from j <= k < i:
* e_gap_order[k+1] = e_gap_order[k] # <<<<<<<<<<<<<<
@@ -59185,7 +59709,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
(__pyx_v_e_gap_order[(__pyx_v_k + 1)]) = (__pyx_v_e_gap_order[__pyx_v_k]);
}
- /* "rulefactory.pxi":1395
+ /* "cdec/sa/rulefactory.pxi":1395
* for k from j <= k < i:
* e_gap_order[k+1] = e_gap_order[k]
* e_gap_order[j] = i # <<<<<<<<<<<<<<
@@ -59194,7 +59718,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
(__pyx_v_e_gap_order[__pyx_v_j]) = __pyx_v_i;
- /* "rulefactory.pxi":1396
+ /* "cdec/sa/rulefactory.pxi":1396
* e_gap_order[k+1] = e_gap_order[k]
* e_gap_order[j] = i
* break # <<<<<<<<<<<<<<
@@ -59206,7 +59730,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
}
/*else*/ {
- /* "rulefactory.pxi":1398
+ /* "cdec/sa/rulefactory.pxi":1398
* break
* else:
* e_gap_order[i] = i # <<<<<<<<<<<<<<
@@ -59221,7 +59745,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
}
__pyx_L3:;
- /* "rulefactory.pxi":1400
+ /* "cdec/sa/rulefactory.pxi":1400
* e_gap_order[i] = i
*
* e_x_low = e_low # <<<<<<<<<<<<<<
@@ -59230,7 +59754,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_e_x_low = __pyx_v_e_low;
- /* "rulefactory.pxi":1401
+ /* "cdec/sa/rulefactory.pxi":1401
*
* e_x_low = e_low
* e_x_high = e_high # <<<<<<<<<<<<<<
@@ -59239,7 +59763,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_e_x_high = __pyx_v_e_high;
- /* "rulefactory.pxi":1402
+ /* "cdec/sa/rulefactory.pxi":1402
* e_x_low = e_low
* e_x_high = e_high
* if not self.tight_phrases: # <<<<<<<<<<<<<<
@@ -59249,7 +59773,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_t_2 = ((!(__pyx_v_self->tight_phrases != 0)) != 0);
if (__pyx_t_2) {
- /* "rulefactory.pxi":1403
+ /* "cdec/sa/rulefactory.pxi":1403
* e_x_high = e_high
* if not self.tight_phrases:
* while e_x_low > 0 and e_high - e_x_low < self.train_max_initial_size and e_links_low[e_x_low-1] == -1: # <<<<<<<<<<<<<<
@@ -59278,7 +59802,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_L14_bool_binop_done:;
if (!__pyx_t_2) break;
- /* "rulefactory.pxi":1404
+ /* "cdec/sa/rulefactory.pxi":1404
* if not self.tight_phrases:
* while e_x_low > 0 and e_high - e_x_low < self.train_max_initial_size and e_links_low[e_x_low-1] == -1:
* e_x_low = e_x_low - 1 # <<<<<<<<<<<<<<
@@ -59288,7 +59812,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_v_e_x_low = (__pyx_v_e_x_low - 1);
}
- /* "rulefactory.pxi":1405
+ /* "cdec/sa/rulefactory.pxi":1405
* while e_x_low > 0 and e_high - e_x_low < self.train_max_initial_size and e_links_low[e_x_low-1] == -1:
* e_x_low = e_x_low - 1
* while e_x_high < e_sent_len and e_x_high - e_low < self.train_max_initial_size and e_links_low[e_x_high] == -1: # <<<<<<<<<<<<<<
@@ -59317,7 +59841,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_L19_bool_binop_done:;
if (!__pyx_t_2) break;
- /* "rulefactory.pxi":1406
+ /* "cdec/sa/rulefactory.pxi":1406
* e_x_low = e_x_low - 1
* while e_x_high < e_sent_len and e_x_high - e_low < self.train_max_initial_size and e_links_low[e_x_high] == -1:
* e_x_high = e_x_high + 1 # <<<<<<<<<<<<<<
@@ -59330,7 +59854,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
}
__pyx_L11:;
- /* "rulefactory.pxi":1408
+ /* "cdec/sa/rulefactory.pxi":1408
* e_x_high = e_x_high + 1
*
* for i from e_x_low <= i <= e_low: # <<<<<<<<<<<<<<
@@ -59340,7 +59864,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_t_3 = __pyx_v_e_low;
for (__pyx_v_i = __pyx_v_e_x_low; __pyx_v_i <= __pyx_t_3; __pyx_v_i++) {
- /* "rulefactory.pxi":1409
+ /* "cdec/sa/rulefactory.pxi":1409
*
* for i from e_x_low <= i <= e_low:
* e_gaps1 = self.int_arr_extend(e_gaps1, &len1, &i, 1) # <<<<<<<<<<<<<<
@@ -59350,7 +59874,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_v_e_gaps1 = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->int_arr_extend(__pyx_v_self, __pyx_v_e_gaps1, (&__pyx_v_len1), (&__pyx_v_i), 1);
}
- /* "rulefactory.pxi":1411
+ /* "cdec/sa/rulefactory.pxi":1411
* e_gaps1 = self.int_arr_extend(e_gaps1, &len1, &i, 1)
*
* for i from 0 <= i < num_gaps: # <<<<<<<<<<<<<<
@@ -59360,7 +59884,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_t_3 = __pyx_v_num_gaps;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) {
- /* "rulefactory.pxi":1412
+ /* "cdec/sa/rulefactory.pxi":1412
*
* for i from 0 <= i < num_gaps:
* e_gaps2 = <int*> malloc(0) # <<<<<<<<<<<<<<
@@ -59369,7 +59893,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_e_gaps2 = ((int *)malloc(0));
- /* "rulefactory.pxi":1413
+ /* "cdec/sa/rulefactory.pxi":1413
* for i from 0 <= i < num_gaps:
* e_gaps2 = <int*> malloc(0)
* len2 = 0 # <<<<<<<<<<<<<<
@@ -59378,7 +59902,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_len2 = 0;
- /* "rulefactory.pxi":1415
+ /* "cdec/sa/rulefactory.pxi":1415
* len2 = 0
*
* j = e_gap_order[i] # <<<<<<<<<<<<<<
@@ -59387,7 +59911,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_j = (__pyx_v_e_gap_order[__pyx_v_i]);
- /* "rulefactory.pxi":1416
+ /* "cdec/sa/rulefactory.pxi":1416
*
* j = e_gap_order[i]
* e_x_gap_low = e_gap_low[j] # <<<<<<<<<<<<<<
@@ -59396,7 +59920,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_e_x_gap_low = (__pyx_v_e_gap_low[__pyx_v_j]);
- /* "rulefactory.pxi":1417
+ /* "cdec/sa/rulefactory.pxi":1417
* j = e_gap_order[i]
* e_x_gap_low = e_gap_low[j]
* e_x_gap_high = e_gap_high[j] # <<<<<<<<<<<<<<
@@ -59405,7 +59929,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_e_x_gap_high = (__pyx_v_e_gap_high[__pyx_v_j]);
- /* "rulefactory.pxi":1418
+ /* "cdec/sa/rulefactory.pxi":1418
* e_x_gap_low = e_gap_low[j]
* e_x_gap_high = e_gap_high[j]
* if not self.tight_phrases: # <<<<<<<<<<<<<<
@@ -59415,7 +59939,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_t_2 = ((!(__pyx_v_self->tight_phrases != 0)) != 0);
if (__pyx_t_2) {
- /* "rulefactory.pxi":1419
+ /* "cdec/sa/rulefactory.pxi":1419
* e_x_gap_high = e_gap_high[j]
* if not self.tight_phrases:
* while e_x_gap_low > e_x_low and e_links_low[e_x_gap_low-1] == -1: # <<<<<<<<<<<<<<
@@ -59436,7 +59960,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_L29_bool_binop_done:;
if (!__pyx_t_2) break;
- /* "rulefactory.pxi":1420
+ /* "cdec/sa/rulefactory.pxi":1420
* if not self.tight_phrases:
* while e_x_gap_low > e_x_low and e_links_low[e_x_gap_low-1] == -1:
* e_x_gap_low = e_x_gap_low - 1 # <<<<<<<<<<<<<<
@@ -59446,7 +59970,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_v_e_x_gap_low = (__pyx_v_e_x_gap_low - 1);
}
- /* "rulefactory.pxi":1421
+ /* "cdec/sa/rulefactory.pxi":1421
* while e_x_gap_low > e_x_low and e_links_low[e_x_gap_low-1] == -1:
* e_x_gap_low = e_x_gap_low - 1
* while e_x_gap_high < e_x_high and e_links_low[e_x_gap_high] == -1: # <<<<<<<<<<<<<<
@@ -59467,7 +59991,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_L33_bool_binop_done:;
if (!__pyx_t_2) break;
- /* "rulefactory.pxi":1422
+ /* "cdec/sa/rulefactory.pxi":1422
* e_x_gap_low = e_x_gap_low - 1
* while e_x_gap_high < e_x_high and e_links_low[e_x_gap_high] == -1:
* e_x_gap_high = e_x_gap_high + 1 # <<<<<<<<<<<<<<
@@ -59480,7 +60004,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
}
__pyx_L26:;
- /* "rulefactory.pxi":1424
+ /* "cdec/sa/rulefactory.pxi":1424
* e_x_gap_high = e_x_gap_high + 1
*
* k = 0 # <<<<<<<<<<<<<<
@@ -59489,7 +60013,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_k = 0;
- /* "rulefactory.pxi":1425
+ /* "cdec/sa/rulefactory.pxi":1425
*
* k = 0
* step = 1+(i*2) # <<<<<<<<<<<<<<
@@ -59498,7 +60022,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_step = (1 + (__pyx_v_i * 2));
- /* "rulefactory.pxi":1426
+ /* "cdec/sa/rulefactory.pxi":1426
* k = 0
* step = 1+(i*2)
* while k < len1: # <<<<<<<<<<<<<<
@@ -59509,7 +60033,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_t_2 = ((__pyx_v_k < __pyx_v_len1) != 0);
if (!__pyx_t_2) break;
- /* "rulefactory.pxi":1427
+ /* "cdec/sa/rulefactory.pxi":1427
* step = 1+(i*2)
* while k < len1:
* for m from e_x_gap_low <= m <= e_gap_low[j]: # <<<<<<<<<<<<<<
@@ -59519,7 +60043,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_t_4 = (__pyx_v_e_gap_low[__pyx_v_j]);
for (__pyx_v_m = __pyx_v_e_x_gap_low; __pyx_v_m <= __pyx_t_4; __pyx_v_m++) {
- /* "rulefactory.pxi":1428
+ /* "cdec/sa/rulefactory.pxi":1428
* while k < len1:
* for m from e_x_gap_low <= m <= e_gap_low[j]:
* if m >= e_gaps1[k+step-1]: # <<<<<<<<<<<<<<
@@ -59529,7 +60053,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_t_2 = ((__pyx_v_m >= (__pyx_v_e_gaps1[((__pyx_v_k + __pyx_v_step) - 1)])) != 0);
if (__pyx_t_2) {
- /* "rulefactory.pxi":1429
+ /* "cdec/sa/rulefactory.pxi":1429
* for m from e_x_gap_low <= m <= e_gap_low[j]:
* if m >= e_gaps1[k+step-1]:
* for n from e_gap_high[j] <= n <= e_x_gap_high: # <<<<<<<<<<<<<<
@@ -59539,7 +60063,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_t_5 = __pyx_v_e_x_gap_high;
for (__pyx_v_n = (__pyx_v_e_gap_high[__pyx_v_j]); __pyx_v_n <= __pyx_t_5; __pyx_v_n++) {
- /* "rulefactory.pxi":1430
+ /* "cdec/sa/rulefactory.pxi":1430
* if m >= e_gaps1[k+step-1]:
* for n from e_gap_high[j] <= n <= e_x_gap_high:
* if n-m >= 1: # extractor.py doesn't restrict target-side gap length # <<<<<<<<<<<<<<
@@ -59549,7 +60073,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_t_2 = (((__pyx_v_n - __pyx_v_m) >= 1) != 0);
if (__pyx_t_2) {
- /* "rulefactory.pxi":1431
+ /* "cdec/sa/rulefactory.pxi":1431
* for n from e_gap_high[j] <= n <= e_x_gap_high:
* if n-m >= 1: # extractor.py doesn't restrict target-side gap length
* e_gaps2 = self.int_arr_extend(e_gaps2, &len2, e_gaps1+k, step) # <<<<<<<<<<<<<<
@@ -59558,7 +60082,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_e_gaps2 = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->int_arr_extend(__pyx_v_self, __pyx_v_e_gaps2, (&__pyx_v_len2), (__pyx_v_e_gaps1 + __pyx_v_k), __pyx_v_step);
- /* "rulefactory.pxi":1432
+ /* "cdec/sa/rulefactory.pxi":1432
* if n-m >= 1: # extractor.py doesn't restrict target-side gap length
* e_gaps2 = self.int_arr_extend(e_gaps2, &len2, e_gaps1+k, step)
* e_gaps2 = self.int_arr_extend(e_gaps2, &len2, &m, 1) # <<<<<<<<<<<<<<
@@ -59567,7 +60091,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_e_gaps2 = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->int_arr_extend(__pyx_v_self, __pyx_v_e_gaps2, (&__pyx_v_len2), (&__pyx_v_m), 1);
- /* "rulefactory.pxi":1433
+ /* "cdec/sa/rulefactory.pxi":1433
* e_gaps2 = self.int_arr_extend(e_gaps2, &len2, e_gaps1+k, step)
* e_gaps2 = self.int_arr_extend(e_gaps2, &len2, &m, 1)
* e_gaps2 = self.int_arr_extend(e_gaps2, &len2, &n, 1) # <<<<<<<<<<<<<<
@@ -59584,7 +60108,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_L39:;
}
- /* "rulefactory.pxi":1434
+ /* "cdec/sa/rulefactory.pxi":1434
* e_gaps2 = self.int_arr_extend(e_gaps2, &len2, &m, 1)
* e_gaps2 = self.int_arr_extend(e_gaps2, &len2, &n, 1)
* k = k + step # <<<<<<<<<<<<<<
@@ -59594,7 +60118,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_v_k = (__pyx_v_k + __pyx_v_step);
}
- /* "rulefactory.pxi":1435
+ /* "cdec/sa/rulefactory.pxi":1435
* e_gaps2 = self.int_arr_extend(e_gaps2, &len2, &n, 1)
* k = k + step
* free(e_gaps1) # <<<<<<<<<<<<<<
@@ -59603,7 +60127,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
free(__pyx_v_e_gaps1);
- /* "rulefactory.pxi":1436
+ /* "cdec/sa/rulefactory.pxi":1436
* k = k + step
* free(e_gaps1)
* e_gaps1 = e_gaps2 # <<<<<<<<<<<<<<
@@ -59612,7 +60136,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_e_gaps1 = __pyx_v_e_gaps2;
- /* "rulefactory.pxi":1437
+ /* "cdec/sa/rulefactory.pxi":1437
* free(e_gaps1)
* e_gaps1 = e_gaps2
* len1 = len2 # <<<<<<<<<<<<<<
@@ -59622,7 +60146,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_v_len1 = __pyx_v_len2;
}
- /* "rulefactory.pxi":1439
+ /* "cdec/sa/rulefactory.pxi":1439
* len1 = len2
*
* step = 1+(num_gaps*2) # <<<<<<<<<<<<<<
@@ -59631,7 +60155,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_step = (1 + (__pyx_v_num_gaps * 2));
- /* "rulefactory.pxi":1440
+ /* "cdec/sa/rulefactory.pxi":1440
*
* step = 1+(num_gaps*2)
* e_gaps2 = <int*> malloc(0) # <<<<<<<<<<<<<<
@@ -59640,7 +60164,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_e_gaps2 = ((int *)malloc(0));
- /* "rulefactory.pxi":1441
+ /* "cdec/sa/rulefactory.pxi":1441
* step = 1+(num_gaps*2)
* e_gaps2 = <int*> malloc(0)
* len2 = 0 # <<<<<<<<<<<<<<
@@ -59649,7 +60173,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_len2 = 0;
- /* "rulefactory.pxi":1442
+ /* "cdec/sa/rulefactory.pxi":1442
* e_gaps2 = <int*> malloc(0)
* len2 = 0
* for i from e_high <= i <= e_x_high: # <<<<<<<<<<<<<<
@@ -59659,7 +60183,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_t_3 = __pyx_v_e_x_high;
for (__pyx_v_i = __pyx_v_e_high; __pyx_v_i <= __pyx_t_3; __pyx_v_i++) {
- /* "rulefactory.pxi":1443
+ /* "cdec/sa/rulefactory.pxi":1443
* len2 = 0
* for i from e_high <= i <= e_x_high:
* j = 0 # <<<<<<<<<<<<<<
@@ -59668,7 +60192,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_j = 0;
- /* "rulefactory.pxi":1444
+ /* "cdec/sa/rulefactory.pxi":1444
* for i from e_high <= i <= e_x_high:
* j = 0
* while j < len1: # <<<<<<<<<<<<<<
@@ -59679,7 +60203,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_t_2 = ((__pyx_v_j < __pyx_v_len1) != 0);
if (!__pyx_t_2) break;
- /* "rulefactory.pxi":1445
+ /* "cdec/sa/rulefactory.pxi":1445
* j = 0
* while j < len1:
* if i - e_gaps1[j] <= self.train_max_initial_size and i >= e_gaps1[j+step-1]: # <<<<<<<<<<<<<<
@@ -59699,7 +60223,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_L48_bool_binop_done:;
if (__pyx_t_2) {
- /* "rulefactory.pxi":1446
+ /* "cdec/sa/rulefactory.pxi":1446
* while j < len1:
* if i - e_gaps1[j] <= self.train_max_initial_size and i >= e_gaps1[j+step-1]:
* e_gaps2 = self.int_arr_extend(e_gaps2, &len2, e_gaps1+j, step) # <<<<<<<<<<<<<<
@@ -59708,7 +60232,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_e_gaps2 = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->int_arr_extend(__pyx_v_self, __pyx_v_e_gaps2, (&__pyx_v_len2), (__pyx_v_e_gaps1 + __pyx_v_j), __pyx_v_step);
- /* "rulefactory.pxi":1447
+ /* "cdec/sa/rulefactory.pxi":1447
* if i - e_gaps1[j] <= self.train_max_initial_size and i >= e_gaps1[j+step-1]:
* e_gaps2 = self.int_arr_extend(e_gaps2, &len2, e_gaps1+j, step)
* e_gaps2 = self.int_arr_extend(e_gaps2, &len2, &i, 1) # <<<<<<<<<<<<<<
@@ -59720,7 +60244,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
}
__pyx_L47:;
- /* "rulefactory.pxi":1448
+ /* "cdec/sa/rulefactory.pxi":1448
* e_gaps2 = self.int_arr_extend(e_gaps2, &len2, e_gaps1+j, step)
* e_gaps2 = self.int_arr_extend(e_gaps2, &len2, &i, 1)
* j = j + step # <<<<<<<<<<<<<<
@@ -59731,7 +60255,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
}
}
- /* "rulefactory.pxi":1449
+ /* "cdec/sa/rulefactory.pxi":1449
* e_gaps2 = self.int_arr_extend(e_gaps2, &len2, &i, 1)
* j = j + step
* free(e_gaps1) # <<<<<<<<<<<<<<
@@ -59740,7 +60264,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
free(__pyx_v_e_gaps1);
- /* "rulefactory.pxi":1450
+ /* "cdec/sa/rulefactory.pxi":1450
* j = j + step
* free(e_gaps1)
* e_gaps1 = e_gaps2 # <<<<<<<<<<<<<<
@@ -59749,7 +60273,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_e_gaps1 = __pyx_v_e_gaps2;
- /* "rulefactory.pxi":1451
+ /* "cdec/sa/rulefactory.pxi":1451
* free(e_gaps1)
* e_gaps1 = e_gaps2
* len1 = len2 # <<<<<<<<<<<<<<
@@ -59758,7 +60282,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_len1 = __pyx_v_len2;
- /* "rulefactory.pxi":1453
+ /* "cdec/sa/rulefactory.pxi":1453
* len1 = len2
*
* step = (num_gaps+1)*2 # <<<<<<<<<<<<<<
@@ -59767,7 +60291,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_step = ((__pyx_v_num_gaps + 1) * 2);
- /* "rulefactory.pxi":1454
+ /* "cdec/sa/rulefactory.pxi":1454
*
* step = (num_gaps+1)*2
* i = 0 # <<<<<<<<<<<<<<
@@ -59776,7 +60300,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_i = 0;
- /* "rulefactory.pxi":1457
+ /* "cdec/sa/rulefactory.pxi":1457
*
* cdef IntList indexes
* while i < len1: # <<<<<<<<<<<<<<
@@ -59787,7 +60311,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_t_2 = ((__pyx_v_i < __pyx_v_len1) != 0);
if (!__pyx_t_2) break;
- /* "rulefactory.pxi":1458
+ /* "cdec/sa/rulefactory.pxi":1458
* cdef IntList indexes
* while i < len1:
* ephr_arr._clear() # <<<<<<<<<<<<<<
@@ -59796,7 +60320,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_ephr_arr->__pyx_vtab)->_clear(__pyx_v_ephr_arr);
- /* "rulefactory.pxi":1459
+ /* "cdec/sa/rulefactory.pxi":1459
* while i < len1:
* ephr_arr._clear()
* num_chunks = 0 # <<<<<<<<<<<<<<
@@ -59805,7 +60329,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_num_chunks = 0;
- /* "rulefactory.pxi":1460
+ /* "cdec/sa/rulefactory.pxi":1460
* ephr_arr._clear()
* num_chunks = 0
* indexes = IntList() # <<<<<<<<<<<<<<
@@ -59817,7 +60341,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__Pyx_XDECREF_SET(__pyx_v_indexes, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1));
__pyx_t_1 = 0;
- /* "rulefactory.pxi":1461
+ /* "cdec/sa/rulefactory.pxi":1461
* num_chunks = 0
* indexes = IntList()
* for j from 0 <= j < num_gaps+1: # <<<<<<<<<<<<<<
@@ -59827,7 +60351,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_t_7 = (__pyx_v_num_gaps + 1);
for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) {
- /* "rulefactory.pxi":1462
+ /* "cdec/sa/rulefactory.pxi":1462
* indexes = IntList()
* for j from 0 <= j < num_gaps+1:
* if e_gaps1[i+2*j] < e_gaps1[i+(2*j)+1]: # <<<<<<<<<<<<<<
@@ -59837,7 +60361,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_t_2 = (((__pyx_v_e_gaps1[(__pyx_v_i + (2 * __pyx_v_j))]) < (__pyx_v_e_gaps1[((__pyx_v_i + (2 * __pyx_v_j)) + 1)])) != 0);
if (__pyx_t_2) {
- /* "rulefactory.pxi":1463
+ /* "cdec/sa/rulefactory.pxi":1463
* for j from 0 <= j < num_gaps+1:
* if e_gaps1[i+2*j] < e_gaps1[i+(2*j)+1]:
* num_chunks = num_chunks + 1 # <<<<<<<<<<<<<<
@@ -59849,7 +60373,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
}
__pyx_L54:;
- /* "rulefactory.pxi":1464
+ /* "cdec/sa/rulefactory.pxi":1464
* if e_gaps1[i+2*j] < e_gaps1[i+(2*j)+1]:
* num_chunks = num_chunks + 1
* for k from e_gaps1[i+2*j] <= k < e_gaps1[i+(2*j)+1]: # <<<<<<<<<<<<<<
@@ -59859,7 +60383,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_t_3 = (__pyx_v_e_gaps1[((__pyx_v_i + (2 * __pyx_v_j)) + 1)]);
for (__pyx_v_k = (__pyx_v_e_gaps1[(__pyx_v_i + (2 * __pyx_v_j))]); __pyx_v_k < __pyx_t_3; __pyx_v_k++) {
- /* "rulefactory.pxi":1465
+ /* "cdec/sa/rulefactory.pxi":1465
* num_chunks = num_chunks + 1
* for k from e_gaps1[i+2*j] <= k < e_gaps1[i+(2*j)+1]:
* indexes.append(k) # <<<<<<<<<<<<<<
@@ -59871,7 +60395,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_t_8 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_indexes), __pyx_t_1); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "rulefactory.pxi":1466
+ /* "cdec/sa/rulefactory.pxi":1466
* for k from e_gaps1[i+2*j] <= k < e_gaps1[i+(2*j)+1]:
* indexes.append(k)
* ephr_arr._append(self.eid2symid[self.eda.data.arr[e_sent_start+k]]) # <<<<<<<<<<<<<<
@@ -59886,7 +60410,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_ephr_arr->__pyx_vtab)->_append(__pyx_v_ephr_arr, __pyx_t_4);
}
- /* "rulefactory.pxi":1467
+ /* "cdec/sa/rulefactory.pxi":1467
* indexes.append(k)
* ephr_arr._append(self.eid2symid[self.eda.data.arr[e_sent_start+k]])
* if j < num_gaps: # <<<<<<<<<<<<<<
@@ -59896,7 +60420,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_t_2 = ((__pyx_v_j < __pyx_v_num_gaps) != 0);
if (__pyx_t_2) {
- /* "rulefactory.pxi":1468
+ /* "cdec/sa/rulefactory.pxi":1468
* ephr_arr._append(self.eid2symid[self.eda.data.arr[e_sent_start+k]])
* if j < num_gaps:
* indexes.append(sym_setindex(self.category, e_gap_order[j]+1)) # <<<<<<<<<<<<<<
@@ -59908,7 +60432,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_t_8 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_indexes), __pyx_t_1); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "rulefactory.pxi":1469
+ /* "cdec/sa/rulefactory.pxi":1469
* if j < num_gaps:
* indexes.append(sym_setindex(self.category, e_gap_order[j]+1))
* ephr_arr._append(sym_setindex(self.category, e_gap_order[j]+1)) # <<<<<<<<<<<<<<
@@ -59921,7 +60445,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_L57:;
}
- /* "rulefactory.pxi":1470
+ /* "cdec/sa/rulefactory.pxi":1470
* indexes.append(sym_setindex(self.category, e_gap_order[j]+1))
* ephr_arr._append(sym_setindex(self.category, e_gap_order[j]+1))
* i = i + step # <<<<<<<<<<<<<<
@@ -59930,7 +60454,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_i = (__pyx_v_i + __pyx_v_step);
- /* "rulefactory.pxi":1471
+ /* "cdec/sa/rulefactory.pxi":1471
* ephr_arr._append(sym_setindex(self.category, e_gap_order[j]+1))
* i = i + step
* if ephr_arr.len <= self.max_target_length and num_chunks <= self.max_target_chunks: # <<<<<<<<<<<<<<
@@ -59950,7 +60474,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_L59_bool_binop_done:;
if (__pyx_t_2) {
- /* "rulefactory.pxi":1472
+ /* "cdec/sa/rulefactory.pxi":1472
* i = i + step
* if ephr_arr.len <= self.max_target_length and num_chunks <= self.max_target_chunks:
* result.append((Phrase(ephr_arr),indexes)) # <<<<<<<<<<<<<<
@@ -59980,7 +60504,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_L58:;
}
- /* "rulefactory.pxi":1474
+ /* "cdec/sa/rulefactory.pxi":1474
* result.append((Phrase(ephr_arr),indexes))
*
* free(e_gaps1) # <<<<<<<<<<<<<<
@@ -59989,7 +60513,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
free(__pyx_v_e_gaps1);
- /* "rulefactory.pxi":1475
+ /* "cdec/sa/rulefactory.pxi":1475
*
* free(e_gaps1)
* free(e_gap_order) # <<<<<<<<<<<<<<
@@ -59998,7 +60522,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
free(__pyx_v_e_gap_order);
- /* "rulefactory.pxi":1476
+ /* "cdec/sa/rulefactory.pxi":1476
* free(e_gaps1)
* free(e_gap_order)
* return result # <<<<<<<<<<<<<<
@@ -60010,7 +60534,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "rulefactory.pxi":1370
+ /* "cdec/sa/rulefactory.pxi":1370
*
*
* cdef extract_phrases(self, int e_low, int e_high, int* e_gap_low, int* e_gap_high, int* e_links_low, int num_gaps, # <<<<<<<<<<<<<<
@@ -60033,7 +60557,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
return __pyx_r;
}
-/* "rulefactory.pxi":1478
+/* "cdec/sa/rulefactory.pxi":1478
* return result
*
* cdef IntList create_alignments(self, int* sent_links, int num_links, # <<<<<<<<<<<<<<
@@ -60064,7 +60588,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_f_4cdec_2sa_3_sa_23HieroCa
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("create_alignments", 0);
- /* "rulefactory.pxi":1481
+ /* "cdec/sa/rulefactory.pxi":1481
* IntList findexes, IntList eindexes):
* cdef unsigned i
* cdef IntList ret = IntList() # <<<<<<<<<<<<<<
@@ -60076,7 +60600,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_f_4cdec_2sa_3_sa_23HieroCa
__pyx_v_ret = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "rulefactory.pxi":1482
+ /* "cdec/sa/rulefactory.pxi":1482
* cdef unsigned i
* cdef IntList ret = IntList()
* for i in range(findexes.len): # <<<<<<<<<<<<<<
@@ -60087,7 +60611,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_f_4cdec_2sa_3_sa_23HieroCa
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "rulefactory.pxi":1483
+ /* "cdec/sa/rulefactory.pxi":1483
* cdef IntList ret = IntList()
* for i in range(findexes.len):
* s = findexes.arr[i] # <<<<<<<<<<<<<<
@@ -60096,7 +60620,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_f_4cdec_2sa_3_sa_23HieroCa
*/
__pyx_v_s = (__pyx_v_findexes->arr[__pyx_v_i]);
- /* "rulefactory.pxi":1484
+ /* "cdec/sa/rulefactory.pxi":1484
* for i in range(findexes.len):
* s = findexes.arr[i]
* if s < 0: continue # <<<<<<<<<<<<<<
@@ -60108,7 +60632,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_f_4cdec_2sa_3_sa_23HieroCa
goto __pyx_L3_continue;
}
- /* "rulefactory.pxi":1485
+ /* "cdec/sa/rulefactory.pxi":1485
* s = findexes.arr[i]
* if s < 0: continue
* idx = 0 # <<<<<<<<<<<<<<
@@ -60118,7 +60642,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_f_4cdec_2sa_3_sa_23HieroCa
__Pyx_INCREF(__pyx_int_0);
__Pyx_XDECREF_SET(__pyx_v_idx, __pyx_int_0);
- /* "rulefactory.pxi":1486
+ /* "cdec/sa/rulefactory.pxi":1486
* if s < 0: continue
* idx = 0
* while idx < num_links * 2: # <<<<<<<<<<<<<<
@@ -60134,7 +60658,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_f_4cdec_2sa_3_sa_23HieroCa
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (!__pyx_t_4) break;
- /* "rulefactory.pxi":1487
+ /* "cdec/sa/rulefactory.pxi":1487
* idx = 0
* while idx < num_links * 2:
* if sent_links[idx] == s: # <<<<<<<<<<<<<<
@@ -60145,7 +60669,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_f_4cdec_2sa_3_sa_23HieroCa
__pyx_t_4 = (((__pyx_v_sent_links[__pyx_t_6]) == __pyx_v_s) != 0);
if (__pyx_t_4) {
- /* "rulefactory.pxi":1488
+ /* "cdec/sa/rulefactory.pxi":1488
* while idx < num_links * 2:
* if sent_links[idx] == s:
* j = eindexes.index(sent_links[idx+1]) # <<<<<<<<<<<<<<
@@ -60189,7 +60713,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_f_4cdec_2sa_3_sa_23HieroCa
__Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_5);
__pyx_t_5 = 0;
- /* "rulefactory.pxi":1489
+ /* "cdec/sa/rulefactory.pxi":1489
* if sent_links[idx] == s:
* j = eindexes.index(sent_links[idx+1])
* ret.append(i * ALIGNMENT_CODE + j) # <<<<<<<<<<<<<<
@@ -60207,7 +60731,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_f_4cdec_2sa_3_sa_23HieroCa
}
__pyx_L8:;
- /* "rulefactory.pxi":1490
+ /* "cdec/sa/rulefactory.pxi":1490
* j = eindexes.index(sent_links[idx+1])
* ret.append(i * ALIGNMENT_CODE + j)
* idx += 2 # <<<<<<<<<<<<<<
@@ -60222,7 +60746,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_f_4cdec_2sa_3_sa_23HieroCa
__pyx_L3_continue:;
}
- /* "rulefactory.pxi":1491
+ /* "cdec/sa/rulefactory.pxi":1491
* ret.append(i * ALIGNMENT_CODE + j)
* idx += 2
* return ret # <<<<<<<<<<<<<<
@@ -60234,7 +60758,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_f_4cdec_2sa_3_sa_23HieroCa
__pyx_r = __pyx_v_ret;
goto __pyx_L0;
- /* "rulefactory.pxi":1478
+ /* "cdec/sa/rulefactory.pxi":1478
* return result
*
* cdef IntList create_alignments(self, int* sent_links, int num_links, # <<<<<<<<<<<<<<
@@ -60260,7 +60784,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_f_4cdec_2sa_3_sa_23HieroCa
return __pyx_r;
}
-/* "rulefactory.pxi":1493
+/* "cdec/sa/rulefactory.pxi":1493
* return ret
*
* cdef extract(self, Phrase phrase, Matching* matching, int* chunklen, int num_chunks): # <<<<<<<<<<<<<<
@@ -60345,7 +60869,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("extract", 0);
- /* "rulefactory.pxi":1514
+ /* "cdec/sa/rulefactory.pxi":1514
* cdef reason_for_failure
*
* fphr_arr = IntList() # <<<<<<<<<<<<<<
@@ -60357,7 +60881,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_v_fphr_arr = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "rulefactory.pxi":1515
+ /* "cdec/sa/rulefactory.pxi":1515
*
* fphr_arr = IntList()
* phrase_len = phrase.n # <<<<<<<<<<<<<<
@@ -60367,7 +60891,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_2 = __pyx_v_phrase->n;
__pyx_v_phrase_len = __pyx_t_2;
- /* "rulefactory.pxi":1516
+ /* "cdec/sa/rulefactory.pxi":1516
* fphr_arr = IntList()
* phrase_len = phrase.n
* extracts = [] # <<<<<<<<<<<<<<
@@ -60379,7 +60903,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_v_extracts = __pyx_t_1;
__pyx_t_1 = 0;
- /* "rulefactory.pxi":1517
+ /* "cdec/sa/rulefactory.pxi":1517
* phrase_len = phrase.n
* extracts = []
* sent_links = self.alignment._get_sent_links(matching.sent_id, &num_links) # <<<<<<<<<<<<<<
@@ -60388,7 +60912,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_sent_links = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Alignment *)__pyx_v_self->alignment->__pyx_vtab)->_get_sent_links(__pyx_v_self->alignment, __pyx_v_matching->sent_id, (&__pyx_v_num_links));
- /* "rulefactory.pxi":1519
+ /* "cdec/sa/rulefactory.pxi":1519
* sent_links = self.alignment._get_sent_links(matching.sent_id, &num_links)
*
* e_sent_start = self.eda.sent_index.arr[matching.sent_id] # <<<<<<<<<<<<<<
@@ -60397,7 +60921,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_e_sent_start = (__pyx_v_self->eda->sent_index->arr[__pyx_v_matching->sent_id]);
- /* "rulefactory.pxi":1520
+ /* "cdec/sa/rulefactory.pxi":1520
*
* e_sent_start = self.eda.sent_index.arr[matching.sent_id]
* e_sent_end = self.eda.sent_index.arr[matching.sent_id+1] # <<<<<<<<<<<<<<
@@ -60406,7 +60930,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_e_sent_end = (__pyx_v_self->eda->sent_index->arr[(__pyx_v_matching->sent_id + 1)]);
- /* "rulefactory.pxi":1521
+ /* "cdec/sa/rulefactory.pxi":1521
* e_sent_start = self.eda.sent_index.arr[matching.sent_id]
* e_sent_end = self.eda.sent_index.arr[matching.sent_id+1]
* e_sent_len = e_sent_end - e_sent_start - 1 # <<<<<<<<<<<<<<
@@ -60415,7 +60939,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_e_sent_len = ((__pyx_v_e_sent_end - __pyx_v_e_sent_start) - 1);
- /* "rulefactory.pxi":1522
+ /* "cdec/sa/rulefactory.pxi":1522
* e_sent_end = self.eda.sent_index.arr[matching.sent_id+1]
* e_sent_len = e_sent_end - e_sent_start - 1
* f_sent_start = self.fda.sent_index.arr[matching.sent_id] # <<<<<<<<<<<<<<
@@ -60424,7 +60948,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_f_sent_start = (__pyx_v_self->fda->sent_index->arr[__pyx_v_matching->sent_id]);
- /* "rulefactory.pxi":1523
+ /* "cdec/sa/rulefactory.pxi":1523
* e_sent_len = e_sent_end - e_sent_start - 1
* f_sent_start = self.fda.sent_index.arr[matching.sent_id]
* f_sent_end = self.fda.sent_index.arr[matching.sent_id+1] # <<<<<<<<<<<<<<
@@ -60433,7 +60957,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_f_sent_end = (__pyx_v_self->fda->sent_index->arr[(__pyx_v_matching->sent_id + 1)]);
- /* "rulefactory.pxi":1524
+ /* "cdec/sa/rulefactory.pxi":1524
* f_sent_start = self.fda.sent_index.arr[matching.sent_id]
* f_sent_end = self.fda.sent_index.arr[matching.sent_id+1]
* f_sent_len = f_sent_end - f_sent_start - 1 # <<<<<<<<<<<<<<
@@ -60442,7 +60966,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_f_sent_len = ((__pyx_v_f_sent_end - __pyx_v_f_sent_start) - 1);
- /* "rulefactory.pxi":1526
+ /* "cdec/sa/rulefactory.pxi":1526
* f_sent_len = f_sent_end - f_sent_start - 1
*
* self.findexes1.reset() # <<<<<<<<<<<<<<
@@ -60471,7 +60995,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "rulefactory.pxi":1527
+ /* "cdec/sa/rulefactory.pxi":1527
*
* self.findexes1.reset()
* sofar = 0 # <<<<<<<<<<<<<<
@@ -60481,7 +61005,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_INCREF(__pyx_int_0);
__pyx_v_sofar = __pyx_int_0;
- /* "rulefactory.pxi":1528
+ /* "cdec/sa/rulefactory.pxi":1528
* self.findexes1.reset()
* sofar = 0
* for i in range(num_chunks): # <<<<<<<<<<<<<<
@@ -60492,7 +61016,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_2; __pyx_t_5+=1) {
__pyx_v_i = __pyx_t_5;
- /* "rulefactory.pxi":1529
+ /* "cdec/sa/rulefactory.pxi":1529
* sofar = 0
* for i in range(num_chunks):
* for j in range(chunklen[i]): # <<<<<<<<<<<<<<
@@ -60503,7 +61027,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
__pyx_v_j = __pyx_t_7;
- /* "rulefactory.pxi":1530
+ /* "cdec/sa/rulefactory.pxi":1530
* for i in range(num_chunks):
* for j in range(chunklen[i]):
* self.findexes1.append(matching.arr[matching.start+i]+j-f_sent_start); # <<<<<<<<<<<<<<
@@ -60515,7 +61039,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_8 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes1), __pyx_t_1); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "rulefactory.pxi":1531
+ /* "cdec/sa/rulefactory.pxi":1531
* for j in range(chunklen[i]):
* self.findexes1.append(matching.arr[matching.start+i]+j-f_sent_start);
* sofar += 1 # <<<<<<<<<<<<<<
@@ -60528,7 +61052,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_1 = 0;
}
- /* "rulefactory.pxi":1532
+ /* "cdec/sa/rulefactory.pxi":1532
* self.findexes1.append(matching.arr[matching.start+i]+j-f_sent_start);
* sofar += 1
* if i+1 < num_chunks: # <<<<<<<<<<<<<<
@@ -60538,7 +61062,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = (((__pyx_v_i + 1) < __pyx_v_num_chunks) != 0);
if (__pyx_t_9) {
- /* "rulefactory.pxi":1533
+ /* "cdec/sa/rulefactory.pxi":1533
* sofar += 1
* if i+1 < num_chunks:
* self.findexes1.append(phrase[sofar]) # <<<<<<<<<<<<<<
@@ -60550,7 +61074,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_8 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes1), __pyx_t_1); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "rulefactory.pxi":1534
+ /* "cdec/sa/rulefactory.pxi":1534
* if i+1 < num_chunks:
* self.findexes1.append(phrase[sofar])
* sofar += 1 # <<<<<<<<<<<<<<
@@ -60566,7 +61090,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_L7:;
}
- /* "rulefactory.pxi":1537
+ /* "cdec/sa/rulefactory.pxi":1537
*
*
* e_links_low = <int*> malloc(e_sent_len*sizeof(int)) # <<<<<<<<<<<<<<
@@ -60575,7 +61099,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_e_links_low = ((int *)malloc((__pyx_v_e_sent_len * (sizeof(int)))));
- /* "rulefactory.pxi":1538
+ /* "cdec/sa/rulefactory.pxi":1538
*
* e_links_low = <int*> malloc(e_sent_len*sizeof(int))
* e_links_high = <int*> malloc(e_sent_len*sizeof(int)) # <<<<<<<<<<<<<<
@@ -60584,7 +61108,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_e_links_high = ((int *)malloc((__pyx_v_e_sent_len * (sizeof(int)))));
- /* "rulefactory.pxi":1539
+ /* "cdec/sa/rulefactory.pxi":1539
* e_links_low = <int*> malloc(e_sent_len*sizeof(int))
* e_links_high = <int*> malloc(e_sent_len*sizeof(int))
* f_links_low = <int*> malloc(f_sent_len*sizeof(int)) # <<<<<<<<<<<<<<
@@ -60593,7 +61117,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_f_links_low = ((int *)malloc((__pyx_v_f_sent_len * (sizeof(int)))));
- /* "rulefactory.pxi":1540
+ /* "cdec/sa/rulefactory.pxi":1540
* e_links_high = <int*> malloc(e_sent_len*sizeof(int))
* f_links_low = <int*> malloc(f_sent_len*sizeof(int))
* f_links_high = <int*> malloc(f_sent_len*sizeof(int)) # <<<<<<<<<<<<<<
@@ -60602,7 +61126,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_f_links_high = ((int *)malloc((__pyx_v_f_sent_len * (sizeof(int)))));
- /* "rulefactory.pxi":1541
+ /* "cdec/sa/rulefactory.pxi":1541
* f_links_low = <int*> malloc(f_sent_len*sizeof(int))
* f_links_high = <int*> malloc(f_sent_len*sizeof(int))
* f_gap_low = <int*> malloc((num_chunks+1)*sizeof(int)) # <<<<<<<<<<<<<<
@@ -60611,7 +61135,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_f_gap_low = ((int *)malloc(((__pyx_v_num_chunks + 1) * (sizeof(int)))));
- /* "rulefactory.pxi":1542
+ /* "cdec/sa/rulefactory.pxi":1542
* f_links_high = <int*> malloc(f_sent_len*sizeof(int))
* f_gap_low = <int*> malloc((num_chunks+1)*sizeof(int))
* f_gap_high = <int*> malloc((num_chunks+1)*sizeof(int)) # <<<<<<<<<<<<<<
@@ -60620,7 +61144,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_f_gap_high = ((int *)malloc(((__pyx_v_num_chunks + 1) * (sizeof(int)))));
- /* "rulefactory.pxi":1543
+ /* "cdec/sa/rulefactory.pxi":1543
* f_gap_low = <int*> malloc((num_chunks+1)*sizeof(int))
* f_gap_high = <int*> malloc((num_chunks+1)*sizeof(int))
* e_gap_low = <int*> malloc((num_chunks+1)*sizeof(int)) # <<<<<<<<<<<<<<
@@ -60629,7 +61153,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_e_gap_low = ((int *)malloc(((__pyx_v_num_chunks + 1) * (sizeof(int)))));
- /* "rulefactory.pxi":1544
+ /* "cdec/sa/rulefactory.pxi":1544
* f_gap_high = <int*> malloc((num_chunks+1)*sizeof(int))
* e_gap_low = <int*> malloc((num_chunks+1)*sizeof(int))
* e_gap_high = <int*> malloc((num_chunks+1)*sizeof(int)) # <<<<<<<<<<<<<<
@@ -60638,7 +61162,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_e_gap_high = ((int *)malloc(((__pyx_v_num_chunks + 1) * (sizeof(int)))));
- /* "rulefactory.pxi":1545
+ /* "cdec/sa/rulefactory.pxi":1545
* e_gap_low = <int*> malloc((num_chunks+1)*sizeof(int))
* e_gap_high = <int*> malloc((num_chunks+1)*sizeof(int))
* memset(f_gap_low, 0, (num_chunks+1)*sizeof(int)) # <<<<<<<<<<<<<<
@@ -60647,7 +61171,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
memset(__pyx_v_f_gap_low, 0, ((__pyx_v_num_chunks + 1) * (sizeof(int))));
- /* "rulefactory.pxi":1546
+ /* "cdec/sa/rulefactory.pxi":1546
* e_gap_high = <int*> malloc((num_chunks+1)*sizeof(int))
* memset(f_gap_low, 0, (num_chunks+1)*sizeof(int))
* memset(f_gap_high, 0, (num_chunks+1)*sizeof(int)) # <<<<<<<<<<<<<<
@@ -60656,7 +61180,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
memset(__pyx_v_f_gap_high, 0, ((__pyx_v_num_chunks + 1) * (sizeof(int))));
- /* "rulefactory.pxi":1547
+ /* "cdec/sa/rulefactory.pxi":1547
* memset(f_gap_low, 0, (num_chunks+1)*sizeof(int))
* memset(f_gap_high, 0, (num_chunks+1)*sizeof(int))
* memset(e_gap_low, 0, (num_chunks+1)*sizeof(int)) # <<<<<<<<<<<<<<
@@ -60665,7 +61189,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
memset(__pyx_v_e_gap_low, 0, ((__pyx_v_num_chunks + 1) * (sizeof(int))));
- /* "rulefactory.pxi":1548
+ /* "cdec/sa/rulefactory.pxi":1548
* memset(f_gap_high, 0, (num_chunks+1)*sizeof(int))
* memset(e_gap_low, 0, (num_chunks+1)*sizeof(int))
* memset(e_gap_high, 0, (num_chunks+1)*sizeof(int)) # <<<<<<<<<<<<<<
@@ -60674,7 +61198,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
memset(__pyx_v_e_gap_high, 0, ((__pyx_v_num_chunks + 1) * (sizeof(int))));
- /* "rulefactory.pxi":1550
+ /* "cdec/sa/rulefactory.pxi":1550
* memset(e_gap_high, 0, (num_chunks+1)*sizeof(int))
*
* reason_for_failure = "" # <<<<<<<<<<<<<<
@@ -60684,7 +61208,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_INCREF(__pyx_kp_s__32);
__pyx_v_reason_for_failure = __pyx_kp_s__32;
- /* "rulefactory.pxi":1552
+ /* "cdec/sa/rulefactory.pxi":1552
* reason_for_failure = ""
*
* for i from 0 <= i < e_sent_len: # <<<<<<<<<<<<<<
@@ -60694,7 +61218,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_2 = __pyx_v_e_sent_len;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {
- /* "rulefactory.pxi":1553
+ /* "cdec/sa/rulefactory.pxi":1553
*
* for i from 0 <= i < e_sent_len:
* e_links_low[i] = -1 # <<<<<<<<<<<<<<
@@ -60703,7 +61227,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
(__pyx_v_e_links_low[__pyx_v_i]) = -1;
- /* "rulefactory.pxi":1554
+ /* "cdec/sa/rulefactory.pxi":1554
* for i from 0 <= i < e_sent_len:
* e_links_low[i] = -1
* e_links_high[i] = -1 # <<<<<<<<<<<<<<
@@ -60713,7 +61237,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
(__pyx_v_e_links_high[__pyx_v_i]) = -1;
}
- /* "rulefactory.pxi":1555
+ /* "cdec/sa/rulefactory.pxi":1555
* e_links_low[i] = -1
* e_links_high[i] = -1
* for i from 0 <= i < f_sent_len: # <<<<<<<<<<<<<<
@@ -60723,7 +61247,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_2 = __pyx_v_f_sent_len;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {
- /* "rulefactory.pxi":1556
+ /* "cdec/sa/rulefactory.pxi":1556
* e_links_high[i] = -1
* for i from 0 <= i < f_sent_len:
* f_links_low[i] = -1 # <<<<<<<<<<<<<<
@@ -60732,7 +61256,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
(__pyx_v_f_links_low[__pyx_v_i]) = -1;
- /* "rulefactory.pxi":1557
+ /* "cdec/sa/rulefactory.pxi":1557
* for i from 0 <= i < f_sent_len:
* f_links_low[i] = -1
* f_links_high[i] = -1 # <<<<<<<<<<<<<<
@@ -60742,7 +61266,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
(__pyx_v_f_links_high[__pyx_v_i]) = -1;
}
- /* "rulefactory.pxi":1563
+ /* "cdec/sa/rulefactory.pxi":1563
* # links that we care about (but then how to look up
* # when we want to check something on the e side?)
* i = 0 # <<<<<<<<<<<<<<
@@ -60751,7 +61275,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_i = 0;
- /* "rulefactory.pxi":1564
+ /* "cdec/sa/rulefactory.pxi":1564
* # when we want to check something on the e side?)
* i = 0
* while i < num_links*2: # <<<<<<<<<<<<<<
@@ -60762,7 +61286,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = ((__pyx_v_i < (__pyx_v_num_links * 2)) != 0);
if (!__pyx_t_9) break;
- /* "rulefactory.pxi":1565
+ /* "cdec/sa/rulefactory.pxi":1565
* i = 0
* while i < num_links*2:
* f_i = sent_links[i] # <<<<<<<<<<<<<<
@@ -60771,7 +61295,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_f_i = (__pyx_v_sent_links[__pyx_v_i]);
- /* "rulefactory.pxi":1566
+ /* "cdec/sa/rulefactory.pxi":1566
* while i < num_links*2:
* f_i = sent_links[i]
* e_i = sent_links[i+1] # <<<<<<<<<<<<<<
@@ -60780,7 +61304,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_e_i = (__pyx_v_sent_links[(__pyx_v_i + 1)]);
- /* "rulefactory.pxi":1567
+ /* "cdec/sa/rulefactory.pxi":1567
* f_i = sent_links[i]
* e_i = sent_links[i+1]
* if f_links_low[f_i] == -1 or f_links_low[f_i] > e_i: # <<<<<<<<<<<<<<
@@ -60800,7 +61324,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_L15_bool_binop_done:;
if (__pyx_t_9) {
- /* "rulefactory.pxi":1568
+ /* "cdec/sa/rulefactory.pxi":1568
* e_i = sent_links[i+1]
* if f_links_low[f_i] == -1 or f_links_low[f_i] > e_i:
* f_links_low[f_i] = e_i # <<<<<<<<<<<<<<
@@ -60812,7 +61336,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L14:;
- /* "rulefactory.pxi":1569
+ /* "cdec/sa/rulefactory.pxi":1569
* if f_links_low[f_i] == -1 or f_links_low[f_i] > e_i:
* f_links_low[f_i] = e_i
* if f_links_high[f_i] == -1 or f_links_high[f_i] < e_i + 1: # <<<<<<<<<<<<<<
@@ -60832,7 +61356,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_L18_bool_binop_done:;
if (__pyx_t_9) {
- /* "rulefactory.pxi":1570
+ /* "cdec/sa/rulefactory.pxi":1570
* f_links_low[f_i] = e_i
* if f_links_high[f_i] == -1 or f_links_high[f_i] < e_i + 1:
* f_links_high[f_i] = e_i + 1 # <<<<<<<<<<<<<<
@@ -60844,7 +61368,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L17:;
- /* "rulefactory.pxi":1571
+ /* "cdec/sa/rulefactory.pxi":1571
* if f_links_high[f_i] == -1 or f_links_high[f_i] < e_i + 1:
* f_links_high[f_i] = e_i + 1
* if e_links_low[e_i] == -1 or e_links_low[e_i] > f_i: # <<<<<<<<<<<<<<
@@ -60864,7 +61388,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_L21_bool_binop_done:;
if (__pyx_t_9) {
- /* "rulefactory.pxi":1572
+ /* "cdec/sa/rulefactory.pxi":1572
* f_links_high[f_i] = e_i + 1
* if e_links_low[e_i] == -1 or e_links_low[e_i] > f_i:
* e_links_low[e_i] = f_i # <<<<<<<<<<<<<<
@@ -60876,7 +61400,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L20:;
- /* "rulefactory.pxi":1573
+ /* "cdec/sa/rulefactory.pxi":1573
* if e_links_low[e_i] == -1 or e_links_low[e_i] > f_i:
* e_links_low[e_i] = f_i
* if e_links_high[e_i] == -1 or e_links_high[e_i] < f_i + 1: # <<<<<<<<<<<<<<
@@ -60896,7 +61420,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_L24_bool_binop_done:;
if (__pyx_t_9) {
- /* "rulefactory.pxi":1574
+ /* "cdec/sa/rulefactory.pxi":1574
* e_links_low[e_i] = f_i
* if e_links_high[e_i] == -1 or e_links_high[e_i] < f_i + 1:
* e_links_high[e_i] = f_i + 1 # <<<<<<<<<<<<<<
@@ -60908,7 +61432,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L23:;
- /* "rulefactory.pxi":1575
+ /* "cdec/sa/rulefactory.pxi":1575
* if e_links_high[e_i] == -1 or e_links_high[e_i] < f_i + 1:
* e_links_high[e_i] = f_i + 1
* i = i + 2 # <<<<<<<<<<<<<<
@@ -60918,7 +61442,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_v_i = (__pyx_v_i + 2);
}
- /* "rulefactory.pxi":1577
+ /* "cdec/sa/rulefactory.pxi":1577
* i = i + 2
*
* als = [] # <<<<<<<<<<<<<<
@@ -60930,7 +61454,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_v_als = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "rulefactory.pxi":1578
+ /* "cdec/sa/rulefactory.pxi":1578
*
* als = []
* for x in range(matching.start,matching.end): # <<<<<<<<<<<<<<
@@ -60941,7 +61465,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
for (__pyx_t_5 = __pyx_v_matching->start; __pyx_t_5 < __pyx_t_2; __pyx_t_5+=1) {
__pyx_v_x = __pyx_t_5;
- /* "rulefactory.pxi":1579
+ /* "cdec/sa/rulefactory.pxi":1579
* als = []
* for x in range(matching.start,matching.end):
* al = (matching.arr[x]-f_sent_start,f_links_low[matching.arr[x]-f_sent_start]) # <<<<<<<<<<<<<<
@@ -60963,7 +61487,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_XDECREF_SET(__pyx_v_al, ((PyObject*)__pyx_t_4));
__pyx_t_4 = 0;
- /* "rulefactory.pxi":1580
+ /* "cdec/sa/rulefactory.pxi":1580
* for x in range(matching.start,matching.end):
* al = (matching.arr[x]-f_sent_start,f_links_low[matching.arr[x]-f_sent_start])
* als.append(al) # <<<<<<<<<<<<<<
@@ -60973,7 +61497,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_8 = __Pyx_PyList_Append(__pyx_v_als, __pyx_v_al); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- /* "rulefactory.pxi":1582
+ /* "cdec/sa/rulefactory.pxi":1582
* als.append(al)
* # check all source-side alignment constraints
* met_constraints = 1 # <<<<<<<<<<<<<<
@@ -60982,7 +61506,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_met_constraints = 1;
- /* "rulefactory.pxi":1583
+ /* "cdec/sa/rulefactory.pxi":1583
* # check all source-side alignment constraints
* met_constraints = 1
* if self.require_aligned_terminal: # <<<<<<<<<<<<<<
@@ -60992,7 +61516,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = (__pyx_v_self->require_aligned_terminal != 0);
if (__pyx_t_9) {
- /* "rulefactory.pxi":1584
+ /* "cdec/sa/rulefactory.pxi":1584
* met_constraints = 1
* if self.require_aligned_terminal:
* num_aligned_chunks = 0 # <<<<<<<<<<<<<<
@@ -61001,7 +61525,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_num_aligned_chunks = 0;
- /* "rulefactory.pxi":1585
+ /* "cdec/sa/rulefactory.pxi":1585
* if self.require_aligned_terminal:
* num_aligned_chunks = 0
* for i from 0 <= i < num_chunks: # <<<<<<<<<<<<<<
@@ -61011,7 +61535,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_2 = __pyx_v_num_chunks;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {
- /* "rulefactory.pxi":1586
+ /* "cdec/sa/rulefactory.pxi":1586
* num_aligned_chunks = 0
* for i from 0 <= i < num_chunks:
* for j from 0 <= j < chunklen[i]: # <<<<<<<<<<<<<<
@@ -61021,7 +61545,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_5 = (__pyx_v_chunklen[__pyx_v_i]);
for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) {
- /* "rulefactory.pxi":1587
+ /* "cdec/sa/rulefactory.pxi":1587
* for i from 0 <= i < num_chunks:
* for j from 0 <= j < chunklen[i]:
* if f_links_low[matching.arr[matching.start+i]+j-f_sent_start] > -1: # <<<<<<<<<<<<<<
@@ -61031,7 +61555,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = (((__pyx_v_f_links_low[(((__pyx_v_matching->arr[(__pyx_v_matching->start + __pyx_v_i)]) + __pyx_v_j) - __pyx_v_f_sent_start)]) > -1) != 0);
if (__pyx_t_9) {
- /* "rulefactory.pxi":1588
+ /* "cdec/sa/rulefactory.pxi":1588
* for j from 0 <= j < chunklen[i]:
* if f_links_low[matching.arr[matching.start+i]+j-f_sent_start] > -1:
* num_aligned_chunks = num_aligned_chunks + 1 # <<<<<<<<<<<<<<
@@ -61040,7 +61564,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_num_aligned_chunks = (__pyx_v_num_aligned_chunks + 1);
- /* "rulefactory.pxi":1589
+ /* "cdec/sa/rulefactory.pxi":1589
* if f_links_low[matching.arr[matching.start+i]+j-f_sent_start] > -1:
* num_aligned_chunks = num_aligned_chunks + 1
* break # <<<<<<<<<<<<<<
@@ -61053,7 +61577,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_L32_break:;
}
- /* "rulefactory.pxi":1590
+ /* "cdec/sa/rulefactory.pxi":1590
* num_aligned_chunks = num_aligned_chunks + 1
* break
* if num_aligned_chunks == 0: # <<<<<<<<<<<<<<
@@ -61063,7 +61587,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = ((__pyx_v_num_aligned_chunks == 0) != 0);
if (__pyx_t_9) {
- /* "rulefactory.pxi":1591
+ /* "cdec/sa/rulefactory.pxi":1591
* break
* if num_aligned_chunks == 0:
* reason_for_failure = "No aligned terminals" # <<<<<<<<<<<<<<
@@ -61073,7 +61597,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_INCREF(__pyx_kp_s_No_aligned_terminals);
__Pyx_DECREF_SET(__pyx_v_reason_for_failure, __pyx_kp_s_No_aligned_terminals);
- /* "rulefactory.pxi":1592
+ /* "cdec/sa/rulefactory.pxi":1592
* if num_aligned_chunks == 0:
* reason_for_failure = "No aligned terminals"
* met_constraints = 0 # <<<<<<<<<<<<<<
@@ -61085,7 +61609,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L34:;
- /* "rulefactory.pxi":1593
+ /* "cdec/sa/rulefactory.pxi":1593
* reason_for_failure = "No aligned terminals"
* met_constraints = 0
* if self.require_aligned_chunks and num_aligned_chunks < num_chunks: # <<<<<<<<<<<<<<
@@ -61105,7 +61629,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_L36_bool_binop_done:;
if (__pyx_t_9) {
- /* "rulefactory.pxi":1594
+ /* "cdec/sa/rulefactory.pxi":1594
* met_constraints = 0
* if self.require_aligned_chunks and num_aligned_chunks < num_chunks:
* reason_for_failure = "Unaligned chunk" # <<<<<<<<<<<<<<
@@ -61115,7 +61639,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_INCREF(__pyx_kp_s_Unaligned_chunk);
__Pyx_DECREF_SET(__pyx_v_reason_for_failure, __pyx_kp_s_Unaligned_chunk);
- /* "rulefactory.pxi":1595
+ /* "cdec/sa/rulefactory.pxi":1595
* if self.require_aligned_chunks and num_aligned_chunks < num_chunks:
* reason_for_failure = "Unaligned chunk"
* met_constraints = 0 # <<<<<<<<<<<<<<
@@ -61130,7 +61654,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L28:;
- /* "rulefactory.pxi":1597
+ /* "cdec/sa/rulefactory.pxi":1597
* met_constraints = 0
*
* if met_constraints and self.tight_phrases: # <<<<<<<<<<<<<<
@@ -61150,7 +61674,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_L39_bool_binop_done:;
if (__pyx_t_9) {
- /* "rulefactory.pxi":1599
+ /* "cdec/sa/rulefactory.pxi":1599
* if met_constraints and self.tight_phrases:
* # outside edge constraints are checked later
* for i from 0 <= i < num_chunks-1: # <<<<<<<<<<<<<<
@@ -61160,7 +61684,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_11 = (__pyx_v_num_chunks - 1);
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_11; __pyx_v_i++) {
- /* "rulefactory.pxi":1600
+ /* "cdec/sa/rulefactory.pxi":1600
* # outside edge constraints are checked later
* for i from 0 <= i < num_chunks-1:
* if f_links_low[matching.arr[matching.start+i]+chunklen[i]-f_sent_start] == -1: # <<<<<<<<<<<<<<
@@ -61170,7 +61694,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = (((__pyx_v_f_links_low[(((__pyx_v_matching->arr[(__pyx_v_matching->start + __pyx_v_i)]) + (__pyx_v_chunklen[__pyx_v_i])) - __pyx_v_f_sent_start)]) == -1) != 0);
if (__pyx_t_9) {
- /* "rulefactory.pxi":1601
+ /* "cdec/sa/rulefactory.pxi":1601
* for i from 0 <= i < num_chunks-1:
* if f_links_low[matching.arr[matching.start+i]+chunklen[i]-f_sent_start] == -1:
* reason_for_failure = "Gaps are not tight phrases" # <<<<<<<<<<<<<<
@@ -61180,7 +61704,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_INCREF(__pyx_kp_s_Gaps_are_not_tight_phrases);
__Pyx_DECREF_SET(__pyx_v_reason_for_failure, __pyx_kp_s_Gaps_are_not_tight_phrases);
- /* "rulefactory.pxi":1602
+ /* "cdec/sa/rulefactory.pxi":1602
* if f_links_low[matching.arr[matching.start+i]+chunklen[i]-f_sent_start] == -1:
* reason_for_failure = "Gaps are not tight phrases"
* met_constraints = 0 # <<<<<<<<<<<<<<
@@ -61189,7 +61713,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_met_constraints = 0;
- /* "rulefactory.pxi":1603
+ /* "cdec/sa/rulefactory.pxi":1603
* reason_for_failure = "Gaps are not tight phrases"
* met_constraints = 0
* break # <<<<<<<<<<<<<<
@@ -61199,7 +61723,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
goto __pyx_L42_break;
}
- /* "rulefactory.pxi":1604
+ /* "cdec/sa/rulefactory.pxi":1604
* met_constraints = 0
* break
* if f_links_low[matching.arr[matching.start+i+1]-1-f_sent_start] == -1: # <<<<<<<<<<<<<<
@@ -61209,7 +61733,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = (((__pyx_v_f_links_low[(((__pyx_v_matching->arr[((__pyx_v_matching->start + __pyx_v_i) + 1)]) - 1) - __pyx_v_f_sent_start)]) == -1) != 0);
if (__pyx_t_9) {
- /* "rulefactory.pxi":1605
+ /* "cdec/sa/rulefactory.pxi":1605
* break
* if f_links_low[matching.arr[matching.start+i+1]-1-f_sent_start] == -1:
* reason_for_failure = "Gaps are not tight phrases" # <<<<<<<<<<<<<<
@@ -61219,7 +61743,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_INCREF(__pyx_kp_s_Gaps_are_not_tight_phrases);
__Pyx_DECREF_SET(__pyx_v_reason_for_failure, __pyx_kp_s_Gaps_are_not_tight_phrases);
- /* "rulefactory.pxi":1606
+ /* "cdec/sa/rulefactory.pxi":1606
* if f_links_low[matching.arr[matching.start+i+1]-1-f_sent_start] == -1:
* reason_for_failure = "Gaps are not tight phrases"
* met_constraints = 0 # <<<<<<<<<<<<<<
@@ -61228,7 +61752,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_met_constraints = 0;
- /* "rulefactory.pxi":1607
+ /* "cdec/sa/rulefactory.pxi":1607
* reason_for_failure = "Gaps are not tight phrases"
* met_constraints = 0
* break # <<<<<<<<<<<<<<
@@ -61243,7 +61767,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L38:;
- /* "rulefactory.pxi":1609
+ /* "cdec/sa/rulefactory.pxi":1609
* break
*
* f_low = matching.arr[matching.start] - f_sent_start # <<<<<<<<<<<<<<
@@ -61252,7 +61776,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_f_low = ((__pyx_v_matching->arr[__pyx_v_matching->start]) - __pyx_v_f_sent_start);
- /* "rulefactory.pxi":1610
+ /* "cdec/sa/rulefactory.pxi":1610
*
* f_low = matching.arr[matching.start] - f_sent_start
* f_high = matching.arr[matching.start + matching.size - 1] + chunklen[num_chunks-1] - f_sent_start # <<<<<<<<<<<<<<
@@ -61261,7 +61785,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_f_high = (((__pyx_v_matching->arr[((__pyx_v_matching->start + __pyx_v_matching->size) - 1)]) + (__pyx_v_chunklen[(__pyx_v_num_chunks - 1)])) - __pyx_v_f_sent_start);
- /* "rulefactory.pxi":1611
+ /* "cdec/sa/rulefactory.pxi":1611
* f_low = matching.arr[matching.start] - f_sent_start
* f_high = matching.arr[matching.start + matching.size - 1] + chunklen[num_chunks-1] - f_sent_start
* if met_constraints: # <<<<<<<<<<<<<<
@@ -61271,7 +61795,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = (__pyx_v_met_constraints != 0);
if (__pyx_t_9) {
- /* "rulefactory.pxi":1613
+ /* "cdec/sa/rulefactory.pxi":1613
* if met_constraints:
*
* if self.find_fixpoint(f_low, f_high, f_links_low, f_links_high, e_links_low, e_links_high, # <<<<<<<<<<<<<<
@@ -61281,7 +61805,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_f_high); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- /* "rulefactory.pxi":1617
+ /* "cdec/sa/rulefactory.pxi":1617
* self.train_max_initial_size, self.train_max_initial_size,
* self.train_min_gap_size, 0,
* self.max_nonterminals - num_chunks + 1, 1, 1, 0, 0): # <<<<<<<<<<<<<<
@@ -61292,7 +61816,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_9) {
- /* "rulefactory.pxi":1618
+ /* "cdec/sa/rulefactory.pxi":1618
* self.train_min_gap_size, 0,
* self.max_nonterminals - num_chunks + 1, 1, 1, 0, 0):
* gap_error = 0 # <<<<<<<<<<<<<<
@@ -61301,7 +61825,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_gap_error = 0;
- /* "rulefactory.pxi":1619
+ /* "cdec/sa/rulefactory.pxi":1619
* self.max_nonterminals - num_chunks + 1, 1, 1, 0, 0):
* gap_error = 0
* num_gaps = 0 # <<<<<<<<<<<<<<
@@ -61310,7 +61834,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_num_gaps = 0;
- /* "rulefactory.pxi":1621
+ /* "cdec/sa/rulefactory.pxi":1621
* num_gaps = 0
*
* if f_back_low < f_low: # <<<<<<<<<<<<<<
@@ -61320,7 +61844,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = ((__pyx_v_f_back_low < __pyx_v_f_low) != 0);
if (__pyx_t_9) {
- /* "rulefactory.pxi":1622
+ /* "cdec/sa/rulefactory.pxi":1622
*
* if f_back_low < f_low:
* f_gap_low[0] = f_back_low # <<<<<<<<<<<<<<
@@ -61329,7 +61853,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
(__pyx_v_f_gap_low[0]) = __pyx_v_f_back_low;
- /* "rulefactory.pxi":1623
+ /* "cdec/sa/rulefactory.pxi":1623
* if f_back_low < f_low:
* f_gap_low[0] = f_back_low
* f_gap_high[0] = f_low # <<<<<<<<<<<<<<
@@ -61338,7 +61862,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
(__pyx_v_f_gap_high[0]) = __pyx_v_f_low;
- /* "rulefactory.pxi":1624
+ /* "cdec/sa/rulefactory.pxi":1624
* f_gap_low[0] = f_back_low
* f_gap_high[0] = f_low
* num_gaps = 1 # <<<<<<<<<<<<<<
@@ -61347,7 +61871,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_num_gaps = 1;
- /* "rulefactory.pxi":1625
+ /* "cdec/sa/rulefactory.pxi":1625
* f_gap_high[0] = f_low
* num_gaps = 1
* gap_start = 0 # <<<<<<<<<<<<<<
@@ -61356,7 +61880,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_gap_start = 0;
- /* "rulefactory.pxi":1626
+ /* "cdec/sa/rulefactory.pxi":1626
* num_gaps = 1
* gap_start = 0
* phrase_len = phrase_len+1 # <<<<<<<<<<<<<<
@@ -61365,7 +61889,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_phrase_len = (__pyx_v_phrase_len + 1);
- /* "rulefactory.pxi":1627
+ /* "cdec/sa/rulefactory.pxi":1627
* gap_start = 0
* phrase_len = phrase_len+1
* if phrase_len > self.max_length: # <<<<<<<<<<<<<<
@@ -61375,7 +61899,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = ((__pyx_v_phrase_len > __pyx_v_self->max_length) != 0);
if (__pyx_t_9) {
- /* "rulefactory.pxi":1628
+ /* "cdec/sa/rulefactory.pxi":1628
* phrase_len = phrase_len+1
* if phrase_len > self.max_length:
* gap_error = 1 # <<<<<<<<<<<<<<
@@ -61387,7 +61911,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L48:;
- /* "rulefactory.pxi":1629
+ /* "cdec/sa/rulefactory.pxi":1629
* if phrase_len > self.max_length:
* gap_error = 1
* if self.tight_phrases: # <<<<<<<<<<<<<<
@@ -61397,7 +61921,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = (__pyx_v_self->tight_phrases != 0);
if (__pyx_t_9) {
- /* "rulefactory.pxi":1630
+ /* "cdec/sa/rulefactory.pxi":1630
* gap_error = 1
* if self.tight_phrases:
* if f_links_low[f_back_low] == -1 or f_links_low[f_low-1] == -1: # <<<<<<<<<<<<<<
@@ -61417,7 +61941,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_L51_bool_binop_done:;
if (__pyx_t_9) {
- /* "rulefactory.pxi":1631
+ /* "cdec/sa/rulefactory.pxi":1631
* if self.tight_phrases:
* if f_links_low[f_back_low] == -1 or f_links_low[f_low-1] == -1:
* gap_error = 1 # <<<<<<<<<<<<<<
@@ -61426,7 +61950,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_gap_error = 1;
- /* "rulefactory.pxi":1632
+ /* "cdec/sa/rulefactory.pxi":1632
* if f_links_low[f_back_low] == -1 or f_links_low[f_low-1] == -1:
* gap_error = 1
* reason_for_failure = "Inside edges of preceding subphrase are not tight" # <<<<<<<<<<<<<<
@@ -61445,7 +61969,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
/*else*/ {
- /* "rulefactory.pxi":1634
+ /* "cdec/sa/rulefactory.pxi":1634
* reason_for_failure = "Inside edges of preceding subphrase are not tight"
* else:
* gap_start = 1 # <<<<<<<<<<<<<<
@@ -61454,7 +61978,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_gap_start = 1;
- /* "rulefactory.pxi":1635
+ /* "cdec/sa/rulefactory.pxi":1635
* else:
* gap_start = 1
* if self.tight_phrases and f_links_low[f_low] == -1: # <<<<<<<<<<<<<<
@@ -61474,7 +61998,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_L54_bool_binop_done:;
if (__pyx_t_9) {
- /* "rulefactory.pxi":1638
+ /* "cdec/sa/rulefactory.pxi":1638
* # this is not a hard error. we can't extract this phrase
* # but we still might be able to extract a superphrase
* met_constraints = 0 # <<<<<<<<<<<<<<
@@ -61488,7 +62012,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L47:;
- /* "rulefactory.pxi":1640
+ /* "cdec/sa/rulefactory.pxi":1640
* met_constraints = 0
*
* for i from 0 <= i < matching.size - 1: # <<<<<<<<<<<<<<
@@ -61498,7 +62022,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_11 = (__pyx_v_matching->size - 1);
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_11; __pyx_v_i++) {
- /* "rulefactory.pxi":1641
+ /* "cdec/sa/rulefactory.pxi":1641
*
* for i from 0 <= i < matching.size - 1:
* f_gap_low[1+i] = matching.arr[matching.start+i] + chunklen[i] - f_sent_start # <<<<<<<<<<<<<<
@@ -61507,7 +62031,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
(__pyx_v_f_gap_low[(1 + __pyx_v_i)]) = (((__pyx_v_matching->arr[(__pyx_v_matching->start + __pyx_v_i)]) + (__pyx_v_chunklen[__pyx_v_i])) - __pyx_v_f_sent_start);
- /* "rulefactory.pxi":1642
+ /* "cdec/sa/rulefactory.pxi":1642
* for i from 0 <= i < matching.size - 1:
* f_gap_low[1+i] = matching.arr[matching.start+i] + chunklen[i] - f_sent_start
* f_gap_high[1+i] = matching.arr[matching.start+i+1] - f_sent_start # <<<<<<<<<<<<<<
@@ -61516,7 +62040,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
(__pyx_v_f_gap_high[(1 + __pyx_v_i)]) = ((__pyx_v_matching->arr[((__pyx_v_matching->start + __pyx_v_i) + 1)]) - __pyx_v_f_sent_start);
- /* "rulefactory.pxi":1643
+ /* "cdec/sa/rulefactory.pxi":1643
* f_gap_low[1+i] = matching.arr[matching.start+i] + chunklen[i] - f_sent_start
* f_gap_high[1+i] = matching.arr[matching.start+i+1] - f_sent_start
* num_gaps = num_gaps + 1 # <<<<<<<<<<<<<<
@@ -61526,7 +62050,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_v_num_gaps = (__pyx_v_num_gaps + 1);
}
- /* "rulefactory.pxi":1645
+ /* "cdec/sa/rulefactory.pxi":1645
* num_gaps = num_gaps + 1
*
* if f_high < f_back_high: # <<<<<<<<<<<<<<
@@ -61536,7 +62060,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = ((__pyx_v_f_high < __pyx_v_f_back_high) != 0);
if (__pyx_t_9) {
- /* "rulefactory.pxi":1646
+ /* "cdec/sa/rulefactory.pxi":1646
*
* if f_high < f_back_high:
* f_gap_low[gap_start+num_gaps] = f_high # <<<<<<<<<<<<<<
@@ -61545,7 +62069,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
(__pyx_v_f_gap_low[(__pyx_v_gap_start + __pyx_v_num_gaps)]) = __pyx_v_f_high;
- /* "rulefactory.pxi":1647
+ /* "cdec/sa/rulefactory.pxi":1647
* if f_high < f_back_high:
* f_gap_low[gap_start+num_gaps] = f_high
* f_gap_high[gap_start+num_gaps] = f_back_high # <<<<<<<<<<<<<<
@@ -61554,7 +62078,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
(__pyx_v_f_gap_high[(__pyx_v_gap_start + __pyx_v_num_gaps)]) = __pyx_v_f_back_high;
- /* "rulefactory.pxi":1648
+ /* "cdec/sa/rulefactory.pxi":1648
* f_gap_low[gap_start+num_gaps] = f_high
* f_gap_high[gap_start+num_gaps] = f_back_high
* num_gaps = num_gaps + 1 # <<<<<<<<<<<<<<
@@ -61563,7 +62087,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_num_gaps = (__pyx_v_num_gaps + 1);
- /* "rulefactory.pxi":1649
+ /* "cdec/sa/rulefactory.pxi":1649
* f_gap_high[gap_start+num_gaps] = f_back_high
* num_gaps = num_gaps + 1
* phrase_len = phrase_len+1 # <<<<<<<<<<<<<<
@@ -61572,7 +62096,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_phrase_len = (__pyx_v_phrase_len + 1);
- /* "rulefactory.pxi":1650
+ /* "cdec/sa/rulefactory.pxi":1650
* num_gaps = num_gaps + 1
* phrase_len = phrase_len+1
* if phrase_len > self.max_length: # <<<<<<<<<<<<<<
@@ -61582,7 +62106,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = ((__pyx_v_phrase_len > __pyx_v_self->max_length) != 0);
if (__pyx_t_9) {
- /* "rulefactory.pxi":1651
+ /* "cdec/sa/rulefactory.pxi":1651
* phrase_len = phrase_len+1
* if phrase_len > self.max_length:
* gap_error = 1 # <<<<<<<<<<<<<<
@@ -61594,7 +62118,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L59:;
- /* "rulefactory.pxi":1652
+ /* "cdec/sa/rulefactory.pxi":1652
* if phrase_len > self.max_length:
* gap_error = 1
* if self.tight_phrases: # <<<<<<<<<<<<<<
@@ -61604,7 +62128,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = (__pyx_v_self->tight_phrases != 0);
if (__pyx_t_9) {
- /* "rulefactory.pxi":1653
+ /* "cdec/sa/rulefactory.pxi":1653
* gap_error = 1
* if self.tight_phrases:
* if f_links_low[f_back_high-1] == -1 or f_links_low[f_high] == -1: # <<<<<<<<<<<<<<
@@ -61624,7 +62148,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_L62_bool_binop_done:;
if (__pyx_t_9) {
- /* "rulefactory.pxi":1654
+ /* "cdec/sa/rulefactory.pxi":1654
* if self.tight_phrases:
* if f_links_low[f_back_high-1] == -1 or f_links_low[f_high] == -1:
* gap_error = 1 # <<<<<<<<<<<<<<
@@ -61633,7 +62157,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_gap_error = 1;
- /* "rulefactory.pxi":1655
+ /* "cdec/sa/rulefactory.pxi":1655
* if f_links_low[f_back_high-1] == -1 or f_links_low[f_high] == -1:
* gap_error = 1
* reason_for_failure = "Inside edges of following subphrase are not tight" # <<<<<<<<<<<<<<
@@ -61652,7 +62176,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
/*else*/ {
- /* "rulefactory.pxi":1657
+ /* "cdec/sa/rulefactory.pxi":1657
* reason_for_failure = "Inside edges of following subphrase are not tight"
* else:
* if self.tight_phrases and f_links_low[f_high-1] == -1: # <<<<<<<<<<<<<<
@@ -61672,7 +62196,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_L65_bool_binop_done:;
if (__pyx_t_9) {
- /* "rulefactory.pxi":1658
+ /* "cdec/sa/rulefactory.pxi":1658
* else:
* if self.tight_phrases and f_links_low[f_high-1] == -1:
* met_constraints = 0 # <<<<<<<<<<<<<<
@@ -61686,7 +62210,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L58:;
- /* "rulefactory.pxi":1660
+ /* "cdec/sa/rulefactory.pxi":1660
* met_constraints = 0
*
* if gap_error == 0: # <<<<<<<<<<<<<<
@@ -61696,7 +62220,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = ((__pyx_v_gap_error == 0) != 0);
if (__pyx_t_9) {
- /* "rulefactory.pxi":1661
+ /* "cdec/sa/rulefactory.pxi":1661
*
* if gap_error == 0:
* e_word_count = e_high - e_low # <<<<<<<<<<<<<<
@@ -61705,7 +62229,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_e_word_count = (__pyx_v_e_high - __pyx_v_e_low);
- /* "rulefactory.pxi":1662
+ /* "cdec/sa/rulefactory.pxi":1662
* if gap_error == 0:
* e_word_count = e_high - e_low
* for i from 0 <= i < num_gaps: # check integrity of subphrases # <<<<<<<<<<<<<<
@@ -61715,7 +62239,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_2 = __pyx_v_num_gaps;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {
- /* "rulefactory.pxi":1663
+ /* "cdec/sa/rulefactory.pxi":1663
* e_word_count = e_high - e_low
* for i from 0 <= i < num_gaps: # check integrity of subphrases
* if self.find_fixpoint(f_gap_low[gap_start+i], f_gap_high[gap_start+i], # <<<<<<<<<<<<<<
@@ -61725,7 +62249,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_f_gap_high[(__pyx_v_gap_start + __pyx_v_i)])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- /* "rulefactory.pxi":1669
+ /* "cdec/sa/rulefactory.pxi":1669
* f_sent_len, e_sent_len,
* self.train_max_initial_size, self.train_max_initial_size,
* 0, 0, 0, 0, 0, 0, 0) == 0: # <<<<<<<<<<<<<<
@@ -61736,7 +62260,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_9) {
- /* "rulefactory.pxi":1670
+ /* "cdec/sa/rulefactory.pxi":1670
* self.train_max_initial_size, self.train_max_initial_size,
* 0, 0, 0, 0, 0, 0, 0) == 0:
* gap_error = 1 # <<<<<<<<<<<<<<
@@ -61745,7 +62269,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_gap_error = 1;
- /* "rulefactory.pxi":1671
+ /* "cdec/sa/rulefactory.pxi":1671
* 0, 0, 0, 0, 0, 0, 0) == 0:
* gap_error = 1
* reason_for_failure = "Subphrase [%d, %d] failed integrity check" % (f_gap_low[gap_start+i], f_gap_high[gap_start+i]) # <<<<<<<<<<<<<<
@@ -61770,7 +62294,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_DECREF_SET(__pyx_v_reason_for_failure, __pyx_t_3);
__pyx_t_3 = 0;
- /* "rulefactory.pxi":1672
+ /* "cdec/sa/rulefactory.pxi":1672
* gap_error = 1
* reason_for_failure = "Subphrase [%d, %d] failed integrity check" % (f_gap_low[gap_start+i], f_gap_high[gap_start+i])
* break # <<<<<<<<<<<<<<
@@ -61785,7 +62309,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L67:;
- /* "rulefactory.pxi":1674
+ /* "cdec/sa/rulefactory.pxi":1674
* break
*
* if gap_error == 0: # <<<<<<<<<<<<<<
@@ -61795,7 +62319,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = ((__pyx_v_gap_error == 0) != 0);
if (__pyx_t_9) {
- /* "rulefactory.pxi":1675
+ /* "cdec/sa/rulefactory.pxi":1675
*
* if gap_error == 0:
* i = 1 # <<<<<<<<<<<<<<
@@ -61804,7 +62328,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_i = 1;
- /* "rulefactory.pxi":1676
+ /* "cdec/sa/rulefactory.pxi":1676
* if gap_error == 0:
* i = 1
* self.findexes.reset() # <<<<<<<<<<<<<<
@@ -61833,7 +62357,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "rulefactory.pxi":1677
+ /* "cdec/sa/rulefactory.pxi":1677
* i = 1
* self.findexes.reset()
* if f_back_low < f_low: # <<<<<<<<<<<<<<
@@ -61843,7 +62367,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = ((__pyx_v_f_back_low < __pyx_v_f_low) != 0);
if (__pyx_t_9) {
- /* "rulefactory.pxi":1678
+ /* "cdec/sa/rulefactory.pxi":1678
* self.findexes.reset()
* if f_back_low < f_low:
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -61852,7 +62376,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i));
- /* "rulefactory.pxi":1679
+ /* "cdec/sa/rulefactory.pxi":1679
* if f_back_low < f_low:
* fphr_arr._append(sym_setindex(self.category, i))
* i = i+1 # <<<<<<<<<<<<<<
@@ -61861,7 +62385,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_i = (__pyx_v_i + 1);
- /* "rulefactory.pxi":1680
+ /* "cdec/sa/rulefactory.pxi":1680
* fphr_arr._append(sym_setindex(self.category, i))
* i = i+1
* self.findexes.append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -61876,7 +62400,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L72:;
- /* "rulefactory.pxi":1681
+ /* "cdec/sa/rulefactory.pxi":1681
* i = i+1
* self.findexes.append(sym_setindex(self.category, i))
* self.findexes.extend(self.findexes1) # <<<<<<<<<<<<<<
@@ -61912,7 +62436,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "rulefactory.pxi":1682
+ /* "cdec/sa/rulefactory.pxi":1682
* self.findexes.append(sym_setindex(self.category, i))
* self.findexes.extend(self.findexes1)
* for j from 0 <= j < phrase.n: # <<<<<<<<<<<<<<
@@ -61922,7 +62446,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_2 = __pyx_v_phrase->n;
for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_2; __pyx_v_j++) {
- /* "rulefactory.pxi":1683
+ /* "cdec/sa/rulefactory.pxi":1683
* self.findexes.extend(self.findexes1)
* for j from 0 <= j < phrase.n:
* if sym_isvar(phrase.syms[j]): # <<<<<<<<<<<<<<
@@ -61932,7 +62456,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = (__pyx_f_4cdec_2sa_3_sa_sym_isvar((__pyx_v_phrase->syms[__pyx_v_j])) != 0);
if (__pyx_t_9) {
- /* "rulefactory.pxi":1684
+ /* "cdec/sa/rulefactory.pxi":1684
* for j from 0 <= j < phrase.n:
* if sym_isvar(phrase.syms[j]):
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -61941,7 +62465,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i));
- /* "rulefactory.pxi":1685
+ /* "cdec/sa/rulefactory.pxi":1685
* if sym_isvar(phrase.syms[j]):
* fphr_arr._append(sym_setindex(self.category, i))
* i = i + 1 # <<<<<<<<<<<<<<
@@ -61953,7 +62477,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
/*else*/ {
- /* "rulefactory.pxi":1687
+ /* "cdec/sa/rulefactory.pxi":1687
* i = i + 1
* else:
* fphr_arr._append(phrase.syms[j]) # <<<<<<<<<<<<<<
@@ -61965,7 +62489,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_L75:;
}
- /* "rulefactory.pxi":1688
+ /* "cdec/sa/rulefactory.pxi":1688
* else:
* fphr_arr._append(phrase.syms[j])
* if f_back_high > f_high: # <<<<<<<<<<<<<<
@@ -61975,7 +62499,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = ((__pyx_v_f_back_high > __pyx_v_f_high) != 0);
if (__pyx_t_9) {
- /* "rulefactory.pxi":1689
+ /* "cdec/sa/rulefactory.pxi":1689
* fphr_arr._append(phrase.syms[j])
* if f_back_high > f_high:
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -61984,7 +62508,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i));
- /* "rulefactory.pxi":1690
+ /* "cdec/sa/rulefactory.pxi":1690
* if f_back_high > f_high:
* fphr_arr._append(sym_setindex(self.category, i))
* self.findexes.append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -61999,7 +62523,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L76:;
- /* "rulefactory.pxi":1692
+ /* "cdec/sa/rulefactory.pxi":1692
* self.findexes.append(sym_setindex(self.category, i))
*
* fphr = Phrase(fphr_arr) # <<<<<<<<<<<<<<
@@ -62017,7 +62541,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_v_fphr = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "rulefactory.pxi":1693
+ /* "cdec/sa/rulefactory.pxi":1693
*
* fphr = Phrase(fphr_arr)
* if met_constraints: # <<<<<<<<<<<<<<
@@ -62027,7 +62551,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = (__pyx_v_met_constraints != 0);
if (__pyx_t_9) {
- /* "rulefactory.pxi":1694
+ /* "cdec/sa/rulefactory.pxi":1694
* fphr = Phrase(fphr_arr)
* if met_constraints:
* phrase_list = self.extract_phrases(e_low, e_high, e_gap_low + gap_start, e_gap_high + gap_start, e_links_low, num_gaps, # <<<<<<<<<<<<<<
@@ -62039,7 +62563,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_v_phrase_list = __pyx_t_1;
__pyx_t_1 = 0;
- /* "rulefactory.pxi":1697
+ /* "cdec/sa/rulefactory.pxi":1697
* f_back_low, f_back_high, f_gap_low + gap_start, f_gap_high + gap_start, f_links_low,
* matching.sent_id, e_sent_len, e_sent_start)
* if len(phrase_list) > 0: # <<<<<<<<<<<<<<
@@ -62050,7 +62574,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = ((__pyx_t_13 > 0) != 0);
if (__pyx_t_9) {
- /* "rulefactory.pxi":1698
+ /* "cdec/sa/rulefactory.pxi":1698
* matching.sent_id, e_sent_len, e_sent_start)
* if len(phrase_list) > 0:
* pair_count = 1.0 / len(phrase_list) # <<<<<<<<<<<<<<
@@ -62073,7 +62597,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
/*else*/ {
- /* "rulefactory.pxi":1700
+ /* "cdec/sa/rulefactory.pxi":1700
* pair_count = 1.0 / len(phrase_list)
* else:
* pair_count = 0 # <<<<<<<<<<<<<<
@@ -62082,7 +62606,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_pair_count = 0.0;
- /* "rulefactory.pxi":1701
+ /* "cdec/sa/rulefactory.pxi":1701
* else:
* pair_count = 0
* reason_for_failure = "Didn't extract anything from [%d, %d] -> [%d, %d]" % (f_back_low, f_back_high, e_low, e_high) # <<<<<<<<<<<<<<
@@ -62119,7 +62643,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L78:;
- /* "rulefactory.pxi":1702
+ /* "cdec/sa/rulefactory.pxi":1702
* pair_count = 0
* reason_for_failure = "Didn't extract anything from [%d, %d] -> [%d, %d]" % (f_back_low, f_back_high, e_low, e_high)
* for phrase2, eindexes in phrase_list: # <<<<<<<<<<<<<<
@@ -62218,7 +62742,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_XDECREF_SET(__pyx_v_eindexes, __pyx_t_3);
__pyx_t_3 = 0;
- /* "rulefactory.pxi":1703
+ /* "cdec/sa/rulefactory.pxi":1703
* reason_for_failure = "Didn't extract anything from [%d, %d] -> [%d, %d]" % (f_back_low, f_back_high, e_low, e_high)
* for phrase2, eindexes in phrase_list:
* als1 = self.create_alignments(sent_links,num_links,self.findexes,eindexes) # <<<<<<<<<<<<<<
@@ -62234,7 +62758,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_XDECREF_SET(__pyx_v_als1, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_3));
__pyx_t_3 = 0;
- /* "rulefactory.pxi":1704
+ /* "cdec/sa/rulefactory.pxi":1704
* for phrase2, eindexes in phrase_list:
* als1 = self.create_alignments(sent_links,num_links,self.findexes,eindexes)
* extracts.append((fphr, phrase2, pair_count, tuple(als1))) # <<<<<<<<<<<<<<
@@ -62268,7 +62792,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_8 = __Pyx_PyObject_Append(__pyx_v_extracts, __pyx_t_14); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- /* "rulefactory.pxi":1702
+ /* "cdec/sa/rulefactory.pxi":1702
* pair_count = 0
* reason_for_failure = "Didn't extract anything from [%d, %d] -> [%d, %d]" % (f_back_low, f_back_high, e_low, e_high)
* for phrase2, eindexes in phrase_list: # <<<<<<<<<<<<<<
@@ -62281,7 +62805,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L77:;
- /* "rulefactory.pxi":1705
+ /* "cdec/sa/rulefactory.pxi":1705
* als1 = self.create_alignments(sent_links,num_links,self.findexes,eindexes)
* extracts.append((fphr, phrase2, pair_count, tuple(als1)))
* if (num_gaps < self.max_nonterminals and # <<<<<<<<<<<<<<
@@ -62297,7 +62821,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L85_next_and:;
- /* "rulefactory.pxi":1706
+ /* "cdec/sa/rulefactory.pxi":1706
* extracts.append((fphr, phrase2, pair_count, tuple(als1)))
* if (num_gaps < self.max_nonterminals and
* phrase_len < self.max_length and # <<<<<<<<<<<<<<
@@ -62313,7 +62837,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L86_next_and:;
- /* "rulefactory.pxi":1707
+ /* "cdec/sa/rulefactory.pxi":1707
* if (num_gaps < self.max_nonterminals and
* phrase_len < self.max_length and
* f_back_high - f_back_low + self.train_min_gap_size <= self.train_max_initial_size): # <<<<<<<<<<<<<<
@@ -62325,7 +62849,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_L84_bool_binop_done:;
if (__pyx_t_9) {
- /* "rulefactory.pxi":1708
+ /* "cdec/sa/rulefactory.pxi":1708
* phrase_len < self.max_length and
* f_back_high - f_back_low + self.train_min_gap_size <= self.train_max_initial_size):
* if (f_back_low == f_low and # <<<<<<<<<<<<<<
@@ -62341,7 +62865,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L89_next_and:;
- /* "rulefactory.pxi":1709
+ /* "cdec/sa/rulefactory.pxi":1709
* f_back_high - f_back_low + self.train_min_gap_size <= self.train_max_initial_size):
* if (f_back_low == f_low and
* f_low >= self.train_min_gap_size and # <<<<<<<<<<<<<<
@@ -62357,7 +62881,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L90_next_and:;
- /* "rulefactory.pxi":1710
+ /* "cdec/sa/rulefactory.pxi":1710
* if (f_back_low == f_low and
* f_low >= self.train_min_gap_size and
* ((not self.tight_phrases) or (f_links_low[f_low-1] != -1 and f_links_low[f_back_high-1] != -1))): # <<<<<<<<<<<<<<
@@ -62385,7 +62909,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_L88_bool_binop_done:;
if (__pyx_t_9) {
- /* "rulefactory.pxi":1711
+ /* "cdec/sa/rulefactory.pxi":1711
* f_low >= self.train_min_gap_size and
* ((not self.tight_phrases) or (f_links_low[f_low-1] != -1 and f_links_low[f_back_high-1] != -1))):
* f_x_low = f_low-self.train_min_gap_size # <<<<<<<<<<<<<<
@@ -62394,7 +62918,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_f_x_low = (__pyx_v_f_low - __pyx_v_self->train_min_gap_size);
- /* "rulefactory.pxi":1712
+ /* "cdec/sa/rulefactory.pxi":1712
* ((not self.tight_phrases) or (f_links_low[f_low-1] != -1 and f_links_low[f_back_high-1] != -1))):
* f_x_low = f_low-self.train_min_gap_size
* met_constraints = 1 # <<<<<<<<<<<<<<
@@ -62403,7 +62927,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_met_constraints = 1;
- /* "rulefactory.pxi":1713
+ /* "cdec/sa/rulefactory.pxi":1713
* f_x_low = f_low-self.train_min_gap_size
* met_constraints = 1
* if self.tight_phrases: # <<<<<<<<<<<<<<
@@ -62413,7 +62937,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = (__pyx_v_self->tight_phrases != 0);
if (__pyx_t_9) {
- /* "rulefactory.pxi":1714
+ /* "cdec/sa/rulefactory.pxi":1714
* met_constraints = 1
* if self.tight_phrases:
* while f_x_low >= 0 and f_links_low[f_x_low] == -1: # <<<<<<<<<<<<<<
@@ -62434,7 +62958,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_L96_bool_binop_done:;
if (!__pyx_t_9) break;
- /* "rulefactory.pxi":1715
+ /* "cdec/sa/rulefactory.pxi":1715
* if self.tight_phrases:
* while f_x_low >= 0 and f_links_low[f_x_low] == -1:
* f_x_low = f_x_low - 1 # <<<<<<<<<<<<<<
@@ -62447,7 +62971,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L93:;
- /* "rulefactory.pxi":1716
+ /* "cdec/sa/rulefactory.pxi":1716
* while f_x_low >= 0 and f_links_low[f_x_low] == -1:
* f_x_low = f_x_low - 1
* if f_x_low < 0 or f_back_high - f_x_low > self.train_max_initial_size: # <<<<<<<<<<<<<<
@@ -62467,7 +62991,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_L99_bool_binop_done:;
if (__pyx_t_9) {
- /* "rulefactory.pxi":1717
+ /* "cdec/sa/rulefactory.pxi":1717
* f_x_low = f_x_low - 1
* if f_x_low < 0 or f_back_high - f_x_low > self.train_max_initial_size:
* met_constraints = 0 # <<<<<<<<<<<<<<
@@ -62479,7 +63003,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L98:;
- /* "rulefactory.pxi":1719
+ /* "cdec/sa/rulefactory.pxi":1719
* met_constraints = 0
*
* if (met_constraints and # <<<<<<<<<<<<<<
@@ -62495,7 +63019,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L103_next_and:;
- /* "rulefactory.pxi":1720
+ /* "cdec/sa/rulefactory.pxi":1720
*
* if (met_constraints and
* (self.find_fixpoint(f_x_low, f_back_high, # <<<<<<<<<<<<<<
@@ -62505,7 +63029,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_f_back_high); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- /* "rulefactory.pxi":1725
+ /* "cdec/sa/rulefactory.pxi":1725
* f_sent_len, e_sent_len,
* self.train_max_initial_size, self.train_max_initial_size,
* 1, 1, 1, 1, 0, 1, 0) == 1) and # <<<<<<<<<<<<<<
@@ -62522,7 +63046,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L104_next_and:;
- /* "rulefactory.pxi":1726
+ /* "cdec/sa/rulefactory.pxi":1726
* self.train_max_initial_size, self.train_max_initial_size,
* 1, 1, 1, 1, 0, 1, 0) == 1) and
* ((not self.tight_phrases) or f_links_low[f_x_low] != -1) and # <<<<<<<<<<<<<<
@@ -62545,7 +63069,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L105_next_and:;
- /* "rulefactory.pxi":1727
+ /* "cdec/sa/rulefactory.pxi":1727
* 1, 1, 1, 1, 0, 1, 0) == 1) and
* ((not self.tight_phrases) or f_links_low[f_x_low] != -1) and
* self.find_fixpoint(f_x_low, f_low, # check integrity of new subphrase # <<<<<<<<<<<<<<
@@ -62555,7 +63079,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_f_low); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- /* "rulefactory.pxi":1731
+ /* "cdec/sa/rulefactory.pxi":1731
* -1, -1, e_gap_low, e_gap_high, f_gap_low, f_gap_high,
* f_sent_len, e_sent_len,
* self.train_max_initial_size, self.train_max_initial_size, # <<<<<<<<<<<<<<
@@ -62568,7 +63092,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_L102_bool_binop_done:;
if (__pyx_t_9) {
- /* "rulefactory.pxi":1733
+ /* "cdec/sa/rulefactory.pxi":1733
* self.train_max_initial_size, self.train_max_initial_size,
* 0, 0, 0, 0, 0, 0, 0)):
* fphr_arr._clear() # <<<<<<<<<<<<<<
@@ -62577,7 +63101,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_clear(__pyx_v_fphr_arr);
- /* "rulefactory.pxi":1734
+ /* "cdec/sa/rulefactory.pxi":1734
* 0, 0, 0, 0, 0, 0, 0)):
* fphr_arr._clear()
* i = 1 # <<<<<<<<<<<<<<
@@ -62586,7 +63110,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_i = 1;
- /* "rulefactory.pxi":1735
+ /* "cdec/sa/rulefactory.pxi":1735
* fphr_arr._clear()
* i = 1
* self.findexes.reset() # <<<<<<<<<<<<<<
@@ -62615,7 +63139,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "rulefactory.pxi":1736
+ /* "cdec/sa/rulefactory.pxi":1736
* i = 1
* self.findexes.reset()
* self.findexes.append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -62627,7 +63151,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_8 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_4); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "rulefactory.pxi":1737
+ /* "cdec/sa/rulefactory.pxi":1737
* self.findexes.reset()
* self.findexes.append(sym_setindex(self.category, i))
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -62636,7 +63160,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i));
- /* "rulefactory.pxi":1738
+ /* "cdec/sa/rulefactory.pxi":1738
* self.findexes.append(sym_setindex(self.category, i))
* fphr_arr._append(sym_setindex(self.category, i))
* i = i+1 # <<<<<<<<<<<<<<
@@ -62645,7 +63169,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_i = (__pyx_v_i + 1);
- /* "rulefactory.pxi":1739
+ /* "cdec/sa/rulefactory.pxi":1739
* fphr_arr._append(sym_setindex(self.category, i))
* i = i+1
* self.findexes.extend(self.findexes1) # <<<<<<<<<<<<<<
@@ -62681,7 +63205,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "rulefactory.pxi":1740
+ /* "cdec/sa/rulefactory.pxi":1740
* i = i+1
* self.findexes.extend(self.findexes1)
* for j from 0 <= j < phrase.n: # <<<<<<<<<<<<<<
@@ -62691,7 +63215,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_2 = __pyx_v_phrase->n;
for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_2; __pyx_v_j++) {
- /* "rulefactory.pxi":1741
+ /* "cdec/sa/rulefactory.pxi":1741
* self.findexes.extend(self.findexes1)
* for j from 0 <= j < phrase.n:
* if sym_isvar(phrase.syms[j]): # <<<<<<<<<<<<<<
@@ -62701,7 +63225,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = (__pyx_f_4cdec_2sa_3_sa_sym_isvar((__pyx_v_phrase->syms[__pyx_v_j])) != 0);
if (__pyx_t_9) {
- /* "rulefactory.pxi":1742
+ /* "cdec/sa/rulefactory.pxi":1742
* for j from 0 <= j < phrase.n:
* if sym_isvar(phrase.syms[j]):
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -62710,7 +63234,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i));
- /* "rulefactory.pxi":1743
+ /* "cdec/sa/rulefactory.pxi":1743
* if sym_isvar(phrase.syms[j]):
* fphr_arr._append(sym_setindex(self.category, i))
* i = i + 1 # <<<<<<<<<<<<<<
@@ -62722,7 +63246,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
/*else*/ {
- /* "rulefactory.pxi":1745
+ /* "cdec/sa/rulefactory.pxi":1745
* i = i + 1
* else:
* fphr_arr._append(phrase.syms[j]) # <<<<<<<<<<<<<<
@@ -62734,7 +63258,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_L109:;
}
- /* "rulefactory.pxi":1746
+ /* "cdec/sa/rulefactory.pxi":1746
* else:
* fphr_arr._append(phrase.syms[j])
* if f_back_high > f_high: # <<<<<<<<<<<<<<
@@ -62744,7 +63268,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = ((__pyx_v_f_back_high > __pyx_v_f_high) != 0);
if (__pyx_t_9) {
- /* "rulefactory.pxi":1747
+ /* "cdec/sa/rulefactory.pxi":1747
* fphr_arr._append(phrase.syms[j])
* if f_back_high > f_high:
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -62753,7 +63277,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i));
- /* "rulefactory.pxi":1748
+ /* "cdec/sa/rulefactory.pxi":1748
* if f_back_high > f_high:
* fphr_arr._append(sym_setindex(self.category, i))
* self.findexes.append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -62768,7 +63292,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L110:;
- /* "rulefactory.pxi":1749
+ /* "cdec/sa/rulefactory.pxi":1749
* fphr_arr._append(sym_setindex(self.category, i))
* self.findexes.append(sym_setindex(self.category, i))
* fphr = Phrase(fphr_arr) # <<<<<<<<<<<<<<
@@ -62786,7 +63310,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_DECREF_SET(__pyx_v_fphr, ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_14));
__pyx_t_14 = 0;
- /* "rulefactory.pxi":1750
+ /* "cdec/sa/rulefactory.pxi":1750
* self.findexes.append(sym_setindex(self.category, i))
* fphr = Phrase(fphr_arr)
* phrase_list = self.extract_phrases(e_x_low, e_x_high, e_gap_low, e_gap_high, e_links_low, num_gaps+1, # <<<<<<<<<<<<<<
@@ -62798,7 +63322,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_XDECREF_SET(__pyx_v_phrase_list, __pyx_t_14);
__pyx_t_14 = 0;
- /* "rulefactory.pxi":1753
+ /* "cdec/sa/rulefactory.pxi":1753
* f_x_low, f_x_high, f_gap_low, f_gap_high, f_links_low, matching.sent_id,
* e_sent_len, e_sent_start)
* if len(phrase_list) > 0: # <<<<<<<<<<<<<<
@@ -62809,7 +63333,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = ((__pyx_t_13 > 0) != 0);
if (__pyx_t_9) {
- /* "rulefactory.pxi":1754
+ /* "cdec/sa/rulefactory.pxi":1754
* e_sent_len, e_sent_start)
* if len(phrase_list) > 0:
* pair_count = 1.0 / len(phrase_list) # <<<<<<<<<<<<<<
@@ -62832,7 +63356,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
/*else*/ {
- /* "rulefactory.pxi":1756
+ /* "cdec/sa/rulefactory.pxi":1756
* pair_count = 1.0 / len(phrase_list)
* else:
* pair_count = 0 # <<<<<<<<<<<<<<
@@ -62843,7 +63367,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L111:;
- /* "rulefactory.pxi":1757
+ /* "cdec/sa/rulefactory.pxi":1757
* else:
* pair_count = 0
* for phrase2, eindexes in phrase_list: # <<<<<<<<<<<<<<
@@ -62942,7 +63466,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_XDECREF_SET(__pyx_v_eindexes, __pyx_t_12);
__pyx_t_12 = 0;
- /* "rulefactory.pxi":1758
+ /* "cdec/sa/rulefactory.pxi":1758
* pair_count = 0
* for phrase2, eindexes in phrase_list:
* als2 = self.create_alignments(sent_links,num_links,self.findexes,eindexes) # <<<<<<<<<<<<<<
@@ -62958,7 +63482,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_XDECREF_SET(__pyx_v_als2, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_12));
__pyx_t_12 = 0;
- /* "rulefactory.pxi":1759
+ /* "cdec/sa/rulefactory.pxi":1759
* for phrase2, eindexes in phrase_list:
* als2 = self.create_alignments(sent_links,num_links,self.findexes,eindexes)
* extracts.append((fphr, phrase2, pair_count, tuple(als2))) # <<<<<<<<<<<<<<
@@ -62992,7 +63516,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_8 = __Pyx_PyObject_Append(__pyx_v_extracts, __pyx_t_4); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "rulefactory.pxi":1757
+ /* "cdec/sa/rulefactory.pxi":1757
* else:
* pair_count = 0
* for phrase2, eindexes in phrase_list: # <<<<<<<<<<<<<<
@@ -63008,7 +63532,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L87:;
- /* "rulefactory.pxi":1761
+ /* "cdec/sa/rulefactory.pxi":1761
* extracts.append((fphr, phrase2, pair_count, tuple(als2)))
*
* if (f_back_high == f_high and # <<<<<<<<<<<<<<
@@ -63024,7 +63548,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L118_next_and:;
- /* "rulefactory.pxi":1762
+ /* "cdec/sa/rulefactory.pxi":1762
*
* if (f_back_high == f_high and
* f_sent_len - f_high >= self.train_min_gap_size and # <<<<<<<<<<<<<<
@@ -63040,7 +63564,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L119_next_and:;
- /* "rulefactory.pxi":1763
+ /* "cdec/sa/rulefactory.pxi":1763
* if (f_back_high == f_high and
* f_sent_len - f_high >= self.train_min_gap_size and
* ((not self.tight_phrases) or (f_links_low[f_high] != -1 and f_links_low[f_back_low] != -1))): # <<<<<<<<<<<<<<
@@ -63068,7 +63592,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_L117_bool_binop_done:;
if (__pyx_t_9) {
- /* "rulefactory.pxi":1764
+ /* "cdec/sa/rulefactory.pxi":1764
* f_sent_len - f_high >= self.train_min_gap_size and
* ((not self.tight_phrases) or (f_links_low[f_high] != -1 and f_links_low[f_back_low] != -1))):
* f_x_high = f_high+self.train_min_gap_size # <<<<<<<<<<<<<<
@@ -63077,7 +63601,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_f_x_high = (__pyx_v_f_high + __pyx_v_self->train_min_gap_size);
- /* "rulefactory.pxi":1765
+ /* "cdec/sa/rulefactory.pxi":1765
* ((not self.tight_phrases) or (f_links_low[f_high] != -1 and f_links_low[f_back_low] != -1))):
* f_x_high = f_high+self.train_min_gap_size
* met_constraints = 1 # <<<<<<<<<<<<<<
@@ -63086,7 +63610,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_met_constraints = 1;
- /* "rulefactory.pxi":1766
+ /* "cdec/sa/rulefactory.pxi":1766
* f_x_high = f_high+self.train_min_gap_size
* met_constraints = 1
* if self.tight_phrases: # <<<<<<<<<<<<<<
@@ -63096,7 +63620,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = (__pyx_v_self->tight_phrases != 0);
if (__pyx_t_9) {
- /* "rulefactory.pxi":1767
+ /* "cdec/sa/rulefactory.pxi":1767
* met_constraints = 1
* if self.tight_phrases:
* while f_x_high <= f_sent_len and f_links_low[f_x_high-1] == -1: # <<<<<<<<<<<<<<
@@ -63117,7 +63641,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_L125_bool_binop_done:;
if (!__pyx_t_9) break;
- /* "rulefactory.pxi":1768
+ /* "cdec/sa/rulefactory.pxi":1768
* if self.tight_phrases:
* while f_x_high <= f_sent_len and f_links_low[f_x_high-1] == -1:
* f_x_high = f_x_high + 1 # <<<<<<<<<<<<<<
@@ -63130,7 +63654,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L122:;
- /* "rulefactory.pxi":1769
+ /* "cdec/sa/rulefactory.pxi":1769
* while f_x_high <= f_sent_len and f_links_low[f_x_high-1] == -1:
* f_x_high = f_x_high + 1
* if f_x_high > f_sent_len or f_x_high - f_back_low > self.train_max_initial_size: # <<<<<<<<<<<<<<
@@ -63150,7 +63674,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_L128_bool_binop_done:;
if (__pyx_t_9) {
- /* "rulefactory.pxi":1770
+ /* "cdec/sa/rulefactory.pxi":1770
* f_x_high = f_x_high + 1
* if f_x_high > f_sent_len or f_x_high - f_back_low > self.train_max_initial_size:
* met_constraints = 0 # <<<<<<<<<<<<<<
@@ -63162,7 +63686,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L127:;
- /* "rulefactory.pxi":1772
+ /* "cdec/sa/rulefactory.pxi":1772
* met_constraints = 0
*
* if (met_constraints and # <<<<<<<<<<<<<<
@@ -63178,7 +63702,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L132_next_and:;
- /* "rulefactory.pxi":1773
+ /* "cdec/sa/rulefactory.pxi":1773
*
* if (met_constraints and
* self.find_fixpoint(f_back_low, f_x_high, # <<<<<<<<<<<<<<
@@ -63188,7 +63712,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_f_x_high); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
- /* "rulefactory.pxi":1777
+ /* "cdec/sa/rulefactory.pxi":1777
* e_low, e_high, &e_x_low, &e_x_high, &f_x_low, &f_x_high,
* f_sent_len, e_sent_len,
* self.train_max_initial_size, self.train_max_initial_size, # <<<<<<<<<<<<<<
@@ -63205,7 +63729,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L133_next_and:;
- /* "rulefactory.pxi":1779
+ /* "cdec/sa/rulefactory.pxi":1779
* self.train_max_initial_size, self.train_max_initial_size,
* 1, 1, 1, 0, 1, 1, 0) and
* ((not self.tight_phrases) or f_links_low[f_x_high-1] != -1) and # <<<<<<<<<<<<<<
@@ -63228,7 +63752,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L134_next_and:;
- /* "rulefactory.pxi":1780
+ /* "cdec/sa/rulefactory.pxi":1780
* 1, 1, 1, 0, 1, 1, 0) and
* ((not self.tight_phrases) or f_links_low[f_x_high-1] != -1) and
* self.find_fixpoint(f_high, f_x_high, # <<<<<<<<<<<<<<
@@ -63238,7 +63762,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_f_x_high); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
- /* "rulefactory.pxi":1785
+ /* "cdec/sa/rulefactory.pxi":1785
* f_gap_low+gap_start+num_gaps, f_gap_high+gap_start+num_gaps,
* f_sent_len, e_sent_len,
* self.train_max_initial_size, self.train_max_initial_size, # <<<<<<<<<<<<<<
@@ -63251,7 +63775,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_L131_bool_binop_done:;
if (__pyx_t_9) {
- /* "rulefactory.pxi":1787
+ /* "cdec/sa/rulefactory.pxi":1787
* self.train_max_initial_size, self.train_max_initial_size,
* 0, 0, 0, 0, 0, 0, 0)):
* fphr_arr._clear() # <<<<<<<<<<<<<<
@@ -63260,7 +63784,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_clear(__pyx_v_fphr_arr);
- /* "rulefactory.pxi":1788
+ /* "cdec/sa/rulefactory.pxi":1788
* 0, 0, 0, 0, 0, 0, 0)):
* fphr_arr._clear()
* i = 1 # <<<<<<<<<<<<<<
@@ -63269,7 +63793,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_i = 1;
- /* "rulefactory.pxi":1789
+ /* "cdec/sa/rulefactory.pxi":1789
* fphr_arr._clear()
* i = 1
* self.findexes.reset() # <<<<<<<<<<<<<<
@@ -63298,7 +63822,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- /* "rulefactory.pxi":1790
+ /* "cdec/sa/rulefactory.pxi":1790
* i = 1
* self.findexes.reset()
* if f_back_low < f_low: # <<<<<<<<<<<<<<
@@ -63308,7 +63832,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = ((__pyx_v_f_back_low < __pyx_v_f_low) != 0);
if (__pyx_t_9) {
- /* "rulefactory.pxi":1791
+ /* "cdec/sa/rulefactory.pxi":1791
* self.findexes.reset()
* if f_back_low < f_low:
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -63317,7 +63841,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i));
- /* "rulefactory.pxi":1792
+ /* "cdec/sa/rulefactory.pxi":1792
* if f_back_low < f_low:
* fphr_arr._append(sym_setindex(self.category, i))
* i = i+1 # <<<<<<<<<<<<<<
@@ -63326,7 +63850,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_i = (__pyx_v_i + 1);
- /* "rulefactory.pxi":1793
+ /* "cdec/sa/rulefactory.pxi":1793
* fphr_arr._append(sym_setindex(self.category, i))
* i = i+1
* self.findexes.append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -63341,7 +63865,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L136:;
- /* "rulefactory.pxi":1794
+ /* "cdec/sa/rulefactory.pxi":1794
* i = i+1
* self.findexes.append(sym_setindex(self.category, i))
* self.findexes.extend(self.findexes1) # <<<<<<<<<<<<<<
@@ -63377,7 +63901,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- /* "rulefactory.pxi":1795
+ /* "cdec/sa/rulefactory.pxi":1795
* self.findexes.append(sym_setindex(self.category, i))
* self.findexes.extend(self.findexes1)
* for j from 0 <= j < phrase.n: # <<<<<<<<<<<<<<
@@ -63387,7 +63911,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_2 = __pyx_v_phrase->n;
for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_2; __pyx_v_j++) {
- /* "rulefactory.pxi":1796
+ /* "cdec/sa/rulefactory.pxi":1796
* self.findexes.extend(self.findexes1)
* for j from 0 <= j < phrase.n:
* if sym_isvar(phrase.syms[j]): # <<<<<<<<<<<<<<
@@ -63397,7 +63921,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = (__pyx_f_4cdec_2sa_3_sa_sym_isvar((__pyx_v_phrase->syms[__pyx_v_j])) != 0);
if (__pyx_t_9) {
- /* "rulefactory.pxi":1797
+ /* "cdec/sa/rulefactory.pxi":1797
* for j from 0 <= j < phrase.n:
* if sym_isvar(phrase.syms[j]):
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -63406,7 +63930,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i));
- /* "rulefactory.pxi":1798
+ /* "cdec/sa/rulefactory.pxi":1798
* if sym_isvar(phrase.syms[j]):
* fphr_arr._append(sym_setindex(self.category, i))
* i = i + 1 # <<<<<<<<<<<<<<
@@ -63418,7 +63942,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
/*else*/ {
- /* "rulefactory.pxi":1800
+ /* "cdec/sa/rulefactory.pxi":1800
* i = i + 1
* else:
* fphr_arr._append(phrase.syms[j]) # <<<<<<<<<<<<<<
@@ -63430,7 +63954,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_L139:;
}
- /* "rulefactory.pxi":1801
+ /* "cdec/sa/rulefactory.pxi":1801
* else:
* fphr_arr._append(phrase.syms[j])
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -63439,7 +63963,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i));
- /* "rulefactory.pxi":1802
+ /* "cdec/sa/rulefactory.pxi":1802
* fphr_arr._append(phrase.syms[j])
* fphr_arr._append(sym_setindex(self.category, i))
* self.findexes.append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -63451,7 +63975,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_8 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_14); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- /* "rulefactory.pxi":1803
+ /* "cdec/sa/rulefactory.pxi":1803
* fphr_arr._append(sym_setindex(self.category, i))
* self.findexes.append(sym_setindex(self.category, i))
* fphr = Phrase(fphr_arr) # <<<<<<<<<<<<<<
@@ -63469,7 +63993,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_DECREF_SET(__pyx_v_fphr, ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_4));
__pyx_t_4 = 0;
- /* "rulefactory.pxi":1804
+ /* "cdec/sa/rulefactory.pxi":1804
* self.findexes.append(sym_setindex(self.category, i))
* fphr = Phrase(fphr_arr)
* phrase_list = self.extract_phrases(e_x_low, e_x_high, e_gap_low+gap_start, e_gap_high+gap_start, e_links_low, num_gaps+1, # <<<<<<<<<<<<<<
@@ -63481,7 +64005,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_XDECREF_SET(__pyx_v_phrase_list, __pyx_t_4);
__pyx_t_4 = 0;
- /* "rulefactory.pxi":1807
+ /* "cdec/sa/rulefactory.pxi":1807
* f_x_low, f_x_high, f_gap_low+gap_start, f_gap_high+gap_start, f_links_low,
* matching.sent_id, e_sent_len, e_sent_start)
* if len(phrase_list) > 0: # <<<<<<<<<<<<<<
@@ -63492,7 +64016,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = ((__pyx_t_13 > 0) != 0);
if (__pyx_t_9) {
- /* "rulefactory.pxi":1808
+ /* "cdec/sa/rulefactory.pxi":1808
* matching.sent_id, e_sent_len, e_sent_start)
* if len(phrase_list) > 0:
* pair_count = 1.0 / len(phrase_list) # <<<<<<<<<<<<<<
@@ -63515,7 +64039,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
/*else*/ {
- /* "rulefactory.pxi":1810
+ /* "cdec/sa/rulefactory.pxi":1810
* pair_count = 1.0 / len(phrase_list)
* else:
* pair_count = 0 # <<<<<<<<<<<<<<
@@ -63526,7 +64050,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L140:;
- /* "rulefactory.pxi":1811
+ /* "cdec/sa/rulefactory.pxi":1811
* else:
* pair_count = 0
* for phrase2, eindexes in phrase_list: # <<<<<<<<<<<<<<
@@ -63625,7 +64149,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_XDECREF_SET(__pyx_v_eindexes, __pyx_t_3);
__pyx_t_3 = 0;
- /* "rulefactory.pxi":1812
+ /* "cdec/sa/rulefactory.pxi":1812
* pair_count = 0
* for phrase2, eindexes in phrase_list:
* als3 = self.create_alignments(sent_links,num_links,self.findexes,eindexes) # <<<<<<<<<<<<<<
@@ -63641,7 +64165,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_XDECREF_SET(__pyx_v_als3, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_3));
__pyx_t_3 = 0;
- /* "rulefactory.pxi":1813
+ /* "cdec/sa/rulefactory.pxi":1813
* for phrase2, eindexes in phrase_list:
* als3 = self.create_alignments(sent_links,num_links,self.findexes,eindexes)
* extracts.append((fphr, phrase2, pair_count, tuple(als3))) # <<<<<<<<<<<<<<
@@ -63675,7 +64199,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_8 = __Pyx_PyObject_Append(__pyx_v_extracts, __pyx_t_14); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- /* "rulefactory.pxi":1811
+ /* "cdec/sa/rulefactory.pxi":1811
* else:
* pair_count = 0
* for phrase2, eindexes in phrase_list: # <<<<<<<<<<<<<<
@@ -63691,7 +64215,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L116:;
- /* "rulefactory.pxi":1814
+ /* "cdec/sa/rulefactory.pxi":1814
* als3 = self.create_alignments(sent_links,num_links,self.findexes,eindexes)
* extracts.append((fphr, phrase2, pair_count, tuple(als3)))
* if (num_gaps < self.max_nonterminals - 1 and # <<<<<<<<<<<<<<
@@ -63707,7 +64231,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L147_next_and:;
- /* "rulefactory.pxi":1815
+ /* "cdec/sa/rulefactory.pxi":1815
* extracts.append((fphr, phrase2, pair_count, tuple(als3)))
* if (num_gaps < self.max_nonterminals - 1 and
* phrase_len+1 < self.max_length and # <<<<<<<<<<<<<<
@@ -63723,7 +64247,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L148_next_and:;
- /* "rulefactory.pxi":1816
+ /* "cdec/sa/rulefactory.pxi":1816
* if (num_gaps < self.max_nonterminals - 1 and
* phrase_len+1 < self.max_length and
* f_back_high == f_high and # <<<<<<<<<<<<<<
@@ -63739,7 +64263,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L149_next_and:;
- /* "rulefactory.pxi":1817
+ /* "cdec/sa/rulefactory.pxi":1817
* phrase_len+1 < self.max_length and
* f_back_high == f_high and
* f_back_low == f_low and # <<<<<<<<<<<<<<
@@ -63755,7 +64279,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L150_next_and:;
- /* "rulefactory.pxi":1818
+ /* "cdec/sa/rulefactory.pxi":1818
* f_back_high == f_high and
* f_back_low == f_low and
* f_back_high - f_back_low + (2*self.train_min_gap_size) <= self.train_max_initial_size and # <<<<<<<<<<<<<<
@@ -63771,7 +64295,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L151_next_and:;
- /* "rulefactory.pxi":1819
+ /* "cdec/sa/rulefactory.pxi":1819
* f_back_low == f_low and
* f_back_high - f_back_low + (2*self.train_min_gap_size) <= self.train_max_initial_size and
* f_low >= self.train_min_gap_size and # <<<<<<<<<<<<<<
@@ -63787,7 +64311,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L152_next_and:;
- /* "rulefactory.pxi":1820
+ /* "cdec/sa/rulefactory.pxi":1820
* f_back_high - f_back_low + (2*self.train_min_gap_size) <= self.train_max_initial_size and
* f_low >= self.train_min_gap_size and
* f_high <= f_sent_len - self.train_min_gap_size and # <<<<<<<<<<<<<<
@@ -63803,7 +64327,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L153_next_and:;
- /* "rulefactory.pxi":1821
+ /* "cdec/sa/rulefactory.pxi":1821
* f_low >= self.train_min_gap_size and
* f_high <= f_sent_len - self.train_min_gap_size and
* ((not self.tight_phrases) or (f_links_low[f_low-1] != -1 and f_links_low[f_high] != -1))): # <<<<<<<<<<<<<<
@@ -63831,7 +64355,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_L146_bool_binop_done:;
if (__pyx_t_9) {
- /* "rulefactory.pxi":1823
+ /* "cdec/sa/rulefactory.pxi":1823
* ((not self.tight_phrases) or (f_links_low[f_low-1] != -1 and f_links_low[f_high] != -1))):
*
* met_constraints = 1 # <<<<<<<<<<<<<<
@@ -63840,7 +64364,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_met_constraints = 1;
- /* "rulefactory.pxi":1824
+ /* "cdec/sa/rulefactory.pxi":1824
*
* met_constraints = 1
* f_x_low = f_low-self.train_min_gap_size # <<<<<<<<<<<<<<
@@ -63849,7 +64373,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_f_x_low = (__pyx_v_f_low - __pyx_v_self->train_min_gap_size);
- /* "rulefactory.pxi":1825
+ /* "cdec/sa/rulefactory.pxi":1825
* met_constraints = 1
* f_x_low = f_low-self.train_min_gap_size
* if self.tight_phrases: # <<<<<<<<<<<<<<
@@ -63859,7 +64383,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = (__pyx_v_self->tight_phrases != 0);
if (__pyx_t_9) {
- /* "rulefactory.pxi":1826
+ /* "cdec/sa/rulefactory.pxi":1826
* f_x_low = f_low-self.train_min_gap_size
* if self.tight_phrases:
* while f_x_low >= 0 and f_links_low[f_x_low] == -1: # <<<<<<<<<<<<<<
@@ -63880,7 +64404,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_L159_bool_binop_done:;
if (!__pyx_t_9) break;
- /* "rulefactory.pxi":1827
+ /* "cdec/sa/rulefactory.pxi":1827
* if self.tight_phrases:
* while f_x_low >= 0 and f_links_low[f_x_low] == -1:
* f_x_low = f_x_low - 1 # <<<<<<<<<<<<<<
@@ -63893,7 +64417,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L156:;
- /* "rulefactory.pxi":1828
+ /* "cdec/sa/rulefactory.pxi":1828
* while f_x_low >= 0 and f_links_low[f_x_low] == -1:
* f_x_low = f_x_low - 1
* if f_x_low < 0: # <<<<<<<<<<<<<<
@@ -63903,7 +64427,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = ((__pyx_v_f_x_low < 0) != 0);
if (__pyx_t_9) {
- /* "rulefactory.pxi":1829
+ /* "cdec/sa/rulefactory.pxi":1829
* f_x_low = f_x_low - 1
* if f_x_low < 0:
* met_constraints = 0 # <<<<<<<<<<<<<<
@@ -63915,7 +64439,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L161:;
- /* "rulefactory.pxi":1831
+ /* "cdec/sa/rulefactory.pxi":1831
* met_constraints = 0
*
* f_x_high = f_high+self.train_min_gap_size # <<<<<<<<<<<<<<
@@ -63924,7 +64448,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_f_x_high = (__pyx_v_f_high + __pyx_v_self->train_min_gap_size);
- /* "rulefactory.pxi":1832
+ /* "cdec/sa/rulefactory.pxi":1832
*
* f_x_high = f_high+self.train_min_gap_size
* if self.tight_phrases: # <<<<<<<<<<<<<<
@@ -63934,7 +64458,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = (__pyx_v_self->tight_phrases != 0);
if (__pyx_t_9) {
- /* "rulefactory.pxi":1833
+ /* "cdec/sa/rulefactory.pxi":1833
* f_x_high = f_high+self.train_min_gap_size
* if self.tight_phrases:
* while f_x_high <= f_sent_len and f_links_low[f_x_high-1] == -1: # <<<<<<<<<<<<<<
@@ -63955,7 +64479,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_L165_bool_binop_done:;
if (!__pyx_t_9) break;
- /* "rulefactory.pxi":1834
+ /* "cdec/sa/rulefactory.pxi":1834
* if self.tight_phrases:
* while f_x_high <= f_sent_len and f_links_low[f_x_high-1] == -1:
* f_x_high = f_x_high + 1 # <<<<<<<<<<<<<<
@@ -63968,7 +64492,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L162:;
- /* "rulefactory.pxi":1835
+ /* "cdec/sa/rulefactory.pxi":1835
* while f_x_high <= f_sent_len and f_links_low[f_x_high-1] == -1:
* f_x_high = f_x_high + 1
* if f_x_high > f_sent_len or f_x_high - f_x_low > self.train_max_initial_size: # <<<<<<<<<<<<<<
@@ -63988,7 +64512,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_L168_bool_binop_done:;
if (__pyx_t_9) {
- /* "rulefactory.pxi":1836
+ /* "cdec/sa/rulefactory.pxi":1836
* f_x_high = f_x_high + 1
* if f_x_high > f_sent_len or f_x_high - f_x_low > self.train_max_initial_size:
* met_constraints = 0 # <<<<<<<<<<<<<<
@@ -64000,7 +64524,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L167:;
- /* "rulefactory.pxi":1838
+ /* "cdec/sa/rulefactory.pxi":1838
* met_constraints = 0
*
* if (met_constraints and # <<<<<<<<<<<<<<
@@ -64016,7 +64540,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L172_next_and:;
- /* "rulefactory.pxi":1839
+ /* "cdec/sa/rulefactory.pxi":1839
*
* if (met_constraints and
* (self.find_fixpoint(f_x_low, f_x_high, # <<<<<<<<<<<<<<
@@ -64026,7 +64550,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_f_x_high); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- /* "rulefactory.pxi":1844
+ /* "cdec/sa/rulefactory.pxi":1844
* f_sent_len, e_sent_len,
* self.train_max_initial_size, self.train_max_initial_size,
* 1, 1, 2, 1, 1, 1, 1) == 1) and # <<<<<<<<<<<<<<
@@ -64043,7 +64567,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L173_next_and:;
- /* "rulefactory.pxi":1845
+ /* "cdec/sa/rulefactory.pxi":1845
* self.train_max_initial_size, self.train_max_initial_size,
* 1, 1, 2, 1, 1, 1, 1) == 1) and
* ((not self.tight_phrases) or (f_links_low[f_x_low] != -1 and f_links_low[f_x_high-1] != -1)) and # <<<<<<<<<<<<<<
@@ -64074,7 +64598,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L174_next_and:;
- /* "rulefactory.pxi":1846
+ /* "cdec/sa/rulefactory.pxi":1846
* 1, 1, 2, 1, 1, 1, 1) == 1) and
* ((not self.tight_phrases) or (f_links_low[f_x_low] != -1 and f_links_low[f_x_high-1] != -1)) and
* self.find_fixpoint(f_x_low, f_low, # <<<<<<<<<<<<<<
@@ -64084,7 +64608,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_f_low); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- /* "rulefactory.pxi":1850
+ /* "cdec/sa/rulefactory.pxi":1850
* -1, -1, e_gap_low, e_gap_high, f_gap_low, f_gap_high,
* f_sent_len, e_sent_len,
* self.train_max_initial_size, self.train_max_initial_size, # <<<<<<<<<<<<<<
@@ -64101,7 +64625,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L177_next_and:;
- /* "rulefactory.pxi":1852
+ /* "cdec/sa/rulefactory.pxi":1852
* self.train_max_initial_size, self.train_max_initial_size,
* 0, 0, 0, 0, 0, 0, 0) and
* self.find_fixpoint(f_high, f_x_high, # <<<<<<<<<<<<<<
@@ -64111,7 +64635,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_f_x_high); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- /* "rulefactory.pxi":1857
+ /* "cdec/sa/rulefactory.pxi":1857
* f_gap_low+1+num_gaps, f_gap_high+1+num_gaps,
* f_sent_len, e_sent_len,
* self.train_max_initial_size, self.train_max_initial_size, # <<<<<<<<<<<<<<
@@ -64124,7 +64648,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_L171_bool_binop_done:;
if (__pyx_t_9) {
- /* "rulefactory.pxi":1859
+ /* "cdec/sa/rulefactory.pxi":1859
* self.train_max_initial_size, self.train_max_initial_size,
* 0, 0, 0, 0, 0, 0, 0)):
* fphr_arr._clear() # <<<<<<<<<<<<<<
@@ -64133,7 +64657,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_clear(__pyx_v_fphr_arr);
- /* "rulefactory.pxi":1860
+ /* "cdec/sa/rulefactory.pxi":1860
* 0, 0, 0, 0, 0, 0, 0)):
* fphr_arr._clear()
* i = 1 # <<<<<<<<<<<<<<
@@ -64142,7 +64666,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_i = 1;
- /* "rulefactory.pxi":1861
+ /* "cdec/sa/rulefactory.pxi":1861
* fphr_arr._clear()
* i = 1
* self.findexes.reset() # <<<<<<<<<<<<<<
@@ -64171,7 +64695,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "rulefactory.pxi":1862
+ /* "cdec/sa/rulefactory.pxi":1862
* i = 1
* self.findexes.reset()
* self.findexes.append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -64183,7 +64707,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_8 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_4); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "rulefactory.pxi":1863
+ /* "cdec/sa/rulefactory.pxi":1863
* self.findexes.reset()
* self.findexes.append(sym_setindex(self.category, i))
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -64192,7 +64716,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i));
- /* "rulefactory.pxi":1864
+ /* "cdec/sa/rulefactory.pxi":1864
* self.findexes.append(sym_setindex(self.category, i))
* fphr_arr._append(sym_setindex(self.category, i))
* i = i+1 # <<<<<<<<<<<<<<
@@ -64201,7 +64725,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_i = (__pyx_v_i + 1);
- /* "rulefactory.pxi":1865
+ /* "cdec/sa/rulefactory.pxi":1865
* fphr_arr._append(sym_setindex(self.category, i))
* i = i+1
* self.findexes.extend(self.findexes1) # <<<<<<<<<<<<<<
@@ -64237,7 +64761,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "rulefactory.pxi":1866
+ /* "cdec/sa/rulefactory.pxi":1866
* i = i+1
* self.findexes.extend(self.findexes1)
* for j from 0 <= j < phrase.n: # <<<<<<<<<<<<<<
@@ -64247,7 +64771,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_2 = __pyx_v_phrase->n;
for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_2; __pyx_v_j++) {
- /* "rulefactory.pxi":1867
+ /* "cdec/sa/rulefactory.pxi":1867
* self.findexes.extend(self.findexes1)
* for j from 0 <= j < phrase.n:
* if sym_isvar(phrase.syms[j]): # <<<<<<<<<<<<<<
@@ -64257,7 +64781,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = (__pyx_f_4cdec_2sa_3_sa_sym_isvar((__pyx_v_phrase->syms[__pyx_v_j])) != 0);
if (__pyx_t_9) {
- /* "rulefactory.pxi":1868
+ /* "cdec/sa/rulefactory.pxi":1868
* for j from 0 <= j < phrase.n:
* if sym_isvar(phrase.syms[j]):
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -64266,7 +64790,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i));
- /* "rulefactory.pxi":1869
+ /* "cdec/sa/rulefactory.pxi":1869
* if sym_isvar(phrase.syms[j]):
* fphr_arr._append(sym_setindex(self.category, i))
* i = i + 1 # <<<<<<<<<<<<<<
@@ -64278,7 +64802,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
/*else*/ {
- /* "rulefactory.pxi":1871
+ /* "cdec/sa/rulefactory.pxi":1871
* i = i + 1
* else:
* fphr_arr._append(phrase.syms[j]) # <<<<<<<<<<<<<<
@@ -64290,7 +64814,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_L180:;
}
- /* "rulefactory.pxi":1872
+ /* "cdec/sa/rulefactory.pxi":1872
* else:
* fphr_arr._append(phrase.syms[j])
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -64299,7 +64823,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i));
- /* "rulefactory.pxi":1873
+ /* "cdec/sa/rulefactory.pxi":1873
* fphr_arr._append(phrase.syms[j])
* fphr_arr._append(sym_setindex(self.category, i))
* self.findexes.append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -64311,7 +64835,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_8 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_4); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "rulefactory.pxi":1874
+ /* "cdec/sa/rulefactory.pxi":1874
* fphr_arr._append(sym_setindex(self.category, i))
* self.findexes.append(sym_setindex(self.category, i))
* fphr = Phrase(fphr_arr) # <<<<<<<<<<<<<<
@@ -64329,7 +64853,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_DECREF_SET(__pyx_v_fphr, ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_14));
__pyx_t_14 = 0;
- /* "rulefactory.pxi":1875
+ /* "cdec/sa/rulefactory.pxi":1875
* self.findexes.append(sym_setindex(self.category, i))
* fphr = Phrase(fphr_arr)
* phrase_list = self.extract_phrases(e_x_low, e_x_high, e_gap_low, e_gap_high, e_links_low, num_gaps+2, # <<<<<<<<<<<<<<
@@ -64341,7 +64865,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_XDECREF_SET(__pyx_v_phrase_list, __pyx_t_14);
__pyx_t_14 = 0;
- /* "rulefactory.pxi":1878
+ /* "cdec/sa/rulefactory.pxi":1878
* f_x_low, f_x_high, f_gap_low, f_gap_high, f_links_low,
* matching.sent_id, e_sent_len, e_sent_start)
* if len(phrase_list) > 0: # <<<<<<<<<<<<<<
@@ -64352,7 +64876,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = ((__pyx_t_13 > 0) != 0);
if (__pyx_t_9) {
- /* "rulefactory.pxi":1879
+ /* "cdec/sa/rulefactory.pxi":1879
* matching.sent_id, e_sent_len, e_sent_start)
* if len(phrase_list) > 0:
* pair_count = 1.0 / len(phrase_list) # <<<<<<<<<<<<<<
@@ -64375,7 +64899,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
/*else*/ {
- /* "rulefactory.pxi":1881
+ /* "cdec/sa/rulefactory.pxi":1881
* pair_count = 1.0 / len(phrase_list)
* else:
* pair_count = 0 # <<<<<<<<<<<<<<
@@ -64386,7 +64910,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L181:;
- /* "rulefactory.pxi":1882
+ /* "cdec/sa/rulefactory.pxi":1882
* else:
* pair_count = 0
* for phrase2, eindexes in phrase_list: # <<<<<<<<<<<<<<
@@ -64485,7 +65009,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_XDECREF_SET(__pyx_v_eindexes, __pyx_t_12);
__pyx_t_12 = 0;
- /* "rulefactory.pxi":1883
+ /* "cdec/sa/rulefactory.pxi":1883
* pair_count = 0
* for phrase2, eindexes in phrase_list:
* als4 = self.create_alignments(sent_links,num_links,self.findexes,eindexes) # <<<<<<<<<<<<<<
@@ -64501,7 +65025,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_XDECREF_SET(__pyx_v_als4, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_12));
__pyx_t_12 = 0;
- /* "rulefactory.pxi":1884
+ /* "cdec/sa/rulefactory.pxi":1884
* for phrase2, eindexes in phrase_list:
* als4 = self.create_alignments(sent_links,num_links,self.findexes,eindexes)
* extracts.append((fphr, phrase2, pair_count, tuple(als4))) # <<<<<<<<<<<<<<
@@ -64535,7 +65059,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_8 = __Pyx_PyObject_Append(__pyx_v_extracts, __pyx_t_4); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "rulefactory.pxi":1882
+ /* "cdec/sa/rulefactory.pxi":1882
* else:
* pair_count = 0
* for phrase2, eindexes in phrase_list: # <<<<<<<<<<<<<<
@@ -64560,7 +65084,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
/*else*/ {
- /* "rulefactory.pxi":1886
+ /* "cdec/sa/rulefactory.pxi":1886
* extracts.append((fphr, phrase2, pair_count, tuple(als4)))
* else:
* reason_for_failure = "Unable to extract basic phrase" # <<<<<<<<<<<<<<
@@ -64575,7 +65099,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L45:;
- /* "rulefactory.pxi":1888
+ /* "cdec/sa/rulefactory.pxi":1888
* reason_for_failure = "Unable to extract basic phrase"
*
* free(sent_links) # <<<<<<<<<<<<<<
@@ -64584,7 +65108,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
free(__pyx_v_sent_links);
- /* "rulefactory.pxi":1889
+ /* "cdec/sa/rulefactory.pxi":1889
*
* free(sent_links)
* free(f_links_low) # <<<<<<<<<<<<<<
@@ -64593,7 +65117,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
free(__pyx_v_f_links_low);
- /* "rulefactory.pxi":1890
+ /* "cdec/sa/rulefactory.pxi":1890
* free(sent_links)
* free(f_links_low)
* free(f_links_high) # <<<<<<<<<<<<<<
@@ -64602,7 +65126,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
free(__pyx_v_f_links_high);
- /* "rulefactory.pxi":1891
+ /* "cdec/sa/rulefactory.pxi":1891
* free(f_links_low)
* free(f_links_high)
* free(e_links_low) # <<<<<<<<<<<<<<
@@ -64611,7 +65135,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
free(__pyx_v_e_links_low);
- /* "rulefactory.pxi":1892
+ /* "cdec/sa/rulefactory.pxi":1892
* free(f_links_high)
* free(e_links_low)
* free(e_links_high) # <<<<<<<<<<<<<<
@@ -64620,7 +65144,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
free(__pyx_v_e_links_high);
- /* "rulefactory.pxi":1893
+ /* "cdec/sa/rulefactory.pxi":1893
* free(e_links_low)
* free(e_links_high)
* free(f_gap_low) # <<<<<<<<<<<<<<
@@ -64629,7 +65153,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
free(__pyx_v_f_gap_low);
- /* "rulefactory.pxi":1894
+ /* "cdec/sa/rulefactory.pxi":1894
* free(e_links_high)
* free(f_gap_low)
* free(f_gap_high) # <<<<<<<<<<<<<<
@@ -64638,7 +65162,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
free(__pyx_v_f_gap_high);
- /* "rulefactory.pxi":1895
+ /* "cdec/sa/rulefactory.pxi":1895
* free(f_gap_low)
* free(f_gap_high)
* free(e_gap_low) # <<<<<<<<<<<<<<
@@ -64647,7 +65171,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
free(__pyx_v_e_gap_low);
- /* "rulefactory.pxi":1896
+ /* "cdec/sa/rulefactory.pxi":1896
* free(f_gap_high)
* free(e_gap_low)
* free(e_gap_high) # <<<<<<<<<<<<<<
@@ -64656,7 +65180,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
free(__pyx_v_e_gap_high);
- /* "rulefactory.pxi":1898
+ /* "cdec/sa/rulefactory.pxi":1898
* free(e_gap_high)
*
* return extracts # <<<<<<<<<<<<<<
@@ -64668,7 +65192,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_r = __pyx_v_extracts;
goto __pyx_L0;
- /* "rulefactory.pxi":1493
+ /* "cdec/sa/rulefactory.pxi":1493
* return ret
*
* cdef extract(self, Phrase phrase, Matching* matching, int* chunklen, int num_chunks): # <<<<<<<<<<<<<<
@@ -64705,7 +65229,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
return __pyx_r;
}
-/* "rulefactory.pxi":1906
+/* "cdec/sa/rulefactory.pxi":1906
* # Aggregate stats from a training instance
* # (Extract rules, update counts)
* def add_instance(self, f_words, e_words, alignment, ctx_name=None): # <<<<<<<<<<<<<<
@@ -64795,7 +65319,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_26add_instanc
return __pyx_r;
}
-/* "rulefactory.pxi":1940
+/* "cdec/sa/rulefactory.pxi":1940
* # f_ i and j are current, e_ i and j are previous
* # We care _considering_ f_j, so it is not yet in counts
* def extract(f_i, f_j, e_i, e_j, min_bound, wc, links, nt, nt_open): # <<<<<<<<<<<<<<
@@ -64929,8 +65453,8 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
}
static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_extract(PyObject *__pyx_self, PyObject *__pyx_v_f_i, PyObject *__pyx_v_f_j, PyObject *__pyx_v_e_i, PyObject *__pyx_v_e_j, PyObject *__pyx_v_min_bound, PyObject *__pyx_v_wc, PyObject *__pyx_v_links, PyObject *__pyx_v_nt, PyObject *__pyx_v_nt_open) {
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance *__pyx_cur_scope;
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance *__pyx_outer_scope;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_add_instance *__pyx_cur_scope;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_add_instance *__pyx_outer_scope;
PyObject *__pyx_v_link_i = NULL;
PyObject *__pyx_v_link_j = NULL;
PyObject *__pyx_v_new_e_i = NULL;
@@ -64963,10 +65487,10 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("extract", 0);
- __pyx_outer_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance *) __Pyx_CyFunction_GetClosure(__pyx_self);
+ __pyx_outer_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_add_instance *) __Pyx_CyFunction_GetClosure(__pyx_self);
__pyx_cur_scope = __pyx_outer_scope;
- /* "rulefactory.pxi":1942
+ /* "cdec/sa/rulefactory.pxi":1942
* def extract(f_i, f_j, e_i, e_j, min_bound, wc, links, nt, nt_open):
* # Phrase extraction limits
* if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size: # <<<<<<<<<<<<<<
@@ -65004,7 +65528,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__pyx_L4_bool_binop_done:;
if (__pyx_t_1) {
- /* "rulefactory.pxi":1943
+ /* "cdec/sa/rulefactory.pxi":1943
* # Phrase extraction limits
* if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size:
* return # <<<<<<<<<<<<<<
@@ -65016,7 +65540,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
goto __pyx_L0;
}
- /* "rulefactory.pxi":1945
+ /* "cdec/sa/rulefactory.pxi":1945
* return
* # Unaligned word
* if not al[f_j]: # <<<<<<<<<<<<<<
@@ -65031,7 +65555,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__pyx_t_4 = ((!__pyx_t_1) != 0);
if (__pyx_t_4) {
- /* "rulefactory.pxi":1947
+ /* "cdec/sa/rulefactory.pxi":1947
* if not al[f_j]:
* # Adjacent to non-terminal: extend (non-terminal now open)
* if nt and nt[-1][2] == f_j - 1: # <<<<<<<<<<<<<<
@@ -65062,7 +65586,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__pyx_L8_bool_binop_done:;
if (__pyx_t_4) {
- /* "rulefactory.pxi":1948
+ /* "cdec/sa/rulefactory.pxi":1948
* # Adjacent to non-terminal: extend (non-terminal now open)
* if nt and nt[-1][2] == f_j - 1:
* nt[-1][2] += 1 # <<<<<<<<<<<<<<
@@ -65081,7 +65605,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "rulefactory.pxi":1949
+ /* "cdec/sa/rulefactory.pxi":1949
* if nt and nt[-1][2] == f_j - 1:
* nt[-1][2] += 1
* extract(f_i, f_j + 1, e_i, e_j, min_bound, wc, links, nt, True) # <<<<<<<<<<<<<<
@@ -65096,7 +65620,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "rulefactory.pxi":1950
+ /* "cdec/sa/rulefactory.pxi":1950
* nt[-1][2] += 1
* extract(f_i, f_j + 1, e_i, e_j, min_bound, wc, links, nt, True)
* nt[-1][2] -= 1 # <<<<<<<<<<<<<<
@@ -65118,7 +65642,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
}
__pyx_L7:;
- /* "rulefactory.pxi":1953
+ /* "cdec/sa/rulefactory.pxi":1953
* # Unless non-terminal already open, always extend with word
* # Make sure adding a word doesn't exceed length
* if not nt_open and wc < self.max_length: # <<<<<<<<<<<<<<
@@ -65145,7 +65669,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__pyx_L11_bool_binop_done:;
if (__pyx_t_4) {
- /* "rulefactory.pxi":1954
+ /* "cdec/sa/rulefactory.pxi":1954
* # Make sure adding a word doesn't exceed length
* if not nt_open and wc < self.max_length:
* extract(f_i, f_j + 1, e_i, e_j, min_bound, wc + 1, links, nt, False) # <<<<<<<<<<<<<<
@@ -65166,7 +65690,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
}
__pyx_L10:;
- /* "rulefactory.pxi":1955
+ /* "cdec/sa/rulefactory.pxi":1955
* if not nt_open and wc < self.max_length:
* extract(f_i, f_j + 1, e_i, e_j, min_bound, wc + 1, links, nt, False)
* return # <<<<<<<<<<<<<<
@@ -65178,7 +65702,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
goto __pyx_L0;
}
- /* "rulefactory.pxi":1957
+ /* "cdec/sa/rulefactory.pxi":1957
* return
* # Aligned word
* link_i = fe_span[f_j][0] # <<<<<<<<<<<<<<
@@ -65198,7 +65722,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__pyx_v_link_i = __pyx_t_3;
__pyx_t_3 = 0;
- /* "rulefactory.pxi":1958
+ /* "cdec/sa/rulefactory.pxi":1958
* # Aligned word
* link_i = fe_span[f_j][0]
* link_j = fe_span[f_j][1] # <<<<<<<<<<<<<<
@@ -65218,7 +65742,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__pyx_v_link_j = __pyx_t_2;
__pyx_t_2 = 0;
- /* "rulefactory.pxi":1959
+ /* "cdec/sa/rulefactory.pxi":1959
* link_i = fe_span[f_j][0]
* link_j = fe_span[f_j][1]
* new_e_i = min(link_i, e_i) # <<<<<<<<<<<<<<
@@ -65247,7 +65771,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__pyx_v_new_e_i = __pyx_t_2;
__pyx_t_2 = 0;
- /* "rulefactory.pxi":1960
+ /* "cdec/sa/rulefactory.pxi":1960
* link_j = fe_span[f_j][1]
* new_e_i = min(link_i, e_i)
* new_e_j = max(link_j, e_j) # <<<<<<<<<<<<<<
@@ -65276,7 +65800,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__pyx_v_new_e_j = __pyx_t_2;
__pyx_t_2 = 0;
- /* "rulefactory.pxi":1963
+ /* "cdec/sa/rulefactory.pxi":1963
* # Check reverse links of newly covered words to see if they violate left
* # bound (return) or extend minimum right bound for chunk
* new_min_bound = min_bound # <<<<<<<<<<<<<<
@@ -65286,7 +65810,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_INCREF(__pyx_v_min_bound);
__pyx_v_new_min_bound = __pyx_v_min_bound;
- /* "rulefactory.pxi":1965
+ /* "cdec/sa/rulefactory.pxi":1965
* new_min_bound = min_bound
* # First aligned word creates span
* if e_j == -1: # <<<<<<<<<<<<<<
@@ -65298,7 +65822,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (__pyx_t_4) {
- /* "rulefactory.pxi":1966
+ /* "cdec/sa/rulefactory.pxi":1966
* # First aligned word creates span
* if e_j == -1:
* for i from new_e_i <= i <= new_e_j: # <<<<<<<<<<<<<<
@@ -65313,7 +65837,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
__pyx_t_2 = 0;
- /* "rulefactory.pxi":1967
+ /* "cdec/sa/rulefactory.pxi":1967
* if e_j == -1:
* for i from new_e_i <= i <= new_e_j:
* if ef_span[i][0] < f_i: # <<<<<<<<<<<<<<
@@ -65336,7 +65860,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (__pyx_t_4) {
- /* "rulefactory.pxi":1968
+ /* "cdec/sa/rulefactory.pxi":1968
* for i from new_e_i <= i <= new_e_j:
* if ef_span[i][0] < f_i:
* return # <<<<<<<<<<<<<<
@@ -65348,7 +65872,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
goto __pyx_L0;
}
- /* "rulefactory.pxi":1969
+ /* "cdec/sa/rulefactory.pxi":1969
* if ef_span[i][0] < f_i:
* return
* new_min_bound = max(new_min_bound, ef_span[i][1]) # <<<<<<<<<<<<<<
@@ -65387,7 +65911,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__pyx_t_11 = __Pyx_PyInt_As_int(__pyx_v_i); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- /* "rulefactory.pxi":1966
+ /* "cdec/sa/rulefactory.pxi":1966
* # First aligned word creates span
* if e_j == -1:
* for i from new_e_i <= i <= new_e_j: # <<<<<<<<<<<<<<
@@ -65402,7 +65926,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
}
/*else*/ {
- /* "rulefactory.pxi":1972
+ /* "cdec/sa/rulefactory.pxi":1972
* # Other aligned words extend span
* else:
* for i from new_e_i <= i < e_i: # <<<<<<<<<<<<<<
@@ -65417,7 +65941,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
__pyx_t_3 = 0;
- /* "rulefactory.pxi":1973
+ /* "cdec/sa/rulefactory.pxi":1973
* else:
* for i from new_e_i <= i < e_i:
* if ef_span[i][0] < f_i: # <<<<<<<<<<<<<<
@@ -65440,7 +65964,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_4) {
- /* "rulefactory.pxi":1974
+ /* "cdec/sa/rulefactory.pxi":1974
* for i from new_e_i <= i < e_i:
* if ef_span[i][0] < f_i:
* return # <<<<<<<<<<<<<<
@@ -65452,7 +65976,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
goto __pyx_L0;
}
- /* "rulefactory.pxi":1975
+ /* "cdec/sa/rulefactory.pxi":1975
* if ef_span[i][0] < f_i:
* return
* new_min_bound = max(new_min_bound, ef_span[i][1]) # <<<<<<<<<<<<<<
@@ -65491,7 +66015,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_i); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- /* "rulefactory.pxi":1972
+ /* "cdec/sa/rulefactory.pxi":1972
* # Other aligned words extend span
* else:
* for i from new_e_i <= i < e_i: # <<<<<<<<<<<<<<
@@ -65503,7 +66027,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_5);
__pyx_t_5 = 0;
- /* "rulefactory.pxi":1976
+ /* "cdec/sa/rulefactory.pxi":1976
* return
* new_min_bound = max(new_min_bound, ef_span[i][1])
* for i from e_j < i <= new_e_j: # <<<<<<<<<<<<<<
@@ -65518,7 +66042,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_5);
__pyx_t_5 = 0;
- /* "rulefactory.pxi":1977
+ /* "cdec/sa/rulefactory.pxi":1977
* new_min_bound = max(new_min_bound, ef_span[i][1])
* for i from e_j < i <= new_e_j:
* if ef_span[i][0] < f_i: # <<<<<<<<<<<<<<
@@ -65541,7 +66065,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_4) {
- /* "rulefactory.pxi":1978
+ /* "cdec/sa/rulefactory.pxi":1978
* for i from e_j < i <= new_e_j:
* if ef_span[i][0] < f_i:
* return # <<<<<<<<<<<<<<
@@ -65553,7 +66077,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
goto __pyx_L0;
}
- /* "rulefactory.pxi":1979
+ /* "cdec/sa/rulefactory.pxi":1979
* if ef_span[i][0] < f_i:
* return
* new_min_bound = max(new_min_bound, ef_span[i][1]) # <<<<<<<<<<<<<<
@@ -65592,7 +66116,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__pyx_t_11 = __Pyx_PyInt_As_int(__pyx_v_i); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- /* "rulefactory.pxi":1976
+ /* "cdec/sa/rulefactory.pxi":1976
* return
* new_min_bound = max(new_min_bound, ef_span[i][1])
* for i from e_j < i <= new_e_j: # <<<<<<<<<<<<<<
@@ -65606,7 +66130,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
}
__pyx_L13:;
- /* "rulefactory.pxi":1981
+ /* "cdec/sa/rulefactory.pxi":1981
* new_min_bound = max(new_min_bound, ef_span[i][1])
* # Extract, extend with word (unless non-terminal open)
* if not nt_open: # <<<<<<<<<<<<<<
@@ -65617,7 +66141,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__pyx_t_7 = ((!__pyx_t_4) != 0);
if (__pyx_t_7) {
- /* "rulefactory.pxi":1982
+ /* "cdec/sa/rulefactory.pxi":1982
* # Extract, extend with word (unless non-terminal open)
* if not nt_open:
* nt_collision = False # <<<<<<<<<<<<<<
@@ -65626,7 +66150,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
*/
__pyx_v_nt_collision = 0;
- /* "rulefactory.pxi":1983
+ /* "cdec/sa/rulefactory.pxi":1983
* if not nt_open:
* nt_collision = False
* for link in al[f_j]: # <<<<<<<<<<<<<<
@@ -65677,7 +66201,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_XDECREF_SET(__pyx_v_link, __pyx_t_2);
__pyx_t_2 = 0;
- /* "rulefactory.pxi":1984
+ /* "cdec/sa/rulefactory.pxi":1984
* nt_collision = False
* for link in al[f_j]:
* if e_nt_cover[link]: # <<<<<<<<<<<<<<
@@ -65695,7 +66219,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (__pyx_t_7) {
- /* "rulefactory.pxi":1985
+ /* "cdec/sa/rulefactory.pxi":1985
* for link in al[f_j]:
* if e_nt_cover[link]:
* nt_collision = True # <<<<<<<<<<<<<<
@@ -65707,7 +66231,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
}
__pyx_L26:;
- /* "rulefactory.pxi":1983
+ /* "cdec/sa/rulefactory.pxi":1983
* if not nt_open:
* nt_collision = False
* for link in al[f_j]: # <<<<<<<<<<<<<<
@@ -65717,7 +66241,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "rulefactory.pxi":1988
+ /* "cdec/sa/rulefactory.pxi":1988
* # Non-terminal collisions block word extraction and extension, but
* # may be okay for continuing non-terminals
* if not nt_collision and wc < self.max_length: # <<<<<<<<<<<<<<
@@ -65743,7 +66267,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__pyx_L28_bool_binop_done:;
if (__pyx_t_7) {
- /* "rulefactory.pxi":1989
+ /* "cdec/sa/rulefactory.pxi":1989
* # may be okay for continuing non-terminals
* if not nt_collision and wc < self.max_length:
* plus_links = [] # <<<<<<<<<<<<<<
@@ -65755,7 +66279,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__pyx_v_plus_links = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
- /* "rulefactory.pxi":1990
+ /* "cdec/sa/rulefactory.pxi":1990
* if not nt_collision and wc < self.max_length:
* plus_links = []
* for link in al[f_j]: # <<<<<<<<<<<<<<
@@ -65806,7 +66330,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_XDECREF_SET(__pyx_v_link, __pyx_t_2);
__pyx_t_2 = 0;
- /* "rulefactory.pxi":1991
+ /* "cdec/sa/rulefactory.pxi":1991
* plus_links = []
* for link in al[f_j]:
* plus_links.append((f_j, link)) # <<<<<<<<<<<<<<
@@ -65824,7 +66348,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__pyx_t_13 = __Pyx_PyList_Append(__pyx_v_plus_links, __pyx_t_2); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "rulefactory.pxi":1992
+ /* "cdec/sa/rulefactory.pxi":1992
* for link in al[f_j]:
* plus_links.append((f_j, link))
* cover[link] += 1 # <<<<<<<<<<<<<<
@@ -65858,7 +66382,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- /* "rulefactory.pxi":1990
+ /* "cdec/sa/rulefactory.pxi":1990
* if not nt_collision and wc < self.max_length:
* plus_links = []
* for link in al[f_j]: # <<<<<<<<<<<<<<
@@ -65868,7 +66392,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "rulefactory.pxi":1993
+ /* "cdec/sa/rulefactory.pxi":1993
* plus_links.append((f_j, link))
* cover[link] += 1
* links.append(plus_links) # <<<<<<<<<<<<<<
@@ -65877,7 +66401,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
*/
__pyx_t_13 = __Pyx_PyObject_Append(__pyx_v_links, __pyx_v_plus_links); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "rulefactory.pxi":1994
+ /* "cdec/sa/rulefactory.pxi":1994
* cover[link] += 1
* links.append(plus_links)
* if links and f_j >= new_min_bound: # <<<<<<<<<<<<<<
@@ -65899,7 +66423,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__pyx_L33_bool_binop_done:;
if (__pyx_t_7) {
- /* "rulefactory.pxi":1995
+ /* "cdec/sa/rulefactory.pxi":1995
* links.append(plus_links)
* if links and f_j >= new_min_bound:
* rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links)) # <<<<<<<<<<<<<<
@@ -65971,7 +66495,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
}
__pyx_L32:;
- /* "rulefactory.pxi":1996
+ /* "cdec/sa/rulefactory.pxi":1996
* if links and f_j >= new_min_bound:
* rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links))
* extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc + 1, links, nt, False) # <<<<<<<<<<<<<<
@@ -65989,7 +66513,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- /* "rulefactory.pxi":1997
+ /* "cdec/sa/rulefactory.pxi":1997
* rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links))
* extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc + 1, links, nt, False)
* links.pop() # <<<<<<<<<<<<<<
@@ -66000,7 +66524,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_GOTREF(__pyx_t_16);
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- /* "rulefactory.pxi":1998
+ /* "cdec/sa/rulefactory.pxi":1998
* extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc + 1, links, nt, False)
* links.pop()
* for link in al[f_j]: # <<<<<<<<<<<<<<
@@ -66051,7 +66575,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_XDECREF_SET(__pyx_v_link, __pyx_t_16);
__pyx_t_16 = 0;
- /* "rulefactory.pxi":1999
+ /* "cdec/sa/rulefactory.pxi":1999
* links.pop()
* for link in al[f_j]:
* cover[link] -= 1 # <<<<<<<<<<<<<<
@@ -66085,7 +66609,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- /* "rulefactory.pxi":1998
+ /* "cdec/sa/rulefactory.pxi":1998
* extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc + 1, links, nt, False)
* links.pop()
* for link in al[f_j]: # <<<<<<<<<<<<<<
@@ -66101,7 +66625,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
}
__pyx_L23:;
- /* "rulefactory.pxi":2001
+ /* "cdec/sa/rulefactory.pxi":2001
* cover[link] -= 1
* # Try to add a word to current non-terminal (if any), extract, extend
* if nt and nt[-1][2] == f_j - 1: # <<<<<<<<<<<<<<
@@ -66132,7 +66656,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__pyx_L38_bool_binop_done:;
if (__pyx_t_7) {
- /* "rulefactory.pxi":2003
+ /* "cdec/sa/rulefactory.pxi":2003
* if nt and nt[-1][2] == f_j - 1:
* # Add to non-terminal, checking for collisions
* old_last_nt = nt[-1][:] # <<<<<<<<<<<<<<
@@ -66147,7 +66671,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__pyx_v_old_last_nt = __pyx_t_2;
__pyx_t_2 = 0;
- /* "rulefactory.pxi":2004
+ /* "cdec/sa/rulefactory.pxi":2004
* # Add to non-terminal, checking for collisions
* old_last_nt = nt[-1][:]
* nt[-1][2] = f_j # <<<<<<<<<<<<<<
@@ -66159,7 +66683,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
if (unlikely(__Pyx_SetItemInt(__pyx_t_2, 2, __pyx_v_f_j, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "rulefactory.pxi":2005
+ /* "cdec/sa/rulefactory.pxi":2005
* old_last_nt = nt[-1][:]
* nt[-1][2] = f_j
* if link_i < nt[-1][3]: # <<<<<<<<<<<<<<
@@ -66177,7 +66701,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (__pyx_t_7) {
- /* "rulefactory.pxi":2006
+ /* "cdec/sa/rulefactory.pxi":2006
* nt[-1][2] = f_j
* if link_i < nt[-1][3]:
* if not span_check(cover, link_i, nt[-1][3] - 1): # <<<<<<<<<<<<<<
@@ -66230,7 +66754,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__pyx_t_4 = ((!__pyx_t_7) != 0);
if (__pyx_t_4) {
- /* "rulefactory.pxi":2007
+ /* "cdec/sa/rulefactory.pxi":2007
* if link_i < nt[-1][3]:
* if not span_check(cover, link_i, nt[-1][3] - 1):
* nt[-1] = old_last_nt # <<<<<<<<<<<<<<
@@ -66239,7 +66763,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
*/
if (unlikely(__Pyx_SetItemInt(__pyx_v_nt, -1, __pyx_v_old_last_nt, long, 1, __Pyx_PyInt_From_long, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "rulefactory.pxi":2008
+ /* "cdec/sa/rulefactory.pxi":2008
* if not span_check(cover, link_i, nt[-1][3] - 1):
* nt[-1] = old_last_nt
* return # <<<<<<<<<<<<<<
@@ -66251,7 +66775,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
goto __pyx_L0;
}
- /* "rulefactory.pxi":2009
+ /* "cdec/sa/rulefactory.pxi":2009
* nt[-1] = old_last_nt
* return
* span_inc(cover, link_i, nt[-1][3] - 1) # <<<<<<<<<<<<<<
@@ -66301,7 +66825,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "rulefactory.pxi":2010
+ /* "cdec/sa/rulefactory.pxi":2010
* return
* span_inc(cover, link_i, nt[-1][3] - 1)
* span_inc(e_nt_cover, link_i, nt[-1][3] - 1) # <<<<<<<<<<<<<<
@@ -66351,7 +66875,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "rulefactory.pxi":2011
+ /* "cdec/sa/rulefactory.pxi":2011
* span_inc(cover, link_i, nt[-1][3] - 1)
* span_inc(e_nt_cover, link_i, nt[-1][3] - 1)
* nt[-1][3] = link_i # <<<<<<<<<<<<<<
@@ -66366,7 +66890,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
}
__pyx_L40:;
- /* "rulefactory.pxi":2012
+ /* "cdec/sa/rulefactory.pxi":2012
* span_inc(e_nt_cover, link_i, nt[-1][3] - 1)
* nt[-1][3] = link_i
* if link_j > nt[-1][4]: # <<<<<<<<<<<<<<
@@ -66384,7 +66908,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (__pyx_t_4) {
- /* "rulefactory.pxi":2013
+ /* "cdec/sa/rulefactory.pxi":2013
* nt[-1][3] = link_i
* if link_j > nt[-1][4]:
* if not span_check(cover, nt[-1][4] + 1, link_j): # <<<<<<<<<<<<<<
@@ -66437,7 +66961,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__pyx_t_7 = ((!__pyx_t_4) != 0);
if (__pyx_t_7) {
- /* "rulefactory.pxi":2014
+ /* "cdec/sa/rulefactory.pxi":2014
* if link_j > nt[-1][4]:
* if not span_check(cover, nt[-1][4] + 1, link_j):
* nt[-1] = old_last_nt # <<<<<<<<<<<<<<
@@ -66446,7 +66970,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
*/
if (unlikely(__Pyx_SetItemInt(__pyx_v_nt, -1, __pyx_v_old_last_nt, long, 1, __Pyx_PyInt_From_long, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "rulefactory.pxi":2015
+ /* "cdec/sa/rulefactory.pxi":2015
* if not span_check(cover, nt[-1][4] + 1, link_j):
* nt[-1] = old_last_nt
* return # <<<<<<<<<<<<<<
@@ -66458,7 +66982,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
goto __pyx_L0;
}
- /* "rulefactory.pxi":2016
+ /* "cdec/sa/rulefactory.pxi":2016
* nt[-1] = old_last_nt
* return
* span_inc(cover, nt[-1][4] + 1, link_j) # <<<<<<<<<<<<<<
@@ -66508,7 +67032,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "rulefactory.pxi":2017
+ /* "cdec/sa/rulefactory.pxi":2017
* return
* span_inc(cover, nt[-1][4] + 1, link_j)
* span_inc(e_nt_cover, nt[-1][4] + 1, link_j) # <<<<<<<<<<<<<<
@@ -66558,7 +67082,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "rulefactory.pxi":2018
+ /* "cdec/sa/rulefactory.pxi":2018
* span_inc(cover, nt[-1][4] + 1, link_j)
* span_inc(e_nt_cover, nt[-1][4] + 1, link_j)
* nt[-1][4] = link_j # <<<<<<<<<<<<<<
@@ -66573,7 +67097,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
}
__pyx_L42:;
- /* "rulefactory.pxi":2019
+ /* "cdec/sa/rulefactory.pxi":2019
* span_inc(e_nt_cover, nt[-1][4] + 1, link_j)
* nt[-1][4] = link_j
* if links and f_j >= new_min_bound: # <<<<<<<<<<<<<<
@@ -66595,7 +67119,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__pyx_L45_bool_binop_done:;
if (__pyx_t_7) {
- /* "rulefactory.pxi":2020
+ /* "cdec/sa/rulefactory.pxi":2020
* nt[-1][4] = link_j
* if links and f_j >= new_min_bound:
* rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links)) # <<<<<<<<<<<<<<
@@ -66667,7 +67191,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
}
__pyx_L44:;
- /* "rulefactory.pxi":2021
+ /* "cdec/sa/rulefactory.pxi":2021
* if links and f_j >= new_min_bound:
* rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links))
* extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc, links, nt, False) # <<<<<<<<<<<<<<
@@ -66682,7 +67206,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- /* "rulefactory.pxi":2022
+ /* "cdec/sa/rulefactory.pxi":2022
* rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links))
* extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc, links, nt, False)
* nt[-1] = old_last_nt # <<<<<<<<<<<<<<
@@ -66691,7 +67215,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
*/
if (unlikely(__Pyx_SetItemInt(__pyx_v_nt, -1, __pyx_v_old_last_nt, long, 1, __Pyx_PyInt_From_long, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "rulefactory.pxi":2023
+ /* "cdec/sa/rulefactory.pxi":2023
* extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc, links, nt, False)
* nt[-1] = old_last_nt
* if link_i < nt[-1][3]: # <<<<<<<<<<<<<<
@@ -66709,7 +67233,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
if (__pyx_t_7) {
- /* "rulefactory.pxi":2024
+ /* "cdec/sa/rulefactory.pxi":2024
* nt[-1] = old_last_nt
* if link_i < nt[-1][3]:
* span_dec(cover, link_i, nt[-1][3] - 1) # <<<<<<<<<<<<<<
@@ -66759,7 +67283,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- /* "rulefactory.pxi":2025
+ /* "cdec/sa/rulefactory.pxi":2025
* if link_i < nt[-1][3]:
* span_dec(cover, link_i, nt[-1][3] - 1)
* span_dec(e_nt_cover, link_i, nt[-1][3] - 1) # <<<<<<<<<<<<<<
@@ -66812,7 +67336,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
}
__pyx_L47:;
- /* "rulefactory.pxi":2026
+ /* "cdec/sa/rulefactory.pxi":2026
* span_dec(cover, link_i, nt[-1][3] - 1)
* span_dec(e_nt_cover, link_i, nt[-1][3] - 1)
* if link_j > nt[-1][4]: # <<<<<<<<<<<<<<
@@ -66830,7 +67354,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
if (__pyx_t_7) {
- /* "rulefactory.pxi":2027
+ /* "cdec/sa/rulefactory.pxi":2027
* span_dec(e_nt_cover, link_i, nt[-1][3] - 1)
* if link_j > nt[-1][4]:
* span_dec(cover, nt[-1][4] + 1, link_j) # <<<<<<<<<<<<<<
@@ -66880,7 +67404,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- /* "rulefactory.pxi":2028
+ /* "cdec/sa/rulefactory.pxi":2028
* if link_j > nt[-1][4]:
* span_dec(cover, nt[-1][4] + 1, link_j)
* span_dec(e_nt_cover, nt[-1][4] + 1, link_j) # <<<<<<<<<<<<<<
@@ -66936,7 +67460,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
}
__pyx_L37:;
- /* "rulefactory.pxi":2030
+ /* "cdec/sa/rulefactory.pxi":2030
* span_dec(e_nt_cover, nt[-1][4] + 1, link_j)
* # Try to start a new non-terminal, extract, extend
* if (not nt or f_j - nt[-1][2] > 1) and wc < self.max_length and len(nt) < self.max_nonterminals: # <<<<<<<<<<<<<<
@@ -66991,7 +67515,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__pyx_L50_bool_binop_done:;
if (__pyx_t_7) {
- /* "rulefactory.pxi":2032
+ /* "cdec/sa/rulefactory.pxi":2032
* if (not nt or f_j - nt[-1][2] > 1) and wc < self.max_length and len(nt) < self.max_nonterminals:
* # Check for collisions
* if not span_check(cover, link_i, link_j): # <<<<<<<<<<<<<<
@@ -67036,7 +67560,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__pyx_t_1 = ((!__pyx_t_7) != 0);
if (__pyx_t_1) {
- /* "rulefactory.pxi":2033
+ /* "cdec/sa/rulefactory.pxi":2033
* # Check for collisions
* if not span_check(cover, link_i, link_j):
* return # <<<<<<<<<<<<<<
@@ -67048,7 +67572,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
goto __pyx_L0;
}
- /* "rulefactory.pxi":2034
+ /* "cdec/sa/rulefactory.pxi":2034
* if not span_check(cover, link_i, link_j):
* return
* span_inc(cover, link_i, link_j) # <<<<<<<<<<<<<<
@@ -67090,7 +67614,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- /* "rulefactory.pxi":2035
+ /* "cdec/sa/rulefactory.pxi":2035
* return
* span_inc(cover, link_i, link_j)
* span_inc(e_nt_cover, link_i, link_j) # <<<<<<<<<<<<<<
@@ -67132,7 +67656,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- /* "rulefactory.pxi":2036
+ /* "cdec/sa/rulefactory.pxi":2036
* span_inc(cover, link_i, link_j)
* span_inc(e_nt_cover, link_i, link_j)
* nt.append([(nt[-1][0] + 1) if nt else 1, f_j, f_j, link_i, link_j]) # <<<<<<<<<<<<<<
@@ -67175,7 +67699,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__pyx_t_13 = __Pyx_PyObject_Append(__pyx_v_nt, __pyx_t_2); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "rulefactory.pxi":2038
+ /* "cdec/sa/rulefactory.pxi":2038
* nt.append([(nt[-1][0] + 1) if nt else 1, f_j, f_j, link_i, link_j])
* # Require at least one word in phrase
* if links and f_j >= new_min_bound: # <<<<<<<<<<<<<<
@@ -67197,7 +67721,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__pyx_L56_bool_binop_done:;
if (__pyx_t_1) {
- /* "rulefactory.pxi":2039
+ /* "cdec/sa/rulefactory.pxi":2039
* # Require at least one word in phrase
* if links and f_j >= new_min_bound:
* rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links)) # <<<<<<<<<<<<<<
@@ -67269,7 +67793,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
}
__pyx_L55:;
- /* "rulefactory.pxi":2040
+ /* "cdec/sa/rulefactory.pxi":2040
* if links and f_j >= new_min_bound:
* rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links))
* extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc + 1, links, nt, False) # <<<<<<<<<<<<<<
@@ -67287,7 +67811,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- /* "rulefactory.pxi":2041
+ /* "cdec/sa/rulefactory.pxi":2041
* rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links))
* extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc + 1, links, nt, False)
* nt.pop() # <<<<<<<<<<<<<<
@@ -67298,7 +67822,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_GOTREF(__pyx_t_16);
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- /* "rulefactory.pxi":2042
+ /* "cdec/sa/rulefactory.pxi":2042
* extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc + 1, links, nt, False)
* nt.pop()
* span_dec(cover, link_i, link_j) # <<<<<<<<<<<<<<
@@ -67340,7 +67864,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- /* "rulefactory.pxi":2043
+ /* "cdec/sa/rulefactory.pxi":2043
* nt.pop()
* span_dec(cover, link_i, link_j)
* span_dec(e_nt_cover, link_i, link_j) # <<<<<<<<<<<<<<
@@ -67385,7 +67909,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
}
__pyx_L49:;
- /* "rulefactory.pxi":1940
+ /* "cdec/sa/rulefactory.pxi":1940
* # f_ i and j are current, e_ i and j are previous
* # We care _considering_ f_j, so it is not yet in counts
* def extract(f_i, f_j, e_i, e_j, min_bound, wc, links, nt, nt_open): # <<<<<<<<<<<<<<
@@ -67421,7 +67945,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
return __pyx_r;
}
-/* "rulefactory.pxi":1906
+/* "cdec/sa/rulefactory.pxi":1906
* # Aggregate stats from a training instance
* # (Extract rules, update counts)
* def add_instance(self, f_words, e_words, alignment, ctx_name=None): # <<<<<<<<<<<<<<
@@ -67430,7 +67954,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
*/
static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instance(struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_f_words, PyObject *__pyx_v_e_words, PyObject *__pyx_v_alignment, PyObject *__pyx_v_ctx_name) {
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance *__pyx_cur_scope;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_add_instance *__pyx_cur_scope;
PyObject *__pyx_v_e_len = NULL;
PyObject *__pyx_v_f = NULL;
PyObject *__pyx_v_e = NULL;
@@ -67463,7 +67987,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("add_instance", 0);
- __pyx_cur_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance *)__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance(__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance, __pyx_empty_tuple, NULL);
+ __pyx_cur_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_add_instance *)__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_22_add_instance(__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_22_add_instance, __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_cur_scope)) {
__Pyx_RefNannyFinishContext();
return NULL;
@@ -67479,7 +68003,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_e_words);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e_words);
- /* "rulefactory.pxi":1908
+ /* "cdec/sa/rulefactory.pxi":1908
* def add_instance(self, f_words, e_words, alignment, ctx_name=None):
*
* self.online = True # <<<<<<<<<<<<<<
@@ -67488,7 +68012,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
*/
__pyx_cur_scope->__pyx_v_self->online = 1;
- /* "rulefactory.pxi":1915
+ /* "cdec/sa/rulefactory.pxi":1915
* # span more than once.
* # (f, e, al, lex_f_i, lex_f_j)
* rules = set() # <<<<<<<<<<<<<<
@@ -67501,7 +68025,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
__pyx_cur_scope->__pyx_v_rules = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "rulefactory.pxi":1917
+ /* "cdec/sa/rulefactory.pxi":1917
* rules = set()
*
* f_len = len(f_words) # <<<<<<<<<<<<<<
@@ -67518,7 +68042,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
__pyx_cur_scope->__pyx_v_f_len = __pyx_t_1;
__pyx_t_1 = 0;
- /* "rulefactory.pxi":1918
+ /* "cdec/sa/rulefactory.pxi":1918
*
* f_len = len(f_words)
* e_len = len(e_words) # <<<<<<<<<<<<<<
@@ -67534,7 +68058,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
__pyx_v_e_len = __pyx_t_1;
__pyx_t_1 = 0;
- /* "rulefactory.pxi":1921
+ /* "cdec/sa/rulefactory.pxi":1921
*
* # Pre-compute alignment info
* al = [[] for i in range(f_len)] # <<<<<<<<<<<<<<
@@ -67601,7 +68125,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
__pyx_cur_scope->__pyx_v_al = __pyx_t_1;
__pyx_t_1 = 0;
- /* "rulefactory.pxi":1922
+ /* "cdec/sa/rulefactory.pxi":1922
* # Pre-compute alignment info
* al = [[] for i in range(f_len)]
* fe_span = [[e_len + 1, -1] for i in range(f_len)] # <<<<<<<<<<<<<<
@@ -67676,7 +68200,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
__pyx_cur_scope->__pyx_v_fe_span = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "rulefactory.pxi":1923
+ /* "cdec/sa/rulefactory.pxi":1923
* al = [[] for i in range(f_len)]
* fe_span = [[e_len + 1, -1] for i in range(f_len)]
* ef_span = [[f_len + 1, -1] for i in range(e_len)] # <<<<<<<<<<<<<<
@@ -67751,7 +68275,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
__pyx_cur_scope->__pyx_v_ef_span = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "rulefactory.pxi":1924
+ /* "cdec/sa/rulefactory.pxi":1924
* fe_span = [[e_len + 1, -1] for i in range(f_len)]
* ef_span = [[f_len + 1, -1] for i in range(e_len)]
* for f, e in alignment: # <<<<<<<<<<<<<<
@@ -67850,7 +68374,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
__Pyx_XDECREF_SET(__pyx_v_e, __pyx_t_6);
__pyx_t_6 = 0;
- /* "rulefactory.pxi":1925
+ /* "cdec/sa/rulefactory.pxi":1925
* ef_span = [[f_len + 1, -1] for i in range(e_len)]
* for f, e in alignment:
* al[f].append(e) # <<<<<<<<<<<<<<
@@ -67862,7 +68386,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
__pyx_t_9 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_v_e); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "rulefactory.pxi":1926
+ /* "cdec/sa/rulefactory.pxi":1926
* for f, e in alignment:
* al[f].append(e)
* fe_span[f][0] = min(fe_span[f][0], e) # <<<<<<<<<<<<<<
@@ -67897,7 +68421,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "rulefactory.pxi":1927
+ /* "cdec/sa/rulefactory.pxi":1927
* al[f].append(e)
* fe_span[f][0] = min(fe_span[f][0], e)
* fe_span[f][1] = max(fe_span[f][1], e) # <<<<<<<<<<<<<<
@@ -67932,7 +68456,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "rulefactory.pxi":1928
+ /* "cdec/sa/rulefactory.pxi":1928
* fe_span[f][0] = min(fe_span[f][0], e)
* fe_span[f][1] = max(fe_span[f][1], e)
* ef_span[e][0] = min(ef_span[e][0], f) # <<<<<<<<<<<<<<
@@ -67967,7 +68491,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "rulefactory.pxi":1929
+ /* "cdec/sa/rulefactory.pxi":1929
* fe_span[f][1] = max(fe_span[f][1], e)
* ef_span[e][0] = min(ef_span[e][0], f)
* ef_span[e][1] = max(ef_span[e][1], f) # <<<<<<<<<<<<<<
@@ -68002,7 +68526,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "rulefactory.pxi":1924
+ /* "cdec/sa/rulefactory.pxi":1924
* fe_span = [[e_len + 1, -1] for i in range(f_len)]
* ef_span = [[f_len + 1, -1] for i in range(e_len)]
* for f, e in alignment: # <<<<<<<<<<<<<<
@@ -68012,7 +68536,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "rulefactory.pxi":1932
+ /* "cdec/sa/rulefactory.pxi":1932
*
* # Target side word coverage
* cover = [0] * e_len # <<<<<<<<<<<<<<
@@ -68033,7 +68557,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
__pyx_cur_scope->__pyx_v_cover = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "rulefactory.pxi":1934
+ /* "cdec/sa/rulefactory.pxi":1934
* cover = [0] * e_len
* # Non-terminal coverage
* f_nt_cover = [0] * f_len # <<<<<<<<<<<<<<
@@ -68053,7 +68577,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
__pyx_v_f_nt_cover = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "rulefactory.pxi":1935
+ /* "cdec/sa/rulefactory.pxi":1935
* # Non-terminal coverage
* f_nt_cover = [0] * f_len
* e_nt_cover = [0] * e_len # <<<<<<<<<<<<<<
@@ -68074,7 +68598,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
__pyx_cur_scope->__pyx_v_e_nt_cover = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "rulefactory.pxi":1940
+ /* "cdec/sa/rulefactory.pxi":1940
* # f_ i and j are current, e_ i and j are previous
* # We care _considering_ f_j, so it is not yet in counts
* def extract(f_i, f_j, e_i, e_j, min_bound, wc, links, nt, nt_open): # <<<<<<<<<<<<<<
@@ -68087,7 +68611,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
__pyx_cur_scope->__pyx_v_extract = __pyx_t_1;
__pyx_t_1 = 0;
- /* "rulefactory.pxi":2046
+ /* "cdec/sa/rulefactory.pxi":2046
*
* # Try to extract phrases from every f index
* for f_i from 0 <= f_i < f_len: # <<<<<<<<<<<<<<
@@ -68097,7 +68621,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
__pyx_t_11 = __Pyx_PyInt_As_long(__pyx_cur_scope->__pyx_v_f_len); if (unlikely((__pyx_t_11 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
for (__pyx_v_f_i = 0; __pyx_v_f_i < __pyx_t_11; __pyx_v_f_i++) {
- /* "rulefactory.pxi":2048
+ /* "cdec/sa/rulefactory.pxi":2048
* for f_i from 0 <= f_i < f_len:
* # Skip if phrases won't be tight on left side
* if not al[f_i]: # <<<<<<<<<<<<<<
@@ -68111,7 +68635,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
__pyx_t_12 = ((!__pyx_t_10) != 0);
if (__pyx_t_12) {
- /* "rulefactory.pxi":2049
+ /* "cdec/sa/rulefactory.pxi":2049
* # Skip if phrases won't be tight on left side
* if not al[f_i]:
* continue # <<<<<<<<<<<<<<
@@ -68121,7 +68645,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
goto __pyx_L13_continue;
}
- /* "rulefactory.pxi":2050
+ /* "cdec/sa/rulefactory.pxi":2050
* if not al[f_i]:
* continue
* extract(f_i, f_i, f_len + 1, -1, f_i, 0, [], [], False) # <<<<<<<<<<<<<<
@@ -68152,7 +68676,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
__pyx_L13_continue:;
}
- /* "rulefactory.pxi":2052
+ /* "cdec/sa/rulefactory.pxi":2052
* extract(f_i, f_i, f_len + 1, -1, f_i, 0, [], [], False)
*
* stats = self.online_stats[ctx_name] # <<<<<<<<<<<<<<
@@ -68164,7 +68688,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
__pyx_v_stats = __pyx_t_14;
__pyx_t_14 = 0;
- /* "rulefactory.pxi":2057
+ /* "cdec/sa/rulefactory.pxi":2057
* # This could be more efficiently integrated with extraction
* # at the cost of readability
* for f, lex_i, lex_j in self.get_f_phrases(f_words): # <<<<<<<<<<<<<<
@@ -68300,7 +68824,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
__Pyx_XDECREF_SET(__pyx_v_lex_j, __pyx_t_6);
__pyx_t_6 = 0;
- /* "rulefactory.pxi":2058
+ /* "cdec/sa/rulefactory.pxi":2058
* # at the cost of readability
* for f, lex_i, lex_j in self.get_f_phrases(f_words):
* stats.samples_f[f] += 1 # <<<<<<<<<<<<<<
@@ -68321,7 +68845,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- /* "rulefactory.pxi":2057
+ /* "cdec/sa/rulefactory.pxi":2057
* # This could be more efficiently integrated with extraction
* # at the cost of readability
* for f, lex_i, lex_j in self.get_f_phrases(f_words): # <<<<<<<<<<<<<<
@@ -68331,7 +68855,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
}
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- /* "rulefactory.pxi":2061
+ /* "cdec/sa/rulefactory.pxi":2061
*
* # Update phrase counts
* for rule in rules: # <<<<<<<<<<<<<<
@@ -68357,7 +68881,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
__Pyx_XDECREF_SET(__pyx_v_rule, __pyx_t_14);
__pyx_t_14 = 0;
- /* "rulefactory.pxi":2062
+ /* "cdec/sa/rulefactory.pxi":2062
* # Update phrase counts
* for rule in rules:
* (f_ph, e_ph, al) = rule[:3] # <<<<<<<<<<<<<<
@@ -68432,7 +68956,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
__Pyx_GIVEREF(__pyx_t_7);
__pyx_t_7 = 0;
- /* "rulefactory.pxi":2063
+ /* "cdec/sa/rulefactory.pxi":2063
* for rule in rules:
* (f_ph, e_ph, al) = rule[:3]
* stats.phrases_f[f_ph] += 1 # <<<<<<<<<<<<<<
@@ -68453,7 +68977,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- /* "rulefactory.pxi":2064
+ /* "cdec/sa/rulefactory.pxi":2064
* (f_ph, e_ph, al) = rule[:3]
* stats.phrases_f[f_ph] += 1
* stats.phrases_e[e_ph] += 1 # <<<<<<<<<<<<<<
@@ -68474,7 +68998,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- /* "rulefactory.pxi":2065
+ /* "cdec/sa/rulefactory.pxi":2065
* stats.phrases_f[f_ph] += 1
* stats.phrases_e[e_ph] += 1
* stats.phrases_fe[f_ph][e_ph] += 1 # <<<<<<<<<<<<<<
@@ -68498,7 +69022,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "rulefactory.pxi":2066
+ /* "cdec/sa/rulefactory.pxi":2066
* stats.phrases_e[e_ph] += 1
* stats.phrases_fe[f_ph][e_ph] += 1
* if not stats.phrases_al[f_ph][e_ph]: # <<<<<<<<<<<<<<
@@ -68518,7 +69042,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
__pyx_t_10 = ((!__pyx_t_12) != 0);
if (__pyx_t_10) {
- /* "rulefactory.pxi":2067
+ /* "cdec/sa/rulefactory.pxi":2067
* stats.phrases_fe[f_ph][e_ph] += 1
* if not stats.phrases_al[f_ph][e_ph]:
* stats.phrases_al[f_ph][e_ph] = al # <<<<<<<<<<<<<<
@@ -68536,7 +69060,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
}
__pyx_L24:;
- /* "rulefactory.pxi":2061
+ /* "cdec/sa/rulefactory.pxi":2061
*
* # Update phrase counts
* for rule in rules: # <<<<<<<<<<<<<<
@@ -68546,7 +69070,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
}
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- /* "rulefactory.pxi":2070
+ /* "cdec/sa/rulefactory.pxi":2070
*
* # Update bilexical dictionary
* stats.bilex.update(f_words, e_words, alignment) # <<<<<<<<<<<<<<
@@ -68590,7 +69114,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- /* "rulefactory.pxi":1906
+ /* "cdec/sa/rulefactory.pxi":1906
* # Aggregate stats from a training instance
* # (Extract rules, update counts)
* def add_instance(self, f_words, e_words, alignment, ctx_name=None): # <<<<<<<<<<<<<<
@@ -68629,7 +69153,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
return __pyx_r;
}
-/* "rulefactory.pxi":2073
+/* "cdec/sa/rulefactory.pxi":2073
*
* # Create a rule from source, target, non-terminals, and alignments
* def form_rule(self, f_i, e_i, f_span, e_span, nt, al): # <<<<<<<<<<<<<<
@@ -68734,7 +69258,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_28form_rule(P
return __pyx_r;
}
-/* "rulefactory.pxi":2076
+/* "cdec/sa/rulefactory.pxi":2076
*
* # Substitute in non-terminals
* nt_inv = sorted(nt, cmp=lambda x, y: cmp(x[3], y[3])) # <<<<<<<<<<<<<<
@@ -68743,9 +69267,9 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_28form_rule(P
*/
/* Python wrapper */
-static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_lambda6(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_lambda6 = {"lambda6", (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_lambda6, METH_VARARGS|METH_KEYWORDS, 0};
-static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_lambda6(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_lambda8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_lambda8 = {"lambda8", (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_lambda8, METH_VARARGS|METH_KEYWORDS, 0};
+static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_lambda8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_x = 0;
PyObject *__pyx_v_y = 0;
int __pyx_lineno = 0;
@@ -68753,7 +69277,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_la
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("lambda6 (wrapper)", 0);
+ __Pyx_RefNannySetupContext("lambda8 (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0};
PyObject* values[2] = {0,0};
@@ -68774,11 +69298,11 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_la
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("lambda6", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("lambda8", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda6") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda8") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
@@ -68791,20 +69315,20 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_la
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("lambda6", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("lambda8", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
- __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.form_rule.lambda6", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.form_rule.lambda8", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_lambda_funcdef_lambda6(__pyx_self, __pyx_v_x, __pyx_v_y);
+ __pyx_r = __pyx_lambda_funcdef_lambda8(__pyx_self, __pyx_v_x, __pyx_v_y);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_lambda_funcdef_lambda6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
+static PyObject *__pyx_lambda_funcdef_lambda8(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
@@ -68813,7 +69337,7 @@ static PyObject *__pyx_lambda_funcdef_lambda6(CYTHON_UNUSED PyObject *__pyx_self
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("lambda6", 0);
+ __Pyx_RefNannySetupContext("lambda8", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
__Pyx_GOTREF(__pyx_t_1);
@@ -68839,7 +69363,7 @@ static PyObject *__pyx_lambda_funcdef_lambda6(CYTHON_UNUSED PyObject *__pyx_self
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.form_rule.lambda6", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.form_rule.lambda8", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -68847,7 +69371,7 @@ static PyObject *__pyx_lambda_funcdef_lambda6(CYTHON_UNUSED PyObject *__pyx_self
return __pyx_r;
}
-/* "rulefactory.pxi":2100
+/* "cdec/sa/rulefactory.pxi":2100
* # Adjusting alignment links takes some doing
* links = [list(link) for sub in al for link in sub]
* links_inv = sorted(links, cmp=lambda x, y: cmp(x[1], y[1])) # <<<<<<<<<<<<<<
@@ -68856,9 +69380,9 @@ static PyObject *__pyx_lambda_funcdef_lambda6(CYTHON_UNUSED PyObject *__pyx_self
*/
/* Python wrapper */
-static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda7(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda7 = {"lambda7", (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda7, METH_VARARGS|METH_KEYWORDS, 0};
-static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda7(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda9(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda9 = {"lambda9", (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda9, METH_VARARGS|METH_KEYWORDS, 0};
+static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda9(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_x = 0;
PyObject *__pyx_v_y = 0;
int __pyx_lineno = 0;
@@ -68866,7 +69390,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1l
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("lambda7 (wrapper)", 0);
+ __Pyx_RefNannySetupContext("lambda9 (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0};
PyObject* values[2] = {0,0};
@@ -68887,11 +69411,11 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1l
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("lambda7", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("lambda9", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda7") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda9") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
@@ -68904,20 +69428,20 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1l
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("lambda7", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("lambda9", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
- __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.form_rule.lambda7", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.form_rule.lambda9", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_lambda_funcdef_lambda7(__pyx_self, __pyx_v_x, __pyx_v_y);
+ __pyx_r = __pyx_lambda_funcdef_lambda9(__pyx_self, __pyx_v_x, __pyx_v_y);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_lambda_funcdef_lambda7(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
+static PyObject *__pyx_lambda_funcdef_lambda9(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
@@ -68926,7 +69450,7 @@ static PyObject *__pyx_lambda_funcdef_lambda7(CYTHON_UNUSED PyObject *__pyx_self
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("lambda7", 0);
+ __Pyx_RefNannySetupContext("lambda9", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
__Pyx_GOTREF(__pyx_t_1);
@@ -68952,16 +69476,16 @@ static PyObject *__pyx_lambda_funcdef_lambda7(CYTHON_UNUSED PyObject *__pyx_self
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.form_rule.lambda7", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.form_rule.lambda9", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4generator15(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4generator16(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-/* "rulefactory.pxi":2134
+/* "cdec/sa/rulefactory.pxi":2134
* f = Phrase(f_sym)
* e = Phrase(e_sym)
* a = tuple(self.alignment.link(i, j) for i, j in links) # <<<<<<<<<<<<<<
@@ -68970,24 +69494,24 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4g
*/
static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_2genexpr(PyObject *__pyx_self) {
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr *__pyx_cur_scope;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_genexpr *__pyx_cur_scope;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("genexpr", 0);
- __pyx_cur_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr *)__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr(__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr, __pyx_empty_tuple, NULL);
+ __pyx_cur_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_genexpr *)__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_24_genexpr(__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_24_genexpr, __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_cur_scope)) {
__Pyx_RefNannyFinishContext();
return NULL;
}
__Pyx_GOTREF(__pyx_cur_scope);
- __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule *) __pyx_self;
+ __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_form_rule *) __pyx_self;
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
{
- __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4generator15, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_form_rule_locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4generator16, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_form_rule_locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_cur_scope);
__Pyx_RefNannyFinishContext();
return (PyObject *) gen;
@@ -69003,9 +69527,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_2g
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4generator15(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4generator16(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr *)__pyx_generator->closure);
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_genexpr *)__pyx_generator->closure);
PyObject *__pyx_r = NULL;
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
@@ -69143,7 +69667,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4g
return NULL;
}
-/* "rulefactory.pxi":2073
+/* "cdec/sa/rulefactory.pxi":2073
*
* # Create a rule from source, target, non-terminals, and alignments
* def form_rule(self, f_i, e_i, f_span, e_span, nt, al): # <<<<<<<<<<<<<<
@@ -69152,7 +69676,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4g
*/
static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_f_i, PyObject *__pyx_v_e_i, PyObject *__pyx_v_f_span, PyObject *__pyx_v_e_span, PyObject *__pyx_v_nt, PyObject *__pyx_v_al) {
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule *__pyx_cur_scope;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_form_rule *__pyx_cur_scope;
PyObject *__pyx_v_nt_inv = NULL;
PyObject *__pyx_v_f_sym = NULL;
PyObject *__pyx_v_off = NULL;
@@ -69189,7 +69713,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("form_rule", 0);
- __pyx_cur_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule *)__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule(__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule, __pyx_empty_tuple, NULL);
+ __pyx_cur_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_form_rule *)__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_23_form_rule(__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_23_form_rule, __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_cur_scope)) {
__Pyx_RefNannyFinishContext();
return NULL;
@@ -69199,7 +69723,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
__Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
- /* "rulefactory.pxi":2076
+ /* "cdec/sa/rulefactory.pxi":2076
*
* # Substitute in non-terminals
* nt_inv = sorted(nt, cmp=lambda x, y: cmp(x[3], y[3])) # <<<<<<<<<<<<<<
@@ -69213,7 +69737,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__Pyx_GIVEREF(__pyx_v_nt);
__pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_lambda6, 0, __pyx_n_s_form_rule_locals_lambda, NULL, __pyx_n_s_cdec_sa__sa, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_lambda8, 0, __pyx_n_s_form_rule_locals_lambda, NULL, __pyx_n_s_cdec_sa__sa, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_cmp, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -69224,7 +69748,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__pyx_v_nt_inv = __pyx_t_3;
__pyx_t_3 = 0;
- /* "rulefactory.pxi":2077
+ /* "cdec/sa/rulefactory.pxi":2077
* # Substitute in non-terminals
* nt_inv = sorted(nt, cmp=lambda x, y: cmp(x[3], y[3]))
* f_sym = list(f_span[:]) # <<<<<<<<<<<<<<
@@ -69244,7 +69768,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__pyx_v_f_sym = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
- /* "rulefactory.pxi":2078
+ /* "cdec/sa/rulefactory.pxi":2078
* nt_inv = sorted(nt, cmp=lambda x, y: cmp(x[3], y[3]))
* f_sym = list(f_span[:])
* off = f_i # <<<<<<<<<<<<<<
@@ -69254,7 +69778,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__Pyx_INCREF(__pyx_v_f_i);
__pyx_v_off = __pyx_v_f_i;
- /* "rulefactory.pxi":2079
+ /* "cdec/sa/rulefactory.pxi":2079
* f_sym = list(f_span[:])
* off = f_i
* for next_nt in nt: # <<<<<<<<<<<<<<
@@ -69301,7 +69825,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__Pyx_XDECREF_SET(__pyx_v_next_nt, __pyx_t_2);
__pyx_t_2 = 0;
- /* "rulefactory.pxi":2080
+ /* "cdec/sa/rulefactory.pxi":2080
* off = f_i
* for next_nt in nt:
* nt_len = (next_nt[2] - next_nt[1]) + 1 # <<<<<<<<<<<<<<
@@ -69322,7 +69846,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__Pyx_XDECREF_SET(__pyx_v_nt_len, __pyx_t_1);
__pyx_t_1 = 0;
- /* "rulefactory.pxi":2081
+ /* "cdec/sa/rulefactory.pxi":2081
* for next_nt in nt:
* nt_len = (next_nt[2] - next_nt[1]) + 1
* i = 0 # <<<<<<<<<<<<<<
@@ -69332,7 +69856,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__Pyx_INCREF(__pyx_int_0);
__Pyx_XDECREF_SET(__pyx_v_i, __pyx_int_0);
- /* "rulefactory.pxi":2082
+ /* "cdec/sa/rulefactory.pxi":2082
* nt_len = (next_nt[2] - next_nt[1]) + 1
* i = 0
* while i < nt_len: # <<<<<<<<<<<<<<
@@ -69345,7 +69869,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!__pyx_t_7) break;
- /* "rulefactory.pxi":2083
+ /* "cdec/sa/rulefactory.pxi":2083
* i = 0
* while i < nt_len:
* f_sym.pop(next_nt[1] - off) # <<<<<<<<<<<<<<
@@ -69363,7 +69887,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "rulefactory.pxi":2084
+ /* "cdec/sa/rulefactory.pxi":2084
* while i < nt_len:
* f_sym.pop(next_nt[1] - off)
* i += 1 # <<<<<<<<<<<<<<
@@ -69376,7 +69900,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__pyx_t_6 = 0;
}
- /* "rulefactory.pxi":2085
+ /* "cdec/sa/rulefactory.pxi":2085
* f_sym.pop(next_nt[1] - off)
* i += 1
* f_sym.insert(next_nt[1] - off, sym_setindex(self.category, next_nt[0])) # <<<<<<<<<<<<<<
@@ -69399,7 +69923,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__pyx_t_10 = PyList_Insert(__pyx_v_f_sym, __pyx_t_8, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "rulefactory.pxi":2086
+ /* "cdec/sa/rulefactory.pxi":2086
* i += 1
* f_sym.insert(next_nt[1] - off, sym_setindex(self.category, next_nt[0]))
* off += (nt_len - 1) # <<<<<<<<<<<<<<
@@ -69414,7 +69938,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__Pyx_DECREF_SET(__pyx_v_off, __pyx_t_6);
__pyx_t_6 = 0;
- /* "rulefactory.pxi":2079
+ /* "cdec/sa/rulefactory.pxi":2079
* f_sym = list(f_span[:])
* off = f_i
* for next_nt in nt: # <<<<<<<<<<<<<<
@@ -69424,7 +69948,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "rulefactory.pxi":2087
+ /* "cdec/sa/rulefactory.pxi":2087
* f_sym.insert(next_nt[1] - off, sym_setindex(self.category, next_nt[0]))
* off += (nt_len - 1)
* e_sym = list(e_span[:]) # <<<<<<<<<<<<<<
@@ -69444,7 +69968,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__pyx_v_e_sym = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
- /* "rulefactory.pxi":2088
+ /* "cdec/sa/rulefactory.pxi":2088
* off += (nt_len - 1)
* e_sym = list(e_span[:])
* off = e_i # <<<<<<<<<<<<<<
@@ -69454,7 +69978,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__Pyx_INCREF(__pyx_v_e_i);
__Pyx_DECREF_SET(__pyx_v_off, __pyx_v_e_i);
- /* "rulefactory.pxi":2089
+ /* "cdec/sa/rulefactory.pxi":2089
* e_sym = list(e_span[:])
* off = e_i
* for next_nt in nt_inv: # <<<<<<<<<<<<<<
@@ -69501,7 +70025,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__Pyx_XDECREF_SET(__pyx_v_next_nt, __pyx_t_6);
__pyx_t_6 = 0;
- /* "rulefactory.pxi":2090
+ /* "cdec/sa/rulefactory.pxi":2090
* off = e_i
* for next_nt in nt_inv:
* nt_len = (next_nt[4] - next_nt[3]) + 1 # <<<<<<<<<<<<<<
@@ -69522,7 +70046,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__Pyx_XDECREF_SET(__pyx_v_nt_len, __pyx_t_1);
__pyx_t_1 = 0;
- /* "rulefactory.pxi":2091
+ /* "cdec/sa/rulefactory.pxi":2091
* for next_nt in nt_inv:
* nt_len = (next_nt[4] - next_nt[3]) + 1
* i = 0 # <<<<<<<<<<<<<<
@@ -69532,7 +70056,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__Pyx_INCREF(__pyx_int_0);
__Pyx_XDECREF_SET(__pyx_v_i, __pyx_int_0);
- /* "rulefactory.pxi":2092
+ /* "cdec/sa/rulefactory.pxi":2092
* nt_len = (next_nt[4] - next_nt[3]) + 1
* i = 0
* while i < nt_len: # <<<<<<<<<<<<<<
@@ -69545,7 +70069,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!__pyx_t_7) break;
- /* "rulefactory.pxi":2093
+ /* "cdec/sa/rulefactory.pxi":2093
* i = 0
* while i < nt_len:
* e_sym.pop(next_nt[3] - off) # <<<<<<<<<<<<<<
@@ -69563,7 +70087,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "rulefactory.pxi":2094
+ /* "cdec/sa/rulefactory.pxi":2094
* while i < nt_len:
* e_sym.pop(next_nt[3] - off)
* i += 1 # <<<<<<<<<<<<<<
@@ -69576,7 +70100,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__pyx_t_2 = 0;
}
- /* "rulefactory.pxi":2095
+ /* "cdec/sa/rulefactory.pxi":2095
* e_sym.pop(next_nt[3] - off)
* i += 1
* e_sym.insert(next_nt[3] - off, sym_setindex(self.category, next_nt[0])) # <<<<<<<<<<<<<<
@@ -69599,7 +70123,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__pyx_t_10 = PyList_Insert(__pyx_v_e_sym, __pyx_t_8, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "rulefactory.pxi":2096
+ /* "cdec/sa/rulefactory.pxi":2096
* i += 1
* e_sym.insert(next_nt[3] - off, sym_setindex(self.category, next_nt[0]))
* off += (nt_len - 1) # <<<<<<<<<<<<<<
@@ -69614,7 +70138,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__Pyx_DECREF_SET(__pyx_v_off, __pyx_t_2);
__pyx_t_2 = 0;
- /* "rulefactory.pxi":2089
+ /* "cdec/sa/rulefactory.pxi":2089
* e_sym = list(e_span[:])
* off = e_i
* for next_nt in nt_inv: # <<<<<<<<<<<<<<
@@ -69624,7 +70148,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "rulefactory.pxi":2099
+ /* "cdec/sa/rulefactory.pxi":2099
*
* # Adjusting alignment links takes some doing
* links = [list(link) for sub in al for link in sub] # <<<<<<<<<<<<<<
@@ -69729,7 +70253,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__pyx_cur_scope->__pyx_v_links = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
- /* "rulefactory.pxi":2100
+ /* "cdec/sa/rulefactory.pxi":2100
* # Adjusting alignment links takes some doing
* links = [list(link) for sub in al for link in sub]
* links_inv = sorted(links, cmp=lambda x, y: cmp(x[1], y[1])) # <<<<<<<<<<<<<<
@@ -69743,7 +70267,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_links);
__pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda7, 0, __pyx_n_s_form_rule_locals_lambda, NULL, __pyx_n_s_cdec_sa__sa, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda9, 0, __pyx_n_s_form_rule_locals_lambda, NULL, __pyx_n_s_cdec_sa__sa, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_cmp, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -69754,7 +70278,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__pyx_v_links_inv = __pyx_t_1;
__pyx_t_1 = 0;
- /* "rulefactory.pxi":2101
+ /* "cdec/sa/rulefactory.pxi":2101
* links = [list(link) for sub in al for link in sub]
* links_inv = sorted(links, cmp=lambda x, y: cmp(x[1], y[1]))
* links_len = len(links) # <<<<<<<<<<<<<<
@@ -69771,7 +70295,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_links_len = __pyx_t_4;
- /* "rulefactory.pxi":2102
+ /* "cdec/sa/rulefactory.pxi":2102
* links_inv = sorted(links, cmp=lambda x, y: cmp(x[1], y[1]))
* links_len = len(links)
* nt_len = len(nt) # <<<<<<<<<<<<<<
@@ -69784,7 +70308,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__Pyx_XDECREF_SET(__pyx_v_nt_len, __pyx_t_1);
__pyx_t_1 = 0;
- /* "rulefactory.pxi":2103
+ /* "cdec/sa/rulefactory.pxi":2103
* links_len = len(links)
* nt_len = len(nt)
* nt_i = 0 # <<<<<<<<<<<<<<
@@ -69794,7 +70318,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__Pyx_INCREF(__pyx_int_0);
__pyx_v_nt_i = __pyx_int_0;
- /* "rulefactory.pxi":2104
+ /* "cdec/sa/rulefactory.pxi":2104
* nt_len = len(nt)
* nt_i = 0
* off = f_i # <<<<<<<<<<<<<<
@@ -69804,7 +70328,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__Pyx_INCREF(__pyx_v_f_i);
__Pyx_DECREF_SET(__pyx_v_off, __pyx_v_f_i);
- /* "rulefactory.pxi":2105
+ /* "cdec/sa/rulefactory.pxi":2105
* nt_i = 0
* off = f_i
* i = 0 # <<<<<<<<<<<<<<
@@ -69814,7 +70338,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__Pyx_INCREF(__pyx_int_0);
__Pyx_XDECREF_SET(__pyx_v_i, __pyx_int_0);
- /* "rulefactory.pxi":2106
+ /* "cdec/sa/rulefactory.pxi":2106
* off = f_i
* i = 0
* while i < links_len: # <<<<<<<<<<<<<<
@@ -69830,7 +70354,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (!__pyx_t_7) break;
- /* "rulefactory.pxi":2107
+ /* "cdec/sa/rulefactory.pxi":2107
* i = 0
* while i < links_len:
* while nt_i < nt_len and links[i][0] > nt[nt_i][1]: # <<<<<<<<<<<<<<
@@ -69867,7 +70391,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__pyx_L19_bool_binop_done:;
if (!__pyx_t_7) break;
- /* "rulefactory.pxi":2108
+ /* "cdec/sa/rulefactory.pxi":2108
* while i < links_len:
* while nt_i < nt_len and links[i][0] > nt[nt_i][1]:
* off += (nt[nt_i][2] - nt[nt_i][1]) # <<<<<<<<<<<<<<
@@ -69894,7 +70418,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__Pyx_DECREF_SET(__pyx_v_off, __pyx_t_1);
__pyx_t_1 = 0;
- /* "rulefactory.pxi":2109
+ /* "cdec/sa/rulefactory.pxi":2109
* while nt_i < nt_len and links[i][0] > nt[nt_i][1]:
* off += (nt[nt_i][2] - nt[nt_i][1])
* nt_i += 1 # <<<<<<<<<<<<<<
@@ -69907,7 +70431,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__pyx_t_1 = 0;
}
- /* "rulefactory.pxi":2110
+ /* "cdec/sa/rulefactory.pxi":2110
* off += (nt[nt_i][2] - nt[nt_i][1])
* nt_i += 1
* links[i][0] -= off # <<<<<<<<<<<<<<
@@ -69926,7 +70450,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "rulefactory.pxi":2111
+ /* "cdec/sa/rulefactory.pxi":2111
* nt_i += 1
* links[i][0] -= off
* i += 1 # <<<<<<<<<<<<<<
@@ -69939,7 +70463,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__pyx_t_1 = 0;
}
- /* "rulefactory.pxi":2112
+ /* "cdec/sa/rulefactory.pxi":2112
* links[i][0] -= off
* i += 1
* nt_i = 0 # <<<<<<<<<<<<<<
@@ -69949,7 +70473,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__Pyx_INCREF(__pyx_int_0);
__Pyx_DECREF_SET(__pyx_v_nt_i, __pyx_int_0);
- /* "rulefactory.pxi":2113
+ /* "cdec/sa/rulefactory.pxi":2113
* i += 1
* nt_i = 0
* off = e_i # <<<<<<<<<<<<<<
@@ -69959,7 +70483,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__Pyx_INCREF(__pyx_v_e_i);
__Pyx_DECREF_SET(__pyx_v_off, __pyx_v_e_i);
- /* "rulefactory.pxi":2114
+ /* "cdec/sa/rulefactory.pxi":2114
* nt_i = 0
* off = e_i
* i = 0 # <<<<<<<<<<<<<<
@@ -69969,7 +70493,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__Pyx_INCREF(__pyx_int_0);
__Pyx_DECREF_SET(__pyx_v_i, __pyx_int_0);
- /* "rulefactory.pxi":2115
+ /* "cdec/sa/rulefactory.pxi":2115
* off = e_i
* i = 0
* while i < links_len: # <<<<<<<<<<<<<<
@@ -69985,7 +70509,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (!__pyx_t_7) break;
- /* "rulefactory.pxi":2116
+ /* "cdec/sa/rulefactory.pxi":2116
* i = 0
* while i < links_len:
* while nt_i < nt_len and links_inv[i][1] > nt_inv[nt_i][3]: # <<<<<<<<<<<<<<
@@ -70022,7 +70546,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__pyx_L25_bool_binop_done:;
if (!__pyx_t_7) break;
- /* "rulefactory.pxi":2117
+ /* "cdec/sa/rulefactory.pxi":2117
* while i < links_len:
* while nt_i < nt_len and links_inv[i][1] > nt_inv[nt_i][3]:
* off += (nt_inv[nt_i][4] - nt_inv[nt_i][3]) # <<<<<<<<<<<<<<
@@ -70049,7 +70573,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__Pyx_DECREF_SET(__pyx_v_off, __pyx_t_1);
__pyx_t_1 = 0;
- /* "rulefactory.pxi":2118
+ /* "cdec/sa/rulefactory.pxi":2118
* while nt_i < nt_len and links_inv[i][1] > nt_inv[nt_i][3]:
* off += (nt_inv[nt_i][4] - nt_inv[nt_i][3])
* nt_i += 1 # <<<<<<<<<<<<<<
@@ -70062,7 +70586,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__pyx_t_1 = 0;
}
- /* "rulefactory.pxi":2119
+ /* "cdec/sa/rulefactory.pxi":2119
* off += (nt_inv[nt_i][4] - nt_inv[nt_i][3])
* nt_i += 1
* links_inv[i][1] -= off # <<<<<<<<<<<<<<
@@ -70081,7 +70605,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "rulefactory.pxi":2120
+ /* "cdec/sa/rulefactory.pxi":2120
* nt_i += 1
* links_inv[i][1] -= off
* i += 1 # <<<<<<<<<<<<<<
@@ -70094,7 +70618,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__pyx_t_1 = 0;
}
- /* "rulefactory.pxi":2123
+ /* "cdec/sa/rulefactory.pxi":2123
*
* # Find lexical span
* lex_f_i = f_i # <<<<<<<<<<<<<<
@@ -70104,7 +70628,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__Pyx_INCREF(__pyx_v_f_i);
__pyx_v_lex_f_i = __pyx_v_f_i;
- /* "rulefactory.pxi":2124
+ /* "cdec/sa/rulefactory.pxi":2124
* # Find lexical span
* lex_f_i = f_i
* lex_f_j = f_i + (len(f_span) - 1) # <<<<<<<<<<<<<<
@@ -70120,7 +70644,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__pyx_v_lex_f_j = __pyx_t_2;
__pyx_t_2 = 0;
- /* "rulefactory.pxi":2125
+ /* "cdec/sa/rulefactory.pxi":2125
* lex_f_i = f_i
* lex_f_j = f_i + (len(f_span) - 1)
* if nt: # <<<<<<<<<<<<<<
@@ -70130,7 +70654,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_nt); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_7) {
- /* "rulefactory.pxi":2126
+ /* "cdec/sa/rulefactory.pxi":2126
* lex_f_j = f_i + (len(f_span) - 1)
* if nt:
* if nt[0][1] == lex_f_i: # <<<<<<<<<<<<<<
@@ -70148,7 +70672,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (__pyx_t_7) {
- /* "rulefactory.pxi":2127
+ /* "cdec/sa/rulefactory.pxi":2127
* if nt:
* if nt[0][1] == lex_f_i:
* lex_f_i += (nt[0][2] - nt[0][1]) + 1 # <<<<<<<<<<<<<<
@@ -70181,7 +70705,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
}
__pyx_L28:;
- /* "rulefactory.pxi":2128
+ /* "cdec/sa/rulefactory.pxi":2128
* if nt[0][1] == lex_f_i:
* lex_f_i += (nt[0][2] - nt[0][1]) + 1
* if nt[-1][2] == lex_f_j: # <<<<<<<<<<<<<<
@@ -70199,7 +70723,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (__pyx_t_7) {
- /* "rulefactory.pxi":2129
+ /* "cdec/sa/rulefactory.pxi":2129
* lex_f_i += (nt[0][2] - nt[0][1]) + 1
* if nt[-1][2] == lex_f_j:
* lex_f_j -= (nt[-1][2] - nt[-1][1]) + 1 # <<<<<<<<<<<<<<
@@ -70235,7 +70759,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
}
__pyx_L27:;
- /* "rulefactory.pxi":2132
+ /* "cdec/sa/rulefactory.pxi":2132
*
* # Create rule (f_phrase, e_phrase, links, f_link_min, f_link_max)
* f = Phrase(f_sym) # <<<<<<<<<<<<<<
@@ -70253,7 +70777,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__pyx_v_f = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "rulefactory.pxi":2133
+ /* "cdec/sa/rulefactory.pxi":2133
* # Create rule (f_phrase, e_phrase, links, f_link_min, f_link_max)
* f = Phrase(f_sym)
* e = Phrase(e_sym) # <<<<<<<<<<<<<<
@@ -70271,7 +70795,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__pyx_v_e = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "rulefactory.pxi":2134
+ /* "cdec/sa/rulefactory.pxi":2134
* f = Phrase(f_sym)
* e = Phrase(e_sym)
* a = tuple(self.alignment.link(i, j) for i, j in links) # <<<<<<<<<<<<<<
@@ -70291,7 +70815,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__pyx_v_a = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
- /* "rulefactory.pxi":2135
+ /* "cdec/sa/rulefactory.pxi":2135
* e = Phrase(e_sym)
* a = tuple(self.alignment.link(i, j) for i, j in links)
* return (f, e, a, lex_f_i, lex_f_j) # <<<<<<<<<<<<<<
@@ -70320,7 +70844,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "rulefactory.pxi":2073
+ /* "cdec/sa/rulefactory.pxi":2073
*
* # Create a rule from source, target, non-terminals, and alignments
* def form_rule(self, f_i, e_i, f_span, e_span, nt, al): # <<<<<<<<<<<<<<
@@ -70360,7 +70884,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
return __pyx_r;
}
-/* "rulefactory.pxi":2138
+/* "cdec/sa/rulefactory.pxi":2138
*
* # Rule string from rule
* def fmt_rule(self, f, e, a): # <<<<<<<<<<<<<<
@@ -70437,9 +70961,9 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_30fmt_rule(Py
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_2generator16(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_2generator17(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-/* "rulefactory.pxi":2139
+/* "cdec/sa/rulefactory.pxi":2139
* # Rule string from rule
* def fmt_rule(self, f, e, a):
* a_str = ' '.join('{0}-{1}'.format(*self.alignment.unlink(packed)) for packed in a) # <<<<<<<<<<<<<<
@@ -70448,24 +70972,24 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_2ge
*/
static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_genexpr(PyObject *__pyx_self) {
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr *__pyx_cur_scope;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_genexpr *__pyx_cur_scope;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("genexpr", 0);
- __pyx_cur_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr *)__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr(__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr, __pyx_empty_tuple, NULL);
+ __pyx_cur_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_genexpr *)__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_26_genexpr(__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_26_genexpr, __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_cur_scope)) {
__Pyx_RefNannyFinishContext();
return NULL;
}
__Pyx_GOTREF(__pyx_cur_scope);
- __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule *) __pyx_self;
+ __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_fmt_rule *) __pyx_self;
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
{
- __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_2generator16, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_fmt_rule_locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_2generator17, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_fmt_rule_locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_cur_scope);
__Pyx_RefNannyFinishContext();
return (PyObject *) gen;
@@ -70481,9 +71005,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_gen
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_2generator16(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_2generator17(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr *)__pyx_generator->closure);
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_genexpr *)__pyx_generator->closure);
PyObject *__pyx_r = NULL;
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
@@ -70626,7 +71150,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_2ge
return NULL;
}
-/* "rulefactory.pxi":2138
+/* "cdec/sa/rulefactory.pxi":2138
*
* # Rule string from rule
* def fmt_rule(self, f, e, a): # <<<<<<<<<<<<<<
@@ -70635,7 +71159,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_2ge
*/
static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_29fmt_rule(struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_f, PyObject *__pyx_v_e, PyObject *__pyx_v_a) {
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule *__pyx_cur_scope;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_fmt_rule *__pyx_cur_scope;
PyObject *__pyx_v_a_str = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
@@ -70648,7 +71172,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_29fmt_rule(st
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("fmt_rule", 0);
- __pyx_cur_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule *)__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule(__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule, __pyx_empty_tuple, NULL);
+ __pyx_cur_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_fmt_rule *)__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_25_fmt_rule(__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_25_fmt_rule, __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_cur_scope)) {
__Pyx_RefNannyFinishContext();
return NULL;
@@ -70661,7 +71185,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_29fmt_rule(st
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_a);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_a);
- /* "rulefactory.pxi":2139
+ /* "cdec/sa/rulefactory.pxi":2139
* # Rule string from rule
* def fmt_rule(self, f, e, a):
* a_str = ' '.join('{0}-{1}'.format(*self.alignment.unlink(packed)) for packed in a) # <<<<<<<<<<<<<<
@@ -70676,7 +71200,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_29fmt_rule(st
__pyx_v_a_str = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
- /* "rulefactory.pxi":2140
+ /* "cdec/sa/rulefactory.pxi":2140
* def fmt_rule(self, f, e, a):
* a_str = ' '.join('{0}-{1}'.format(*self.alignment.unlink(packed)) for packed in a)
* return '[X] ||| {0} ||| {1} ||| {2}'.format(f, e, a_str) # <<<<<<<<<<<<<<
@@ -70720,7 +71244,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_29fmt_rule(st
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "rulefactory.pxi":2138
+ /* "cdec/sa/rulefactory.pxi":2138
*
* # Rule string from rule
* def fmt_rule(self, f, e, a): # <<<<<<<<<<<<<<
@@ -70744,7 +71268,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_29fmt_rule(st
return __pyx_r;
}
-/* "rulefactory.pxi":2144
+/* "cdec/sa/rulefactory.pxi":2144
* # Lookup online stats for phrase pair (f, e). Return None if no match.
* # IMPORTANT: use get() to avoid adding items to defaultdict
* def online_ctx_lookup(self, f, e, ctx_name=None): # <<<<<<<<<<<<<<
@@ -70845,7 +71369,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_31online_ctx_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("online_ctx_lookup", 0);
- /* "rulefactory.pxi":2145
+ /* "cdec/sa/rulefactory.pxi":2145
* # IMPORTANT: use get() to avoid adding items to defaultdict
* def online_ctx_lookup(self, f, e, ctx_name=None):
* if self.online: # <<<<<<<<<<<<<<
@@ -70855,7 +71379,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_31online_ctx_
__pyx_t_1 = (__pyx_v_self->online != 0);
if (__pyx_t_1) {
- /* "rulefactory.pxi":2146
+ /* "cdec/sa/rulefactory.pxi":2146
* def online_ctx_lookup(self, f, e, ctx_name=None):
* if self.online:
* stats = self.online_stats[ctx_name] # <<<<<<<<<<<<<<
@@ -70867,7 +71391,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_31online_ctx_
__pyx_v_stats = __pyx_t_2;
__pyx_t_2 = 0;
- /* "rulefactory.pxi":2147
+ /* "cdec/sa/rulefactory.pxi":2147
* if self.online:
* stats = self.online_stats[ctx_name]
* fcount = stats.phrases_f.get(f, 0) # <<<<<<<<<<<<<<
@@ -70909,7 +71433,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_31online_ctx_
__pyx_v_fcount = __pyx_t_2;
__pyx_t_2 = 0;
- /* "rulefactory.pxi":2148
+ /* "cdec/sa/rulefactory.pxi":2148
* stats = self.online_stats[ctx_name]
* fcount = stats.phrases_f.get(f, 0)
* fsample_count = stats.samples_f.get(f, 0) # <<<<<<<<<<<<<<
@@ -70951,7 +71475,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_31online_ctx_
__pyx_v_fsample_count = __pyx_t_2;
__pyx_t_2 = 0;
- /* "rulefactory.pxi":2149
+ /* "cdec/sa/rulefactory.pxi":2149
* fcount = stats.phrases_f.get(f, 0)
* fsample_count = stats.samples_f.get(f, 0)
* d = stats.phrases_fe.get(f, None) # <<<<<<<<<<<<<<
@@ -70993,7 +71517,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_31online_ctx_
__pyx_v_d = __pyx_t_2;
__pyx_t_2 = 0;
- /* "rulefactory.pxi":2150
+ /* "cdec/sa/rulefactory.pxi":2150
* fsample_count = stats.samples_f.get(f, 0)
* d = stats.phrases_fe.get(f, None)
* paircount = d.get(e, 0) if d else 0 # <<<<<<<<<<<<<<
@@ -71040,7 +71564,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_31online_ctx_
__pyx_v_paircount = __pyx_t_2;
__pyx_t_2 = 0;
- /* "rulefactory.pxi":2151
+ /* "cdec/sa/rulefactory.pxi":2151
* d = stats.phrases_fe.get(f, None)
* paircount = d.get(e, 0) if d else 0
* return OnlineFeatureContext(fcount, fsample_count, paircount, stats.bilex) # <<<<<<<<<<<<<<
@@ -71090,7 +71614,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_31online_ctx_
goto __pyx_L0;
}
- /* "rulefactory.pxi":2152
+ /* "cdec/sa/rulefactory.pxi":2152
* paircount = d.get(e, 0) if d else 0
* return OnlineFeatureContext(fcount, fsample_count, paircount, stats.bilex)
* return None # <<<<<<<<<<<<<<
@@ -71102,7 +71626,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_31online_ctx_
__pyx_r = Py_None;
goto __pyx_L0;
- /* "rulefactory.pxi":2144
+ /* "cdec/sa/rulefactory.pxi":2144
* # Lookup online stats for phrase pair (f, e). Return None if no match.
* # IMPORTANT: use get() to avoid adding items to defaultdict
* def online_ctx_lookup(self, f, e, ctx_name=None): # <<<<<<<<<<<<<<
@@ -71130,7 +71654,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_31online_ctx_
return __pyx_r;
}
-/* "rulefactory.pxi":2157
+/* "cdec/sa/rulefactory.pxi":2157
* # (Used for EGivenFCoherent)
* # Return set of (fphrase, lex_i, lex_j)
* def get_f_phrases(self, f_words): # <<<<<<<<<<<<<<
@@ -71151,7 +71675,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_34get_f_phras
return __pyx_r;
}
-/* "rulefactory.pxi":2162
+/* "cdec/sa/rulefactory.pxi":2162
* phrases = set() # (fphrase, lex_i, lex_j)
*
* def extract(f_i, f_j, lex_i, lex_j, wc, ntc, syms): # <<<<<<<<<<<<<<
@@ -71267,8 +71791,8 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras
}
static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract(PyObject *__pyx_self, PyObject *__pyx_v_f_i, PyObject *__pyx_v_f_j, PyObject *__pyx_v_lex_i, PyObject *__pyx_v_lex_j, PyObject *__pyx_v_wc, PyObject *__pyx_v_ntc, PyObject *__pyx_v_syms) {
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases *__pyx_cur_scope;
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases *__pyx_outer_scope;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27_get_f_phrases *__pyx_cur_scope;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27_get_f_phrases *__pyx_outer_scope;
struct __pyx_obj_4cdec_2sa_3_sa_Phrase *__pyx_v_f = NULL;
PyObject *__pyx_v_new_lex_i = NULL;
PyObject *__pyx_v_new_lex_j = NULL;
@@ -71287,10 +71811,10 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("extract", 0);
- __pyx_outer_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases *) __Pyx_CyFunction_GetClosure(__pyx_self);
+ __pyx_outer_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27_get_f_phrases *) __Pyx_CyFunction_GetClosure(__pyx_self);
__pyx_cur_scope = __pyx_outer_scope;
- /* "rulefactory.pxi":2164
+ /* "cdec/sa/rulefactory.pxi":2164
* def extract(f_i, f_j, lex_i, lex_j, wc, ntc, syms):
* # Phrase extraction limits
* if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size: # <<<<<<<<<<<<<<
@@ -71327,7 +71851,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras
__pyx_L4_bool_binop_done:;
if (__pyx_t_1) {
- /* "rulefactory.pxi":2165
+ /* "cdec/sa/rulefactory.pxi":2165
* # Phrase extraction limits
* if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size:
* return # <<<<<<<<<<<<<<
@@ -71339,7 +71863,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras
goto __pyx_L0;
}
- /* "rulefactory.pxi":2167
+ /* "cdec/sa/rulefactory.pxi":2167
* return
* # Extend with word
* if wc + ntc < self.max_length: # <<<<<<<<<<<<<<
@@ -71358,7 +71882,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (__pyx_t_1) {
- /* "rulefactory.pxi":2168
+ /* "cdec/sa/rulefactory.pxi":2168
* # Extend with word
* if wc + ntc < self.max_length:
* syms.append(f_words[f_j]) # <<<<<<<<<<<<<<
@@ -71371,7 +71895,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras
__pyx_t_6 = __Pyx_PyObject_Append(__pyx_v_syms, __pyx_t_2); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "rulefactory.pxi":2169
+ /* "cdec/sa/rulefactory.pxi":2169
* if wc + ntc < self.max_length:
* syms.append(f_words[f_j])
* f = Phrase(syms) # <<<<<<<<<<<<<<
@@ -71389,7 +71913,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras
__pyx_v_f = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_3);
__pyx_t_3 = 0;
- /* "rulefactory.pxi":2170
+ /* "cdec/sa/rulefactory.pxi":2170
* syms.append(f_words[f_j])
* f = Phrase(syms)
* new_lex_i = min(lex_i, f_j) # <<<<<<<<<<<<<<
@@ -71418,7 +71942,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras
__pyx_v_new_lex_i = __pyx_t_3;
__pyx_t_3 = 0;
- /* "rulefactory.pxi":2171
+ /* "cdec/sa/rulefactory.pxi":2171
* f = Phrase(syms)
* new_lex_i = min(lex_i, f_j)
* new_lex_j = max(lex_j, f_j) # <<<<<<<<<<<<<<
@@ -71447,7 +71971,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras
__pyx_v_new_lex_j = __pyx_t_3;
__pyx_t_3 = 0;
- /* "rulefactory.pxi":2172
+ /* "cdec/sa/rulefactory.pxi":2172
* new_lex_i = min(lex_i, f_j)
* new_lex_j = max(lex_j, f_j)
* phrases.add((f, new_lex_i, new_lex_j)) # <<<<<<<<<<<<<<
@@ -71473,7 +71997,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras
__pyx_t_6 = PySet_Add(__pyx_cur_scope->__pyx_v_phrases, __pyx_t_3); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "rulefactory.pxi":2173
+ /* "cdec/sa/rulefactory.pxi":2173
* new_lex_j = max(lex_j, f_j)
* phrases.add((f, new_lex_i, new_lex_j))
* extract(f_i, f_j + 1, new_lex_i, new_lex_j, wc + 1, ntc, syms) # <<<<<<<<<<<<<<
@@ -71491,7 +72015,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "rulefactory.pxi":2174
+ /* "cdec/sa/rulefactory.pxi":2174
* phrases.add((f, new_lex_i, new_lex_j))
* extract(f_i, f_j + 1, new_lex_i, new_lex_j, wc + 1, ntc, syms)
* syms.pop() # <<<<<<<<<<<<<<
@@ -71505,7 +72029,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras
}
__pyx_L6:;
- /* "rulefactory.pxi":2176
+ /* "cdec/sa/rulefactory.pxi":2176
* syms.pop()
* # Extend with existing non-terminal
* if syms and sym_isvar(syms[-1]): # <<<<<<<<<<<<<<
@@ -71529,7 +72053,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras
__pyx_L8_bool_binop_done:;
if (__pyx_t_1) {
- /* "rulefactory.pxi":2178
+ /* "cdec/sa/rulefactory.pxi":2178
* if syms and sym_isvar(syms[-1]):
* # Don't re-extract the same phrase
* extract(f_i, f_j + 1, lex_i, lex_j, wc, ntc, syms) # <<<<<<<<<<<<<<
@@ -71547,7 +72071,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras
}
__pyx_L7:;
- /* "rulefactory.pxi":2180
+ /* "cdec/sa/rulefactory.pxi":2180
* extract(f_i, f_j + 1, lex_i, lex_j, wc, ntc, syms)
* # Extend with new non-terminal
* if wc + ntc < self.max_length: # <<<<<<<<<<<<<<
@@ -71566,7 +72090,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_1) {
- /* "rulefactory.pxi":2181
+ /* "cdec/sa/rulefactory.pxi":2181
* # Extend with new non-terminal
* if wc + ntc < self.max_length:
* if not syms or (ntc < self.max_nonterminals and not sym_isvar(syms[-1])): # <<<<<<<<<<<<<<
@@ -71605,7 +72129,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras
__pyx_L12_bool_binop_done:;
if (__pyx_t_1) {
- /* "rulefactory.pxi":2182
+ /* "cdec/sa/rulefactory.pxi":2182
* if wc + ntc < self.max_length:
* if not syms or (ntc < self.max_nonterminals and not sym_isvar(syms[-1])):
* syms.append(sym_setindex(self.category, ntc + 1)) # <<<<<<<<<<<<<<
@@ -71622,7 +72146,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras
__pyx_t_6 = __Pyx_PyObject_Append(__pyx_v_syms, __pyx_t_5); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "rulefactory.pxi":2183
+ /* "cdec/sa/rulefactory.pxi":2183
* if not syms or (ntc < self.max_nonterminals and not sym_isvar(syms[-1])):
* syms.append(sym_setindex(self.category, ntc + 1))
* f = Phrase(syms) # <<<<<<<<<<<<<<
@@ -71640,7 +72164,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras
__Pyx_XDECREF_SET(__pyx_v_f, ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_3));
__pyx_t_3 = 0;
- /* "rulefactory.pxi":2184
+ /* "cdec/sa/rulefactory.pxi":2184
* syms.append(sym_setindex(self.category, ntc + 1))
* f = Phrase(syms)
* if wc > 0: # <<<<<<<<<<<<<<
@@ -71652,7 +72176,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_1) {
- /* "rulefactory.pxi":2185
+ /* "cdec/sa/rulefactory.pxi":2185
* f = Phrase(syms)
* if wc > 0:
* phrases.add((f, lex_i, lex_j)) # <<<<<<<<<<<<<<
@@ -71681,7 +72205,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras
}
__pyx_L15:;
- /* "rulefactory.pxi":2186
+ /* "cdec/sa/rulefactory.pxi":2186
* if wc > 0:
* phrases.add((f, lex_i, lex_j))
* extract(f_i, f_j + 1, lex_i, lex_j, wc, ntc + 1, syms) # <<<<<<<<<<<<<<
@@ -71699,7 +72223,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "rulefactory.pxi":2187
+ /* "cdec/sa/rulefactory.pxi":2187
* phrases.add((f, lex_i, lex_j))
* extract(f_i, f_j + 1, lex_i, lex_j, wc, ntc + 1, syms)
* syms.pop() # <<<<<<<<<<<<<<
@@ -71716,7 +72240,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras
}
__pyx_L10:;
- /* "rulefactory.pxi":2162
+ /* "cdec/sa/rulefactory.pxi":2162
* phrases = set() # (fphrase, lex_i, lex_j)
*
* def extract(f_i, f_j, lex_i, lex_j, wc, ntc, syms): # <<<<<<<<<<<<<<
@@ -71743,7 +72267,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras
return __pyx_r;
}
-/* "rulefactory.pxi":2157
+/* "cdec/sa/rulefactory.pxi":2157
* # (Used for EGivenFCoherent)
* # Return set of (fphrase, lex_i, lex_j)
* def get_f_phrases(self, f_words): # <<<<<<<<<<<<<<
@@ -71752,7 +72276,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras
*/
static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_33get_f_phrases(struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_f_words) {
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases *__pyx_cur_scope;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27_get_f_phrases *__pyx_cur_scope;
long __pyx_v_f_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
@@ -71766,7 +72290,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_33get_f_phras
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("get_f_phrases", 0);
- __pyx_cur_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases *)__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases(__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases, __pyx_empty_tuple, NULL);
+ __pyx_cur_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27_get_f_phrases *)__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_27_get_f_phrases(__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_27_get_f_phrases, __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_cur_scope)) {
__Pyx_RefNannyFinishContext();
return NULL;
@@ -71779,7 +72303,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_33get_f_phras
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_f_words);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f_words);
- /* "rulefactory.pxi":2159
+ /* "cdec/sa/rulefactory.pxi":2159
* def get_f_phrases(self, f_words):
*
* f_len = len(f_words) # <<<<<<<<<<<<<<
@@ -71792,7 +72316,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_33get_f_phras
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_cur_scope->__pyx_v_f_len = __pyx_t_2;
- /* "rulefactory.pxi":2160
+ /* "cdec/sa/rulefactory.pxi":2160
*
* f_len = len(f_words)
* phrases = set() # (fphrase, lex_i, lex_j) # <<<<<<<<<<<<<<
@@ -71805,7 +72329,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_33get_f_phras
__pyx_cur_scope->__pyx_v_phrases = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "rulefactory.pxi":2162
+ /* "cdec/sa/rulefactory.pxi":2162
* phrases = set() # (fphrase, lex_i, lex_j)
*
* def extract(f_i, f_j, lex_i, lex_j, wc, ntc, syms): # <<<<<<<<<<<<<<
@@ -71818,7 +72342,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_33get_f_phras
__pyx_cur_scope->__pyx_v_extract = __pyx_t_1;
__pyx_t_1 = 0;
- /* "rulefactory.pxi":2190
+ /* "cdec/sa/rulefactory.pxi":2190
*
* # Try to extract phrases from every f index
* for f_i from 0 <= f_i < f_len: # <<<<<<<<<<<<<<
@@ -71828,7 +72352,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_33get_f_phras
__pyx_t_2 = __pyx_cur_scope->__pyx_v_f_len;
for (__pyx_v_f_i = 0; __pyx_v_f_i < __pyx_t_2; __pyx_v_f_i++) {
- /* "rulefactory.pxi":2191
+ /* "cdec/sa/rulefactory.pxi":2191
* # Try to extract phrases from every f index
* for f_i from 0 <= f_i < f_len:
* extract(f_i, f_i, f_len, -1, 0, 0, []) # <<<<<<<<<<<<<<
@@ -71852,7 +72376,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_33get_f_phras
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
- /* "rulefactory.pxi":2193
+ /* "cdec/sa/rulefactory.pxi":2193
* extract(f_i, f_i, f_len, -1, 0, 0, [])
*
* return phrases # <<<<<<<<<<<<<<
@@ -71864,7 +72388,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_33get_f_phras
__pyx_r = __pyx_cur_scope->__pyx_v_phrases;
goto __pyx_L0;
- /* "rulefactory.pxi":2157
+ /* "cdec/sa/rulefactory.pxi":2157
* # (Used for EGivenFCoherent)
* # Return set of (fphrase, lex_i, lex_j)
* def get_f_phrases(self, f_words): # <<<<<<<<<<<<<<
@@ -71888,7 +72412,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_33get_f_phras
return __pyx_r;
}
-/* "rulefactory.pxi":2196
+/* "cdec/sa/rulefactory.pxi":2196
*
* # Drop online stats for a context
* def drop_ctx(self, ctx_name=None): # <<<<<<<<<<<<<<
@@ -71966,7 +72490,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_35drop_ctx(st
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("drop_ctx", 0);
- /* "rulefactory.pxi":2197
+ /* "cdec/sa/rulefactory.pxi":2197
* # Drop online stats for a context
* def drop_ctx(self, ctx_name=None):
* self.online_stats.pop(ctx_name, None) # <<<<<<<<<<<<<<
@@ -72004,7 +72528,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_35drop_ctx(st
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "rulefactory.pxi":2196
+ /* "cdec/sa/rulefactory.pxi":2196
*
* # Drop online stats for a context
* def drop_ctx(self, ctx_name=None): # <<<<<<<<<<<<<<
@@ -72028,7 +72552,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_35drop_ctx(st
return __pyx_r;
}
-/* "rulefactory.pxi":2200
+/* "cdec/sa/rulefactory.pxi":2200
*
* # Spans are _inclusive_ on both ends [i, j]
* def span_check(vec, i, j): # <<<<<<<<<<<<<<
@@ -72118,7 +72642,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_16span_check(CYTHON_UNUSED PyObject *__
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("span_check", 0);
- /* "rulefactory.pxi":2201
+ /* "cdec/sa/rulefactory.pxi":2201
* # Spans are _inclusive_ on both ends [i, j]
* def span_check(vec, i, j):
* k = i # <<<<<<<<<<<<<<
@@ -72128,7 +72652,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_16span_check(CYTHON_UNUSED PyObject *__
__Pyx_INCREF(__pyx_v_i);
__pyx_v_k = __pyx_v_i;
- /* "rulefactory.pxi":2202
+ /* "cdec/sa/rulefactory.pxi":2202
* def span_check(vec, i, j):
* k = i
* while k <= j: # <<<<<<<<<<<<<<
@@ -72141,7 +72665,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_16span_check(CYTHON_UNUSED PyObject *__
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!__pyx_t_2) break;
- /* "rulefactory.pxi":2203
+ /* "cdec/sa/rulefactory.pxi":2203
* k = i
* while k <= j:
* if vec[k]: # <<<<<<<<<<<<<<
@@ -72154,7 +72678,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_16span_check(CYTHON_UNUSED PyObject *__
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
- /* "rulefactory.pxi":2204
+ /* "cdec/sa/rulefactory.pxi":2204
* while k <= j:
* if vec[k]:
* return False # <<<<<<<<<<<<<<
@@ -72167,7 +72691,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_16span_check(CYTHON_UNUSED PyObject *__
goto __pyx_L0;
}
- /* "rulefactory.pxi":2205
+ /* "cdec/sa/rulefactory.pxi":2205
* if vec[k]:
* return False
* k += 1 # <<<<<<<<<<<<<<
@@ -72180,7 +72704,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_16span_check(CYTHON_UNUSED PyObject *__
__pyx_t_1 = 0;
}
- /* "rulefactory.pxi":2206
+ /* "cdec/sa/rulefactory.pxi":2206
* return False
* k += 1
* return True # <<<<<<<<<<<<<<
@@ -72192,7 +72716,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_16span_check(CYTHON_UNUSED PyObject *__
__pyx_r = Py_True;
goto __pyx_L0;
- /* "rulefactory.pxi":2200
+ /* "cdec/sa/rulefactory.pxi":2200
*
* # Spans are _inclusive_ on both ends [i, j]
* def span_check(vec, i, j): # <<<<<<<<<<<<<<
@@ -72212,7 +72736,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_16span_check(CYTHON_UNUSED PyObject *__
return __pyx_r;
}
-/* "rulefactory.pxi":2208
+/* "cdec/sa/rulefactory.pxi":2208
* return True
*
* def span_inc(vec, i, j): # <<<<<<<<<<<<<<
@@ -72304,7 +72828,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_18span_inc(CYTHON_UNUSED PyObject *__py
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("span_inc", 0);
- /* "rulefactory.pxi":2209
+ /* "cdec/sa/rulefactory.pxi":2209
*
* def span_inc(vec, i, j):
* k = i # <<<<<<<<<<<<<<
@@ -72314,7 +72838,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_18span_inc(CYTHON_UNUSED PyObject *__py
__Pyx_INCREF(__pyx_v_i);
__pyx_v_k = __pyx_v_i;
- /* "rulefactory.pxi":2210
+ /* "cdec/sa/rulefactory.pxi":2210
* def span_inc(vec, i, j):
* k = i
* while k <= j: # <<<<<<<<<<<<<<
@@ -72327,7 +72851,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_18span_inc(CYTHON_UNUSED PyObject *__py
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!__pyx_t_2) break;
- /* "rulefactory.pxi":2211
+ /* "cdec/sa/rulefactory.pxi":2211
* k = i
* while k <= j:
* vec[k] += 1 # <<<<<<<<<<<<<<
@@ -72345,7 +72869,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_18span_inc(CYTHON_UNUSED PyObject *__py
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "rulefactory.pxi":2212
+ /* "cdec/sa/rulefactory.pxi":2212
* while k <= j:
* vec[k] += 1
* k += 1 # <<<<<<<<<<<<<<
@@ -72358,7 +72882,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_18span_inc(CYTHON_UNUSED PyObject *__py
__pyx_t_1 = 0;
}
- /* "rulefactory.pxi":2208
+ /* "cdec/sa/rulefactory.pxi":2208
* return True
*
* def span_inc(vec, i, j): # <<<<<<<<<<<<<<
@@ -72382,7 +72906,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_18span_inc(CYTHON_UNUSED PyObject *__py
return __pyx_r;
}
-/* "rulefactory.pxi":2214
+/* "cdec/sa/rulefactory.pxi":2214
* k += 1
*
* def span_dec(vec, i, j): # <<<<<<<<<<<<<<
@@ -72474,7 +72998,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_20span_dec(CYTHON_UNUSED PyObject *__py
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("span_dec", 0);
- /* "rulefactory.pxi":2215
+ /* "cdec/sa/rulefactory.pxi":2215
*
* def span_dec(vec, i, j):
* k = i # <<<<<<<<<<<<<<
@@ -72484,7 +73008,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_20span_dec(CYTHON_UNUSED PyObject *__py
__Pyx_INCREF(__pyx_v_i);
__pyx_v_k = __pyx_v_i;
- /* "rulefactory.pxi":2216
+ /* "cdec/sa/rulefactory.pxi":2216
* def span_dec(vec, i, j):
* k = i
* while k <= j: # <<<<<<<<<<<<<<
@@ -72497,7 +73021,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_20span_dec(CYTHON_UNUSED PyObject *__py
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!__pyx_t_2) break;
- /* "rulefactory.pxi":2217
+ /* "cdec/sa/rulefactory.pxi":2217
* k = i
* while k <= j:
* vec[k] -= 1 # <<<<<<<<<<<<<<
@@ -72514,7 +73038,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_20span_dec(CYTHON_UNUSED PyObject *__py
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "rulefactory.pxi":2218
+ /* "cdec/sa/rulefactory.pxi":2218
* while k <= j:
* vec[k] -= 1
* k += 1 # <<<<<<<<<<<<<<
@@ -72525,7 +73049,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_20span_dec(CYTHON_UNUSED PyObject *__py
__pyx_t_1 = 0;
}
- /* "rulefactory.pxi":2214
+ /* "cdec/sa/rulefactory.pxi":2214
* k += 1
*
* def span_dec(vec, i, j): # <<<<<<<<<<<<<<
@@ -72549,7 +73073,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_20span_dec(CYTHON_UNUSED PyObject *__py
return __pyx_r;
}
-/* "features.pxi":7
+/* "cdec/sa/features.pxi":7
*
* cdef class FeatureVector:
* def __cinit__(self): # <<<<<<<<<<<<<<
@@ -72584,7 +73108,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_13FeatureVector___cinit__(struct __pyx_obj_4c
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "features.pxi":8
+ /* "cdec/sa/features.pxi":8
* cdef class FeatureVector:
* def __cinit__(self):
* self.names = IntList(INITIAL_CAPACITY, INCREMENT) # <<<<<<<<<<<<<<
@@ -72612,7 +73136,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_13FeatureVector___cinit__(struct __pyx_obj_4c
__pyx_v_self->names = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "features.pxi":9
+ /* "cdec/sa/features.pxi":9
* def __cinit__(self):
* self.names = IntList(INITIAL_CAPACITY, INCREMENT)
* self.values = FloatList(INITIAL_CAPACITY, INCREMENT) # <<<<<<<<<<<<<<
@@ -72640,7 +73164,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_13FeatureVector___cinit__(struct __pyx_obj_4c
__pyx_v_self->values = ((struct __pyx_obj_4cdec_2sa_3_sa_FloatList *)__pyx_t_3);
__pyx_t_3 = 0;
- /* "features.pxi":7
+ /* "cdec/sa/features.pxi":7
*
* cdef class FeatureVector:
* def __cinit__(self): # <<<<<<<<<<<<<<
@@ -72662,7 +73186,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_13FeatureVector___cinit__(struct __pyx_obj_4c
return __pyx_r;
}
-/* "features.pxi":11
+/* "cdec/sa/features.pxi":11
* self.values = FloatList(INITIAL_CAPACITY, INCREMENT)
*
* def set(self, unsigned name, float value): # <<<<<<<<<<<<<<
@@ -72741,7 +73265,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_13FeatureVector_2set(struct __pyx_obj_4
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("set", 0);
- /* "features.pxi":12
+ /* "cdec/sa/features.pxi":12
*
* def set(self, unsigned name, float value):
* self.names.append(name) # <<<<<<<<<<<<<<
@@ -72753,7 +73277,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_13FeatureVector_2set(struct __pyx_obj_4
__pyx_t_2 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->names), __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "features.pxi":13
+ /* "cdec/sa/features.pxi":13
* def set(self, unsigned name, float value):
* self.names.append(name)
* self.values.append(value) # <<<<<<<<<<<<<<
@@ -72765,7 +73289,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_13FeatureVector_2set(struct __pyx_obj_4
__pyx_t_2 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->values), __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "features.pxi":11
+ /* "cdec/sa/features.pxi":11
* self.values = FloatList(INITIAL_CAPACITY, INCREMENT)
*
* def set(self, unsigned name, float value): # <<<<<<<<<<<<<<
@@ -72785,9 +73309,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_13FeatureVector_2set(struct __pyx_obj_4
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_2sa_3_sa_13FeatureVector_6generator5(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4cdec_2sa_3_sa_13FeatureVector_6generator6(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-/* "features.pxi":15
+/* "cdec/sa/features.pxi":15
* self.values.append(value)
*
* def __iter__(self): # <<<<<<<<<<<<<<
@@ -72809,14 +73333,14 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_13FeatureVector_5__iter__(PyObject *__p
}
static PyObject *__pyx_pf_4cdec_2sa_3_sa_13FeatureVector_4__iter__(struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *__pyx_v_self) {
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ *__pyx_cur_scope;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___iter__ *__pyx_cur_scope;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__iter__", 0);
- __pyx_cur_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ *)__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__(__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__, __pyx_empty_tuple, NULL);
+ __pyx_cur_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___iter__ *)__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_28___iter__(__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_28___iter__, __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_cur_scope)) {
__Pyx_RefNannyFinishContext();
return NULL;
@@ -72826,7 +73350,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_13FeatureVector_4__iter__(struct __pyx_
__Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
__Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
{
- __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_13FeatureVector_6generator5, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_FeatureVector___iter); if (unlikely(!gen)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_13FeatureVector_6generator6, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_FeatureVector___iter); if (unlikely(!gen)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_cur_scope);
__Pyx_RefNannyFinishContext();
return (PyObject *) gen;
@@ -72842,9 +73366,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_13FeatureVector_4__iter__(struct __pyx_
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_2sa_3_sa_13FeatureVector_6generator5(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4cdec_2sa_3_sa_13FeatureVector_6generator6(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ *__pyx_cur_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ *)__pyx_generator->closure);
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___iter__ *__pyx_cur_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___iter__ *)__pyx_generator->closure);
PyObject *__pyx_r = NULL;
int __pyx_t_1;
unsigned int __pyx_t_2;
@@ -72867,7 +73391,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_13FeatureVector_6generator5(__pyx_Gener
__pyx_L3_first_run:;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "features.pxi":17
+ /* "cdec/sa/features.pxi":17
* def __iter__(self):
* cdef unsigned i
* for i in range(self.names.len): # <<<<<<<<<<<<<<
@@ -72878,7 +73402,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_13FeatureVector_6generator5(__pyx_Gener
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_cur_scope->__pyx_v_i = __pyx_t_2;
- /* "features.pxi":18
+ /* "cdec/sa/features.pxi":18
* cdef unsigned i
* for i in range(self.names.len):
* yield (FD.word(self.names[i]), self.values[i]) # <<<<<<<<<<<<<<
@@ -72916,7 +73440,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_13FeatureVector_6generator5(__pyx_Gener
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- /* "features.pxi":15
+ /* "cdec/sa/features.pxi":15
* self.values.append(value)
*
* def __iter__(self): # <<<<<<<<<<<<<<
@@ -72940,7 +73464,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_13FeatureVector_6generator5(__pyx_Gener
return NULL;
}
-/* "features.pxi":20
+/* "cdec/sa/features.pxi":20
* yield (FD.word(self.names[i]), self.values[i])
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -72960,9 +73484,9 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_13FeatureVector_8__str__(PyObject *__py
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_2sa_3_sa_13FeatureVector_7__str___2generator17(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4cdec_2sa_3_sa_13FeatureVector_7__str___2generator18(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-/* "features.pxi":21
+/* "cdec/sa/features.pxi":21
*
* def __str__(self):
* return ' '.join('%s=%s' % feat for feat in self) # <<<<<<<<<<<<<<
@@ -72971,24 +73495,24 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_13FeatureVector_7__str___2generator17(_
*/
static PyObject *__pyx_pf_4cdec_2sa_3_sa_13FeatureVector_7__str___genexpr(PyObject *__pyx_self) {
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr *__pyx_cur_scope;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_30_genexpr *__pyx_cur_scope;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("genexpr", 0);
- __pyx_cur_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr *)__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr(__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr, __pyx_empty_tuple, NULL);
+ __pyx_cur_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_30_genexpr *)__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_30_genexpr(__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_30_genexpr, __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_cur_scope)) {
__Pyx_RefNannyFinishContext();
return NULL;
}
__Pyx_GOTREF(__pyx_cur_scope);
- __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ *) __pyx_self;
+ __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29___str__ *) __pyx_self;
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
{
- __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_13FeatureVector_7__str___2generator17, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_str___locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_13FeatureVector_7__str___2generator18, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_str___locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_cur_scope);
__Pyx_RefNannyFinishContext();
return (PyObject *) gen;
@@ -73004,9 +73528,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_13FeatureVector_7__str___genexpr(PyObje
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_2sa_3_sa_13FeatureVector_7__str___2generator17(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4cdec_2sa_3_sa_13FeatureVector_7__str___2generator18(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr *)__pyx_generator->closure);
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_30_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_30_genexpr *)__pyx_generator->closure);
PyObject *__pyx_r = NULL;
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
@@ -73106,7 +73630,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_13FeatureVector_7__str___2generator17(_
return NULL;
}
-/* "features.pxi":20
+/* "cdec/sa/features.pxi":20
* yield (FD.word(self.names[i]), self.values[i])
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -73115,7 +73639,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_13FeatureVector_7__str___2generator17(_
*/
static PyObject *__pyx_pf_4cdec_2sa_3_sa_13FeatureVector_7__str__(struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *__pyx_v_self) {
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ *__pyx_cur_scope;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29___str__ *__pyx_cur_scope;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
@@ -73124,7 +73648,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_13FeatureVector_7__str__(struct __pyx_o
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__str__", 0);
- __pyx_cur_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ *)__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_28___str__(__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_28___str__, __pyx_empty_tuple, NULL);
+ __pyx_cur_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29___str__ *)__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_29___str__(__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_29___str__, __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_cur_scope)) {
__Pyx_RefNannyFinishContext();
return NULL;
@@ -73134,7 +73658,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_13FeatureVector_7__str__(struct __pyx_o
__Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
__Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
- /* "features.pxi":21
+ /* "cdec/sa/features.pxi":21
*
* def __str__(self):
* return ' '.join('%s=%s' % feat for feat in self) # <<<<<<<<<<<<<<
@@ -73151,7 +73675,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_13FeatureVector_7__str__(struct __pyx_o
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "features.pxi":20
+ /* "cdec/sa/features.pxi":20
* yield (FD.word(self.names[i]), self.values[i])
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -73172,7 +73696,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_13FeatureVector_7__str__(struct __pyx_o
return __pyx_r;
}
-/* "features.pxi":25
+/* "cdec/sa/features.pxi":25
* cdef class Scorer:
* cdef models
* def __init__(self, *models): # <<<<<<<<<<<<<<
@@ -73214,7 +73738,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Scorer___init__(struct __pyx_obj_4cdec_2sa_3
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "features.pxi":26
+ /* "cdec/sa/features.pxi":26
* cdef models
* def __init__(self, *models):
* names = [FD.index(<char *>model.__name__) for model in models] # <<<<<<<<<<<<<<
@@ -73246,7 +73770,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Scorer___init__(struct __pyx_obj_4cdec_2sa_3
__pyx_v_names = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "features.pxi":27
+ /* "cdec/sa/features.pxi":27
* def __init__(self, *models):
* names = [FD.index(<char *>model.__name__) for model in models]
* self.models = zip(names, models) # <<<<<<<<<<<<<<
@@ -73270,7 +73794,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Scorer___init__(struct __pyx_obj_4cdec_2sa_3
__pyx_v_self->models = __pyx_t_2;
__pyx_t_2 = 0;
- /* "features.pxi":25
+ /* "cdec/sa/features.pxi":25
* cdef class Scorer:
* cdef models
* def __init__(self, *models): # <<<<<<<<<<<<<<
@@ -73295,7 +73819,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_6Scorer___init__(struct __pyx_obj_4cdec_2sa_3
return __pyx_r;
}
-/* "features.pxi":29
+/* "cdec/sa/features.pxi":29
* self.models = zip(names, models)
*
* cdef FeatureVector score(self, ctx): # <<<<<<<<<<<<<<
@@ -73325,7 +73849,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *__pyx_f_4cdec_2sa_3_sa_6Sc
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("score", 0);
- /* "features.pxi":30
+ /* "cdec/sa/features.pxi":30
*
* cdef FeatureVector score(self, ctx):
* cdef FeatureVector scores = FeatureVector() # <<<<<<<<<<<<<<
@@ -73337,7 +73861,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *__pyx_f_4cdec_2sa_3_sa_6Sc
__pyx_v_scores = ((struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "features.pxi":31
+ /* "cdec/sa/features.pxi":31
* cdef FeatureVector score(self, ctx):
* cdef FeatureVector scores = FeatureVector()
* for name, model in self.models: # <<<<<<<<<<<<<<
@@ -73436,7 +73960,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *__pyx_f_4cdec_2sa_3_sa_6Sc
__Pyx_XDECREF_SET(__pyx_v_model, __pyx_t_6);
__pyx_t_6 = 0;
- /* "features.pxi":32
+ /* "cdec/sa/features.pxi":32
* cdef FeatureVector scores = FeatureVector()
* for name, model in self.models:
* scores.set(name, model(ctx)) # <<<<<<<<<<<<<<
@@ -73499,7 +74023,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *__pyx_f_4cdec_2sa_3_sa_6Sc
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "features.pxi":31
+ /* "cdec/sa/features.pxi":31
* cdef FeatureVector score(self, ctx):
* cdef FeatureVector scores = FeatureVector()
* for name, model in self.models: # <<<<<<<<<<<<<<
@@ -73509,7 +74033,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *__pyx_f_4cdec_2sa_3_sa_6Sc
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "features.pxi":33
+ /* "cdec/sa/features.pxi":33
* for name, model in self.models:
* scores.set(name, model(ctx))
* return scores # <<<<<<<<<<<<<<
@@ -73519,7 +74043,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *__pyx_f_4cdec_2sa_3_sa_6Sc
__pyx_r = __pyx_v_scores;
goto __pyx_L0;
- /* "features.pxi":29
+ /* "cdec/sa/features.pxi":29
* self.models = zip(names, models)
*
* cdef FeatureVector score(self, ctx): # <<<<<<<<<<<<<<
@@ -74020,6 +74544,7 @@ static PyMethodDef __pyx_methods_4cdec_2sa_3_sa_Phrase[] = {
{"clen", (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_6Phrase_17clen, METH_O, 0},
{"getchunk", (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_6Phrase_19getchunk, METH_O, 0},
{"subst", (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_6Phrase_32subst, METH_VARARGS|METH_KEYWORDS, 0},
+ {"iterspans", (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_6Phrase_34iterspans, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cdec_2sa_3_sa_6Phrase_33iterspans},
{0, 0, 0, 0}
};
@@ -79057,14 +79582,14 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__ = {
#endif
};
-static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_16___str__[8];
-static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ = 0;
+static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16_iterspans *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_16_iterspans[8];
+static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_16_iterspans = 0;
-static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_16___str__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_16_iterspans(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
PyObject *o;
- if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__)))) {
- o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_16___str__[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_16___str__];
- memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__));
+ if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_16_iterspans > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16_iterspans)))) {
+ o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_16_iterspans[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_16_iterspans];
+ memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16_iterspans));
(void) PyObject_INIT(o, t);
PyObject_GC_Track(o);
} else {
@@ -79074,41 +79599,172 @@ static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_16___str__(PyTyp
return o;
}
-static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_16___str__(PyObject *o) {
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ *)o;
+static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_16_iterspans(PyObject *o) {
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16_iterspans *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16_iterspans *)o;
PyObject_GC_UnTrack(o);
+ Py_CLEAR(p->__pyx_v_get_sym);
+ Py_CLEAR(p->__pyx_v_nt_flag);
Py_CLEAR(p->__pyx_v_self);
- if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__)))) {
- __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_16___str__[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_16___str__++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ *)o);
+ Py_CLEAR(p->__pyx_v_span);
+ Py_CLEAR(p->__pyx_v_to_str);
+ if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_16_iterspans < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16_iterspans)))) {
+ __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_16_iterspans[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_16_iterspans++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16_iterspans *)o);
} else {
(*Py_TYPE(o)->tp_free)(o);
}
}
-static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_16___str__(PyObject *o, visitproc v, void *a) {
+static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_16_iterspans(PyObject *o, visitproc v, void *a) {
int e;
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ *)o;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16_iterspans *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16_iterspans *)o;
+ if (p->__pyx_v_get_sym) {
+ e = (*v)(p->__pyx_v_get_sym, a); if (e) return e;
+ }
+ if (p->__pyx_v_nt_flag) {
+ e = (*v)(p->__pyx_v_nt_flag, a); if (e) return e;
+ }
if (p->__pyx_v_self) {
e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
}
+ if (p->__pyx_v_span) {
+ e = (*v)(p->__pyx_v_span, a); if (e) return e;
+ }
+ if (p->__pyx_v_to_str) {
+ e = (*v)(p->__pyx_v_to_str, a); if (e) return e;
+ }
return 0;
}
-static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_16___str__(PyObject *o) {
+static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_16_iterspans(PyObject *o) {
PyObject* tmp;
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ *)o;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16_iterspans *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16_iterspans *)o;
+ tmp = ((PyObject*)p->__pyx_v_get_sym);
+ p->__pyx_v_get_sym = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->__pyx_v_nt_flag);
+ p->__pyx_v_nt_flag = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->__pyx_v_self);
+ p->__pyx_v_self = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)Py_None); Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->__pyx_v_span);
+ p->__pyx_v_span = ((PyObject*)Py_None); Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->__pyx_v_to_str);
+ p->__pyx_v_to_str = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ return 0;
+}
+
+static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_16_iterspans = {
+ PyVarObject_HEAD_INIT(0, 0)
+ "cdec.sa._sa.__pyx_scope_struct_16_iterspans", /*tp_name*/
+ sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16_iterspans), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_16_iterspans, /*tp_dealloc*/
+ 0, /*tp_print*/
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*tp_compare*/
+ #else
+ 0, /*reserved*/
+ #endif
+ 0, /*tp_repr*/
+ 0, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ 0, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ 0, /*tp_str*/
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ 0, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+ 0, /*tp_doc*/
+ __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_16_iterspans, /*tp_traverse*/
+ __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_16_iterspans, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ 0, /*tp_methods*/
+ 0, /*tp_members*/
+ 0, /*tp_getset*/
+ 0, /*tp_base*/
+ 0, /*tp_dict*/
+ 0, /*tp_descr_get*/
+ 0, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ 0, /*tp_init*/
+ 0, /*tp_alloc*/
+ __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_16_iterspans, /*tp_new*/
+ 0, /*tp_free*/
+ 0, /*tp_is_gc*/
+ 0, /*tp_bases*/
+ 0, /*tp_mro*/
+ 0, /*tp_cache*/
+ 0, /*tp_subclasses*/
+ 0, /*tp_weaklist*/
+ 0, /*tp_del*/
+ 0, /*tp_version_tag*/
+ #if PY_VERSION_HEX >= 0x030400a1
+ 0, /*tp_finalize*/
+ #endif
+};
+
+static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17___str__ *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_17___str__[8];
+static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_17___str__ = 0;
+
+static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_17___str__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+ PyObject *o;
+ if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_17___str__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17___str__)))) {
+ o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_17___str__[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_17___str__];
+ memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17___str__));
+ (void) PyObject_INIT(o, t);
+ PyObject_GC_Track(o);
+ } else {
+ o = (*t->tp_alloc)(t, 0);
+ if (unlikely(!o)) return 0;
+ }
+ return o;
+}
+
+static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_17___str__(PyObject *o) {
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17___str__ *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17___str__ *)o;
+ PyObject_GC_UnTrack(o);
+ Py_CLEAR(p->__pyx_v_self);
+ if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_17___str__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17___str__)))) {
+ __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_17___str__[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_17___str__++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17___str__ *)o);
+ } else {
+ (*Py_TYPE(o)->tp_free)(o);
+ }
+}
+
+static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_17___str__(PyObject *o, visitproc v, void *a) {
+ int e;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17___str__ *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17___str__ *)o;
+ if (p->__pyx_v_self) {
+ e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
+ }
+ return 0;
+}
+
+static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_17___str__(PyObject *o) {
+ PyObject* tmp;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17___str__ *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17___str__ *)o;
tmp = ((PyObject*)p->__pyx_v_self);
p->__pyx_v_self = ((struct __pyx_obj_4cdec_2sa_3_sa_Rule *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
return 0;
}
-static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ = {
+static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_17___str__ = {
PyVarObject_HEAD_INIT(0, 0)
- "cdec.sa._sa.__pyx_scope_struct_16___str__", /*tp_name*/
- sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__), /*tp_basicsize*/
+ "cdec.sa._sa.__pyx_scope_struct_17___str__", /*tp_name*/
+ sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17___str__), /*tp_basicsize*/
0, /*tp_itemsize*/
- __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_16___str__, /*tp_dealloc*/
+ __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_17___str__, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
@@ -79129,8 +79785,8 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ = {
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
- __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_16___str__, /*tp_traverse*/
- __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_16___str__, /*tp_clear*/
+ __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_17___str__, /*tp_traverse*/
+ __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_17___str__, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
@@ -79145,7 +79801,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ = {
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
- __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_16___str__, /*tp_new*/
+ __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_17___str__, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
@@ -79160,14 +79816,14 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ = {
#endif
};
-static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr[8];
-static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr = 0;
+static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_genexpr *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_18_genexpr[8];
+static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_18_genexpr = 0;
-static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_18_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
PyObject *o;
- if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr)))) {
- o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr];
- memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr));
+ if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_18_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_genexpr)))) {
+ o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_18_genexpr[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_18_genexpr];
+ memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_genexpr));
(void) PyObject_INIT(o, t);
PyObject_GC_Track(o);
} else {
@@ -79177,22 +79833,22 @@ static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr(PyTyp
return o;
}
-static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr(PyObject *o) {
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr *)o;
+static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_18_genexpr(PyObject *o) {
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_genexpr *)o;
PyObject_GC_UnTrack(o);
Py_CLEAR(p->__pyx_outer_scope);
Py_CLEAR(p->__pyx_v_a);
Py_CLEAR(p->__pyx_t_0);
- if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr)))) {
- __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr *)o);
+ if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_18_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_genexpr)))) {
+ __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_18_genexpr[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_18_genexpr++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_genexpr *)o);
} else {
(*Py_TYPE(o)->tp_free)(o);
}
}
-static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr(PyObject *o, visitproc v, void *a) {
+static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_18_genexpr(PyObject *o, visitproc v, void *a) {
int e;
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr *)o;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_genexpr *)o;
if (p->__pyx_outer_scope) {
e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
}
@@ -79205,11 +79861,11 @@ static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr(PyObje
return 0;
}
-static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr(PyObject *o) {
+static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_18_genexpr(PyObject *o) {
PyObject* tmp;
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr *)o;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_genexpr *)o;
tmp = ((PyObject*)p->__pyx_outer_scope);
- p->__pyx_outer_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ *)Py_None); Py_INCREF(Py_None);
+ p->__pyx_outer_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17___str__ *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
tmp = ((PyObject*)p->__pyx_v_a);
p->__pyx_v_a = Py_None; Py_INCREF(Py_None);
@@ -79220,12 +79876,12 @@ static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr(PyObject
return 0;
}
-static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr = {
+static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_18_genexpr = {
PyVarObject_HEAD_INIT(0, 0)
- "cdec.sa._sa.__pyx_scope_struct_17_genexpr", /*tp_name*/
- sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr), /*tp_basicsize*/
+ "cdec.sa._sa.__pyx_scope_struct_18_genexpr", /*tp_name*/
+ sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_genexpr), /*tp_basicsize*/
0, /*tp_itemsize*/
- __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr, /*tp_dealloc*/
+ __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_18_genexpr, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
@@ -79246,8 +79902,8 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr = {
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
- __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr, /*tp_traverse*/
- __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr, /*tp_clear*/
+ __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_18_genexpr, /*tp_traverse*/
+ __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_18_genexpr, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
@@ -79262,7 +79918,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr = {
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
- __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr, /*tp_new*/
+ __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_18_genexpr, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
@@ -79277,14 +79933,14 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr = {
#endif
};
-static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments[8];
-static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments = 0;
+static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_alignments *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_19_alignments[8];
+static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_19_alignments = 0;
-static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_19_alignments(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
PyObject *o;
- if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments)))) {
- o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments];
- memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments));
+ if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_19_alignments > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_alignments)))) {
+ o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_19_alignments[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_19_alignments];
+ memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_alignments));
(void) PyObject_INIT(o, t);
PyObject_GC_Track(o);
} else {
@@ -79294,22 +79950,22 @@ static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments(Py
return o;
}
-static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments(PyObject *o) {
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments *)o;
+static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_19_alignments(PyObject *o) {
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_alignments *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_alignments *)o;
PyObject_GC_UnTrack(o);
Py_CLEAR(p->__pyx_v_point);
Py_CLEAR(p->__pyx_v_self);
Py_CLEAR(p->__pyx_t_0);
- if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments)))) {
- __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments *)o);
+ if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_19_alignments < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_alignments)))) {
+ __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_19_alignments[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_19_alignments++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_alignments *)o);
} else {
(*Py_TYPE(o)->tp_free)(o);
}
}
-static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments(PyObject *o, visitproc v, void *a) {
+static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_19_alignments(PyObject *o, visitproc v, void *a) {
int e;
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments *)o;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_alignments *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_alignments *)o;
if (p->__pyx_v_point) {
e = (*v)(p->__pyx_v_point, a); if (e) return e;
}
@@ -79322,9 +79978,9 @@ static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments(PyO
return 0;
}
-static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments(PyObject *o) {
+static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_19_alignments(PyObject *o) {
PyObject* tmp;
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments *)o;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_alignments *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_alignments *)o;
tmp = ((PyObject*)p->__pyx_v_point);
p->__pyx_v_point = Py_None; Py_INCREF(Py_None);
Py_XDECREF(tmp);
@@ -79337,12 +79993,12 @@ static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments(PyObje
return 0;
}
-static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments = {
+static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_19_alignments = {
PyVarObject_HEAD_INIT(0, 0)
- "cdec.sa._sa.__pyx_scope_struct_18_alignments", /*tp_name*/
- sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments), /*tp_basicsize*/
+ "cdec.sa._sa.__pyx_scope_struct_19_alignments", /*tp_name*/
+ sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_alignments), /*tp_basicsize*/
0, /*tp_itemsize*/
- __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments, /*tp_dealloc*/
+ __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_19_alignments, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
@@ -79363,8 +80019,8 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments =
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
- __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments, /*tp_traverse*/
- __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments, /*tp_clear*/
+ __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_19_alignments, /*tp_traverse*/
+ __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_19_alignments, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
@@ -79379,7 +80035,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments =
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
- __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments, /*tp_new*/
+ __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_19_alignments, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
@@ -79394,14 +80050,14 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments =
#endif
};
-static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_19_input[8];
-static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_19_input = 0;
+static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_input *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_20_input[8];
+static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_20_input = 0;
-static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_19_input(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_20_input(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
PyObject *o;
- if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_19_input > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input)))) {
- o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_19_input[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_19_input];
- memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input));
+ if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_20_input > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_input)))) {
+ o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_20_input[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_20_input];
+ memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_input));
(void) PyObject_INIT(o, t);
PyObject_GC_Track(o);
} else {
@@ -79411,8 +80067,8 @@ static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_19_input(PyTypeO
return o;
}
-static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_19_input(PyObject *o) {
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input *)o;
+static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_20_input(PyObject *o) {
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_input *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_input *)o;
PyObject_GC_UnTrack(o);
Py_CLEAR(p->__pyx_v_alignment);
Py_CLEAR(p->__pyx_v_als);
@@ -79473,16 +80129,16 @@ static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_19_input(PyObject
Py_CLEAR(p->__pyx_t_0);
Py_CLEAR(p->__pyx_t_4);
Py_CLEAR(p->__pyx_t_5);
- if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_19_input < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input)))) {
- __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_19_input[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_19_input++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input *)o);
+ if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_20_input < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_input)))) {
+ __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_20_input[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_20_input++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_input *)o);
} else {
(*Py_TYPE(o)->tp_free)(o);
}
}
-static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_19_input(PyObject *o, visitproc v, void *a) {
+static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_20_input(PyObject *o, visitproc v, void *a) {
int e;
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input *)o;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_input *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_input *)o;
if (p->__pyx_v_alignment) {
e = (*v)(p->__pyx_v_alignment, a); if (e) return e;
}
@@ -79663,9 +80319,9 @@ static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_19_input(PyObject
return 0;
}
-static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_19_input(PyObject *o) {
+static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_20_input(PyObject *o) {
PyObject* tmp;
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input *)o;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_input *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_input *)o;
tmp = ((PyObject*)p->__pyx_v_alignment);
p->__pyx_v_alignment = Py_None; Py_INCREF(Py_None);
Py_XDECREF(tmp);
@@ -79846,12 +80502,12 @@ static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_19_input(PyObject *o
return 0;
}
-static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_19_input = {
+static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_20_input = {
PyVarObject_HEAD_INIT(0, 0)
- "cdec.sa._sa.__pyx_scope_struct_19_input", /*tp_name*/
- sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input), /*tp_basicsize*/
+ "cdec.sa._sa.__pyx_scope_struct_20_input", /*tp_name*/
+ sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_input), /*tp_basicsize*/
0, /*tp_itemsize*/
- __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_19_input, /*tp_dealloc*/
+ __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_20_input, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
@@ -79872,8 +80528,8 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_19_input = {
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
- __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_19_input, /*tp_traverse*/
- __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_19_input, /*tp_clear*/
+ __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_20_input, /*tp_traverse*/
+ __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_20_input, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
@@ -79888,7 +80544,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_19_input = {
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
- __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_19_input, /*tp_new*/
+ __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_20_input, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
@@ -79903,14 +80559,14 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_19_input = {
#endif
};
-static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr[8];
-static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr = 0;
+static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_genexpr *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_21_genexpr[8];
+static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_21_genexpr = 0;
-static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_21_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
PyObject *o;
- if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr)))) {
- o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr];
- memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr));
+ if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_21_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_genexpr)))) {
+ o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_21_genexpr[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_21_genexpr];
+ memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_genexpr));
(void) PyObject_INIT(o, t);
PyObject_GC_Track(o);
} else {
@@ -79920,22 +80576,22 @@ static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr(PyTyp
return o;
}
-static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr(PyObject *o) {
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr *)o;
+static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_21_genexpr(PyObject *o) {
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_genexpr *)o;
PyObject_GC_UnTrack(o);
Py_CLEAR(p->__pyx_outer_scope);
Py_CLEAR(p->__pyx_v_word);
Py_CLEAR(p->__pyx_t_0);
- if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr)))) {
- __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr *)o);
+ if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_21_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_genexpr)))) {
+ __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_21_genexpr[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_21_genexpr++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_genexpr *)o);
} else {
(*Py_TYPE(o)->tp_free)(o);
}
}
-static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr(PyObject *o, visitproc v, void *a) {
+static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_21_genexpr(PyObject *o, visitproc v, void *a) {
int e;
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr *)o;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_genexpr *)o;
if (p->__pyx_outer_scope) {
e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
}
@@ -79948,11 +80604,11 @@ static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr(PyObje
return 0;
}
-static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr(PyObject *o) {
+static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_21_genexpr(PyObject *o) {
PyObject* tmp;
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr *)o;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_genexpr *)o;
tmp = ((PyObject*)p->__pyx_outer_scope);
- p->__pyx_outer_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_19_input *)Py_None); Py_INCREF(Py_None);
+ p->__pyx_outer_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_input *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
tmp = ((PyObject*)p->__pyx_v_word);
p->__pyx_v_word = Py_None; Py_INCREF(Py_None);
@@ -79963,12 +80619,12 @@ static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr(PyObject
return 0;
}
-static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr = {
+static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_21_genexpr = {
PyVarObject_HEAD_INIT(0, 0)
- "cdec.sa._sa.__pyx_scope_struct_20_genexpr", /*tp_name*/
- sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr), /*tp_basicsize*/
+ "cdec.sa._sa.__pyx_scope_struct_21_genexpr", /*tp_name*/
+ sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_genexpr), /*tp_basicsize*/
0, /*tp_itemsize*/
- __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr, /*tp_dealloc*/
+ __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_21_genexpr, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
@@ -79989,8 +80645,8 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr = {
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
- __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr, /*tp_traverse*/
- __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr, /*tp_clear*/
+ __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_21_genexpr, /*tp_traverse*/
+ __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_21_genexpr, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
@@ -80005,7 +80661,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr = {
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
- __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr, /*tp_new*/
+ __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_21_genexpr, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
@@ -80020,14 +80676,14 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr = {
#endif
};
-static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance[8];
-static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance = 0;
+static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_add_instance *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_22_add_instance[8];
+static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_22_add_instance = 0;
-static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_22_add_instance(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
PyObject *o;
- if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance)))) {
- o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance];
- memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance));
+ if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_22_add_instance > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_add_instance)))) {
+ o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_22_add_instance[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_22_add_instance];
+ memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_add_instance));
(void) PyObject_INIT(o, t);
PyObject_GC_Track(o);
} else {
@@ -80037,8 +80693,8 @@ static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance(
return o;
}
-static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance(PyObject *o) {
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance *)o;
+static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_22_add_instance(PyObject *o) {
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_add_instance *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_add_instance *)o;
PyObject_GC_UnTrack(o);
Py_CLEAR(p->__pyx_v_al);
Py_CLEAR(p->__pyx_v_cover);
@@ -80051,16 +80707,16 @@ static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance(P
Py_CLEAR(p->__pyx_v_fe_span);
Py_CLEAR(p->__pyx_v_rules);
Py_CLEAR(p->__pyx_v_self);
- if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance)))) {
- __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance *)o);
+ if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_22_add_instance < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_add_instance)))) {
+ __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_22_add_instance[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_22_add_instance++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_add_instance *)o);
} else {
(*Py_TYPE(o)->tp_free)(o);
}
}
-static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance(PyObject *o, visitproc v, void *a) {
+static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_22_add_instance(PyObject *o, visitproc v, void *a) {
int e;
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance *)o;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_add_instance *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_add_instance *)o;
if (p->__pyx_v_al) {
e = (*v)(p->__pyx_v_al, a); if (e) return e;
}
@@ -80097,9 +80753,9 @@ static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance(P
return 0;
}
-static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance(PyObject *o) {
+static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_22_add_instance(PyObject *o) {
PyObject* tmp;
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance *)o;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_add_instance *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_add_instance *)o;
tmp = ((PyObject*)p->__pyx_v_al);
p->__pyx_v_al = Py_None; Py_INCREF(Py_None);
Py_XDECREF(tmp);
@@ -80136,12 +80792,12 @@ static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance(PyOb
return 0;
}
-static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance = {
+static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_22_add_instance = {
PyVarObject_HEAD_INIT(0, 0)
- "cdec.sa._sa.__pyx_scope_struct_21_add_instance", /*tp_name*/
- sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance), /*tp_basicsize*/
+ "cdec.sa._sa.__pyx_scope_struct_22_add_instance", /*tp_name*/
+ sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_add_instance), /*tp_basicsize*/
0, /*tp_itemsize*/
- __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance, /*tp_dealloc*/
+ __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_22_add_instance, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
@@ -80162,8 +80818,8 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
- __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance, /*tp_traverse*/
- __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance, /*tp_clear*/
+ __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_22_add_instance, /*tp_traverse*/
+ __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_22_add_instance, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
@@ -80178,7 +80834,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
- __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance, /*tp_new*/
+ __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_22_add_instance, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
@@ -80193,14 +80849,14 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance
#endif
};
-static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule[8];
-static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule = 0;
+static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_form_rule *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_23_form_rule[8];
+static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_23_form_rule = 0;
-static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_23_form_rule(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
PyObject *o;
- if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule)))) {
- o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule];
- memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule));
+ if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_23_form_rule > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_form_rule)))) {
+ o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_23_form_rule[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_23_form_rule];
+ memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_form_rule));
(void) PyObject_INIT(o, t);
PyObject_GC_Track(o);
} else {
@@ -80210,21 +80866,21 @@ static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule(PyT
return o;
}
-static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule(PyObject *o) {
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule *)o;
+static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_23_form_rule(PyObject *o) {
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_form_rule *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_form_rule *)o;
PyObject_GC_UnTrack(o);
Py_CLEAR(p->__pyx_v_links);
Py_CLEAR(p->__pyx_v_self);
- if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule)))) {
- __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule *)o);
+ if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_23_form_rule < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_form_rule)))) {
+ __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_23_form_rule[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_23_form_rule++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_form_rule *)o);
} else {
(*Py_TYPE(o)->tp_free)(o);
}
}
-static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule(PyObject *o, visitproc v, void *a) {
+static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_23_form_rule(PyObject *o, visitproc v, void *a) {
int e;
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule *)o;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_form_rule *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_form_rule *)o;
if (p->__pyx_v_links) {
e = (*v)(p->__pyx_v_links, a); if (e) return e;
}
@@ -80234,9 +80890,9 @@ static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule(PyOb
return 0;
}
-static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule(PyObject *o) {
+static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_23_form_rule(PyObject *o) {
PyObject* tmp;
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule *)o;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_form_rule *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_form_rule *)o;
tmp = ((PyObject*)p->__pyx_v_links);
p->__pyx_v_links = ((PyObject*)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
@@ -80246,12 +80902,12 @@ static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule(PyObjec
return 0;
}
-static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule = {
+static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_23_form_rule = {
PyVarObject_HEAD_INIT(0, 0)
- "cdec.sa._sa.__pyx_scope_struct_22_form_rule", /*tp_name*/
- sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule), /*tp_basicsize*/
+ "cdec.sa._sa.__pyx_scope_struct_23_form_rule", /*tp_name*/
+ sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_form_rule), /*tp_basicsize*/
0, /*tp_itemsize*/
- __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule, /*tp_dealloc*/
+ __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_23_form_rule, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
@@ -80272,8 +80928,8 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule =
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
- __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule, /*tp_traverse*/
- __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule, /*tp_clear*/
+ __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_23_form_rule, /*tp_traverse*/
+ __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_23_form_rule, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
@@ -80288,7 +80944,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule =
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
- __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule, /*tp_new*/
+ __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_23_form_rule, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
@@ -80303,14 +80959,14 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule =
#endif
};
-static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr[8];
-static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr = 0;
+static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_genexpr *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_24_genexpr[8];
+static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_24_genexpr = 0;
-static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_24_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
PyObject *o;
- if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr)))) {
- o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr];
- memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr));
+ if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_24_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_genexpr)))) {
+ o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_24_genexpr[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_24_genexpr];
+ memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_genexpr));
(void) PyObject_INIT(o, t);
PyObject_GC_Track(o);
} else {
@@ -80320,23 +80976,23 @@ static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr(PyTyp
return o;
}
-static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr(PyObject *o) {
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr *)o;
+static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_24_genexpr(PyObject *o) {
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_genexpr *)o;
PyObject_GC_UnTrack(o);
Py_CLEAR(p->__pyx_outer_scope);
Py_CLEAR(p->__pyx_v_i);
Py_CLEAR(p->__pyx_v_j);
Py_CLEAR(p->__pyx_t_0);
- if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr)))) {
- __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr *)o);
+ if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_24_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_genexpr)))) {
+ __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_24_genexpr[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_24_genexpr++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_genexpr *)o);
} else {
(*Py_TYPE(o)->tp_free)(o);
}
}
-static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr(PyObject *o, visitproc v, void *a) {
+static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_24_genexpr(PyObject *o, visitproc v, void *a) {
int e;
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr *)o;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_genexpr *)o;
if (p->__pyx_outer_scope) {
e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
}
@@ -80352,11 +81008,11 @@ static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr(PyObje
return 0;
}
-static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr(PyObject *o) {
+static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_24_genexpr(PyObject *o) {
PyObject* tmp;
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr *)o;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_genexpr *)o;
tmp = ((PyObject*)p->__pyx_outer_scope);
- p->__pyx_outer_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule *)Py_None); Py_INCREF(Py_None);
+ p->__pyx_outer_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_form_rule *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
tmp = ((PyObject*)p->__pyx_v_i);
p->__pyx_v_i = Py_None; Py_INCREF(Py_None);
@@ -80370,12 +81026,12 @@ static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr(PyObject
return 0;
}
-static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr = {
+static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_24_genexpr = {
PyVarObject_HEAD_INIT(0, 0)
- "cdec.sa._sa.__pyx_scope_struct_23_genexpr", /*tp_name*/
- sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr), /*tp_basicsize*/
+ "cdec.sa._sa.__pyx_scope_struct_24_genexpr", /*tp_name*/
+ sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_genexpr), /*tp_basicsize*/
0, /*tp_itemsize*/
- __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr, /*tp_dealloc*/
+ __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_24_genexpr, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
@@ -80396,8 +81052,8 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr = {
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
- __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr, /*tp_traverse*/
- __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr, /*tp_clear*/
+ __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_24_genexpr, /*tp_traverse*/
+ __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_24_genexpr, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
@@ -80412,7 +81068,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr = {
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
- __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr, /*tp_new*/
+ __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_24_genexpr, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
@@ -80427,14 +81083,14 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr = {
#endif
};
-static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule[8];
-static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule = 0;
+static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_fmt_rule *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_25_fmt_rule[8];
+static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_25_fmt_rule = 0;
-static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_25_fmt_rule(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
PyObject *o;
- if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule)))) {
- o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule];
- memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule));
+ if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_25_fmt_rule > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_fmt_rule)))) {
+ o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_25_fmt_rule[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_25_fmt_rule];
+ memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_fmt_rule));
(void) PyObject_INIT(o, t);
PyObject_GC_Track(o);
} else {
@@ -80444,21 +81100,21 @@ static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule(PyTy
return o;
}
-static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule(PyObject *o) {
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule *)o;
+static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_25_fmt_rule(PyObject *o) {
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_fmt_rule *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_fmt_rule *)o;
PyObject_GC_UnTrack(o);
Py_CLEAR(p->__pyx_v_a);
Py_CLEAR(p->__pyx_v_self);
- if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule)))) {
- __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule *)o);
+ if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_25_fmt_rule < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_fmt_rule)))) {
+ __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_25_fmt_rule[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_25_fmt_rule++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_fmt_rule *)o);
} else {
(*Py_TYPE(o)->tp_free)(o);
}
}
-static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule(PyObject *o, visitproc v, void *a) {
+static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_25_fmt_rule(PyObject *o, visitproc v, void *a) {
int e;
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule *)o;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_fmt_rule *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_fmt_rule *)o;
if (p->__pyx_v_a) {
e = (*v)(p->__pyx_v_a, a); if (e) return e;
}
@@ -80468,9 +81124,9 @@ static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule(PyObj
return 0;
}
-static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule(PyObject *o) {
+static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_25_fmt_rule(PyObject *o) {
PyObject* tmp;
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule *)o;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_fmt_rule *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_fmt_rule *)o;
tmp = ((PyObject*)p->__pyx_v_a);
p->__pyx_v_a = Py_None; Py_INCREF(Py_None);
Py_XDECREF(tmp);
@@ -80480,12 +81136,12 @@ static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule(PyObject
return 0;
}
-static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule = {
+static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_25_fmt_rule = {
PyVarObject_HEAD_INIT(0, 0)
- "cdec.sa._sa.__pyx_scope_struct_24_fmt_rule", /*tp_name*/
- sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule), /*tp_basicsize*/
+ "cdec.sa._sa.__pyx_scope_struct_25_fmt_rule", /*tp_name*/
+ sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_fmt_rule), /*tp_basicsize*/
0, /*tp_itemsize*/
- __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule, /*tp_dealloc*/
+ __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_25_fmt_rule, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
@@ -80506,8 +81162,8 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule = {
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
- __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule, /*tp_traverse*/
- __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule, /*tp_clear*/
+ __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_25_fmt_rule, /*tp_traverse*/
+ __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_25_fmt_rule, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
@@ -80522,7 +81178,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule = {
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
- __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule, /*tp_new*/
+ __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_25_fmt_rule, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
@@ -80537,14 +81193,14 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule = {
#endif
};
-static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr[8];
-static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr = 0;
+static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_genexpr *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_26_genexpr[8];
+static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_26_genexpr = 0;
-static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_26_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
PyObject *o;
- if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr)))) {
- o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr];
- memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr));
+ if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_26_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_genexpr)))) {
+ o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_26_genexpr[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_26_genexpr];
+ memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_genexpr));
(void) PyObject_INIT(o, t);
PyObject_GC_Track(o);
} else {
@@ -80554,22 +81210,22 @@ static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr(PyTyp
return o;
}
-static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr(PyObject *o) {
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr *)o;
+static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_26_genexpr(PyObject *o) {
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_genexpr *)o;
PyObject_GC_UnTrack(o);
Py_CLEAR(p->__pyx_outer_scope);
Py_CLEAR(p->__pyx_v_packed);
Py_CLEAR(p->__pyx_t_0);
- if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr)))) {
- __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr *)o);
+ if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_26_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_genexpr)))) {
+ __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_26_genexpr[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_26_genexpr++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_genexpr *)o);
} else {
(*Py_TYPE(o)->tp_free)(o);
}
}
-static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr(PyObject *o, visitproc v, void *a) {
+static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_26_genexpr(PyObject *o, visitproc v, void *a) {
int e;
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr *)o;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_genexpr *)o;
if (p->__pyx_outer_scope) {
e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
}
@@ -80582,11 +81238,11 @@ static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr(PyObje
return 0;
}
-static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr(PyObject *o) {
+static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_26_genexpr(PyObject *o) {
PyObject* tmp;
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr *)o;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_genexpr *)o;
tmp = ((PyObject*)p->__pyx_outer_scope);
- p->__pyx_outer_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule *)Py_None); Py_INCREF(Py_None);
+ p->__pyx_outer_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_fmt_rule *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
tmp = ((PyObject*)p->__pyx_v_packed);
p->__pyx_v_packed = Py_None; Py_INCREF(Py_None);
@@ -80597,12 +81253,12 @@ static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr(PyObject
return 0;
}
-static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr = {
+static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_26_genexpr = {
PyVarObject_HEAD_INIT(0, 0)
- "cdec.sa._sa.__pyx_scope_struct_25_genexpr", /*tp_name*/
- sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr), /*tp_basicsize*/
+ "cdec.sa._sa.__pyx_scope_struct_26_genexpr", /*tp_name*/
+ sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_genexpr), /*tp_basicsize*/
0, /*tp_itemsize*/
- __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr, /*tp_dealloc*/
+ __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_26_genexpr, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
@@ -80623,8 +81279,8 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr = {
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
- __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr, /*tp_traverse*/
- __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr, /*tp_clear*/
+ __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_26_genexpr, /*tp_traverse*/
+ __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_26_genexpr, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
@@ -80639,7 +81295,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr = {
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
- __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr, /*tp_new*/
+ __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_26_genexpr, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
@@ -80654,14 +81310,14 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr = {
#endif
};
-static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases[8];
-static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases = 0;
+static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27_get_f_phrases *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_27_get_f_phrases[8];
+static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_27_get_f_phrases = 0;
-static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_27_get_f_phrases(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
PyObject *o;
- if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases)))) {
- o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases];
- memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases));
+ if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_27_get_f_phrases > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27_get_f_phrases)))) {
+ o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_27_get_f_phrases[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_27_get_f_phrases];
+ memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27_get_f_phrases));
(void) PyObject_INIT(o, t);
PyObject_GC_Track(o);
} else {
@@ -80671,23 +81327,23 @@ static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases
return o;
}
-static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases(PyObject *o) {
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases *)o;
+static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_27_get_f_phrases(PyObject *o) {
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27_get_f_phrases *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27_get_f_phrases *)o;
PyObject_GC_UnTrack(o);
Py_CLEAR(p->__pyx_v_extract);
Py_CLEAR(p->__pyx_v_f_words);
Py_CLEAR(p->__pyx_v_phrases);
Py_CLEAR(p->__pyx_v_self);
- if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases)))) {
- __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases *)o);
+ if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_27_get_f_phrases < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27_get_f_phrases)))) {
+ __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_27_get_f_phrases[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_27_get_f_phrases++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27_get_f_phrases *)o);
} else {
(*Py_TYPE(o)->tp_free)(o);
}
}
-static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases(PyObject *o, visitproc v, void *a) {
+static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_27_get_f_phrases(PyObject *o, visitproc v, void *a) {
int e;
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases *)o;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27_get_f_phrases *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27_get_f_phrases *)o;
if (p->__pyx_v_extract) {
e = (*v)(p->__pyx_v_extract, a); if (e) return e;
}
@@ -80703,9 +81359,9 @@ static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases(
return 0;
}
-static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases(PyObject *o) {
+static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_27_get_f_phrases(PyObject *o) {
PyObject* tmp;
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases *)o;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27_get_f_phrases *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27_get_f_phrases *)o;
tmp = ((PyObject*)p->__pyx_v_extract);
p->__pyx_v_extract = Py_None; Py_INCREF(Py_None);
Py_XDECREF(tmp);
@@ -80721,12 +81377,12 @@ static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases(PyO
return 0;
}
-static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases = {
+static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_27_get_f_phrases = {
PyVarObject_HEAD_INIT(0, 0)
- "cdec.sa._sa.__pyx_scope_struct_26_get_f_phrases", /*tp_name*/
- sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases), /*tp_basicsize*/
+ "cdec.sa._sa.__pyx_scope_struct_27_get_f_phrases", /*tp_name*/
+ sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27_get_f_phrases), /*tp_basicsize*/
0, /*tp_itemsize*/
- __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases, /*tp_dealloc*/
+ __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_27_get_f_phrases, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
@@ -80747,8 +81403,8 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrase
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
- __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases, /*tp_traverse*/
- __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases, /*tp_clear*/
+ __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_27_get_f_phrases, /*tp_traverse*/
+ __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_27_get_f_phrases, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
@@ -80763,7 +81419,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrase
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
- __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases, /*tp_new*/
+ __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_27_get_f_phrases, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
@@ -80778,14 +81434,14 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrase
#endif
};
-static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__[8];
-static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ = 0;
+static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___iter__ *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_28___iter__[8];
+static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_28___iter__ = 0;
-static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_28___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
PyObject *o;
- if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__)))) {
- o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__];
- memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__));
+ if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_28___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___iter__)))) {
+ o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_28___iter__[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_28___iter__];
+ memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___iter__));
(void) PyObject_INIT(o, t);
PyObject_GC_Track(o);
} else {
@@ -80795,41 +81451,41 @@ static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__(PyTy
return o;
}
-static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__(PyObject *o) {
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ *)o;
+static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_28___iter__(PyObject *o) {
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___iter__ *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___iter__ *)o;
PyObject_GC_UnTrack(o);
Py_CLEAR(p->__pyx_v_self);
- if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__)))) {
- __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ *)o);
+ if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_28___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___iter__)))) {
+ __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_28___iter__[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_28___iter__++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___iter__ *)o);
} else {
(*Py_TYPE(o)->tp_free)(o);
}
}
-static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__(PyObject *o, visitproc v, void *a) {
+static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_28___iter__(PyObject *o, visitproc v, void *a) {
int e;
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ *)o;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___iter__ *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___iter__ *)o;
if (p->__pyx_v_self) {
e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
}
return 0;
}
-static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__(PyObject *o) {
+static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_28___iter__(PyObject *o) {
PyObject* tmp;
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ *)o;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___iter__ *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___iter__ *)o;
tmp = ((PyObject*)p->__pyx_v_self);
p->__pyx_v_self = ((struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
return 0;
}
-static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ = {
+static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_28___iter__ = {
PyVarObject_HEAD_INIT(0, 0)
- "cdec.sa._sa.__pyx_scope_struct_27___iter__", /*tp_name*/
- sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__), /*tp_basicsize*/
+ "cdec.sa._sa.__pyx_scope_struct_28___iter__", /*tp_name*/
+ sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___iter__), /*tp_basicsize*/
0, /*tp_itemsize*/
- __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__, /*tp_dealloc*/
+ __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_28___iter__, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
@@ -80850,8 +81506,8 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ = {
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
- __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__, /*tp_traverse*/
- __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__, /*tp_clear*/
+ __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_28___iter__, /*tp_traverse*/
+ __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_28___iter__, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
@@ -80866,7 +81522,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ = {
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
- __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__, /*tp_new*/
+ __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_28___iter__, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
@@ -80881,14 +81537,14 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ = {
#endif
};
-static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_28___str__[8];
-static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ = 0;
+static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29___str__ *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_29___str__[8];
+static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_29___str__ = 0;
-static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_28___str__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_29___str__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
PyObject *o;
- if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___str__)))) {
- o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_28___str__[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_28___str__];
- memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___str__));
+ if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_29___str__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29___str__)))) {
+ o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_29___str__[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_29___str__];
+ memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29___str__));
(void) PyObject_INIT(o, t);
PyObject_GC_Track(o);
} else {
@@ -80898,41 +81554,41 @@ static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_28___str__(PyTyp
return o;
}
-static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_28___str__(PyObject *o) {
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ *)o;
+static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_29___str__(PyObject *o) {
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29___str__ *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29___str__ *)o;
PyObject_GC_UnTrack(o);
Py_CLEAR(p->__pyx_v_self);
- if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___str__)))) {
- __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_28___str__[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_28___str__++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ *)o);
+ if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_29___str__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29___str__)))) {
+ __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_29___str__[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_29___str__++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29___str__ *)o);
} else {
(*Py_TYPE(o)->tp_free)(o);
}
}
-static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_28___str__(PyObject *o, visitproc v, void *a) {
+static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_29___str__(PyObject *o, visitproc v, void *a) {
int e;
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ *)o;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29___str__ *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29___str__ *)o;
if (p->__pyx_v_self) {
e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
}
return 0;
}
-static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_28___str__(PyObject *o) {
+static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_29___str__(PyObject *o) {
PyObject* tmp;
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ *)o;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29___str__ *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29___str__ *)o;
tmp = ((PyObject*)p->__pyx_v_self);
p->__pyx_v_self = ((struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
return 0;
}
-static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ = {
+static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_29___str__ = {
PyVarObject_HEAD_INIT(0, 0)
- "cdec.sa._sa.__pyx_scope_struct_28___str__", /*tp_name*/
- sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___str__), /*tp_basicsize*/
+ "cdec.sa._sa.__pyx_scope_struct_29___str__", /*tp_name*/
+ sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29___str__), /*tp_basicsize*/
0, /*tp_itemsize*/
- __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_28___str__, /*tp_dealloc*/
+ __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_29___str__, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
@@ -80953,8 +81609,8 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ = {
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
- __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_28___str__, /*tp_traverse*/
- __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_28___str__, /*tp_clear*/
+ __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_29___str__, /*tp_traverse*/
+ __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_29___str__, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
@@ -80969,7 +81625,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ = {
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
- __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_28___str__, /*tp_new*/
+ __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_29___str__, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
@@ -80984,14 +81640,14 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ = {
#endif
};
-static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr[8];
-static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr = 0;
+static struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_30_genexpr *__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_30_genexpr[8];
+static int __pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_30_genexpr = 0;
-static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_30_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
PyObject *o;
- if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr)))) {
- o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr];
- memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr));
+ if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_30_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_30_genexpr)))) {
+ o = (PyObject*)__pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_30_genexpr[--__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_30_genexpr];
+ memset(o, 0, sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_30_genexpr));
(void) PyObject_INIT(o, t);
PyObject_GC_Track(o);
} else {
@@ -81001,22 +81657,22 @@ static PyObject *__pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr(PyTyp
return o;
}
-static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr(PyObject *o) {
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr *)o;
+static void __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_30_genexpr(PyObject *o) {
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_30_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_30_genexpr *)o;
PyObject_GC_UnTrack(o);
Py_CLEAR(p->__pyx_outer_scope);
Py_CLEAR(p->__pyx_v_feat);
Py_CLEAR(p->__pyx_t_0);
- if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr)))) {
- __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr *)o);
+ if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_30_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_30_genexpr)))) {
+ __pyx_freelist_4cdec_2sa_3_sa___pyx_scope_struct_30_genexpr[__pyx_freecount_4cdec_2sa_3_sa___pyx_scope_struct_30_genexpr++] = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_30_genexpr *)o);
} else {
(*Py_TYPE(o)->tp_free)(o);
}
}
-static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr(PyObject *o, visitproc v, void *a) {
+static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_30_genexpr(PyObject *o, visitproc v, void *a) {
int e;
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr *)o;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_30_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_30_genexpr *)o;
if (p->__pyx_outer_scope) {
e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
}
@@ -81029,11 +81685,11 @@ static int __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr(PyObje
return 0;
}
-static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr(PyObject *o) {
+static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_30_genexpr(PyObject *o) {
PyObject* tmp;
- struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr *)o;
+ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_30_genexpr *p = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_30_genexpr *)o;
tmp = ((PyObject*)p->__pyx_outer_scope);
- p->__pyx_outer_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ *)Py_None); Py_INCREF(Py_None);
+ p->__pyx_outer_scope = ((struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29___str__ *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
tmp = ((PyObject*)p->__pyx_v_feat);
p->__pyx_v_feat = Py_None; Py_INCREF(Py_None);
@@ -81044,12 +81700,12 @@ static int __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr(PyObject
return 0;
}
-static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr = {
+static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_30_genexpr = {
PyVarObject_HEAD_INIT(0, 0)
- "cdec.sa._sa.__pyx_scope_struct_29_genexpr", /*tp_name*/
- sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr), /*tp_basicsize*/
+ "cdec.sa._sa.__pyx_scope_struct_30_genexpr", /*tp_name*/
+ sizeof(struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_30_genexpr), /*tp_basicsize*/
0, /*tp_itemsize*/
- __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr, /*tp_dealloc*/
+ __pyx_tp_dealloc_4cdec_2sa_3_sa___pyx_scope_struct_30_genexpr, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
@@ -81070,8 +81726,8 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr = {
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
- __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr, /*tp_traverse*/
- __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr, /*tp_clear*/
+ __pyx_tp_traverse_4cdec_2sa_3_sa___pyx_scope_struct_30_genexpr, /*tp_traverse*/
+ __pyx_tp_clear_4cdec_2sa_3_sa___pyx_scope_struct_30_genexpr, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
@@ -81086,7 +81742,7 @@ static PyTypeObject __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr = {
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
- __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr, /*tp_new*/
+ __pyx_tp_new_4cdec_2sa_3_sa___pyx_scope_struct_30_genexpr, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
@@ -81166,6 +81822,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_kp_s_No_aligned_terminals, __pyx_k_No_aligned_terminals, sizeof(__pyx_k_No_aligned_terminals), 0, 0, 1, 0},
{&__pyx_n_s_OnlineFeatureContext, __pyx_k_OnlineFeatureContext, sizeof(__pyx_k_OnlineFeatureContext), 0, 0, 1, 1},
{&__pyx_n_s_Phrase___iter, __pyx_k_Phrase___iter, sizeof(__pyx_k_Phrase___iter), 0, 0, 1, 1},
+ {&__pyx_n_s_Phrase_iterspans, __pyx_k_Phrase_iterspans, sizeof(__pyx_k_Phrase_iterspans), 0, 0, 1, 1},
{&__pyx_kp_s_Precomputation_done_with_max_ini, __pyx_k_Precomputation_done_with_max_ini, sizeof(__pyx_k_Precomputation_done_with_max_ini), 0, 0, 1, 0},
{&__pyx_kp_s_Precomputation_done_with_max_non, __pyx_k_Precomputation_done_with_max_non, sizeof(__pyx_k_Precomputation_done_with_max_non), 0, 0, 1, 0},
{&__pyx_kp_s_Precomputation_done_with_max_ter, __pyx_k_Precomputation_done_with_max_ter, sizeof(__pyx_k_Precomputation_done_with_max_ter), 0, 0, 1, 0},
@@ -81195,6 +81852,9 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_kp_s_Unable_to_extract_basic_phrase, __pyx_k_Unable_to_extract_basic_phrase, sizeof(__pyx_k_Unable_to_extract_basic_phrase), 0, 0, 1, 0},
{&__pyx_kp_s_Unaligned_chunk, __pyx_k_Unaligned_chunk, sizeof(__pyx_k_Unaligned_chunk), 0, 0, 1, 0},
{&__pyx_kp_s_Unexpected_condition_found_in_q3, __pyx_k_Unexpected_condition_found_in_q3, sizeof(__pyx_k_Unexpected_condition_found_in_q3), 0, 0, 1, 0},
+ {&__pyx_kp_s_Users_waziz_workspace_mtm14_my, __pyx_k_Users_waziz_workspace_mtm14_my, sizeof(__pyx_k_Users_waziz_workspace_mtm14_my), 0, 0, 1, 0},
+ {&__pyx_kp_s_Users_waziz_workspace_mtm14_my_2, __pyx_k_Users_waziz_workspace_mtm14_my_2, sizeof(__pyx_k_Users_waziz_workspace_mtm14_my_2), 0, 0, 1, 0},
+ {&__pyx_kp_s_Users_waziz_workspace_mtm14_my_3, __pyx_k_Users_waziz_workspace_mtm14_my_3, sizeof(__pyx_k_Users_waziz_workspace_mtm14_my_3), 0, 0, 1, 0},
{&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
{&__pyx_kp_s_X, __pyx_k_X, sizeof(__pyx_k_X), 0, 0, 1, 0},
{&__pyx_kp_s_X_0_1_2, __pyx_k_X_0_1_2, sizeof(__pyx_k_X_0_1_2), 0, 0, 1, 0},
@@ -81340,6 +82000,9 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s_isvar, __pyx_k_isvar, sizeof(__pyx_k_isvar), 0, 0, 1, 1},
{&__pyx_n_s_iter, __pyx_k_iter, sizeof(__pyx_k_iter), 0, 0, 1, 1},
{&__pyx_n_s_iteritems, __pyx_k_iteritems, sizeof(__pyx_k_iteritems), 0, 0, 1, 1},
+ {&__pyx_n_s_iterspans, __pyx_k_iterspans, sizeof(__pyx_k_iterspans), 0, 0, 1, 1},
+ {&__pyx_n_s_iterspans_locals_lambda, __pyx_k_iterspans_locals_lambda, sizeof(__pyx_k_iterspans_locals_lambda), 0, 0, 1, 1},
+ {&__pyx_n_s_iterspans_locals_lambda_locals_l, __pyx_k_iterspans_locals_lambda_locals_l, sizeof(__pyx_k_iterspans_locals_lambda_locals_l), 0, 0, 1, 1},
{&__pyx_n_s_itertools, __pyx_k_itertools, sizeof(__pyx_k_itertools), 0, 0, 1, 1},
{&__pyx_n_s_itervalues, __pyx_k_itervalues, sizeof(__pyx_k_itervalues), 0, 0, 1, 1},
{&__pyx_n_s_ito, __pyx_k_ito, sizeof(__pyx_k_ito), 0, 0, 1, 1},
@@ -81389,6 +82052,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s_next_states, __pyx_k_next_states, sizeof(__pyx_k_next_states), 0, 0, 1, 1},
{&__pyx_n_s_nt, __pyx_k_nt, sizeof(__pyx_k_nt), 0, 0, 1, 1},
{&__pyx_n_s_nt_collision, __pyx_k_nt_collision, sizeof(__pyx_k_nt_collision), 0, 0, 1, 1},
+ {&__pyx_n_s_nt_flag, __pyx_k_nt_flag, sizeof(__pyx_k_nt_flag), 0, 0, 1, 1},
{&__pyx_n_s_nt_open, __pyx_k_nt_open, sizeof(__pyx_k_nt_open), 0, 0, 1, 1},
{&__pyx_n_s_ntc, __pyx_k_ntc, sizeof(__pyx_k_ntc), 0, 0, 1, 1},
{&__pyx_n_s_num_subpatterns, __pyx_k_num_subpatterns, sizeof(__pyx_k_num_subpatterns), 0, 0, 1, 1},
@@ -81476,6 +82140,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1},
{&__pyx_n_s_tight_phrases, __pyx_k_tight_phrases, sizeof(__pyx_k_tight_phrases), 0, 0, 1, 1},
{&__pyx_n_s_toMap, __pyx_k_toMap, sizeof(__pyx_k_toMap), 0, 0, 1, 1},
+ {&__pyx_n_s_to_str, __pyx_k_to_str, sizeof(__pyx_k_to_str), 0, 0, 1, 1},
{&__pyx_n_s_train_max_initial_size, __pyx_k_train_max_initial_size, sizeof(__pyx_k_train_max_initial_size), 0, 0, 1, 1},
{&__pyx_n_s_train_min_gap_size, __pyx_k_train_min_gap_size, sizeof(__pyx_k_train_min_gap_size), 0, 0, 1, 1},
{&__pyx_n_s_unlink, __pyx_k_unlink, sizeof(__pyx_k_unlink), 0, 0, 1, 1},
@@ -81484,9 +82149,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s_use_collocations, __pyx_k_use_collocations, sizeof(__pyx_k_use_collocations), 0, 0, 1, 1},
{&__pyx_n_s_use_index, __pyx_k_use_index, sizeof(__pyx_k_use_index), 0, 0, 1, 1},
{&__pyx_n_s_use_sent_id, __pyx_k_use_sent_id, sizeof(__pyx_k_use_sent_id), 0, 0, 1, 1},
- {&__pyx_kp_s_usr0_home_cdyer_cdec_python_cde, __pyx_k_usr0_home_cdyer_cdec_python_cde, sizeof(__pyx_k_usr0_home_cdyer_cdec_python_cde), 0, 0, 1, 0},
- {&__pyx_kp_s_usr0_home_cdyer_cdec_python_cde_2, __pyx_k_usr0_home_cdyer_cdec_python_cde_2, sizeof(__pyx_k_usr0_home_cdyer_cdec_python_cde_2), 0, 0, 1, 0},
- {&__pyx_kp_s_usr0_home_cdyer_cdec_python_cde_3, __pyx_k_usr0_home_cdyer_cdec_python_cde_3, sizeof(__pyx_k_usr0_home_cdyer_cdec_python_cde_3), 0, 0, 1, 0},
{&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
{&__pyx_n_s_vec, __pyx_k_vec, sizeof(__pyx_k_vec), 0, 0, 1, 1},
{&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1},
@@ -81515,7 +82177,7 @@ static int __Pyx_InitCachedBuiltins(void) {
__pyx_builtin_Exception = __Pyx_GetBuiltinName(__pyx_n_s_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_cmp = __Pyx_GetBuiltinName(__pyx_n_s_cmp); if (!__pyx_builtin_cmp) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_cmp = __Pyx_GetBuiltinName(__pyx_n_s_cmp); if (!__pyx_builtin_cmp) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_builtin_sorted = __Pyx_GetBuiltinName(__pyx_n_s_sorted); if (!__pyx_builtin_sorted) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_n_s_max); if (!__pyx_builtin_max) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
return 0;
@@ -81527,7 +82189,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
- /* "data_array.pxi":20
+ /* "cdec/sa/data_array.pxi":20
* self.word2id = {"END_OF_FILE":0, "END_OF_LINE":1}
* self.id2word = ["END_OF_FILE", "END_OF_LINE"]
* self.data = IntList(1000,1000) # <<<<<<<<<<<<<<
@@ -81538,7 +82200,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__3);
__Pyx_GIVEREF(__pyx_tuple__3);
- /* "data_array.pxi":21
+ /* "cdec/sa/data_array.pxi":21
* self.id2word = ["END_OF_FILE", "END_OF_LINE"]
* self.data = IntList(1000,1000)
* self.sent_id = IntList(1000,1000) # <<<<<<<<<<<<<<
@@ -81549,7 +82211,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__4);
__Pyx_GIVEREF(__pyx_tuple__4);
- /* "data_array.pxi":22
+ /* "cdec/sa/data_array.pxi":22
* self.data = IntList(1000,1000)
* self.sent_id = IntList(1000,1000)
* self.sent_index = IntList(1000,1000) # <<<<<<<<<<<<<<
@@ -81560,7 +82222,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__5);
__Pyx_GIVEREF(__pyx_tuple__5);
- /* "data_array.pxi":66
+ /* "cdec/sa/data_array.pxi":66
* f.write("%s " % self.get_word(w_id))
* if w_id == 1:
* f.write("\n") # <<<<<<<<<<<<<<
@@ -81571,7 +82233,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__7);
__Pyx_GIVEREF(__pyx_tuple__7);
- /* "data_array.pxi":61
+ /* "cdec/sa/data_array.pxi":61
*
* def write_text(self, char* filename):
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -81582,7 +82244,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__8);
__Pyx_GIVEREF(__pyx_tuple__8);
- /* "data_array.pxi":69
+ /* "cdec/sa/data_array.pxi":69
*
* def read_text(self, char* filename):
* with gzip_or_text(filename) as fp: # <<<<<<<<<<<<<<
@@ -81593,7 +82255,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__9);
__Pyx_GIVEREF(__pyx_tuple__9);
- /* "data_array.pxi":74
+ /* "cdec/sa/data_array.pxi":74
* def read_bitext(self, char* filename, int side):
* with gzip_or_text(filename) as fp:
* data = (line.split(' ||| ')[side] for line in fp) # <<<<<<<<<<<<<<
@@ -81604,7 +82266,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__11);
__Pyx_GIVEREF(__pyx_tuple__11);
- /* "data_array.pxi":73
+ /* "cdec/sa/data_array.pxi":73
*
* def read_bitext(self, char* filename, int side):
* with gzip_or_text(filename) as fp: # <<<<<<<<<<<<<<
@@ -81615,7 +82277,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__12);
__Pyx_GIVEREF(__pyx_tuple__12);
- /* "data_array.pxi":130
+ /* "cdec/sa/data_array.pxi":130
* num_words = len(self.id2word) - 2
* fwrite(&(num_words), sizeof(int), 1, f)
* for word in self.id2word[2:]: # <<<<<<<<<<<<<<
@@ -81626,7 +82288,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_slice__13);
__Pyx_GIVEREF(__pyx_slice__13);
- /* "data_array.pxi":144
+ /* "cdec/sa/data_array.pxi":144
* for i in self.data:
* f.write("%d " %i)
* f.write("\n") # <<<<<<<<<<<<<<
@@ -81637,7 +82299,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__14);
__Pyx_GIVEREF(__pyx_tuple__14);
- /* "data_array.pxi":147
+ /* "cdec/sa/data_array.pxi":147
* for i in self.sent_index:
* f.write("%d " %i)
* f.write("\n") # <<<<<<<<<<<<<<
@@ -81648,7 +82310,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__15);
__Pyx_GIVEREF(__pyx_tuple__15);
- /* "data_array.pxi":150
+ /* "cdec/sa/data_array.pxi":150
* for i in self.sent_id:
* f.write("%d " %i)
* f.write("\n") # <<<<<<<<<<<<<<
@@ -81659,7 +82321,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__16);
__Pyx_GIVEREF(__pyx_tuple__16);
- /* "data_array.pxi":153
+ /* "cdec/sa/data_array.pxi":153
* for word in self.id2word:
* f.write("%s %d " % (word, self.word2id[word]))
* f.write("\n") # <<<<<<<<<<<<<<
@@ -81670,7 +82332,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__17);
__Pyx_GIVEREF(__pyx_tuple__17);
- /* "data_array.pxi":156
+ /* "cdec/sa/data_array.pxi":156
*
* def write_enhanced(self, char* filename):
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -81680,7 +82342,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__18);
__Pyx_GIVEREF(__pyx_tuple__18);
- /* "alignment.pxi":48
+ /* "cdec/sa/alignment.pxi":48
*
* def __cinit__(self, from_binary=None, from_text=None):
* self.links = IntList(1000,1000) # <<<<<<<<<<<<<<
@@ -81691,7 +82353,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__19);
__Pyx_GIVEREF(__pyx_tuple__19);
- /* "alignment.pxi":49
+ /* "cdec/sa/alignment.pxi":49
* def __cinit__(self, from_binary=None, from_text=None):
* self.links = IntList(1000,1000)
* self.sent_index = IntList(1000,1000) # <<<<<<<<<<<<<<
@@ -81702,7 +82364,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__20);
__Pyx_GIVEREF(__pyx_tuple__20);
- /* "alignment.pxi":61
+ /* "cdec/sa/alignment.pxi":61
* pairs = line.split()
* for pair in pairs:
* (i, j) = map(int, pair.split('-')) # <<<<<<<<<<<<<<
@@ -81713,7 +82375,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__22);
__Pyx_GIVEREF(__pyx_tuple__22);
- /* "alignment.pxi":56
+ /* "cdec/sa/alignment.pxi":56
*
* def read_text(self, char* filename):
* with gzip_or_text(filename) as f: # <<<<<<<<<<<<<<
@@ -81724,7 +82386,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__23);
__Pyx_GIVEREF(__pyx_tuple__23);
- /* "alignment.pxi":77
+ /* "cdec/sa/alignment.pxi":77
* for i, link in enumerate(self.links):
* while i >= self.sent_index[sent_num]:
* f.write("\n") # <<<<<<<<<<<<<<
@@ -81735,7 +82397,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__24);
__Pyx_GIVEREF(__pyx_tuple__24);
- /* "alignment.pxi":80
+ /* "cdec/sa/alignment.pxi":80
* sent_num = sent_num + 1
* f.write("%d-%d " % self.unlink(link))
* f.write("\n") # <<<<<<<<<<<<<<
@@ -81746,7 +82408,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__25);
__Pyx_GIVEREF(__pyx_tuple__25);
- /* "alignment.pxi":73
+ /* "cdec/sa/alignment.pxi":73
*
* def write_text(self, char* filename):
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -81757,7 +82419,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__26);
__Pyx_GIVEREF(__pyx_tuple__26);
- /* "alignment.pxi":93
+ /* "cdec/sa/alignment.pxi":93
* for link in self.links:
* f.write("%d " % link)
* f.write("\n") # <<<<<<<<<<<<<<
@@ -81768,7 +82430,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__27);
__Pyx_GIVEREF(__pyx_tuple__27);
- /* "alignment.pxi":96
+ /* "cdec/sa/alignment.pxi":96
* for i in self.sent_index:
* f.write("%d " % i)
* f.write("\n") # <<<<<<<<<<<<<<
@@ -81779,7 +82441,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__28);
__Pyx_GIVEREF(__pyx_tuple__28);
- /* "alignment.pxi":90
+ /* "cdec/sa/alignment.pxi":90
*
* def write_enhanced(self, char* filename):
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -81790,7 +82452,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__29);
__Pyx_GIVEREF(__pyx_tuple__29);
- /* "bilex.pxi":312
+ /* "cdec/sa/bilex.pxi":312
*
* # Re-read file, placing words into buckets
* f.seek(0) # <<<<<<<<<<<<<<
@@ -81801,7 +82463,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__30);
__Pyx_GIVEREF(__pyx_tuple__30);
- /* "bilex.pxi":288
+ /* "cdec/sa/bilex.pxi":288
*
* fcount = IntList()
* with gzip_or_text(filename) as f: # <<<<<<<<<<<<<<
@@ -81812,7 +82474,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__31);
__Pyx_GIVEREF(__pyx_tuple__31);
- /* "bilex.pxi":354
+ /* "cdec/sa/bilex.pxi":354
*
* if i > j:
* raise Exception("Sort error in CLex") # <<<<<<<<<<<<<<
@@ -81823,7 +82485,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__33);
__Pyx_GIVEREF(__pyx_tuple__33);
- /* "bilex.pxi":377
+ /* "cdec/sa/bilex.pxi":377
* for i in self.f_index:
* f.write("%d " % i)
* f.write("\n") # <<<<<<<<<<<<<<
@@ -81834,7 +82496,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__35);
__Pyx_GIVEREF(__pyx_tuple__35);
- /* "bilex.pxi":380
+ /* "cdec/sa/bilex.pxi":380
* for i, s1, s2 in zip(self.e_index, self.col1, self.col2):
* f.write("%d %f %f " % (i, s1, s2))
* f.write("\n") # <<<<<<<<<<<<<<
@@ -81845,7 +82507,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__36);
__Pyx_GIVEREF(__pyx_tuple__36);
- /* "bilex.pxi":383
+ /* "cdec/sa/bilex.pxi":383
* for i, w in enumerate(self.id2fword):
* f.write("%d %s " % (i, w))
* f.write("\n") # <<<<<<<<<<<<<<
@@ -81856,7 +82518,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__37);
__Pyx_GIVEREF(__pyx_tuple__37);
- /* "bilex.pxi":386
+ /* "cdec/sa/bilex.pxi":386
* for i, w in enumerate(self.id2eword):
* f.write("%d %s " % (i, w))
* f.write("\n") # <<<<<<<<<<<<<<
@@ -81867,7 +82529,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__38);
__Pyx_GIVEREF(__pyx_tuple__38);
- /* "bilex.pxi":374
+ /* "cdec/sa/bilex.pxi":374
*
* def write_enhanced(self, char* filename):
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -81878,7 +82540,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__39);
__Pyx_GIVEREF(__pyx_tuple__39);
- /* "bilex.pxi":419
+ /* "cdec/sa/bilex.pxi":419
* cdef i, N, e_id, f_id
*
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -81889,7 +82551,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__40);
__Pyx_GIVEREF(__pyx_tuple__40);
- /* "lcp.pxi":13
+ /* "cdec/sa/lcp.pxi":13
* cdef IntList rank
*
* logger.info("Constructing LCP array") # <<<<<<<<<<<<<<
@@ -81900,7 +82562,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__43);
__Pyx_GIVEREF(__pyx_tuple__43);
- /* "lcp.pxi":34
+ /* "cdec/sa/lcp.pxi":34
* if h > 0:
* h = h-1
* logger.info("LCP array completed") # <<<<<<<<<<<<<<
@@ -81911,7 +82573,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__44);
__Pyx_GIVEREF(__pyx_tuple__44);
- /* "precomputation.pxi":297
+ /* "cdec/sa/precomputation.pxi":297
* pattern_rank = {}
*
* logger.info("Precomputing frequent intersections") # <<<<<<<<<<<<<<
@@ -81922,7 +82584,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__47);
__Pyx_GIVEREF(__pyx_tuple__47);
- /* "precomputation.pxi":314
+ /* "cdec/sa/precomputation.pxi":314
* queue = IntList(increment=1000)
*
* logger.info(" Computing inverted indexes...") # <<<<<<<<<<<<<<
@@ -81933,7 +82595,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__48);
__Pyx_GIVEREF(__pyx_tuple__48);
- /* "precomputation.pxi":329
+ /* "cdec/sa/precomputation.pxi":329
* trie_node_data_append(node, i)
*
* logger.info(" Computing collocations...") # <<<<<<<<<<<<<<
@@ -81944,7 +82606,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__49);
__Pyx_GIVEREF(__pyx_tuple__49);
- /* "precomputation.pxi":386
+ /* "cdec/sa/precomputation.pxi":386
* ptr1 = ptr1 + 1
*
* self.precomputed_collocations = collocations.toMap(False) # <<<<<<<<<<<<<<
@@ -81955,7 +82617,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__50);
__Pyx_GIVEREF(__pyx_tuple__50);
- /* "precomputation.pxi":387
+ /* "cdec/sa/precomputation.pxi":387
*
* self.precomputed_collocations = collocations.toMap(False)
* self.precomputed_index = frequent_patterns.toMap(True) # <<<<<<<<<<<<<<
@@ -81966,7 +82628,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__51);
__Pyx_GIVEREF(__pyx_tuple__51);
- /* "precomputation.pxi":393
+ /* "cdec/sa/precomputation.pxi":393
* for pattern2 in J_set:
* if len(pattern1) + len(pattern2) + 1 < self.max_length:
* combined_pattern = pattern1 + (-1,) + pattern2 # <<<<<<<<<<<<<<
@@ -81977,7 +82639,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__52);
__Pyx_GIVEREF(__pyx_tuple__52);
- /* "precomputation.pxi":400
+ /* "cdec/sa/precomputation.pxi":400
* x = x+1
* if len(pattern1) + len(pattern2) + 1 <= self.max_length:
* combined_pattern = pattern1 + (-1,) + pattern2 # <<<<<<<<<<<<<<
@@ -81988,7 +82650,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__53);
__Pyx_GIVEREF(__pyx_tuple__53);
- /* "precomputation.pxi":407
+ /* "cdec/sa/precomputation.pxi":407
* x = x+2
* if len(pattern1) + len(pattern2) + 1<= self.max_length:
* combined_pattern = pattern1 + (-1,) + pattern2 # <<<<<<<<<<<<<<
@@ -81999,7 +82661,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__54);
__Pyx_GIVEREF(__pyx_tuple__54);
- /* "precomputation.pxi":409
+ /* "cdec/sa/precomputation.pxi":409
* combined_pattern = pattern1 + (-1,) + pattern2
* IJ_set.add(combined_pattern)
* combined_pattern = pattern2 + (-1,) + pattern1 # <<<<<<<<<<<<<<
@@ -82010,7 +82672,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__55);
__Pyx_GIVEREF(__pyx_tuple__55);
- /* "suffix_array.pxi":94
+ /* "cdec/sa/suffix_array.pxi":94
*
* '''Step 3: read off suffix array from inverse suffix array'''
* logger.info(" Finalizing sort...") # <<<<<<<<<<<<<<
@@ -82021,7 +82683,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__56);
__Pyx_GIVEREF(__pyx_tuple__56);
- /* "suffix_array.pxi":193
+ /* "cdec/sa/suffix_array.pxi":193
* for a_i in self.sa:
* f.write("%d " % a_i)
* f.write("\n") # <<<<<<<<<<<<<<
@@ -82032,7 +82694,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__57);
__Pyx_GIVEREF(__pyx_tuple__57);
- /* "suffix_array.pxi":196
+ /* "cdec/sa/suffix_array.pxi":196
* for w_i in self.ha:
* f.write("%d " % w_i)
* f.write("\n") # <<<<<<<<<<<<<<
@@ -82043,7 +82705,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__58);
__Pyx_GIVEREF(__pyx_tuple__58);
- /* "suffix_array.pxi":189
+ /* "cdec/sa/suffix_array.pxi":189
*
* def write_enhanced(self, char* filename):
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -82054,7 +82716,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__59);
__Pyx_GIVEREF(__pyx_tuple__59);
- /* "rulefactory.pxi":140
+ /* "cdec/sa/rulefactory.pxi":140
* logger.info("Sampling strategy: uniform, max sample size = %d", sample_size)
* else:
* logger.info("Sampling strategy: no sampling") # <<<<<<<<<<<<<<
@@ -82065,7 +82727,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__60);
__Pyx_GIVEREF(__pyx_tuple__60);
- /* "rulefactory.pxi":353
+ /* "cdec/sa/rulefactory.pxi":353
* respectively. This is because Chiang's model does not require
* them to be the same, therefore we don't either.'''
* self.rules = TrieTable(True) # cache # <<<<<<<<<<<<<<
@@ -82076,7 +82738,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__61);
__Pyx_GIVEREF(__pyx_tuple__61);
- /* "rulefactory.pxi":356
+ /* "cdec/sa/rulefactory.pxi":356
* self.rules.root = ExtendedTrieNode(phrase_location=PhraseLocation())
* if alignment is None:
* raise Exception("Must specify an alignment object") # <<<<<<<<<<<<<<
@@ -82087,7 +82749,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__62);
__Pyx_GIVEREF(__pyx_tuple__62);
- /* "rulefactory.pxi":1072
+ /* "cdec/sa/rulefactory.pxi":1072
* else:
* #ERROR: We never get here
* raise Exception("Keyword trie error") # <<<<<<<<<<<<<<
@@ -82098,7 +82760,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__66);
__Pyx_GIVEREF(__pyx_tuple__66);
- /* "rulefactory.pxi":2003
+ /* "cdec/sa/rulefactory.pxi":2003
* if nt and nt[-1][2] == f_j - 1:
* # Add to non-terminal, checking for collisions
* old_last_nt = nt[-1][:] # <<<<<<<<<<<<<<
@@ -82109,7 +82771,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_slice__67);
__Pyx_GIVEREF(__pyx_slice__67);
- /* "rulefactory.pxi":1940
+ /* "cdec/sa/rulefactory.pxi":1940
* # f_ i and j are current, e_ i and j are previous
* # We care _considering_ f_j, so it is not yet in counts
* def extract(f_i, f_j, e_i, e_j, min_bound, wc, links, nt, nt_open): # <<<<<<<<<<<<<<
@@ -82119,9 +82781,9 @@ static int __Pyx_InitCachedConstants(void) {
__pyx_tuple__68 = PyTuple_Pack(19, __pyx_n_s_f_i, __pyx_n_s_f_j, __pyx_n_s_e_i, __pyx_n_s_e_j, __pyx_n_s_min_bound, __pyx_n_s_wc, __pyx_n_s_links, __pyx_n_s_nt, __pyx_n_s_nt_open, __pyx_n_s_link_i, __pyx_n_s_link_j, __pyx_n_s_new_e_i, __pyx_n_s_new_e_j, __pyx_n_s_new_min_bound, __pyx_n_s_i, __pyx_n_s_nt_collision, __pyx_n_s_link, __pyx_n_s_plus_links, __pyx_n_s_old_last_nt); if (unlikely(!__pyx_tuple__68)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_tuple__68);
__Pyx_GIVEREF(__pyx_tuple__68);
- __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(9, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr0_home_cdyer_cdec_python_cde, __pyx_n_s_extract, 1940, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(9, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_waziz_workspace_mtm14_my, __pyx_n_s_extract, 1940, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "rulefactory.pxi":2062
+ /* "cdec/sa/rulefactory.pxi":2062
* # Update phrase counts
* for rule in rules:
* (f_ph, e_ph, al) = rule[:3] # <<<<<<<<<<<<<<
@@ -82132,7 +82794,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_slice__70);
__Pyx_GIVEREF(__pyx_slice__70);
- /* "rulefactory.pxi":2077
+ /* "cdec/sa/rulefactory.pxi":2077
* # Substitute in non-terminals
* nt_inv = sorted(nt, cmp=lambda x, y: cmp(x[3], y[3]))
* f_sym = list(f_span[:]) # <<<<<<<<<<<<<<
@@ -82143,7 +82805,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_slice__71);
__Pyx_GIVEREF(__pyx_slice__71);
- /* "rulefactory.pxi":2087
+ /* "cdec/sa/rulefactory.pxi":2087
* f_sym.insert(next_nt[1] - off, sym_setindex(self.category, next_nt[0]))
* off += (nt_len - 1)
* e_sym = list(e_span[:]) # <<<<<<<<<<<<<<
@@ -82154,7 +82816,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_slice__72);
__Pyx_GIVEREF(__pyx_slice__72);
- /* "rulefactory.pxi":2162
+ /* "cdec/sa/rulefactory.pxi":2162
* phrases = set() # (fphrase, lex_i, lex_j)
*
* def extract(f_i, f_j, lex_i, lex_j, wc, ntc, syms): # <<<<<<<<<<<<<<
@@ -82164,7 +82826,7 @@ static int __Pyx_InitCachedConstants(void) {
__pyx_tuple__73 = PyTuple_Pack(10, __pyx_n_s_f_i, __pyx_n_s_f_j, __pyx_n_s_lex_i, __pyx_n_s_lex_j, __pyx_n_s_wc, __pyx_n_s_ntc, __pyx_n_s_syms, __pyx_n_s_f, __pyx_n_s_new_lex_i, __pyx_n_s_new_lex_j); if (unlikely(!__pyx_tuple__73)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_tuple__73);
__Pyx_GIVEREF(__pyx_tuple__73);
- __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(7, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr0_home_cdyer_cdec_python_cde, __pyx_n_s_extract, 2162, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(7, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_waziz_workspace_mtm14_my, __pyx_n_s_extract, 2162, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
/* "cdec/sa/_sa.pyx":5
* import gzip
@@ -82173,7 +82835,7 @@ static int __Pyx_InitCachedConstants(void) {
* return (resource.getrusage(resource.RUSAGE_SELF).ru_utime+
* resource.getrusage(resource.RUSAGE_SELF).ru_stime)
*/
- __pyx_codeobj__75 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr0_home_cdyer_cdec_python_cde_2, __pyx_n_s_monitor_cpu, 5, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__75)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_codeobj__75 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_waziz_workspace_mtm14_my_2, __pyx_n_s_monitor_cpu, 5, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__75)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
/* "cdec/sa/_sa.pyx":9
* resource.getrusage(resource.RUSAGE_SELF).ru_stime)
@@ -82185,7 +82847,7 @@ static int __Pyx_InitCachedConstants(void) {
__pyx_tuple__76 = PyTuple_Pack(2, __pyx_n_s_filename, __pyx_n_s_filename); if (unlikely(!__pyx_tuple__76)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_tuple__76);
__Pyx_GIVEREF(__pyx_tuple__76);
- __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr0_home_cdyer_cdec_python_cde_2, __pyx_n_s_gzip_or_text, 9, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_waziz_workspace_mtm14_my_2, __pyx_n_s_gzip_or_text, 9, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
/* "cdec/sa/_sa.pyx":15
* return open(filename)
@@ -82198,7 +82860,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_tuple__78);
__Pyx_GIVEREF(__pyx_tuple__78);
- /* "sym.pxi":107
+ /* "cdec/sa/sym.pxi":107
* return ALPHABET.fromstring(string, terminal)
*
* def isvar(sym): # <<<<<<<<<<<<<<
@@ -82208,9 +82870,9 @@ static int __Pyx_InitCachedConstants(void) {
__pyx_tuple__79 = PyTuple_Pack(1, __pyx_n_s_sym); if (unlikely(!__pyx_tuple__79)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_tuple__79);
__Pyx_GIVEREF(__pyx_tuple__79);
- __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr0_home_cdyer_cdec_python_cde_3, __pyx_n_s_isvar, 107, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_waziz_workspace_mtm14_my_3, __pyx_n_s_isvar, 107, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "sym.pxi":110
+ /* "cdec/sa/sym.pxi":110
* return sym_isvar(sym)
*
* def make_lattice(words): # <<<<<<<<<<<<<<
@@ -82220,9 +82882,9 @@ static int __Pyx_InitCachedConstants(void) {
__pyx_tuple__81 = PyTuple_Pack(5, __pyx_n_s_words, __pyx_n_s_word_ids, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__81)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_tuple__81);
__Pyx_GIVEREF(__pyx_tuple__81);
- __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__81, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr0_home_cdyer_cdec_python_cde_3, __pyx_n_s_make_lattice, 110, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__81, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_waziz_workspace_mtm14_my_3, __pyx_n_s_make_lattice, 110, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "sym.pxi":114
+ /* "cdec/sa/sym.pxi":114
* return tuple(((word, None, 1), ) for word in word_ids)
*
* def decode_lattice(lattice): # <<<<<<<<<<<<<<
@@ -82232,9 +82894,9 @@ static int __Pyx_InitCachedConstants(void) {
__pyx_tuple__83 = PyTuple_Pack(3, __pyx_n_s_lattice, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__83)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_tuple__83);
__Pyx_GIVEREF(__pyx_tuple__83);
- __pyx_codeobj__84 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__83, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr0_home_cdyer_cdec_python_cde_3, __pyx_n_s_decode_lattice, 114, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_codeobj__84 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__83, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_waziz_workspace_mtm14_my_3, __pyx_n_s_decode_lattice, 114, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "sym.pxi":118
+ /* "cdec/sa/sym.pxi":118
* for arc in node for node in lattice)
*
* def decode_sentence(lattice): # <<<<<<<<<<<<<<
@@ -82244,9 +82906,9 @@ static int __Pyx_InitCachedConstants(void) {
__pyx_tuple__85 = PyTuple_Pack(3, __pyx_n_s_lattice, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__85)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_tuple__85);
__Pyx_GIVEREF(__pyx_tuple__85);
- __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr0_home_cdyer_cdec_python_cde_3, __pyx_n_s_decode_sentence, 118, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_waziz_workspace_mtm14_my_3, __pyx_n_s_decode_sentence, 118, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "sym.pxi":121
+ /* "cdec/sa/sym.pxi":121
* return tuple(sym_tostring(sym) for ((sym, _, _),) in lattice)
*
* def encode_words(words): # <<<<<<<<<<<<<<
@@ -82256,9 +82918,9 @@ static int __Pyx_InitCachedConstants(void) {
__pyx_tuple__87 = PyTuple_Pack(3, __pyx_n_s_words, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__87)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_tuple__87);
__Pyx_GIVEREF(__pyx_tuple__87);
- __pyx_codeobj__88 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__87, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr0_home_cdyer_cdec_python_cde_3, __pyx_n_s_encode_words, 121, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__88)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_codeobj__88 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__87, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_waziz_workspace_mtm14_my_3, __pyx_n_s_encode_words, 121, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__88)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "sym.pxi":124
+ /* "cdec/sa/sym.pxi":124
* return tuple(sym_fromstring(word, True) for word in words)
*
* def decode_words(syms): # <<<<<<<<<<<<<<
@@ -82267,9 +82929,9 @@ static int __Pyx_InitCachedConstants(void) {
__pyx_tuple__89 = PyTuple_Pack(3, __pyx_n_s_syms, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__89)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_tuple__89);
__Pyx_GIVEREF(__pyx_tuple__89);
- __pyx_codeobj__90 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__89, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr0_home_cdyer_cdec_python_cde_3, __pyx_n_s_decode_words, 124, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__90)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_codeobj__90 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__89, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_waziz_workspace_mtm14_my_3, __pyx_n_s_decode_words, 124, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__90)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "rulefactory.pxi":2200
+ /* "cdec/sa/rulefactory.pxi":2200
*
* # Spans are _inclusive_ on both ends [i, j]
* def span_check(vec, i, j): # <<<<<<<<<<<<<<
@@ -82279,9 +82941,9 @@ static int __Pyx_InitCachedConstants(void) {
__pyx_tuple__91 = PyTuple_Pack(4, __pyx_n_s_vec, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k); if (unlikely(!__pyx_tuple__91)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_tuple__91);
__Pyx_GIVEREF(__pyx_tuple__91);
- __pyx_codeobj__92 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__91, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr0_home_cdyer_cdec_python_cde, __pyx_n_s_span_check, 2200, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__92)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_codeobj__92 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__91, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_waziz_workspace_mtm14_my, __pyx_n_s_span_check, 2200, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__92)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "rulefactory.pxi":2208
+ /* "cdec/sa/rulefactory.pxi":2208
* return True
*
* def span_inc(vec, i, j): # <<<<<<<<<<<<<<
@@ -82291,9 +82953,9 @@ static int __Pyx_InitCachedConstants(void) {
__pyx_tuple__93 = PyTuple_Pack(4, __pyx_n_s_vec, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k); if (unlikely(!__pyx_tuple__93)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_tuple__93);
__Pyx_GIVEREF(__pyx_tuple__93);
- __pyx_codeobj__94 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__93, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr0_home_cdyer_cdec_python_cde, __pyx_n_s_span_inc, 2208, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__94)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_codeobj__94 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__93, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_waziz_workspace_mtm14_my, __pyx_n_s_span_inc, 2208, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__94)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "rulefactory.pxi":2214
+ /* "cdec/sa/rulefactory.pxi":2214
* k += 1
*
* def span_dec(vec, i, j): # <<<<<<<<<<<<<<
@@ -82303,7 +82965,7 @@ static int __Pyx_InitCachedConstants(void) {
__pyx_tuple__95 = PyTuple_Pack(4, __pyx_n_s_vec, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k); if (unlikely(!__pyx_tuple__95)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_tuple__95);
__Pyx_GIVEREF(__pyx_tuple__95);
- __pyx_codeobj__96 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__95, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr0_home_cdyer_cdec_python_cde, __pyx_n_s_span_dec, 2214, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__96)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_codeobj__96 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__95, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_waziz_workspace_mtm14_my, __pyx_n_s_span_dec, 2214, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__96)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_RefNannyFinishContext();
return 0;
__pyx_L1_error:;
@@ -82453,9 +83115,9 @@ PyMODINIT_FUNC PyInit__sa(void)
if (__Pyx_SetVtable(__pyx_type_4cdec_2sa_3_sa_Phrase.tp_dict, __pyx_vtabptr_4cdec_2sa_3_sa_Phrase) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (PyObject_SetAttrString(__pyx_m, "Phrase", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_Phrase) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_2sa_3_sa_Phrase = &__pyx_type_4cdec_2sa_3_sa_Phrase;
- if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_Rule) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_Rule) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_type_4cdec_2sa_3_sa_Rule.tp_print = 0;
- if (PyObject_SetAttrString(__pyx_m, "Rule", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_Rule) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetAttrString(__pyx_m, "Rule", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_Rule) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_2sa_3_sa_Rule = &__pyx_type_4cdec_2sa_3_sa_Rule;
__pyx_vtabptr_4cdec_2sa_3_sa_StringMap = &__pyx_vtable_4cdec_2sa_3_sa_StringMap;
__pyx_vtable_4cdec_2sa_3_sa_StringMap.word = (char *(*)(struct __pyx_obj_4cdec_2sa_3_sa_StringMap *, int))__pyx_f_4cdec_2sa_3_sa_9StringMap_word;
@@ -82665,48 +83327,51 @@ PyMODINIT_FUNC PyInit__sa(void)
if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__.tp_print = 0;
__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__ = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__;
- if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_16___str__) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_16___str__.tp_print = 0;
- __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_16___str__;
- if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr.tp_print = 0;
- __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr;
- if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments.tp_print = 0;
- __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_18_alignments;
- if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_19_input) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_19_input.tp_print = 0;
- __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_19_input = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_19_input;
- if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr.tp_print = 0;
- __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr;
- if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance.tp_print = 0;
- __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance;
- if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule.tp_print = 0;
- __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule;
- if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr.tp_print = 0;
- __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr;
- if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule.tp_print = 0;
- __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule;
- if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr.tp_print = 0;
- __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr;
- if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases.tp_print = 0;
- __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases;
- if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__.tp_print = 0;
- __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__;
- if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_28___str__) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_28___str__.tp_print = 0;
- __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_28___str__;
- if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr.tp_print = 0;
- __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr;
+ if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_16_iterspans) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_16_iterspans.tp_print = 0;
+ __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_16_iterspans = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_16_iterspans;
+ if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_17___str__) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_17___str__.tp_print = 0;
+ __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_17___str__ = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_17___str__;
+ if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_18_genexpr) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_18_genexpr.tp_print = 0;
+ __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_18_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_18_genexpr;
+ if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_19_alignments) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_19_alignments.tp_print = 0;
+ __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_19_alignments = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_19_alignments;
+ if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_20_input) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_20_input.tp_print = 0;
+ __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_20_input = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_20_input;
+ if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_21_genexpr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_21_genexpr.tp_print = 0;
+ __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_21_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_21_genexpr;
+ if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_22_add_instance) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_22_add_instance.tp_print = 0;
+ __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_22_add_instance = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_22_add_instance;
+ if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_23_form_rule) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_23_form_rule.tp_print = 0;
+ __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_23_form_rule = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_23_form_rule;
+ if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_24_genexpr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_24_genexpr.tp_print = 0;
+ __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_24_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_24_genexpr;
+ if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_25_fmt_rule) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_25_fmt_rule.tp_print = 0;
+ __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_25_fmt_rule = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_25_fmt_rule;
+ if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_26_genexpr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_26_genexpr.tp_print = 0;
+ __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_26_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_26_genexpr;
+ if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_27_get_f_phrases) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_27_get_f_phrases.tp_print = 0;
+ __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_27_get_f_phrases = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_27_get_f_phrases;
+ if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_28___iter__) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_28___iter__.tp_print = 0;
+ __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_28___iter__ = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_28___iter__;
+ if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_29___str__) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_29___str__.tp_print = 0;
+ __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_29___str__ = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_29___str__;
+ if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_30_genexpr) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_30_genexpr.tp_print = 0;
+ __pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_30_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_30_genexpr;
/*--- Type import code ---*/
/*--- Variable import code ---*/
/*--- Function import code ---*/
@@ -82787,7 +83452,7 @@ PyMODINIT_FUNC PyInit__sa(void)
if (PyDict_SetItem(__pyx_d, __pyx_n_s_logger, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "alignment.pxi":8
+ /* "cdec/sa/alignment.pxi":8
* # May need to revisit if things get really tight, though.
*
* cdef int ALIGNMENT_CODE = 1 << 16 # <<<<<<<<<<<<<<
@@ -82796,7 +83461,7 @@ PyMODINIT_FUNC PyInit__sa(void)
*/
__pyx_v_4cdec_2sa_3_sa_ALIGNMENT_CODE = 65536;
- /* "veb.pxi":17
+ /* "cdec/sa/veb.pxi":17
* from libc.string cimport memset
*
* cdef int MIN_BOTTOM_SIZE = 32 # <<<<<<<<<<<<<<
@@ -82805,7 +83470,7 @@ PyMODINIT_FUNC PyInit__sa(void)
*/
__pyx_v_4cdec_2sa_3_sa_MIN_BOTTOM_SIZE = 32;
- /* "veb.pxi":18
+ /* "cdec/sa/veb.pxi":18
*
* cdef int MIN_BOTTOM_SIZE = 32
* cdef int MIN_BOTTOM_BITS = 5 # <<<<<<<<<<<<<<
@@ -82814,7 +83479,7 @@ PyMODINIT_FUNC PyInit__sa(void)
*/
__pyx_v_4cdec_2sa_3_sa_MIN_BOTTOM_BITS = 5;
- /* "veb.pxi":28
+ /* "cdec/sa/veb.pxi":28
* LOWER_MASK[i] = mask
*
* _init_lower_mask() # <<<<<<<<<<<<<<
@@ -82823,7 +83488,7 @@ PyMODINIT_FUNC PyInit__sa(void)
*/
__pyx_f_4cdec_2sa_3_sa__init_lower_mask();
- /* "sym.pxi":4
+ /* "cdec/sa/sym.pxi":4
* from libc.stdlib cimport malloc, realloc, strtol
*
* cdef int INDEX_SHIFT = 3 # <<<<<<<<<<<<<<
@@ -82832,7 +83497,7 @@ PyMODINIT_FUNC PyInit__sa(void)
*/
__pyx_v_4cdec_2sa_3_sa_INDEX_SHIFT = 3;
- /* "sym.pxi":5
+ /* "cdec/sa/sym.pxi":5
*
* cdef int INDEX_SHIFT = 3
* cdef int INDEX_MASK = (1<<INDEX_SHIFT)-1 # <<<<<<<<<<<<<<
@@ -82841,7 +83506,7 @@ PyMODINIT_FUNC PyInit__sa(void)
*/
__pyx_v_4cdec_2sa_3_sa_INDEX_MASK = ((1 << __pyx_v_4cdec_2sa_3_sa_INDEX_SHIFT) - 1);
- /* "sym.pxi":87
+ /* "cdec/sa/sym.pxi":87
* return self.terminals.index(s)
*
* cdef Alphabet ALPHABET = Alphabet() # <<<<<<<<<<<<<<
@@ -82855,7 +83520,7 @@ PyMODINIT_FUNC PyInit__sa(void)
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_1 = 0;
- /* "sym.pxi":107
+ /* "cdec/sa/sym.pxi":107
* return ALPHABET.fromstring(string, terminal)
*
* def isvar(sym): # <<<<<<<<<<<<<<
@@ -82867,7 +83532,7 @@ PyMODINIT_FUNC PyInit__sa(void)
if (PyDict_SetItem(__pyx_d, __pyx_n_s_isvar, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "sym.pxi":110
+ /* "cdec/sa/sym.pxi":110
* return sym_isvar(sym)
*
* def make_lattice(words): # <<<<<<<<<<<<<<
@@ -82879,7 +83544,7 @@ PyMODINIT_FUNC PyInit__sa(void)
if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_lattice, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "sym.pxi":114
+ /* "cdec/sa/sym.pxi":114
* return tuple(((word, None, 1), ) for word in word_ids)
*
* def decode_lattice(lattice): # <<<<<<<<<<<<<<
@@ -82891,7 +83556,7 @@ PyMODINIT_FUNC PyInit__sa(void)
if (PyDict_SetItem(__pyx_d, __pyx_n_s_decode_lattice, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "sym.pxi":118
+ /* "cdec/sa/sym.pxi":118
* for arc in node for node in lattice)
*
* def decode_sentence(lattice): # <<<<<<<<<<<<<<
@@ -82903,7 +83568,7 @@ PyMODINIT_FUNC PyInit__sa(void)
if (PyDict_SetItem(__pyx_d, __pyx_n_s_decode_sentence, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "sym.pxi":121
+ /* "cdec/sa/sym.pxi":121
* return tuple(sym_tostring(sym) for ((sym, _, _),) in lattice)
*
* def encode_words(words): # <<<<<<<<<<<<<<
@@ -82915,7 +83580,7 @@ PyMODINIT_FUNC PyInit__sa(void)
if (PyDict_SetItem(__pyx_d, __pyx_n_s_encode_words, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "sym.pxi":124
+ /* "cdec/sa/sym.pxi":124
* return tuple(sym_fromstring(word, True) for word in words)
*
* def decode_words(syms): # <<<<<<<<<<<<<<
@@ -82926,7 +83591,7 @@ PyMODINIT_FUNC PyInit__sa(void)
if (PyDict_SetItem(__pyx_d, __pyx_n_s_decode_words, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "rulefactory.pxi":5
+ /* "cdec/sa/rulefactory.pxi":5
* # Much faster than the Python numbers reported there.
* # Note to reader: this code is closer to C than Python
* import gc # <<<<<<<<<<<<<<
@@ -82938,7 +83603,7 @@ PyMODINIT_FUNC PyInit__sa(void)
if (PyDict_SetItem(__pyx_d, __pyx_n_s_gc, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "rulefactory.pxi":6
+ /* "cdec/sa/rulefactory.pxi":6
* # Note to reader: this code is closer to C than Python
* import gc
* import itertools # <<<<<<<<<<<<<<
@@ -82950,7 +83615,7 @@ PyMODINIT_FUNC PyInit__sa(void)
if (PyDict_SetItem(__pyx_d, __pyx_n_s_itertools, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "rulefactory.pxi":12
+ /* "cdec/sa/rulefactory.pxi":12
* from libc.math cimport fmod, ceil, floor, log
*
* from collections import defaultdict, Counter, namedtuple # <<<<<<<<<<<<<<
@@ -82985,7 +83650,7 @@ PyMODINIT_FUNC PyInit__sa(void)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "rulefactory.pxi":14
+ /* "cdec/sa/rulefactory.pxi":14
* from collections import defaultdict, Counter, namedtuple
*
* from online import Bilex # <<<<<<<<<<<<<<
@@ -83006,7 +83671,7 @@ PyMODINIT_FUNC PyInit__sa(void)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "rulefactory.pxi":16
+ /* "cdec/sa/rulefactory.pxi":16
* from online import Bilex
*
* FeatureContext = namedtuple('FeatureContext', # <<<<<<<<<<<<<<
@@ -83016,7 +83681,7 @@ PyMODINIT_FUNC PyInit__sa(void)
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_namedtuple); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- /* "rulefactory.pxi":17
+ /* "cdec/sa/rulefactory.pxi":17
*
* FeatureContext = namedtuple('FeatureContext',
* ['fphrase', # <<<<<<<<<<<<<<
@@ -83094,7 +83759,7 @@ PyMODINIT_FUNC PyInit__sa(void)
if (PyDict_SetItem(__pyx_d, __pyx_n_s_FeatureContext, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "rulefactory.pxi":32
+ /* "cdec/sa/rulefactory.pxi":32
* ])
*
* OnlineFeatureContext = namedtuple('OnlineFeatureContext', # <<<<<<<<<<<<<<
@@ -83104,7 +83769,7 @@ PyMODINIT_FUNC PyInit__sa(void)
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_namedtuple); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- /* "rulefactory.pxi":33
+ /* "cdec/sa/rulefactory.pxi":33
*
* OnlineFeatureContext = namedtuple('OnlineFeatureContext',
* ['fcount', # <<<<<<<<<<<<<<
@@ -83155,7 +83820,7 @@ PyMODINIT_FUNC PyInit__sa(void)
if (PyDict_SetItem(__pyx_d, __pyx_n_s_OnlineFeatureContext, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "rulefactory.pxi":60
+ /* "cdec/sa/rulefactory.pxi":60
* self.bilex = Bilex()
*
* cdef int PRECOMPUTE = 0 # <<<<<<<<<<<<<<
@@ -83164,7 +83829,7 @@ PyMODINIT_FUNC PyInit__sa(void)
*/
__pyx_v_4cdec_2sa_3_sa_PRECOMPUTE = 0;
- /* "rulefactory.pxi":61
+ /* "cdec/sa/rulefactory.pxi":61
*
* cdef int PRECOMPUTE = 0
* cdef int MERGE = 1 # <<<<<<<<<<<<<<
@@ -83173,7 +83838,7 @@ PyMODINIT_FUNC PyInit__sa(void)
*/
__pyx_v_4cdec_2sa_3_sa_MERGE = 1;
- /* "rulefactory.pxi":62
+ /* "cdec/sa/rulefactory.pxi":62
* cdef int PRECOMPUTE = 0
* cdef int MERGE = 1
* cdef int BAEZA_YATES = 2 # <<<<<<<<<<<<<<
@@ -83182,7 +83847,7 @@ PyMODINIT_FUNC PyInit__sa(void)
*/
__pyx_v_4cdec_2sa_3_sa_BAEZA_YATES = 2;
- /* "rulefactory.pxi":65
+ /* "cdec/sa/rulefactory.pxi":65
*
* # NOTE: was encoded as a non-terminal in the previous version
* cdef int EPSILON = sym_fromstring('*EPS*', True) # <<<<<<<<<<<<<<
@@ -83191,7 +83856,7 @@ PyMODINIT_FUNC PyInit__sa(void)
*/
__pyx_v_4cdec_2sa_3_sa_EPSILON = __pyx_f_4cdec_2sa_3_sa_sym_fromstring(__pyx_k_EPS, 1);
- /* "rulefactory.pxi":2200
+ /* "cdec/sa/rulefactory.pxi":2200
*
* # Spans are _inclusive_ on both ends [i, j]
* def span_check(vec, i, j): # <<<<<<<<<<<<<<
@@ -83203,7 +83868,7 @@ PyMODINIT_FUNC PyInit__sa(void)
if (PyDict_SetItem(__pyx_d, __pyx_n_s_span_check, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "rulefactory.pxi":2208
+ /* "cdec/sa/rulefactory.pxi":2208
* return True
*
* def span_inc(vec, i, j): # <<<<<<<<<<<<<<
@@ -83215,7 +83880,7 @@ PyMODINIT_FUNC PyInit__sa(void)
if (PyDict_SetItem(__pyx_d, __pyx_n_s_span_inc, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "rulefactory.pxi":2214
+ /* "cdec/sa/rulefactory.pxi":2214
* k += 1
*
* def span_dec(vec, i, j): # <<<<<<<<<<<<<<
@@ -83227,7 +83892,7 @@ PyMODINIT_FUNC PyInit__sa(void)
if (PyDict_SetItem(__pyx_d, __pyx_n_s_span_dec, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "features.pxi":1
+ /* "cdec/sa/features.pxi":1
* cdef StringMap FD = StringMap() # Feature name dictionary # <<<<<<<<<<<<<<
*
* INITIAL_CAPACITY = 7 # default number of features
@@ -83239,7 +83904,7 @@ PyMODINIT_FUNC PyInit__sa(void)
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_1 = 0;
- /* "features.pxi":3
+ /* "cdec/sa/features.pxi":3
* cdef StringMap FD = StringMap() # Feature name dictionary
*
* INITIAL_CAPACITY = 7 # default number of features # <<<<<<<<<<<<<<
@@ -83248,7 +83913,7 @@ PyMODINIT_FUNC PyInit__sa(void)
*/
if (PyDict_SetItem(__pyx_d, __pyx_n_s_INITIAL_CAPACITY, __pyx_int_7) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "features.pxi":4
+ /* "cdec/sa/features.pxi":4
*
* INITIAL_CAPACITY = 7 # default number of features
* INCREMENT = INITIAL_CAPACITY # double size # <<<<<<<<<<<<<<
@@ -84453,187 +85118,6 @@ static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* value
}
#endif
-static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
- PyObject *method, *result = NULL;
- method = __Pyx_PyObject_GetAttrStr(obj, method_name);
- if (unlikely(!method)) goto bad;
-#if CYTHON_COMPILING_IN_CPYTHON
- if (likely(PyMethod_Check(method))) {
- PyObject *self = PyMethod_GET_SELF(method);
- if (likely(self)) {
- PyObject *function = PyMethod_GET_FUNCTION(method);
- result = __Pyx_PyObject_CallOneArg(function, self);
- Py_DECREF(method);
- return result;
- }
- }
-#endif
- result = __Pyx_PyObject_CallNoArg(method);
- Py_DECREF(method);
-bad:
- return result;
-}
-
-static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
- PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
-}
-
-static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
- if (t == Py_None) {
- __Pyx_RaiseNoneNotIterableError();
- } else if (PyTuple_GET_SIZE(t) < index) {
- __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
- } else {
- __Pyx_RaiseTooManyValuesError(index);
- }
-}
-
-static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
- int is_tuple, int has_known_size, int decref_tuple) {
- Py_ssize_t index;
- PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
- if (!is_tuple && unlikely(!PyTuple_Check(tuple))) {
- iternextfunc iternext;
- iter = PyObject_GetIter(tuple);
- if (unlikely(!iter)) goto bad;
- if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
- iternext = Py_TYPE(iter)->tp_iternext;
- value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
- value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
- if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
- Py_DECREF(iter);
- } else {
- if (!has_known_size && unlikely(PyTuple_GET_SIZE(tuple) != 2)) {
- __Pyx_UnpackTupleError(tuple, 2);
- goto bad;
- }
-#if CYTHON_COMPILING_IN_PYPY
- value1 = PySequence_ITEM(tuple, 0);
- if (unlikely(!value1)) goto bad;
- value2 = PySequence_ITEM(tuple, 1);
- if (unlikely(!value2)) goto bad;
-#else
- value1 = PyTuple_GET_ITEM(tuple, 0);
- value2 = PyTuple_GET_ITEM(tuple, 1);
- Py_INCREF(value1);
- Py_INCREF(value2);
-#endif
- if (decref_tuple) { Py_DECREF(tuple); }
- }
- *pvalue1 = value1;
- *pvalue2 = value2;
- return 0;
-unpacking_failed:
- if (!has_known_size && __Pyx_IterFinish() == 0)
- __Pyx_RaiseNeedMoreValuesError(index);
-bad:
- Py_XDECREF(iter);
- Py_XDECREF(value1);
- Py_XDECREF(value2);
- if (decref_tuple) { Py_XDECREF(tuple); }
- return -1;
-}
-
-static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
- Py_ssize_t* p_orig_length, int* p_source_is_dict) {
- is_dict = is_dict || likely(PyDict_CheckExact(iterable));
- *p_source_is_dict = is_dict;
-#if !CYTHON_COMPILING_IN_PYPY
- if (is_dict) {
- *p_orig_length = PyDict_Size(iterable);
- Py_INCREF(iterable);
- return iterable;
- }
-#endif
- *p_orig_length = 0;
- if (method_name) {
- PyObject* iter;
- iterable = __Pyx_PyObject_CallMethod0(iterable, method_name);
- if (!iterable)
- return NULL;
-#if !CYTHON_COMPILING_IN_PYPY
- if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable))
- return iterable;
-#endif
- iter = PyObject_GetIter(iterable);
- Py_DECREF(iterable);
- return iter;
- }
- return PyObject_GetIter(iterable);
-}
-static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* iter_obj, Py_ssize_t orig_length, Py_ssize_t* ppos,
- PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) {
- PyObject* next_item;
-#if !CYTHON_COMPILING_IN_PYPY
- if (source_is_dict) {
- PyObject *key, *value;
- if (unlikely(orig_length != PyDict_Size(iter_obj))) {
- PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration");
- return -1;
- }
- if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) {
- return 0;
- }
- if (pitem) {
- PyObject* tuple = PyTuple_New(2);
- if (unlikely(!tuple)) {
- return -1;
- }
- Py_INCREF(key);
- Py_INCREF(value);
- PyTuple_SET_ITEM(tuple, 0, key);
- PyTuple_SET_ITEM(tuple, 1, value);
- *pitem = tuple;
- } else {
- if (pkey) {
- Py_INCREF(key);
- *pkey = key;
- }
- if (pvalue) {
- Py_INCREF(value);
- *pvalue = value;
- }
- }
- return 1;
- } else if (PyTuple_CheckExact(iter_obj)) {
- Py_ssize_t pos = *ppos;
- if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0;
- *ppos = pos + 1;
- next_item = PyTuple_GET_ITEM(iter_obj, pos);
- Py_INCREF(next_item);
- } else if (PyList_CheckExact(iter_obj)) {
- Py_ssize_t pos = *ppos;
- if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0;
- *ppos = pos + 1;
- next_item = PyList_GET_ITEM(iter_obj, pos);
- Py_INCREF(next_item);
- } else
-#endif
- {
- next_item = PyIter_Next(iter_obj);
- if (unlikely(!next_item)) {
- return __Pyx_IterFinish();
- }
- }
- if (pitem) {
- *pitem = next_item;
- } else if (pkey && pvalue) {
- if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1))
- return -1;
- } else if (pkey) {
- *pkey = next_item;
- } else {
- *pvalue = next_item;
- }
- return 1;
-}
-
-static CYTHON_INLINE long __Pyx_mod_long(long a, long b) {
- long r = a % b;
- r += ((r != 0) & ((r ^ b) < 0)) * b;
- return r;
-}
-
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
PyObject* fake_module;
PyTypeObject* cached_type = NULL;
@@ -85227,6 +85711,187 @@ static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, Py
Py_INCREF(dict);
}
+static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
+ PyObject *method, *result = NULL;
+ method = __Pyx_PyObject_GetAttrStr(obj, method_name);
+ if (unlikely(!method)) goto bad;
+#if CYTHON_COMPILING_IN_CPYTHON
+ if (likely(PyMethod_Check(method))) {
+ PyObject *self = PyMethod_GET_SELF(method);
+ if (likely(self)) {
+ PyObject *function = PyMethod_GET_FUNCTION(method);
+ result = __Pyx_PyObject_CallOneArg(function, self);
+ Py_DECREF(method);
+ return result;
+ }
+ }
+#endif
+ result = __Pyx_PyObject_CallNoArg(method);
+ Py_DECREF(method);
+bad:
+ return result;
+}
+
+static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+}
+
+static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
+ if (t == Py_None) {
+ __Pyx_RaiseNoneNotIterableError();
+ } else if (PyTuple_GET_SIZE(t) < index) {
+ __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
+ } else {
+ __Pyx_RaiseTooManyValuesError(index);
+ }
+}
+
+static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
+ int is_tuple, int has_known_size, int decref_tuple) {
+ Py_ssize_t index;
+ PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
+ if (!is_tuple && unlikely(!PyTuple_Check(tuple))) {
+ iternextfunc iternext;
+ iter = PyObject_GetIter(tuple);
+ if (unlikely(!iter)) goto bad;
+ if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
+ iternext = Py_TYPE(iter)->tp_iternext;
+ value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
+ value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
+ if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
+ Py_DECREF(iter);
+ } else {
+ if (!has_known_size && unlikely(PyTuple_GET_SIZE(tuple) != 2)) {
+ __Pyx_UnpackTupleError(tuple, 2);
+ goto bad;
+ }
+#if CYTHON_COMPILING_IN_PYPY
+ value1 = PySequence_ITEM(tuple, 0);
+ if (unlikely(!value1)) goto bad;
+ value2 = PySequence_ITEM(tuple, 1);
+ if (unlikely(!value2)) goto bad;
+#else
+ value1 = PyTuple_GET_ITEM(tuple, 0);
+ value2 = PyTuple_GET_ITEM(tuple, 1);
+ Py_INCREF(value1);
+ Py_INCREF(value2);
+#endif
+ if (decref_tuple) { Py_DECREF(tuple); }
+ }
+ *pvalue1 = value1;
+ *pvalue2 = value2;
+ return 0;
+unpacking_failed:
+ if (!has_known_size && __Pyx_IterFinish() == 0)
+ __Pyx_RaiseNeedMoreValuesError(index);
+bad:
+ Py_XDECREF(iter);
+ Py_XDECREF(value1);
+ Py_XDECREF(value2);
+ if (decref_tuple) { Py_XDECREF(tuple); }
+ return -1;
+}
+
+static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
+ Py_ssize_t* p_orig_length, int* p_source_is_dict) {
+ is_dict = is_dict || likely(PyDict_CheckExact(iterable));
+ *p_source_is_dict = is_dict;
+#if !CYTHON_COMPILING_IN_PYPY
+ if (is_dict) {
+ *p_orig_length = PyDict_Size(iterable);
+ Py_INCREF(iterable);
+ return iterable;
+ }
+#endif
+ *p_orig_length = 0;
+ if (method_name) {
+ PyObject* iter;
+ iterable = __Pyx_PyObject_CallMethod0(iterable, method_name);
+ if (!iterable)
+ return NULL;
+#if !CYTHON_COMPILING_IN_PYPY
+ if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable))
+ return iterable;
+#endif
+ iter = PyObject_GetIter(iterable);
+ Py_DECREF(iterable);
+ return iter;
+ }
+ return PyObject_GetIter(iterable);
+}
+static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* iter_obj, Py_ssize_t orig_length, Py_ssize_t* ppos,
+ PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) {
+ PyObject* next_item;
+#if !CYTHON_COMPILING_IN_PYPY
+ if (source_is_dict) {
+ PyObject *key, *value;
+ if (unlikely(orig_length != PyDict_Size(iter_obj))) {
+ PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration");
+ return -1;
+ }
+ if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) {
+ return 0;
+ }
+ if (pitem) {
+ PyObject* tuple = PyTuple_New(2);
+ if (unlikely(!tuple)) {
+ return -1;
+ }
+ Py_INCREF(key);
+ Py_INCREF(value);
+ PyTuple_SET_ITEM(tuple, 0, key);
+ PyTuple_SET_ITEM(tuple, 1, value);
+ *pitem = tuple;
+ } else {
+ if (pkey) {
+ Py_INCREF(key);
+ *pkey = key;
+ }
+ if (pvalue) {
+ Py_INCREF(value);
+ *pvalue = value;
+ }
+ }
+ return 1;
+ } else if (PyTuple_CheckExact(iter_obj)) {
+ Py_ssize_t pos = *ppos;
+ if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0;
+ *ppos = pos + 1;
+ next_item = PyTuple_GET_ITEM(iter_obj, pos);
+ Py_INCREF(next_item);
+ } else if (PyList_CheckExact(iter_obj)) {
+ Py_ssize_t pos = *ppos;
+ if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0;
+ *ppos = pos + 1;
+ next_item = PyList_GET_ITEM(iter_obj, pos);
+ Py_INCREF(next_item);
+ } else
+#endif
+ {
+ next_item = PyIter_Next(iter_obj);
+ if (unlikely(!next_item)) {
+ return __Pyx_IterFinish();
+ }
+ }
+ if (pitem) {
+ *pitem = next_item;
+ } else if (pkey && pvalue) {
+ if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1))
+ return -1;
+ } else if (pkey) {
+ *pkey = next_item;
+ } else {
+ *pvalue = next_item;
+ }
+ return 1;
+}
+
+static CYTHON_INLINE long __Pyx_mod_long(long a, long b) {
+ long r = a % b;
+ r += ((r != 0) & ((r ^ b) < 0)) * b;
+ return r;
+}
+
static CYTHON_INLINE PyObject* __Pyx__PyObject_Pop(PyObject* L) {
#if CYTHON_COMPILING_IN_CPYTHON
if (Py_TYPE(L) == &PySet_Type) {
diff --git a/python/cdec/sa/rule.pxi b/python/cdec/sa/rule.pxi
index 7fde3e06..af8fabea 100644
--- a/python/cdec/sa/rule.pxi
+++ b/python/cdec/sa/rule.pxi
@@ -154,6 +154,25 @@ cdef class Phrase:
property words:
def __get__(self):
return [sym_tostring(w) for w in self if not sym_isvar(w)]
+
+ def iterspans(self, nt_flag = False, to_str = True):
+ """iterate over (terminal and nonterminal) spans, it generates pairs of the kind (terminal span, !nt_flag) or (nonterminal, nt_flag)
+ Example: iterspans(False, False) --> ([-1], False), ([2,3], True), ([-1], False), ([4], True), ([-1], False)
+ for the sequence -1 2 3 -1 4 -1"""
+ span = []
+ cdef int i, s
+ get_sym = lambda sym : sym_tostring(sym) if to_str else lambda sym : sym
+ for i from 0 <= i < self.n:
+ s = self.syms[i]
+ if sym_isvar(s):
+ if len(span):
+ yield (span, not nt_flag)
+ span = []
+ yield ([get_sym(s)], nt_flag)
+ else:
+ span.append(get_sym(s))
+ if len(span):
+ yield (span, not nt_flag)
cdef class Rule: